I evented a steal system to steal items from enemies during battle. It was originally written by someone on a different forum, but I tweaked it a little bit because they made it so you stole a 'chest' that you could open after battle for a random item. I changed it so that I could steal a different item directly from each enemy. It works fine with my adjustments, it knows if the enemy has an item, has been stolen from, etc. However it performs the animations, sounds, and item change, even before the character 'uses' steal and appears on top of the screen, when it should go the other way around. If you'd like to see the event, here it is. It is triggered by Turns Elapsed [1x], btw.
Branch if Switch [Steal_GO] is ON
Switch Operation: [Steal_GO] OFF
Comment: Steal was called, check to see if monster 1 was targetted
Branch if 1:Slime Targetted
Comment: Has monster 1 been stolen from already?
Branch if [StealTarget1_DONE] is ON
Comment: Show the Has no item animation
Show Battle Animation: [Has no item!], 1:Slime
: Else Handler
Comment: This is the actual Steal code
Variable Operation: [XXXX: AGL_Monster] Set 1:Slime Agility
Variable Operation: [XXXX: AGL_Monster] + Var[XXXX: AGL_Hero]'s value
Variable Operation: [XXXX: StealRnd] Set, Rnd [80-120]
Variable Operation: [XXXX: AGL_Hero] * Var[XXXX: StealRnd]'s value
Variable Operation: [XXXX: AGL_Hero] / Var[XXXX: AGL_Monster]'s value
Variable Operation: [XXXX: RandomNumber] Set, Rnd[1-100]
Branch if [XXXX: RandomNumber] is [XXXX: AGL_Hero] Less/Equal
Comment: Steal Attempt was successful!!
Message: Stole Potion x1!
Change Items: Potion 1 Add
Switch Operations: [StealTarget1_DONE] ON
Show Battle Animation: Steal Successful!
: Else Handler
Show Battle Animation: Couldn't Steal!
Comment: If there was more than one monster, the code for that monster would go here.
It generally works by turning on switches to check if each enemy 1-8 have been stolen from, if so successfully, you cannot steal from them again. The bulk of it is an algorithm to determine success rate.
Edit: I can also link you to the original post, I would ask for help there, but I'd prefer not to necropost from '07.http://rpgmaker.net/tutorials/13/
This post has been edited by Biohazard: Aug 29 2012, 10:58 PM