mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
feat(Scripting/Spell): Add new hooks for Spell (OnSpellCast, OnSpellPrepare, OnSpellCancel) (#21149)
This commit is contained in:
@@ -3717,6 +3717,8 @@ SpellCastResult Spell::prepare(SpellCastTargets const* targets, AuraEffect const
|
||||
TriggerGlobalCooldown();
|
||||
}
|
||||
|
||||
sScriptMgr->OnSpellPrepare(this, m_caster, m_spellInfo);
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
@@ -3788,6 +3790,8 @@ void Spell::cancel(bool bySelf)
|
||||
//set state back so finish will be processed
|
||||
m_spellState = oldState;
|
||||
|
||||
sScriptMgr->OnSpellCastCancel(this, m_caster, m_spellInfo, bySelf);
|
||||
|
||||
finish(false);
|
||||
}
|
||||
|
||||
@@ -4114,6 +4118,8 @@ void Spell::_cast(bool skipCheck)
|
||||
if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_COOLDOWN))
|
||||
m_caster->ToPlayer()->RemoveSpellCooldown(m_spellInfo->Id, true);
|
||||
|
||||
sScriptMgr->OnSpellCast(this, m_caster, m_spellInfo, skipCheck);
|
||||
|
||||
SetExecutedCurrently(false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user