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
+15
View File
@@ -670,6 +670,21 @@ namespace Game.AI
{
GetScript().ProcessEventsFor(SmartEvents.SpellHitTarget, target.ToUnit(), 0, 0, false, spellInfo, target.ToGameObject());
}
public override void OnSpellCast(SpellInfo spellInfo)
{
GetScript().ProcessEventsFor(SmartEvents.OnSpellCast, null, 0, 0, false, spellInfo);
}
public override void OnSpellFailed(SpellInfo spellInfo)
{
GetScript().ProcessEventsFor(SmartEvents.OnSpellFailed, null, 0, 0, false, spellInfo);
}
public override void OnSpellStart(SpellInfo spellInfo)
{
GetScript().ProcessEventsFor(SmartEvents.OnSpellStart, null, 0, 0, false, spellInfo);
}
public override void DamageTaken(Unit attacker, ref uint damage, DamageEffectType damageType, SpellInfo spellInfo = null)
{