diff options
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index ae5665d53a2..f1203d70e3d 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3724,10 +3724,10 @@ void Spell::_cast(bool skipCheck) Unit::ProcSkillsAndAuras(m_originalCaster, nullptr, procAttacker, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_CAST, hitMask, this, nullptr, nullptr); - // Call CreatureAI hook OnSuccessfulSpellCast + // Call CreatureAI hook OnSpellCastFinished if (Creature* caster = m_originalCaster->ToCreature()) if (caster->IsAIEnabled()) - caster->AI()->OnSuccessfulSpellCast(GetSpellInfo()); + caster->AI()->OnSpellCastFinished(GetSpellInfo(), SPELL_FINISHED_SUCCESSFUL_CAST); } template <class Container> @@ -4086,6 +4086,11 @@ void Spell::update(uint32 difftime) { SendChannelUpdate(0); finish(); + + // We call the hook here instead of in Spell::finish because we only want to call it for completed channeling. Everything else is handled by interrupts + if (Creature* creatureCaster = m_caster->ToCreature()) + if (creatureCaster->IsAIEnabled()) + creatureCaster->AI()->OnSpellCastFinished(m_spellInfo, SPELL_FINISHED_CHANNELING_COMPLETE); } break; } |