In my game, i have elemental magics deal damage with a chance of applying an ailment state. If the mage is under a specific state, the rate of the ailment is boosted to 100% amongst other changes that aren't not relevant. I'm using yanfly's skills plugin and I have the checks done in pre-damage eval note tags. It works perfectly for custom ailment states that I've made but when I try to attach instant death to a spell it never activates, even though the same code works for the other spells and ailments.
<Pre-Damage Eval>
if (user.isStateAffected(17)){
target.addState(14);}
else{
if (Math.random() < 0.2){
target.addState(14);}}
</Pre-Damage Eval>
This works as intended where the spell has a 20% chance to apply [Insert Ailment Here] unless the caster has the state, where it then becomes 100%. I then made a spell that deals damage, but under the special state gain a 10% chance at instant KO, and i set it up like this:
<Pre-Damage Eval>
if (user.isStateAffected(17)){
if (Math.random() < 0.1){
target.addState(14);}}
</Pre-Damage Eval>
It didn't work, so i thought that i just butchered the code and i decided to set it to something that I knew worked just to test it out. I took the same code that the other spells work with and just changed the ailment state to death and it still does not work
<Pre-Damage Eval>
if (user.isStateAffected(17)){
target.addState(1);}
else{
if (Math.random() < 0.2){
target.addState(1);}}
</Pre-Damage Eval>
Instant death never triggers. Any help?
<Pre-Damage Eval>
if (user.isStateAffected(17)){
target.addState(14);}
else{
if (Math.random() < 0.2){
target.addState(14);}}
</Pre-Damage Eval>
This works as intended where the spell has a 20% chance to apply [Insert Ailment Here] unless the caster has the state, where it then becomes 100%. I then made a spell that deals damage, but under the special state gain a 10% chance at instant KO, and i set it up like this:
<Pre-Damage Eval>
if (user.isStateAffected(17)){
if (Math.random() < 0.1){
target.addState(14);}}
</Pre-Damage Eval>
It didn't work, so i thought that i just butchered the code and i decided to set it to something that I knew worked just to test it out. I took the same code that the other spells work with and just changed the ailment state to death and it still does not work
<Pre-Damage Eval>
if (user.isStateAffected(17)){
target.addState(1);}
else{
if (Math.random() < 0.2){
target.addState(1);}}
</Pre-Damage Eval>
Instant death never triggers. Any help?