VIII_STRENGTH'S PROFILE

Search

Filter

[SCRIPTING] [RMMV] Request for help to modify Yanfly's TnT Scripts to make Second Chance and Thornmail

Hello,
I am trying to make it so that the 2nd Chance State triggers after a character attacks a target with Thornmail and the attacker's HP is dropped below 0. At present, the Thornmail effect kills the attacker outright, without triggering 2nd Chance the State. If you require any further information, please let me know.

Yanfly's Tips & Tricks - Second Chance (Kingdom Hearts)
<Custom React Effect>
// Check to see if the party is in battle.
if ($gameParty.inBattle()) {
// Sets the flag if the target has more than 1 HP at the time of death.
target._secondChance = target.hp > 1;
}
</Custom React Effect>

<Custom Respond Effect>
// Check to see if the party is in battle, has the Second Chance flag, and if the target is dead with 0 HP.
if ($gameParty.inBattle() && target._secondChance && target.hp <= 0) {
// Play the revival animation.
target.startAnimation(49);
// Set the target's HP to 1.
target.setHp(1);
}
</Custom Respond Effect>


Yanfly's Tips & Tricks - Thornmail
<Custom React Effect>
// Check to see if any physical damage is dealt.
if (value > 0 && this.isPhysical()) {
// Sets the Recoil Rate to 15%.
var rate = 0.15;
// Determines the amount of recoil damage dealt.
var recoil = value * rate;
// Sets the DEF bonus rate to 25%.
var rate = 0.25;
// Determines the amount of bonus damage dealt.
var bonus = target.def * rate;
// Rounds up the bonus damage and recoil damage.
var dmg = Math.ceil(bonus + recoil);
// Makes the attacker lose damage equal to the dmg variable.
user.gainHp(-1 * dmg);
// Check to see if the attacker is dead.
if (user.isDead()) {
// If the attacker is dead, make it collapse.
user.performCollapse();
}
}
</Custom React Effect>
Pages: 1