mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/Spells: explicitly disable non proccing auras when generating default procs
Closes #21529
(cherry picked from commit ad796318e8)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user