From de2e2b6e8b7a366c0e72464e244b2cc4d66abff6 Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sat, 12 Aug 2023 00:03:03 +0200 Subject: [PATCH] fix(Scripts/Command): Improve output of event commands (#16980) --- .../updates/pending_db_world/rev_1691767736730972500.sql | 8 ++++++++ src/server/game/Miscellaneous/Language.h | 5 ++++- src/server/scripts/Commands/cs_event.cpp | 6 ++++-- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1691767736730972500.sql diff --git a/data/sql/updates/pending_db_world/rev_1691767736730972500.sql b/data/sql/updates/pending_db_world/rev_1691767736730972500.sql new file mode 100644 index 000000000..4d83bc095 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1691767736730972500.sql @@ -0,0 +1,8 @@ +-- +DELETE FROM `acore_string` WHERE `entry` IN (600,601); +INSERT INTO `acore_string` (`entry`, `content_default`) VALUES +(600,'Event %u (%s) is started'), +(601,'Event %u (%s) is stopped'); + +UPDATE `acore_string` SET `content_default` = 'Event %u (%s) is already active!', `locale_deDE` = 'Event %u (%s) bereits aktiv!', `locale_zhCN` = '事件 %u (%s) 已经激活了。' WHERE `entry` = 587; +UPDATE `acore_string` SET `content_default` = 'Event %u (%s) is not active!', `locale_deDE` = 'Event %u (%s) nicht aktiv!', `locale_zhCN` = '事件 %u (%s) 没有被激活。' WHERE `entry` = 588; diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 0ac55cbf4..824810fda 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -645,7 +645,10 @@ enum AcoreStrings // End Level 3 list, continued at 1100 - // 600-704 - free + LANG_EVENT_STARTED = 600, + LANG_EVENT_STOPPED = 601, + + // 602-704 - free LANG_WAIT_BEFORE_SPEAKING = 705, LANG_NOT_EQUIPPED_ITEM = 706, diff --git a/src/server/scripts/Commands/cs_event.cpp b/src/server/scripts/Commands/cs_event.cpp index f1c1da6b7..cf7ef2123 100644 --- a/src/server/scripts/Commands/cs_event.cpp +++ b/src/server/scripts/Commands/cs_event.cpp @@ -152,11 +152,12 @@ public: GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList(); if (activeEvents.find(eventId) != activeEvents.end()) { - handler->PSendSysMessage(LANG_EVENT_ALREADY_ACTIVE, uint16(eventId)); + handler->PSendSysMessage(LANG_EVENT_ALREADY_ACTIVE, uint16(eventId), eventData.description.c_str()); handler->SetSentErrorMessage(true); return false; } + handler->PSendSysMessage(LANG_EVENT_STARTED, uint16(eventId), eventData.description.c_str()); sGameEventMgr->StartEvent(eventId, true); return true; } @@ -184,11 +185,12 @@ public: if (activeEvents.find(eventId) == activeEvents.end()) { - handler->PSendSysMessage(LANG_EVENT_NOT_ACTIVE, uint16(eventId)); + handler->PSendSysMessage(LANG_EVENT_NOT_ACTIVE, uint16(eventId), eventData.description.c_str()); handler->SetSentErrorMessage(true); return false; } + handler->PSendSysMessage(LANG_EVENT_STOPPED, uint16(eventId), eventData.description.c_str()); sGameEventMgr->StopEvent(eventId, true); return true; }