Core/SAI: allow creatures to handle gameobject spellhit SAI events.

Port From (https://github.com/TrinityCore/TrinityCore/commit/83a9222c390110ae082512ed858a5580a958aa21)
This commit is contained in:
hondacrx
2021-12-24 21:05:03 -05:00
parent b3759bb7b0
commit 0f248e2faa
2 changed files with 168 additions and 158 deletions
+10
View File
@@ -662,11 +662,21 @@ namespace Game.AI
GetScript().ProcessEventsFor(SmartEvents.SpellHit, caster, 0, 0, false, spellInfo);
}
public override void SpellHitByGameObject(GameObject obj, SpellInfo spellInfo)
{
GetScript().ProcessEventsFor(SmartEvents.SpellHit, null, 0, 0, false, spellInfo, obj);
}
public override void SpellHitTarget(Unit target, SpellInfo spellInfo)
{
GetScript().ProcessEventsFor(SmartEvents.SpellHitTarget, target, 0, 0, false, spellInfo);
}
public override void SpellHitTargetGameObject(GameObject target, SpellInfo spellInfo)
{
GetScript().ProcessEventsFor(SmartEvents.SpellHitTarget, null, 0, 0, false, spellInfo, target);
}
public override void DamageTaken(Unit attacker, ref uint damage)
{
GetScript().ProcessEventsFor(SmartEvents.Damaged, attacker, damage);