From c67235e21961365721f885cb6e53c32ffd1a4bb4 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 2 Jan 2022 12:34:53 -0500 Subject: [PATCH] Core/GameEvent: Fix OnGameEvent() hook not being called on Creature/GameObject spawned by the event itself Port From (https://github.com/TrinityCore/TrinityCore/commit/dad86f5bce429e780fd0c4983bec0c52e52e4573) --- Source/Game/Events/GameEventManager.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Game/Events/GameEventManager.cs b/Source/Game/Events/GameEventManager.cs index 3f5d67a15..8bb0b70ab 100644 --- a/Source/Game/Events/GameEventManager.cs +++ b/Source/Game/Events/GameEventManager.cs @@ -1088,9 +1088,6 @@ namespace Game Log.outInfo(LogFilter.Gameevent, "GameEvent {0} \"{1}\" started.", event_id, mGameEvent[event_id].description); - //! Run SAI scripts with SMART_EVENT_GAME_EVENT_END - RunSmartAIScripts(event_id, true); - // spawn positive event tagget objects GameEventSpawn((short)event_id); // un-spawn negative event tagged objects @@ -1107,6 +1104,10 @@ namespace Game UpdateEventNPCVendor(event_id, true); // update bg holiday UpdateBattlegroundSettings(); + + //! Run SAI scripts with SMART_EVENT_GAME_EVENT_START + RunSmartAIScripts(event_id, true); + // If event's worldstate is 0, it means the event hasn't been started yet. In that case, reset seasonal quests. // When event ends (if it expires or if it's stopped via commands) worldstate will be set to 0 again, ready for another seasonal quest reset. if (Global.WorldMgr.GetWorldState(event_id) == 0)