From 96e750cdfb8bab0d0ea1f12d690b698f458ce783 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 4 Jan 2022 17:43:31 -0500 Subject: [PATCH] Scripts/Commands: Cleanup some output from .go instance Port From (https://github.com/TrinityCore/TrinityCore/commit/c7e7c52c1a4ae79e049354d6ab406dfaad80d309) --- Source/Framework/Constants/Language.cs | 4 +-- Source/Game/Chat/Commands/GoCommands.cs | 35 +++++++++++-------- ...021_12_18_21_world_2019_08_06_04_world.sql | 4 +++ 3 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 sql/updates/world/master/2021_12_18_21_world_2019_08_06_04_world.sql diff --git a/Source/Framework/Constants/Language.cs b/Source/Framework/Constants/Language.cs index 90f8a9bdf..3cb0566b7 100644 --- a/Source/Framework/Constants/Language.cs +++ b/Source/Framework/Constants/Language.cs @@ -945,8 +945,8 @@ namespace Framework.Constants CommandInstanceNoExit = 1194, CommandWentToInstanceGate = 1195, CommandWentToInstanceStart = 1196, - CommandGoInstanceFailed = 1197, - CommandGoInstanceStartFailed = 1198, // 3.3.5 RESERVED + CommandGoInstanceGateFailed = 1197, + CommandGoInstanceStartFailed = 1198, // Room for more level 3 1199 not used // Debug Commands diff --git a/Source/Game/Chat/Commands/GoCommands.cs b/Source/Game/Chat/Commands/GoCommands.cs index bdf5dad3a..6dce164e4 100644 --- a/Source/Game/Chat/Commands/GoCommands.cs +++ b/Source/Game/Chat/Commands/GoCommands.cs @@ -172,27 +172,34 @@ namespace Game.Chat.Commands // try going to entrance AreaTriggerStruct exit = Global.ObjectMgr.GetGoBackTrigger(mapId); - if (exit == null) - handler.SendSysMessage(CypherStrings.CommandInstanceNoExit, mapId, scriptname); - - if (exit != null && player.TeleportTo(exit.target_mapId, exit.target_X, exit.target_Y, exit.target_Z, exit.target_Orientation + MathF.PI)) + if (exit != null) { - handler.SendSysMessage(CypherStrings.CommandWentToInstanceGate, mapId, scriptname); - return true; + if (player.TeleportTo(exit.target_mapId, exit.target_X, exit.target_Y, exit.target_Z, exit.target_Orientation + MathF.PI)) + { + handler.SendSysMessage(CypherStrings.CommandWentToInstanceGate, mapId, scriptname); + return true; + } + else + handler.SendSysMessage(CypherStrings.CommandGoInstanceGateFailed, mapId, scriptname, exit.target_mapId); } + else + handler.SendSysMessage(CypherStrings.CommandInstanceNoExit, mapId, scriptname); // try going to start AreaTriggerStruct entrance = Global.ObjectMgr.GetMapEntranceTrigger(mapId); - if (entrance == null) + if (entrance != null) + { + if (player.TeleportTo(entrance.target_mapId, entrance.target_X, entrance.target_Y, entrance.target_Z, entrance.target_Orientation)) + { + handler.SendSysMessage(CypherStrings.CommandWentToInstanceStart, mapId, scriptname); + return true; + } + else + handler.SendSysMessage(CypherStrings.CommandGoInstanceStartFailed, mapId, scriptname); + } + else handler.SendSysMessage(CypherStrings.CommandInstanceNoEntrance, mapId, scriptname); - if (entrance != null && player.TeleportTo(entrance.target_mapId, entrance.target_X, entrance.target_Y, entrance.target_Z, entrance.target_Orientation)) - { - handler.SendSysMessage(CypherStrings.CommandWentToInstanceStart, mapId, scriptname); - return true; - } - - handler.SendSysMessage(CypherStrings.CommandGoInstanceFailed, mapId, scriptname, exit != null ? exit.target_mapId : -1); return false; } diff --git a/sql/updates/world/master/2021_12_18_21_world_2019_08_06_04_world.sql b/sql/updates/world/master/2021_12_18_21_world_2019_08_06_04_world.sql new file mode 100644 index 000000000..650d1272b --- /dev/null +++ b/sql/updates/world/master/2021_12_18_21_world_2019_08_06_04_world.sql @@ -0,0 +1,4 @@ +-- +UPDATE `trinity_string` SET `content_default`='Failed to teleport you to the entrance to mapid %u (%s) - are you maybe not attuned to/missing an expansion for parent map %u?' WHERE `entry`=1197; +DELETE FROM `trinity_string` WHERE `entry`=1198; +INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES (1198, 'Failed to teleport you to the start of mapid %u (%s) - are you maybe not attuned to/missing an expansion for the instance?');