And if you change b with target
Code:
<After Eval>
if(target.result().isHit() ){target.addState(state);}
</After Eval>
And if you change b with target
<After Eval>
if(target.result().isHit() ){target.addState(state);}
</After Eval>
Sorry, to clarify:
The notes.
And is my formula meant to look like this now after changing the b to target? Or am I misunderstanding something, because it doesn't seem to be working?
Yes but the damage formula should be in the formula box or in between the <damage formula></damage formula> tags above the <after eval> tag In this case.
After eval means after the damage evaluation thus it has no meaning putting a damage formula there and might lead to problems.
<damage formula>
value=10;
</damage formula>
<After Eval>
var state = 16 ;
var basechance = 100;
var roll = Math.randomInt(100) + 1;
var chance = basechance * target.stateRate(state) ;
if(target.isStateAffected(15) && target.result().isHit() ){target.addState(state);
}
</After Eval>
<damage formula>
value=10;
</damage formula>
<After Eval>
if(target.isStateAffected(15) && target.result().isHit() ){target.addState(16);
}
</After Eval>
Well what works that works, but you couldn't give them the state death?
Then i'll try to assist.


if (b.isStateAffected(confusedId) || b.isStateAffected(blindId) || Math.randomInt(100) < 25) {b.addState(stunId)}; damageFormula
if (b.isStateAffected(confusedId) || b.isStateAffected(blindId)) {b.addState(stunId} else if (Math.randomInt(100) < 25) {b.addState(stunId)}; damageFormula;


a.hasWeapon($dataWeapons[id])
//where id = weapons database id
if (a.hasWeapon($dataWeapons[weaponId]) && (b.isStateAffected(confusedId) || b.isStateAffected(blindId) || Math.randomInt(100) < 25)) {b.addState(stunId)}; damageFormula
Original thread: https://forums.rpgmakerweb.com/threads/rmmv-damage-formula-ideas-and-help.47099/