diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 4622aa82a..0748d338f 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -1171,6 +1171,7 @@ namespace Framework.Constants IgnoreSetFacing = 0x200, //! Will Not Adjust Facing To Target (If Any) IgnoreShapeshift = 0x400, //! Will Ignore Shapeshift Checks IgnoreCasterAurastate = 0x800, //! Will Ignore Caster Aura States Including Combat Requirements And Death State + DisallowProcEvents = 0x1000, //! Disallows proc events from triggered spell (default) IgnoreCasterMountedOrOnVehicle = 0x2000, //! Will Ignore Mounted/On Vehicle Restrictions IgnoreCasterAuras = 0x10000, //! Will Ignore Caster Aura Restrictions Or Requirements DontResetPeriodicTimer = 0x20000, //! Will allow periodic aura timers to keep ticking (instead of resetting) diff --git a/Source/Game/Entities/Unit/Unit.Spells.cs b/Source/Game/Entities/Unit/Unit.Spells.cs index 832d0b2a7..986e46a94 100644 --- a/Source/Game/Entities/Unit/Unit.Spells.cs +++ b/Source/Game/Entities/Unit/Unit.Spells.cs @@ -1893,6 +1893,11 @@ namespace Game.Entities void TriggerAurasProcOnEvent(ProcEventInfo eventInfo, List> aurasTriggeringProc) { + Spell triggeringSpell = eventInfo.GetProcSpell(); + bool disableProcs = triggeringSpell && triggeringSpell.IsProcDisabled(); + if (disableProcs) + SetCantProc(true); + foreach (var aurAppProc in aurasTriggeringProc) { AuraApplication aurApp = aurAppProc.Item2; @@ -1910,6 +1915,9 @@ namespace Game.Entities if (spellInfo.HasAttribute(SpellAttr3.DisableProc)) SetCantProc(false); } + + if (disableProcs) + SetCantProc(false); } void SetCantProc(bool apply) diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index 568f429a3..dc6bf53de 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -7125,6 +7125,7 @@ namespace Game.Spells public bool IsTriggered() { return _triggeredCastFlags.HasAnyFlag(TriggerCastFlags.FullMask); } public bool IsIgnoringCooldowns() { return _triggeredCastFlags.HasAnyFlag(TriggerCastFlags.IgnoreSpellAndCategoryCD); } + public bool IsProcDisabled() { return _triggeredCastFlags.HasAnyFlag(TriggerCastFlags.DisallowProcEvents); } public bool IsChannelActive() { return m_caster.GetChannelSpellId() != 0; } public bool IsDeletable() diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index e94f7d8d6..dd1515ec0 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -1274,9 +1274,14 @@ namespace Game.Entities if (spellInfo == null) continue; + // Data already present in DB, overwrites default proc if (mSpellProcMap.ContainsKey(spellInfo.Id)) continue; + // Nothing to do if no flags set + if (spellInfo.ProcFlags == 0) + continue; + bool addTriggerFlag = false; ProcFlagsSpellType procSpellTypeMask = ProcFlagsSpellType.None; foreach (SpellEffectInfo effect in spellInfo.GetEffectsForDifficulty(Difficulty.None)) @@ -1294,15 +1299,27 @@ namespace Game.Entities procSpellTypeMask |= getSpellTypeMask(auraName); if (isAlwaysTriggeredAura(auraName)) addTriggerFlag = true; + + // many proc auras with taken procFlag mask don't have attribute "can proc with triggered" + // they should proc nevertheless (example mage armor spells with judgement) + if (!addTriggerFlag && spellInfo.ProcFlags.HasAnyFlag(ProcFlags.TakenHitMask)) + { + switch (auraName) + { + case AuraType.ProcTriggerSpell: + case AuraType.ProcTriggerDamage: + addTriggerFlag = true; + break; + default: + break; + } + } break; } if (procSpellTypeMask == 0) continue; - if (spellInfo.ProcFlags == 0) - continue; - SpellProcEntry procEntry = new SpellProcEntry(); procEntry.SchoolMask = 0; procEntry.ProcFlags = spellInfo.ProcFlags;