I had an idea for an attack/state but I'm not sure how I would go about making it. Help?

Basically, what I want to do is create a skill that an enemy can use, which will put a state on the entire party that causes 2% of their health to be drained every turn (due to the battle system I use, poison-like effects like these will tick every time someone takes an action), but returns all of that health that the party has lost to the enemy that used the skill. If it helps, it will be a boss fight, so there is only one enemy. Is it possible to do this?

Edit: If it makes it any clearer, what I'm going for is essentially Pokemon's Leech Seed, but on all party members.
If you know how to use partial coding, you can try using Yanfly Lunatic States to make the enemy gain HP at the same time as the -HRG damage.
If you know how to use partial coding, you can try using Yanfly Lunatic States to make the enemy gain HP at the same time as the -HRG damage.
Well... I don't know any coding at all, so... >_>
I did a little scriptlet, thought it can be done with events too.

Open your enemy formation. You need it to have Turns 1*X as condition.

4p3M8.png


Then add this code inside a Call script. Revise it as there is some things to change. I will guide you the best I can of course:

a=0$game_party.members.each{|actor|  #if actor.state?(1)    b=(actor.hp*2/100)    actor.hp-=b    a+=b  #end}$game_troop.members[0].hp += aLook for the "id" word and replace accordingly with the state ID from the database that your boss is going to apply with his special attack.

Something to improve: This doesn't displays the damage/restoration being done as pop-ups. But happens the same with the change HP command so I didn't cared really 😛 .

I just put this here because it is going to be just for a battle, so I think it could be more of a mess doing some major change for one ocassion. You can make it trough a script if you want though.

Cheers,

Orochii Zouveleki
I did a little scriptlet, thought it can be done with events too.

Open your enemy formation. You need it to have Turns 1*X as condition.

4p3M8.png


Then add this code inside a Call script. Revise it as there is some things to change. I will guide you the best I can of course:

a=0$game_party.members.each{|actor|  #if actor.state?(1)    b=(actor.hp*2/100)    actor.hp-=b    a+=b  #end}$game_troop.members[0].hp += aLook for the "id" word and replace accordingly with the state ID from the database that your boss is going to apply with his special attack.

Something to improve: This doesn't displays the damage/restoration being done as pop-ups. But happens the same with the change HP command so I didn't cared really 😛 .

I just put this here because it is going to be just for a battle, so I think it could be more of a mess doing some major change for one ocassion. You can make it trough a script if you want though.

Cheers,

Orochii Zouveleki
It doesn't seem to work...

The HP is being lost from allies, but the enemy isn't regenerating.
So.. did I do something wrong with the event or is something else wrong? Cause mine looks just like the one he posted except I changed the state ID like he said to...
There's a thing, remember copying the scriptlet from the code frame, I messed up with the screen xP.

Also you can check if it is working by saving the monster HP on a variable and showing that variable on a text box. Example:

4pUn1.png


Sorry about messing up so much or so I feel, don't mind me, hope it works now to you,

Orochii Zouveleki
There's a thing, remember copying the scriptlet from the code frame, I messed up with the screen xP.

Also you can check if it is working by saving the monster HP on a variable and showing that variable on a text box. Example:

4pUn1.png


Sorry about messing up so much or so I feel, don't mind me, hope it works now to you,

Orochii Zouveleki
I figured out what the problem was. I had the Span set to Battle instead of Turn. Now it seems to be working right. 🙂

Thanks!
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/i-had-an-idea-for-an-attack-state-but-im-not-sure-how-i-would-go-about-making-it-help.18005/