diff options
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 53656861b92..3f3b7cc9694 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3341,6 +3341,11 @@ SpellCastResult Spell::prepare(SpellCastTargets const& targets, AuraEffect const if (!(_triggeredCastFlags & TRIGGERED_IGNORE_GCD)) TriggerGlobalCooldown(); + // Call CreatureAI hook OnSpellStart + if (Creature* caster = m_originalCaster->ToCreature()) + if (caster->IsAIEnabled()) + caster->AI()->OnSpellStart(GetSpellInfo()); + if (willCastDirectly) cast(true); } @@ -3707,10 +3712,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 OnSpellCastFinished + // Call CreatureAI hook OnSpellCast if (Creature* caster = m_originalCaster->ToCreature()) if (caster->IsAIEnabled()) - caster->AI()->OnSpellCastFinished(GetSpellInfo(), SPELL_FINISHED_SUCCESSFUL_CAST); + caster->AI()->OnSpellCast(GetSpellInfo()); } template <class Container> @@ -4068,7 +4073,7 @@ void Spell::update(uint32 difftime) // 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); + creatureCaster->AI()->OnChannelFinished(m_spellInfo); } break; } |