MV Creating a steal skill (help with syntax).

I'm looking to make a skill that will steal gold from humanoid creatures. It can only steal once per humanoid enemy, and will scale depending on the enemy's level. I have an idea how to do this, but don't know the syntax for rpg maker.

1.) Check to see if the enemy has state 1-5 on them. If state 1-5 doesn't exist, then the ability isn't able to be used.

These will be hidden states that indicate that the enemy is a humanoid. 1 is Humanoid level 1, 2 is humanoid level 10, 3 is humanoid level 20 etc.

2.) If state == 1 then roll rng 1-3. If rng != 3 then continue, if ==3 then print in battle (Failed to steal)

3.) Roll rng 1-10, save as variable X. Give player Var X gold. Print in battle (Stole Var X gold). Remove State 1.

4.) If state == 2 then roll rng 1-3. If rng != 3 then continue, if ==3 then print in battle (Failed to steal)

4.) Roll rng 10-20, save as variable X. Give player Var X gold. Print in battle (Stole Var X gold). Remove State 2.


Etc.

If my thinking is correct, when you use this skill it will first check to see if state 1-5 is on them. If so it then will find what state, and roll an rng to see if you steal. Then it will roll a random number to decide how much gold you steal, give you that gold, then say how much gold you stole in battle. After it will delete the state from the enemy so that you can't steal from the enemy again.


I'm using the yanfly core / battle core so it should allow me to type scripts like this into the notes section, I just don't know how to write it in rpg maker.

Thanks!
I'm using the yanfly core / battle core
Did you only pick up the freebies or did you buy the entire collection? yanfly has a plugin specifically for being able to steal from enemies thatll cut out most of the work youre about to do setting up this system, but its not a part of the free section
I would suggest it's more efficient to use notetags than lots of hidden states that don't actually have a mechanical effect...but aside from that, it definitely makes more sense to use an existing plugin that has all of this built in, as @Robro33 said.
Did you only pick up the freebies or did you buy the entire collection? yanfly has a plugin specifically for being able to steal from enemies thatll cut out most of the work youre about to do setting up this system, but its not a part of the free section
Yeah I own them all, but hadn't used the steal plugin because when I first used it, it had just came out and it only allowed stealing of items. I hadn't checked back since then and you can steal gold just fine now. Funny that I've done 3 projects since it game out and each time I manually added stealing because I only wanted gold to be stolen, which it originally didn't allow. I wasted a lot of time :eswt:
The steal plugin works fine, I can just not put gold on non humanoids and it does exactly what I was asking here lol

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-steal-skill-help-with-syntax.164005/