Start With Checkitem removeitem! Lets go!#dynamic 0x800000
#org @start lock faceplayer msgbox @1 0x5 compare 0x800D 0x1 if 0x1 goto @check msgbox @2 0x6 release end #org @check checkitem 0xD 0x1 compare 0x800D 0x1 if 0x4 goto @got msgbox @2 0x6 release end #org @got removeitem 0xD 0x1 giveitem 0x4 0x1 msgbox @3 0x6 release end #org @1 = Would you like to trade this\nPOKE BALL for your POTION? #org @2 = Oh. That's too bad. #org @3 = Yay! Thanks a lot!
We've got a few new things here. We've got:
checkitem 0xD 0x1
if 0x4 goto @pointer
removeitem 0x4 0x1
I'll start at the top of my list. if 0x4 goto @pointer is different. Why have I used 0x4 instead of 0x1? Other than what we have here, we can also use values, like 0x1, 0x2, 0x3 etc. I'll propose a "table". Code: Lower Than (0x0) Equals (0x1) Greater Than (0x2) Lower than or Equal to (0x3) Greater than or Equal to (0x4) Not exactly equal to (0x5)
Now we can see what each value represents.
Pretty useful, huh? From this point on, I'll only be using 0xX with the if line. I thought I'd warn you just so it doesn't look like I've totally changed the way I script without notice.
Now checkitem. checkitem is scripted like this: Code: checkitem [item number] [amount of item]
As an example, let's say we want to check for 10 MASTERBALLs. It would appear like this: Code: checkitem 0x1 0xA compare 0x800D 0x1 if 0x4 goto @got
I haven't explained the compare yet, have I? This compare checks for "Yes, you've got the item (0x1)" or "No, you don't have the item (0x0)" By now, you should be able to tell what the if should do.
Now, we go into removeitem. Obviously, it removes an item from your bag. It's set out in the same way as giveitem and checkitem. Code: removeitem [item number] [amount to remove]
Do I need to give any more explanation? This should be enough info on it.
Thats its it is alot. Compile it and test it Cool!