Hey all. I'm having a problem with a particular skill I'm trying to create:
The skill is meant to do three things: deal damage to the enemy, give a stacking buff to the caster, and remove specific other buffs that the caster has.
The Problem: While the effect works fine when it's used with a single target skill, when it's used in a multi-target or multi-hit skill, like an 'All Enemies' skill, the skill applies a stack of the buff for every enemy hit (or, more specifically, whenever the skill hits an enemy) which is not the intention - it should still only give one stack of the status for each usage of the skill.
The formula used is as follows:
State 19 is an invisible state that works as a background process to make sure the stacking effect works. State 19 has the following code:
Any help appreciated.
The skill is meant to do three things: deal damage to the enemy, give a stacking buff to the caster, and remove specific other buffs that the caster has.
The Problem: While the effect works fine when it's used with a single target skill, when it's used in a multi-target or multi-hit skill, like an 'All Enemies' skill, the skill applies a stack of the buff for every enemy hit (or, more specifically, whenever the skill hits an enemy) which is not the intention - it should still only give one stack of the status for each usage of the skill.
The formula used is as follows:
a.addState(19); a.removeState(16); a.removeState(17); a.removeState (18); a.removeState (22); a.removeState (23); a.removeState (24); a.removeState (25); a.removeState (26); a.removeState (27); 60 + a.mat * 2.5 - b.mdf * 2
State 19 is an invisible state that works as a background process to make sure the stacking effect works. State 19 has the following code:
<Custom Apply Effect>
if (user.isStateAffected(15))
user.setStateTurns(15, 4);
else if (user.isStateAffected(14))
{
user.removeState(14);
user.addState(15);
}
else if (user.isStateAffected(13))
{
user.removeState(13);
user.addState(14);
}
else
user.addState(13);
target.removeState(19);
</Custom Apply Effect>
Any help appreciated.