Core/SAI: implement SMART_EVENT_SUMMONED_UNIT_DIES (82), useable by creatures and gameobjects

Port From (https://github.com/TrinityCore/TrinityCore/commit/d4a1a7a040be0ca0d6428669135bcc64d92be1c2)
This commit is contained in:
hondacrx
2022-02-27 13:57:18 -05:00
parent c4fa1a27ea
commit 1b28a8260c
4 changed files with 16 additions and 11 deletions
@@ -383,6 +383,7 @@ namespace Game.AI
case SmartEvents.Death:
case SmartEvents.Kill:
case SmartEvents.SummonedUnit:
case SmartEvents.SummonedUnitDies:
case SmartEvents.SpellHit:
case SmartEvents.SpellHitTarget:
case SmartEvents.Damaged:
@@ -679,6 +680,7 @@ namespace Game.AI
break;
case SmartEvents.SummonDespawned:
case SmartEvents.SummonedUnit:
case SmartEvents.SummonedUnitDies:
if (e.Event.summoned.creature != 0 && !IsCreatureValid(e, e.Event.summoned.creature))
return false;
@@ -932,7 +934,6 @@ namespace Game.AI
case SmartEvents.SceneCancel:
case SmartEvents.SceneComplete:
case SmartEvents.SceneTrigger:
case SmartEvents.SpellEffectHit:
break;
default:
Log.outError(LogFilter.ScriptsAi, "SmartAIMgr: Not handled event_type({0}), Entry {1} SourceType {2} Event {3} Action {4}, skipped.", e.GetEventType(), e.EntryOrGuid, e.GetScriptType(), e.EventId, e.GetActionType());
@@ -1892,8 +1893,7 @@ namespace Game.AI
SmartEvents.SceneTrigger => SmartScriptTypeMaskId.Scene,
SmartEvents.SceneCancel => SmartScriptTypeMaskId.Scene,
SmartEvents.SceneComplete => SmartScriptTypeMaskId.Scene,
SmartEvents.SpellEffectHit => SmartScriptTypeMaskId.Spell,
SmartEvents.SpellEffectHitTarget => SmartScriptTypeMaskId.Spell,
SmartEvents.SummonedUnitDies => SmartScriptTypeMaskId.Creature + SmartScriptTypeMaskId.Gameobject,
_ => 0,
};
}