Core/Spell: Added the possibility to explicitly disable auraEffect procs using attributes

Port From (https://github.com/TrinityCore/TrinityCore/commit/77fc6ceea8716a85baca80b1816fbe3588b182e7)
This commit is contained in:
hondacrx
2019-08-31 11:01:41 -04:00
parent 966c1fff33
commit 01a8140203
3 changed files with 14 additions and 11 deletions
+4 -4
View File
@@ -1646,7 +1646,7 @@ namespace Game.Spells
SetLastProcSuccessTime(now);
}
public uint IsProcTriggeredOnEvent(AuraApplication aurApp, ProcEventInfo eventInfo, DateTime now)
public uint GetProcEffectMask(AuraApplication aurApp, ProcEventInfo eventInfo, DateTime now)
{
SpellProcEntry procEntry = Global.SpellMgr.GetSpellProcEntry(GetId());
// only auras with spell proc entry can trigger proc
@@ -1712,9 +1712,9 @@ namespace Game.Spells
// At least one effect has to pass checks to proc aura
uint procEffectMask = 0;
for (byte i = 0; i < SpellConst.MaxEffects; ++i)
if (aurApp.HasEffect(i))
if (GetEffect(i).CheckEffectProc(aurApp, eventInfo))
procEffectMask |= (1u << i);
if ((procEffectMask & (1u << i)) != 0)
if ((procEntry.DisableEffectsMask & (1u << i)) != 0 || !GetEffect(i).CheckEffectProc(aurApp, eventInfo))
procEffectMask &= ~(1u << i);
if (procEffectMask == 0)
return 0;