Skip to content

Commit

Permalink
Don't interrupt certain channeled spells
Browse files Browse the repository at this point in the history
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

(based on cmangos/mangos-wotlk@7ced9cf)

Signed-off-by: Cala <calaftp@free.fr>
  • Loading branch information
xfurry authored and cala committed Nov 8, 2015
1 parent a350594 commit fbf7334
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/game/SharedDefines.h
Expand Up @@ -382,7 +382,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
Expand Down
6 changes: 5 additions & 1 deletion src/game/Spell.cpp
Expand Up @@ -3169,7 +3169,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())
Expand Down

0 comments on commit fbf7334

Please sign in to comment.