From 7080de0cacf0886e5a35933436bba47e6c4e6ba1 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 21 Feb 2021 21:36:09 -0500 Subject: [PATCH] Core/Auras: Implemented new spell proc attribute PROC_ATTR_USE_STACKS_FOR_CHARGES to drop stacks instead of charges Port From (https://github.com/TrinityCore/TrinityCore/commit/54c5cc97f53dd456a4496d23c0b3375f9280639a) --- Source/Framework/Constants/Spells/SpellConst.cs | 1 + Source/Game/Spells/Auras/Aura.cs | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index da1509c47..164056e96 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -2412,6 +2412,7 @@ namespace Framework.Constants TriggeredCanProc = 0x02, // aura can proc even with triggered spells 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 } diff --git a/Source/Game/Spells/Auras/Aura.cs b/Source/Game/Spells/Auras/Aura.cs index ae16fcaa4..e6897502e 100644 --- a/Source/Game/Spells/Auras/Aura.cs +++ b/Source/Game/Spells/Auras/Aura.cs @@ -1834,8 +1834,13 @@ namespace Game.Spells } // Remove aura if we've used last charge to proc - if (IsUsingCharges() && GetCharges() == 0) - Remove(); + if (IsUsingCharges()) + { + if (GetCharges() == 0) + Remove(); + } + else if (Global.SpellMgr.GetSpellProcEntry(m_spellInfo).AttributesMask.HasAnyFlag(ProcAttributes.UseStacksForCharges)) + ModStackAmount(-1); } public float CalcPPMProcChance(Unit actor)