I'm trying to create an aura that damages the enemy while the aura is active on the caster. This aura is supposed to deal damage to the enemy party based on the caster's magic attack. Everything is working except that it uses the enemy's magic attack instead of the caster's. I'm not sure what I'm doing wrong as I've tried every combintation of user/target/origin I can think of but the result is always the same.
Plugins needed:
http://yanfly.moe/2016/10/08/yep-117-passive-aura-effects-rpg-maker-mv/
http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/
Script:
I'm using a modified version of Mercury Poisoning from Yanfly's sample project because that spell does what I'm trying to do except I want it in Aura Form. I have included the original Mercury Poisoning I also added a %hp damage for when the target isn't a boss which works fine.
Origin aura state:
<Enemy Aura: 182>
<State Animation: 227>
For the actual aura state:
<Custom Apply Effect>
target._mercuryPoison = Math.ceil(origin.mat * 1);
</Custom Apply Effect>
<Custom Remove Effect>
target._mercuryPoison = undefined;
</Custom Remove Effect>
<Custom Regenerate Effect>
if (target.isStateCategoryAffected('boss')) {
// Damage formula used if the target is a boss.
target._mercuryPoison = target._mercuryPoison || Math.ceil(origin.mat * 1);
target.startAnimation(12);
target.gainHp(-target._mercuryPoison);
target.startDamagePopup();
if (target.isDead()) {
target.performCollapse();
}
target.clearResult();
} else {
// Damage formula used if the target isn't a boss.
var damage = Math.ceil(target.mhp * 0.20);
damage = Math.min(damage, 9999);
}
</Custom Regenerate Effect>
Original Mercury Poisoning:
<Category: Hex>
<Help Description>
For \c[4]5\c[0] turns, unit will receive \c[4]HP DMG\c[0] equal to \c[4]50%\c[0] of the caster's \c[4]INT\c[0] at the time \c[4]Mercury Poisoning\c[0] was applied
</Help Description>
<Custom Apply Effect>
target._mercuryPoison = Math.ceil(origin.mat * 0.50);
</Custom Apply Effect>
<Custom Remove Effect>
target._mercuryPoison = undefined;
</Custom Remove Effect>
<Custom Regenerate Effect>
target._mercuryPoison = target._mercuryPoison || Math.ceil(origin.mat * 0.50);
target.startAnimation(12);
target.gainHp(-target._mercuryPoison);
target.startDamagePopup();
if (target.isDead()) {
target.performCollapse();
}
target.clearResult();
</Custom Regenerate Effect>
Plugins needed:
http://yanfly.moe/2016/10/08/yep-117-passive-aura-effects-rpg-maker-mv/
http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/
Script:
I'm using a modified version of Mercury Poisoning from Yanfly's sample project because that spell does what I'm trying to do except I want it in Aura Form. I have included the original Mercury Poisoning I also added a %hp damage for when the target isn't a boss which works fine.
Origin aura state:
<Enemy Aura: 182>
<State Animation: 227>
For the actual aura state:
<Custom Apply Effect>
target._mercuryPoison = Math.ceil(origin.mat * 1);
</Custom Apply Effect>
<Custom Remove Effect>
target._mercuryPoison = undefined;
</Custom Remove Effect>
<Custom Regenerate Effect>
if (target.isStateCategoryAffected('boss')) {
// Damage formula used if the target is a boss.
target._mercuryPoison = target._mercuryPoison || Math.ceil(origin.mat * 1);
target.startAnimation(12);
target.gainHp(-target._mercuryPoison);
target.startDamagePopup();
if (target.isDead()) {
target.performCollapse();
}
target.clearResult();
} else {
// Damage formula used if the target isn't a boss.
var damage = Math.ceil(target.mhp * 0.20);
damage = Math.min(damage, 9999);
}
</Custom Regenerate Effect>
Original Mercury Poisoning:
<Category: Hex>
<Help Description>
For \c[4]5\c[0] turns, unit will receive \c[4]HP DMG\c[0] equal to \c[4]50%\c[0] of the caster's \c[4]INT\c[0] at the time \c[4]Mercury Poisoning\c[0] was applied
</Help Description>
<Custom Apply Effect>
target._mercuryPoison = Math.ceil(origin.mat * 0.50);
</Custom Apply Effect>
<Custom Remove Effect>
target._mercuryPoison = undefined;
</Custom Remove Effect>
<Custom Regenerate Effect>
target._mercuryPoison = target._mercuryPoison || Math.ceil(origin.mat * 0.50);
target.startAnimation(12);
target.gainHp(-target._mercuryPoison);
target.startDamagePopup();
if (target.isDead()) {
target.performCollapse();
}
target.clearResult();
</Custom Regenerate Effect>