diff options
author | maximius <none@none> | 2009-11-18 06:22:43 +0100 |
---|---|---|
committer | maximius <none@none> | 2009-11-18 06:22:43 +0100 |
commit | 929df85572f8f05751cbdf36d1c463fbd829d49d (patch) | |
tree | ccfb084eb09d9b14e86bb004e1f36618a8c9be66 /src/game/SpellAuras.cpp | |
parent | d03c14e0b7f37fb09048b8cb2be363cb20e30b7a (diff) |
*Tenacity: correct way to keep hp% after spell being casted, by Spp, closes #240
--HG--
branch : trunk
Diffstat (limited to 'src/game/SpellAuras.cpp')
-rw-r--r-- | src/game/SpellAuras.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 2a420a3c7f2..4cb094f06c5 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3316,7 +3316,7 @@ void AuraEffect::HandleAuraMounted(bool apply, bool Real, bool /*changeAmount*/) //some mounts like Headless Horseman's Mount or broom stick are skill based spell // need to remove ALL arura related to mounts, this will stop client crash with broom stick // and never endless flying after using Headless Horseman's Mount - m_target->RemoveAurasByType(SPELL_AURA_MOUNTED); + m_target->RemoveAurasByType(SPELL_AURA_MOUNTED); } } @@ -5109,7 +5109,11 @@ void AuraEffect::HandleAuraModIncreaseEnergyPercent(bool apply, bool /*Real*/, b void AuraEffect::HandleAuraModIncreaseHealthPercent(bool apply, bool /*Real*/, bool /*changeAmount*/) { + // Unit will keep hp% after MaxHealth being modified if unit is alive. + float percent = ((float)m_target->GetHealth()) / m_target->GetMaxHealth(); m_target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_PCT, float(m_amount), apply); + if (m_target->isAlive()) + m_target->SetHealth(uint32(m_target->GetMaxHealth()*percent)); } void AuraEffect::HandleAuraIncreaseBaseHealthPercent(bool apply, bool /*Real*/, bool /*changeAmount*/) |