Fixed periodic damage for stackable auras (Deadly Poison...). Patch by Lyall. Closes issue #1368.
--HG-- branch : trunk
This commit is contained in:
@@ -3496,7 +3496,19 @@ void Unit::_AddAura(UnitAura * aura, Unit * caster)
|
|||||||
if (Aura * foundAura = GetOwnedAura(aura->GetId(), aura->GetCasterGUID(), 0, aura))
|
if (Aura * foundAura = GetOwnedAura(aura->GetId(), aura->GetCasterGUID(), 0, aura))
|
||||||
{
|
{
|
||||||
if (aura->GetSpellProto()->StackAmount)
|
if (aura->GetSpellProto()->StackAmount)
|
||||||
|
{
|
||||||
aura->ModStackAmount(foundAura->GetStackAmount());
|
aura->ModStackAmount(foundAura->GetStackAmount());
|
||||||
|
|
||||||
|
// Update periodic timers from the previous aura
|
||||||
|
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||||
|
{
|
||||||
|
AuraEffect *existingEff = foundAura->GetEffect(i);
|
||||||
|
AuraEffect *newEff = aura->GetEffect(i);
|
||||||
|
if (!existingEff || !newEff)
|
||||||
|
continue;
|
||||||
|
newEff->SetPeriodicTimer(existingEff->GetPeriodicTimer());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Use the new one to replace the old one
|
// Use the new one to replace the old one
|
||||||
// This is the only place where AURA_REMOVE_BY_STACK should be used
|
// This is the only place where AURA_REMOVE_BY_STACK should be used
|
||||||
|
|||||||
@@ -45,6 +45,9 @@ class AuraEffect
|
|||||||
int32 GetAmount() const { return m_amount; }
|
int32 GetAmount() const { return m_amount; }
|
||||||
void SetAmount(int32 amount) { m_amount = amount; m_canBeRecalculated = false;}
|
void SetAmount(int32 amount) { m_amount = amount; m_canBeRecalculated = false;}
|
||||||
|
|
||||||
|
int32 GetPeriodicTimer() const { return m_periodicTimer; }
|
||||||
|
void SetPeriodicTimer(int32 periodicTimer) { m_periodicTimer = periodicTimer; }
|
||||||
|
|
||||||
int32 CalculateAmount(Unit * caster);
|
int32 CalculateAmount(Unit * caster);
|
||||||
void CalculatePeriodic(Unit * caster, bool create = false);
|
void CalculatePeriodic(Unit * caster, bool create = false);
|
||||||
void CalculateSpellMod();
|
void CalculateSpellMod();
|
||||||
|
|||||||
Reference in New Issue
Block a user