Core/Spells: Validate spell_proc.AttributesMask on startup
Port From (https://github.com/TrinityCore/TrinityCore/commit/415aaae7f2fa3a5e09a51b0355120bf4138cde41)
This commit is contained in:
@@ -2540,7 +2540,9 @@ namespace Framework.Constants
|
|||||||
ReqPowerCost = 0x04, // requires triggering spell to have a power cost for aura proc
|
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
|
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
|
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
|
// Spell aura states
|
||||||
|
|||||||
@@ -1431,6 +1431,11 @@ namespace Game.Entities
|
|||||||
if (!found)
|
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");
|
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);
|
mSpellProcMap.Add((spellInfo.Id, spellInfo.Difficulty), procEntry);
|
||||||
++count;
|
++count;
|
||||||
|
|||||||
Reference in New Issue
Block a user