Core/Spells: Validate spell_proc.AttributesMask on startup

Port From (https://github.com/TrinityCore/TrinityCore/commit/415aaae7f2fa3a5e09a51b0355120bf4138cde41)
This commit is contained in:
hondacrx
2022-02-25 13:02:48 -05:00
parent 28175c47b1
commit b7cd5b11f2
2 changed files with 8 additions and 1 deletions
@@ -2540,7 +2540,9 @@ namespace Framework.Constants
ReqPowerCost = 0x04, // requires triggering spell to have a power cost for aura proc
ReqSpellmod = 0x08, // requires triggering spell to be affected by proccing aura to drop charges
UseStacksForCharges = 0x10, // consuming proc drops a stack from proccing aura instead of charge
ReduceProc60 = 0x80 // aura should have a reduced chance to proc if level of proc Actor > 60
ReduceProc60 = 0x80, // aura should have a reduced chance to proc if level of proc Actor > 60
AllAllowed = ReqExpOrHonor | TriggeredCanProc | ReqPowerCost | ReqSpellmod | UseStacksForCharges | ReduceProc60
}
// Spell aura states
+5
View File
@@ -1431,6 +1431,11 @@ namespace Game.Entities
if (!found)
Log.outError(LogFilter.Sql, $"The `spell_proc` table entry for spellId {spellInfo.Id} has Attribute PROC_ATTR_REQ_SPELLMOD, but spell has no spell mods. Proc will not be triggered");
}
if ((procEntry.AttributesMask & ~ProcAttributes.AllAllowed) != 0)
{
Log.outError(LogFilter.Sql, $"The `spell_proc` table entry for spellId {spellInfo.Id} has `AttributesMask` value specifying invalid attributes 0x{procEntry.AttributesMask & ~ProcAttributes.AllAllowed:X2}.");
procEntry.AttributesMask &= ProcAttributes.AllAllowed;
}
mSpellProcMap.Add((spellInfo.Id, spellInfo.Difficulty), procEntry);
++count;