From 7ced9cf483bc1e8afdc403b4a60a8ff4ff3c7912 Mon Sep 17 00:00:00 2001 From: Xfurry Date: Tue, 3 Nov 2015 20:38:12 +0100 Subject: [PATCH] Don't interrupt certain channeled spells This will check for the combination of SPELL_ATTR_EX_CHANNELED_1 and SPELL_ATTR_EX3_UNK28 (possible SPELL_ATTR_EX3_ALWAYS_CAST_OK) and ignore UNIT_STAT_CAN_NOT_REACT Thanks to @vovk Close scriptdev2/scriptdev2#145 --- src/game/SharedDefines.h | 2 +- src/game/Spell.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index b4de0df596f..530628891a0 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -385,7 +385,7 @@ enum SpellAttributesEx3 SPELL_ATTR_EX3_UNK25 = 0x02000000,// 25 no cause spell pushback ? SPELL_ATTR_EX3_UNK26 = 0x04000000,// 26 SPELL_ATTR_EX3_UNK27 = 0x08000000,// 27 - SPELL_ATTR_EX3_UNK28 = 0x10000000,// 28 + SPELL_ATTR_EX3_UNK28 = 0x10000000,// 28 always cast ok ? (requires more research) SPELL_ATTR_EX3_UNK29 = 0x20000000,// 29 SPELL_ATTR_EX3_UNK30 = 0x40000000,// 30 SPELL_ATTR_EX3_UNK31 = 0x80000000,// 31 diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index ed75b5db879..9124dd2b286 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -3609,7 +3609,11 @@ void Spell::update(uint32 difftime) // check for incapacitating player states if (m_caster->hasUnitState(UNIT_STAT_CAN_NOT_REACT)) - cancel(); + { + // certain channel spells are not interrupted + if (!m_spellInfo->HasAttribute(SPELL_ATTR_EX_CHANNELED_1) && !m_spellInfo->HasAttribute(SPELL_ATTR_EX3_UNK28)) + cancel(); + } // check if player has turned if flag is set if (m_spellInfo->ChannelInterruptFlags & CHANNEL_FLAG_TURNING && m_castOrientation != m_caster->GetOrientation())