diff --git a/data/sql/updates/pending_db_world/rev_1623112710636791400.sql b/data/sql/updates/pending_db_world/rev_1623112710636791400.sql new file mode 100644 index 000000000..7f430aee6 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1623112710636791400.sql @@ -0,0 +1,7 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1623112710636791400'); + +DELETE FROM `acore_string` WHERE `entry` = 6617; +INSERT INTO `acore_string` VALUES (6617, 'No acore_string for id: %i found.', null, null, 'Es wurde kein acore_string mit der id: %i gefunden.', null, null, null, null, null); + +DELETE FROM `command` WHERE `name` = 'string'; +INSERT INTO `command` VALUES ('string', 2, 'Syntax: .string #id [#locale]'); diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 95bf80166..29e0d8eae 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -1195,6 +1195,9 @@ enum AcoreStrings LANG_GM_SILENCE = 6616, // "Silence is ON for %s" - Spell 1852 + // Used for .string command + LANG_NO_ACORE_STRING_FOUND = 6617, + LANG_WORLD_CLOSED = 7523, LANG_WORLD_OPENED = 7524, diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index fc0f1b1ec..58566d71e 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -113,7 +113,8 @@ public: { "unbindsight", SEC_ADMINISTRATOR, false, HandleUnbindSightCommand, "" }, { "playall", SEC_GAMEMASTER, false, HandlePlayAllCommand, "" }, { "skirmish", SEC_ADMINISTRATOR, false, HandleSkirmishCommand, "" }, - { "mailbox", SEC_MODERATOR, false, &HandleMailBoxCommand, "" } + { "mailbox", SEC_MODERATOR, false, &HandleMailBoxCommand, "" }, + { "string", SEC_GAMEMASTER, false, &HandleStringCommand, "" } }; return commandTable; } @@ -3344,6 +3345,42 @@ public: handler->GetSession()->SendShowMailBox(player->GetGUID()); return true; } + + static bool HandleStringCommand(ChatHandler *handler, char const *args) + { + if (!*args) + { + handler->SendSysMessage(LANG_CMD_SYNTAX); + return false; + } + + uint32 id = atoi(strtok((char*)args, " ")); + if (id == 0) + { + handler->SendSysMessage(LANG_CMD_SYNTAX); + return false; + } + + uint32 locale = 0; + char* localeString = strtok(nullptr, " "); + if (localeString != nullptr) + { + locale = atoi(localeString); + } + + const char* str = sObjectMgr->GetAcoreString(id, static_cast(locale)); + + if (strcmp(str, "") == 0) + { + handler->PSendSysMessage(LANG_NO_ACORE_STRING_FOUND, id); + return true; + } + else + { + handler->SendSysMessage(str); + return true; + } + } }; void AddSC_misc_commandscript()