Core/Spells: SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT improvement

*Now it'll correctly increase\decrease % of power
*Added helper function for modify power with percent ammount
This commit is contained in:
Chaplain
2011-10-12 01:11:52 +03:00
parent 44c55f78e0
commit 3e9611578c
4 changed files with 22 additions and 2 deletions
@@ -4003,8 +4003,18 @@ void AuraEffect::HandleAuraModIncreaseEnergyPercent(AuraApplication const* aurAp
// return;
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + powerType);
float amount = float(GetAmount());
target->HandleStatModifier(unitMod, TOTAL_PCT, float(GetAmount()), apply);
if (apply)
{
target->HandleStatModifier(unitMod, TOTAL_PCT, amount, apply);
target->ModifyPowerPct(powerType, amount, apply);
}
else
{
target->ModifyPowerPct(powerType, amount, apply);
target->HandleStatModifier(unitMod, TOTAL_PCT, amount, apply);
}
}
void AuraEffect::HandleAuraModIncreaseHealthPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const