*Make auras with periodic power take cancel when there is no more power avalible.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-03-22 11:34:34 +01:00
parent f487cec645
commit b5390f84b9
+9 -3
View File
@@ -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;