From fcb79105331b95de03cd620fb7c7c308fbac9e84 Mon Sep 17 00:00:00 2001 From: ariel- Date: Wed, 9 Nov 2016 00:39:49 -0300 Subject: [PATCH] Core/Spell: reimplemented TRIGGERED_DISALLOW_PROC_EVENTS trigger flag Triggered spells shouldn't chain-trigger other spells Closes #18217 --- src/server/game/Entities/Unit/Unit.cpp | 8 ++++++++ src/server/game/Entities/Unit/Unit.h | 2 +- src/server/game/Spells/Spell.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 460ae5f126..50abb9bbd2 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -10730,6 +10730,11 @@ void Unit::TriggerAurasProcOnEvent(Unit* actionTarget, uint32 typeMaskActor, uin void Unit::TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationProcContainer& aurasTriggeringProc) { + Spell const* triggeringSpell = eventInfo.GetProcSpell(); + bool const disableProcs = triggeringSpell && triggeringSpell->IsProcDisabled(); + if (disableProcs) + SetCantProc(true); + for (auto const& aurAppProc : aurasTriggeringProc) { AuraApplication* aurApp; @@ -10748,6 +10753,9 @@ void Unit::TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationProc if (spellInfo->HasAttribute(SPELL_ATTR3_DISABLE_PROC)) SetCantProc(false); } + + if (disableProcs) + SetCantProc(false); } SpellSchoolMask Unit::GetMeleeDamageSchoolMask() const diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index f04d594e61..17f99c99b6 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -450,7 +450,7 @@ enum TriggerCastFlags TRIGGERED_IGNORE_SET_FACING = 0x00000200, //! Will not adjust facing to target (if any) TRIGGERED_IGNORE_SHAPESHIFT = 0x00000400, //! Will ignore shapeshift checks TRIGGERED_IGNORE_CASTER_AURASTATE = 0x00000800, //! Will ignore caster aura states including combat requirements and death state - // reuse = 0x00001000, + TRIGGERED_DISALLOW_PROC_EVENTS = 0x00001000, //! Disallows proc events from triggered spell (default) TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE = 0x00002000, //! Will ignore mounted/on vehicle restrictions // reuse = 0x00004000, // reuse = 0x00008000, diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 5bf1fd1a03..e8ab92d73f 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -494,6 +494,7 @@ class TC_GAME_API Spell void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; } bool IsTriggered() const { return (_triggeredCastFlags & TRIGGERED_FULL_MASK) != 0; } bool IsIgnoringCooldowns() const { return (_triggeredCastFlags & TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD) != 0; } + bool IsProcDisabled() const { return (_triggeredCastFlags & TRIGGERED_DISALLOW_PROC_EVENTS) != 0; } bool IsChannelActive() const { return m_caster->GetUInt32Value(UNIT_CHANNEL_SPELL) != 0; } bool IsAutoActionResetSpell() const;