Core/Spells: Spells that can be spellstolen that have a permanent duration should respect the 2 minute spellsteal buff duration limit.
This commit is contained in:
@@ -3755,7 +3755,8 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit*
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool stealCharge = aura->GetSpellInfo()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES;
|
bool stealCharge = aura->GetSpellInfo()->AttributesEx7 & SPELL_ATTR7_DISPEL_CHARGES;
|
||||||
int32 dur = std::min(2 * MINUTE * IN_MILLISECONDS, aura->GetDuration());
|
// Cast duration to unsigned to prevent permanent aura's such as Righteous Fury being permanently added to caster
|
||||||
|
uint32 dur = std::min(2u * MINUTE * IN_MILLISECONDS, uint32(aura->GetDuration()));
|
||||||
|
|
||||||
if (Aura* newAura = stealer->GetAura(aura->GetId(), aura->GetCasterGUID()))
|
if (Aura* newAura = stealer->GetAura(aura->GetId(), aura->GetCasterGUID()))
|
||||||
{
|
{
|
||||||
@@ -3763,7 +3764,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit*
|
|||||||
newAura->ModCharges(1);
|
newAura->ModCharges(1);
|
||||||
else
|
else
|
||||||
newAura->ModStackAmount(1);
|
newAura->ModStackAmount(1);
|
||||||
newAura->SetDuration(dur);
|
newAura->SetDuration(int32(dur));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3782,7 +3783,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit*
|
|||||||
caster->GetSingleCastAuras().push_back(aura);
|
caster->GetSingleCastAuras().push_back(aura);
|
||||||
}
|
}
|
||||||
// FIXME: using aura->GetMaxDuration() maybe not blizzlike but it fixes stealing of spells like Innervate
|
// FIXME: using aura->GetMaxDuration() maybe not blizzlike but it fixes stealing of spells like Innervate
|
||||||
newAura->SetLoadedState(aura->GetMaxDuration(), dur, stealCharge ? 1 : aura->GetCharges(), 1, recalculateMask, &damage[0]);
|
newAura->SetLoadedState(aura->GetMaxDuration(), int32(dur), stealCharge ? 1 : aura->GetCharges(), 1, recalculateMask, &damage[0]);
|
||||||
newAura->ApplyForTargets();
|
newAura->ApplyForTargets();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user