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>
Yanfly damage aura
● ARCHIVED · READ-ONLY
-
-
Any time you write states, target is the attacker and user refers to the battler with the state active, with the exception of React effects where it is reversed so the user is the attacker.
-
I tried that already though. Like I mentioned in my first post, it doesn't matter if it put user or target, the result is exactly the same.
-
Bump
-
bump
-
The origin of an aura-caused state is not the battler with the aura, it's the 'target' of the aura afflicted state.
The user didn't afflict the targets with the dot state, the aura did.
To correctly set the origin, you'll have to have the aura skill set something like $gameTemp._auraOrigin to the user, and then reference that in the damage calculation instead of origin. -
The origin of an aura-caused state is not the battler with the aura, it's the 'target' of the aura afflicted state.
The user didn't afflict the targets with the dot state, the aura did.
To correctly set the origin, you'll have to have the aura skill set something like $gameTemp._auraOrigin to the user, and then reference that in the damage calculation instead of origin.
Thanks. I'll see if I can figure it out with that tip. -
The origin of an aura-caused state is not the battler with the aura, it's the 'target' of the aura afflicted state.
The user didn't afflict the targets with the dot state, the aura did.
To correctly set the origin, you'll have to have the aura skill set something like $gameTemp._auraOrigin to the user, and then reference that in the damage calculation instead of origin.
I managed to get it to work!!! Thanks so much
Aura Skill notetags:
<After Eval>
$gameTemp._auraOrigin = user.mat * 1
</After Eval>
Aura state noteags:
<Custom Apply Effect>
target._mercuryPoison = $gameTemp._auraOrigin;
</Custom Apply Effect>
<Custom Remove Effect>
target._mercuryPoison = undefined;
</Custom Remove Effect>
<Custom Regenerate Effect>
target._mercuryPoison = $gameTemp._auraOrigin;
target.startAnimation(12);
target.gainHp(-target._mercuryPoison);
target.startDamagePopup();
if (target.isDead()) {
target.performCollapse();
}
target.clearResult();
</Custom Regenerate Effect>