Core/AI: OnSpellCast, OnSpellFailed, OnSpellStart hooks

Port From (https://github.com/TrinityCore/TrinityCore/commit/050f55b62fded4cc73b76e42d56d98ea950cc26a)
This commit is contained in:
hondacrx
2022-05-30 15:44:21 -04:00
parent 5575703997
commit 306b0cb227
8 changed files with 80 additions and 14 deletions
@@ -3226,6 +3226,20 @@ namespace Game.AI
}
break;
}
case SmartEvents.OnSpellCast:
case SmartEvents.OnSpellFailed:
case SmartEvents.OnSpellStart:
{
if (spell == null)
return;
if (spell.Id != e.Event.spellCast.spell)
return;
RecalcTimer(e, e.Event.spellCast.cooldownMin, e.Event.spellCast.cooldownMax);
ProcessAction(e, null, 0, 0, bvar, spell);
break;
}
case SmartEvents.OocLos:
{
if (_me == null || _me.IsEngaged())