*Make auras with periodic power take cancel when there is no more power avalible.
--HG-- branch : trunk
This commit is contained in:
@@ -578,9 +578,16 @@ void Aura::Update(uint32 diff)
|
||||
if (manaPerSecond)
|
||||
{
|
||||
if(powertype==POWER_HEALTH)
|
||||
caster->ModifyHealth(-manaPerSecond);
|
||||
else
|
||||
{
|
||||
if (caster->GetHealth()>manaPerSecond)
|
||||
caster->ModifyHealth(-manaPerSecond);
|
||||
else
|
||||
m_target->RemoveAurasByCasterSpell(GetId(),GetCasterGUID());
|
||||
}
|
||||
else if (caster->GetPower(powertype)>manaPerSecond)
|
||||
caster->ModifyPower(powertype,-manaPerSecond);
|
||||
else
|
||||
m_target->RemoveAurasByCasterSpell(GetId(),GetCasterGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5683,7 +5690,6 @@ void Aura::PeriodicTick()
|
||||
|
||||
pCaster->SendSpellNonMeleeDamageLog(m_target, GetId(), pdamage, GetSpellSchoolMask(GetSpellProto()), absorb, resist, false, 0);
|
||||
|
||||
|
||||
Unit* target = m_target; // aura can be deleted in DealDamage
|
||||
SpellEntry const* spellProto = GetSpellProto();
|
||||
float multiplier = spellProto->EffectMultipleValue[GetEffIndex()] > 0 ? spellProto->EffectMultipleValue[GetEffIndex()] : 1;
|
||||
|
||||
Reference in New Issue
Block a user