Hello, I have a bit of a problem.
I'm creating a state called Shocked in which, at the beginning of each turn, you have a 25% chance (reduced by the state-holders LUK) to be Stunned. I know Javascript basics, but I'm not entirely sure if this script would accomplish what I want. I'm running a multitude of Yanfly's plugins. Anyway, here's what I have currently.
<Custom Turn Start Effect>
if (a.isStateAffected(17)) {
var chanceHit = (Math.ceil(Math.random() * 100)) + (a.Hp / a.maxHp) * 10 - (a.luk / 5);
if (chanceHit >= 75) {
a.addState(14);
end;
}
else {
end;
}
else {
end;
}
}
</Custom Turn Start Effect>
State 17 being Shock
State 14 being Stunned
'a' is supposed to be the enemy that the Shock state is currently on.
The chance at which they'll be stunned is a random number + 25% of their missing hp - 20% of their LUK, then it checks if that value is 75 or more, giving a fundamental 25% chance.
Any recommendations?
I'm creating a state called Shocked in which, at the beginning of each turn, you have a 25% chance (reduced by the state-holders LUK) to be Stunned. I know Javascript basics, but I'm not entirely sure if this script would accomplish what I want. I'm running a multitude of Yanfly's plugins. Anyway, here's what I have currently.
<Custom Turn Start Effect>
if (a.isStateAffected(17)) {
var chanceHit = (Math.ceil(Math.random() * 100)) + (a.Hp / a.maxHp) * 10 - (a.luk / 5);
if (chanceHit >= 75) {
a.addState(14);
end;
}
else {
end;
}
else {
end;
}
}
</Custom Turn Start Effect>
State 17 being Shock
State 14 being Stunned
'a' is supposed to be the enemy that the Shock state is currently on.
The chance at which they'll be stunned is a random number + 25% of their missing hp - 20% of their LUK, then it checks if that value is 75 or more, giving a fundamental 25% chance.
Any recommendations?