diff options
-rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 11 |
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) |