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 450957a5ca9..c36d26d5096 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3145,6 +3145,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()); + // commented out !m_spellInfo->StartRecoveryTime, it forces instant spells with global cooldown to be processed in spell::update // as a result a spell that passed CheckCast and should be processed instantly may suffer from this delayed process // the easiest bug to observe is LoS check in AddUnitTarget, even if spell passed the CheckCast LoS check the situation can change in spell::update @@ -3483,10 +3488,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> @@ -3802,7 +3807,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; } |
