WoW - Enhanced Pyrotechnics

Hi guys,


I'm trying to recreate the passive ability from World of Warcraft called "Enhanced Pyrotechnics". The state needs to do the following:


When Fireball does not inflict a critical hit, increase the actors CRIT by 10%. This effect stacks.


The critical hit boost is removed when a critical hit is made with Fireball.


I'm using a variety of YanFly's plugins almost exclusively.


I have 2 states set up, but there is an issue with state 1 that is applying state 2 on any attack from that actor, instead of the specific attack.


For reference, state 2 is State 90 and Fireball is Skill 64.


State 1s Notebox:

<Custom Establish Effect>


if (this.isSkill(64) && target.result().hpDamage > 0 && target.result().critical) {


user.removeState(90)


} else if (this.isSkill(64) && target.result().hpDamage > 0) {


user.addState(90)


}


</Custom Establish Effect>



Then, in the second state, the critical chance isn't increasing:


State 2s Notebox:

<Category: Magic>


<Custom Apply Effect>


target._stackingPoison = target._stackingPoison || 0;


target._stackingPoison += 1;


</Custom Apply Effect>


<Flat Critical Formula>


target._stackingPoison = target._stackingPoison || 1;


var stacks = target._stackingPoison;


value += 10 * stacks;


</Flat Critical Formula>



Can anyone see where I'm making a mistake?
I've moved this thread to RPGMaker MV. Please be sure to post your threads in the correct forum next time. Thank you.


Technical support is for helping to run the engine itself.  "How do I...?" queries go in the Support forum for the engine you are using.

Original thread: https://forums.rpgmakerweb.com/threads/wow-enhanced-pyrotechnics.71431/