Core/AI: OnSpellCast, OnSpellFailed, OnSpellStart hooks (#27704)

(cherry picked from commit 3dca705acc)
This commit is contained in:
offl
2022-02-18 19:14:44 +02:00
committed by Shauren
parent bb18bd47e5
commit 050f55b62f
15 changed files with 97 additions and 34 deletions
@@ -3164,6 +3164,20 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
}
break;
}
case SMART_EVENT_ON_SPELL_CAST:
case SMART_EVENT_ON_SPELL_FAILED:
case SMART_EVENT_ON_SPELL_START:
{
if (!spell)
return;
if (spell->Id != e.event.spellCast.spell)
return;
RecalcTimer(e, e.event.spellCast.cooldownMin, e.event.spellCast.cooldownMax);
ProcessAction(e, nullptr, 0, 0, bvar, spell);
break;
}
case SMART_EVENT_OOC_LOS:
{
if (!me || me->IsEngaged())