- Joined
- Jul 4, 2015
- Messages
- 8
- Reaction score
- 1
- First Language
- Enland
- Primarily Uses
So I'm trying to create a custom damage over time effect where the damage and turns it takes is based on the users MP at the time the skill is used (the MP shouldn't be a cost, but it clears once the effect hits the enemy. It's 5 as that's the characters max MP at all times).
I am using YanFly's Buffs and States core for this. The adding turns is working fine, however the variables in the custom apply effect need to go through to the custom regenerate effect (if I set the variable there it will just update to the current MP of the character which is not what I want.)
Here is the code:
Any help would be appreciated.
I am using YanFly's Buffs and States core for this. The adding turns is working fine, however the variables in the custom apply effect need to go through to the custom regenerate effect (if I set the variable there it will just update to the current MP of the character which is not what I want.)
Here is the code:
<Custom Apply Effect>
var RuptureMult = origin.mp;
user.setStateTurns(137, RuptureMult + 1);
origin.gainMp(-5);
</Custom Apply Effect>
<Custom Regenerate Effect>
var elementId = 13;
var damage = Math.round(Math.ceil(origin.level *0.05) * ((origin.atk * 4) * 0.6) * (RuptureMult * RuptureMult));
damage *= user.elementRate(elementId);
damage = Math.floor(damage);
user.gainHp(-damage);
user.startDamagePopup();
user.clearResult();
</Custom Regenerate Effect>
Any help would be appreciated.

