Drain 10% formula

Hello.

I looking for a formule that drain 10% of the current HP of all target.

That skill is only used by ennemy.

EDIT: The ennemy drain all actors and get 10% of each actor current HP.

I discovered a formula for a TP converte to HP/MP so I tried to imagine

a formula from it, but it looks to be more difficult than expected.

I'am getting a (Script '(eval') Line1 : SyntaxError occured) message error.

The TP converte formula:

c = a.tp.to_i; a.tp = 0; b.mp += c; c

And my try for the drain:

c = b.hp/10to_i;b.hp -= c;a.hp += c;c

1st I am not sure if divide is "/".

This is my thinking:

c = b.hp/10to_i; --> save 10% of current target's HP.

b.hp -=c; --> remove c (10%) of the current target's HP

a.hp+=c; --> add c (10%) to the current user's HP

c --> (I realy dont know what I have to do with that.

Thanks in advance.
You're making it too hard.


Set the damage formula to

Code:
b.hp / 10
and set the damage type to HP Drain.
Personally I would do something close to this:

10% damage absorb.png

If you just need 10% of their current hp, chance the b.mhp to b.hp.

Edit:

Shaz beat me.
Perfect! Thanks all ^^

Original thread: https://forums.rpgmakerweb.com/threads/drain-10-formula.38070/