aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2021-08-18 23:17:54 +0200
committerShauren <shauren.trinity@gmail.com>2021-08-18 23:22:46 +0200
commit0ae1ebedfee41662df5ec49ae2b40670aaea9665 (patch)
treecb2672dc8cf0c8d4829fdbfcc8cad711ba680b2f
parent95c8eae12340d2df59d63c7f67874d21af46a171 (diff)
Core/Spells: explicitly disable non proccing auras when generating default procs
Closes #21529 (cherry picked from commit ad796318e8c34df177a935892f27c6a7b4f2f901)
-rw-r--r--src/server/game/Spells/SpellMgr.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index d07cd6a54cb..57eff46b809 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -1616,6 +1616,9 @@ void SpellMgr::LoadSpellProcs()
TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has wrong `HitMask` set: %u", spellInfo->Id, procEntry.HitMask);
if (procEntry.HitMask && !(procEntry.ProcFlags & TAKEN_HIT_PROC_FLAG_MASK || (procEntry.ProcFlags & DONE_HIT_PROC_FLAG_MASK && (!procEntry.SpellPhaseMask || procEntry.SpellPhaseMask & (PROC_SPELL_PHASE_HIT | PROC_SPELL_PHASE_FINISH)))))
TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has `HitMask` value defined, but it will not be used for defined `ProcFlags` and `SpellPhaseMask` values.", spellInfo->Id);
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ if ((procEntry.DisableEffectsMask & (1u << i)) && (!spellInfo->GetEffect(i) || !spellInfo->GetEffect(i)->IsAura()))
+ TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has DisableEffectsMask with effect %u, but effect %u is not an aura effect", spellInfo->Id, static_cast<uint32>(i), static_cast<uint32>(i));
if (procEntry.AttributesMask & PROC_ATTR_REQ_SPELLMOD)
{
bool found = false;
@@ -1757,6 +1760,7 @@ void SpellMgr::LoadSpellProcs()
bool addTriggerFlag = false;
uint32 procSpellTypeMask = PROC_SPELL_TYPE_NONE;
+ uint32 nonProcMask = 0;
for (SpellEffectInfo const* effect : spellInfo.GetEffects())
{
if (!effect || !effect->IsEffect())
@@ -1767,7 +1771,11 @@ void SpellMgr::LoadSpellProcs()
continue;
if (!isTriggerAura[auraName])
+ {
+ // explicitly disable non proccing auras to avoid losing charges on self proc
+ nonProcMask |= 1 << effect->EffectIndex;
continue;
+ }
procSpellTypeMask |= spellTypeMask[auraName];
if (isAlwaysTriggeredAura[auraName])
@@ -1787,7 +1795,6 @@ void SpellMgr::LoadSpellProcs()
break;
}
}
- break;
}
if (!procSpellTypeMask)
@@ -1846,7 +1853,7 @@ void SpellMgr::LoadSpellProcs()
}
procEntry.AttributesMask = 0;
- procEntry.DisableEffectsMask = 0;
+ procEntry.DisableEffectsMask = nonProcMask;
if (spellInfo.ProcFlags & PROC_FLAG_KILL)
procEntry.AttributesMask |= PROC_ATTR_REQ_EXP_OR_HONOR;
if (addTriggerFlag)