aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2021-02-24 22:08:21 +0100
committerShauren <shauren.trinity@gmail.com>2021-02-24 22:08:21 +0100
commit8740c2f85fe28a9396383b313f8fa2a5210e3200 (patch)
treea0d671df48dec50f9d1381fc73750aa7da16be18 /src
parentde77f046a06182edb62a34b5468b174c478dbaa8 (diff)
Core/Auras: Improve PROC_ATTR_USE_STACKS_FOR_CHARGES implementation to give stacks priority over charges if both are present in spell data
Closes #26146
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index 6b692da440a..b9746233b96 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -1675,16 +1675,16 @@ void Aura::PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInf
if (!prepare)
return;
+ SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetSpellInfo());
+ ASSERT(procEntry);
+
// take one charge, aura expiration will be handled in Aura::TriggerProcOnEvent (if needed)
- if (IsUsingCharges())
+ if (!(procEntry->AttributesMask & PROC_ATTR_USE_STACKS_FOR_CHARGES) && IsUsingCharges())
{
--m_procCharges;
SetNeedClientUpdateForTargets();
}
- SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetSpellInfo());
- ASSERT(procEntry);
-
// cooldowns should be added to the whole aura (see 51698 area aura)
AddProcCooldown(now + procEntry->Cooldown);
@@ -1860,13 +1860,15 @@ void Aura::TriggerProcOnEvent(uint32 procEffectMask, AuraApplication* aurApp, Pr
}
// Remove aura if we've used last charge to proc
- if (IsUsingCharges())
+ if (ASSERT_NOTNULL(sSpellMgr->GetSpellProcEntry(m_spellInfo))->AttributesMask & PROC_ATTR_USE_STACKS_FOR_CHARGES)
+ {
+ ModStackAmount(-1);
+ }
+ else if (IsUsingCharges())
{
if (!GetCharges())
Remove();
}
- else if (ASSERT_NOTNULL(sSpellMgr->GetSpellProcEntry(m_spellInfo))->AttributesMask & PROC_ATTR_USE_STACKS_FOR_CHARGES)
- ModStackAmount(-1);
}
float Aura::CalcPPMProcChance(Unit* actor) const