From b9caad745527e5e63ee6cb415fc8f65fe567b17f Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 10 Mar 2022 13:40:20 -0500 Subject: [PATCH] Core/Spells: Correct implementation of SPELL_ATTR2_TRIGGERED_CAN_TRIGGER_PROC, SPELL_ATTR3_TRIGGERED_CAN_TRIGGER_PROC_2, SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED and rename them (SPELL_ATTR2_ACTIVE_THREAT, SPELL_ATTR3_NOT_A_PROC, SPELL_ATTR3_CAN_PROC_FROM_PROCS) Port From (https://github.com/TrinityCore/TrinityCore/commit/b6bc8a50acaf153849f58c8b408e236bb2b70c35) --- Source/Framework/Constants/Spells/SpellConst.cs | 6 +++--- Source/Game/Spells/Auras/Aura.cs | 4 ++-- Source/Game/Spells/SpellManager.cs | 16 ---------------- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index 47049e3b8..3b9339c23 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -1673,7 +1673,7 @@ namespace Framework.Constants Unk27 = 0x8000000, // 27 IgnoreActionAuraInterruptFlags = 0x10000000, // 28 doesnt break auras with SpellAuraInterruptFlags::Action and SpellAuraInterruptFlags::ActionDelayed CantCrit = 0x20000000, // 29 Spell Can'T Crit - TriggeredCanTriggerProc = 0x40000000, // 30 Spell Can Trigger Even If Triggered + ActiveThreat = 0x40000000, // 30 Active Threat FoodBuff = 0x80000000 // 31 Food Or Drink Buff (Like Well Fed) } public enum SpellAttr3 : uint @@ -1687,7 +1687,7 @@ namespace Framework.Constants Unk6 = 0x40, // 6 StackForDiffCasters = 0x80, // 7 Separate Stack For Every Caster OnlyTargetPlayers = 0x100, // 8 Can Only Target Players - TriggeredCanTriggerProc2 = 0x200, // 9 Triggered From Effect? + NotAProc = 0x200, // 9 Without this attribute, any triggered spell will be unable to trigger other auras' procs MainHand = 0x400, // 10 Main Hand Weapon Required Battleground = 0x800, // 11 Can Casted Only On Battleground OnlyTargetGhosts = 0x1000, // 12 @@ -1704,7 +1704,7 @@ namespace Framework.Constants Unk23 = 0x800000, // 23 ReqOffhand = 0x1000000, // 24 Req Offhand Weapon TreatAsPeriodic = 0x2000000, // 25 Makes the spell appear as periodic in client combat logs - used by spells that trigger another spell on each tick - CanProcWithTriggered = 0x4000000, // 26 Auras With This Attribute Can Proc From Triggered Spell Casts With TriggeredCanTriggerProc2 (67736 + 52999) + CanProcFromProcs = 0x4000000, // 26 Can Proc From Procs DrainSoul = 0x8000000, // 27 Only Drain Soul Has This Flag Unk28 = 0x10000000, // 28 NoDoneBonus = 0x20000000, // 29 Ignore Caster Spellpower And Done Damage Mods? Client Doesn'T Apply Spellmods For Those Spells diff --git a/Source/Game/Spells/Auras/Aura.cs b/Source/Game/Spells/Auras/Aura.cs index 5805147a7..9a8edb0d3 100644 --- a/Source/Game/Spells/Auras/Aura.cs +++ b/Source/Game/Spells/Auras/Aura.cs @@ -1709,8 +1709,8 @@ namespace Game.Spells return 0; // check if aura can proc when spell is triggered (exception for hunter auto shot & wands) - if (spell.IsTriggered() && !procEntry.AttributesMask.HasAnyFlag(ProcAttributes.TriggeredCanProc) && !eventInfo.GetTypeMask().HasFlag(ProcFlags.AutoAttackMask)) - if (!GetSpellInfo().HasAttribute(SpellAttr3.CanProcWithTriggered)) + if (!GetSpellInfo().HasAttribute(SpellAttr3.CanProcFromProcs) && !procEntry.AttributesMask.HasFlag(ProcAttributes.TriggeredCanProc) && !eventInfo.GetTypeMask().HasFlag(ProcFlags.AutoAttackMask)) + if (spell.IsTriggered() && !spell.GetSpellInfo().HasAttribute(SpellAttr3.NotAProc)) return 0; } diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index 7d010aafc..7f1a48ed8 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -487,22 +487,6 @@ namespace Game.Entities if (eventInfo.GetTypeMask().HasAnyFlag(ProcFlags.Killed | ProcFlags.Kill | ProcFlags.Death)) return true; - // Do not consider autoattacks as triggered spells - if (!procEntry.AttributesMask.HasAnyFlag(ProcAttributes.TriggeredCanProc) && !eventInfo.GetTypeMask().HasFlag(ProcFlags.AutoAttackMask)) - { - Spell spell = eventInfo.GetProcSpell(); - if (spell) - { - if (spell.IsTriggered()) - { - SpellInfo spellInfo = spell.GetSpellInfo(); - if (!spellInfo.HasAttribute(SpellAttr3.TriggeredCanTriggerProc2) && - !spellInfo.HasAttribute(SpellAttr2.TriggeredCanTriggerProc)) - return false; - } - } - } - // check school mask (if set) for other trigger types if (procEntry.SchoolMask != 0 && !Convert.ToBoolean(eventInfo.GetSchoolMask() & procEntry.SchoolMask)) return false;