From 5e65e712c6331fabe1f2121be7eb45327bf365ca Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 24 May 2022 10:05:48 -0400 Subject: [PATCH] Core/SAI: Add orientation and delay columns to waypoints table Port From (https://github.com/TrinityCore/TrinityCore/commit/a65b3493a7823ba543070c514d54f3c07c417bc1) --- Source/Framework/Database/Databases/WorldDatabase.cs | 2 +- Source/Game/AI/SmartScripts/SmartAIManager.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Framework/Database/Databases/WorldDatabase.cs b/Source/Framework/Database/Databases/WorldDatabase.cs index 6490a889b..e36b83127 100644 --- a/Source/Framework/Database/Databases/WorldDatabase.cs +++ b/Source/Framework/Database/Databases/WorldDatabase.cs @@ -26,7 +26,7 @@ namespace Framework.Database PrepareStatement(WorldStatements.REP_LINKED_RESPAWN, "REPLACE INTO linked_respawn (guid, linkedGuid, linkType) VALUES (?, ?, ?)"); PrepareStatement(WorldStatements.SEL_CREATURE_TEXT, "SELECT CreatureID, GroupID, ID, Text, Type, Language, Probability, Emote, Duration, Sound, SoundPlayType, BroadcastTextId, TextRange FROM creature_text"); PrepareStatement(WorldStatements.SEL_SMART_SCRIPTS, "SELECT entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, event_param5, event_param_string, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_param4, target_x, target_y, target_z, target_o FROM smart_scripts ORDER BY entryorguid, source_type, id, link"); - PrepareStatement(WorldStatements.SEL_SMARTAI_WP, "SELECT entry, pointid, position_x, position_y, position_z FROM waypoints ORDER BY entry, pointid"); + PrepareStatement(WorldStatements.SEL_SMARTAI_WP, "SELECT entry, pointid, position_x, position_y, position_z, orientation, delay FROM waypoints ORDER BY entry, pointid"); PrepareStatement(WorldStatements.DEL_GAMEOBJECT, "DELETE FROM gameobject WHERE guid = ?"); PrepareStatement(WorldStatements.DEL_EVENT_GAMEOBJECT, "DELETE FROM game_event_gameobject WHERE guid = ?"); PrepareStatement(WorldStatements.INS_GRAVEYARD_ZONE, "INSERT INTO graveyard_zone (ID, GhostZone, faction) VALUES (?, ?, ?)"); diff --git a/Source/Game/AI/SmartScripts/SmartAIManager.cs b/Source/Game/AI/SmartScripts/SmartAIManager.cs index 7c4f71374..4d6ea9714 100644 --- a/Source/Game/AI/SmartScripts/SmartAIManager.cs +++ b/Source/Game/AI/SmartScripts/SmartAIManager.cs @@ -348,6 +348,8 @@ namespace Game.AI float x = result.Read(2); float y = result.Read(3); float z = result.Read(4); + float o = result.Read(5); + uint delay = result.Read(6); if (lastEntry != entry) { @@ -365,7 +367,7 @@ namespace Game.AI WaypointPath path = _waypointStore[entry]; path.id = entry; - path.nodes.Add(new WaypointNode(id, x, y, z)); + path.nodes.Add(new WaypointNode(id, x, y, z, o, delay)); lastEntry = entry; ++total;