From bb450b82efc54d72d60d7bf10f39be75f7d14bce Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 18 Feb 2021 23:28:26 +0100 Subject: [PATCH] Core/Auras: Implemented new spell proc attribute PROC_ATTR_USE_STACKS_FOR_CHARGES to drop stacks instead of charges --- src/server/game/Spells/Auras/SpellAuras.cpp | 9 +++++++-- src/server/game/Spells/SpellMgr.h | 15 +++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index b3919bd575e..94cc4ea76e6 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1873,8 +1873,13 @@ void Aura::TriggerProcOnEvent(uint8 procEffectMask, AuraApplication* aurApp, Pro } // Remove aura if we've used last charge to proc - if (IsUsingCharges() && !GetCharges()) - Remove(); + if (IsUsingCharges()) + { + if (!GetCharges()) + Remove(); + } + else if (ASSERT_NOTNULL(sSpellMgr->GetSpellProcEntry(m_spellInfo->Id))->AttributesMask & PROC_ATTR_USE_STACKS_FOR_CHARGES) + ModStackAmount(-1); } void Aura::_DeleteRemovedApplications() diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 1f17b06743c..3bdc4e40cc2 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -236,12 +236,15 @@ enum ProcFlagsHit enum ProcAttributes { - PROC_ATTR_REQ_EXP_OR_HONOR = 0x0000001, // requires proc target to give exp or honor for aura proc - PROC_ATTR_TRIGGERED_CAN_PROC = 0x0000002, // aura can proc even with triggered spells - PROC_ATTR_REQ_MANA_COST = 0x0000004, // requires triggering spell to have a mana cost for aura proc - PROC_ATTR_REQ_SPELLMOD = 0x0000008, // requires triggering spell to be affected by proccing aura to drop charges - PROC_ATTR_REDUCE_PROC_60 = 0x0000080, // aura should have a reduced chance to proc if level of proc Actor > 60 - PROC_ATTR_CANT_PROC_FROM_ITEM_CAST = 0x0000100, // do not allow aura proc if proc is caused by a spell casted by item + PROC_ATTR_REQ_EXP_OR_HONOR = 0x0000001, // requires proc target to give exp or honor for aura proc + PROC_ATTR_TRIGGERED_CAN_PROC = 0x0000002, // aura can proc even with triggered spells + PROC_ATTR_REQ_POWER_COST = 0x0000004, // requires triggering spell to have a power cost for aura proc + PROC_ATTR_REQ_SPELLMOD = 0x0000008, // requires triggering spell to be affected by proccing aura to drop charges + PROC_ATTR_REDUCE_PROC_60 = 0x0000080, // aura should have a reduced chance to proc if level of proc Actor > 60 + PROC_ATTR_USE_STACKS_FOR_CHARGES = 0x0000010, // consuming proc drops a stack from proccing aura instead of charge + + PROC_ATTR_REDUCE_PROC_60 = 0x0000080, // aura should have a reduced chance to proc if level of proc Actor > 60 + PROC_ATTR_CANT_PROC_FROM_ITEM_CAST = 0x0000100, // do not allow aura proc if proc is caused by a spell casted by item }; struct SpellProcEntry