fix(Scripts/Command): Improve output of event commands (#16980)

This commit is contained in:
Kitzunu
2023-08-12 00:03:03 +02:00
committed by GitHub
parent da8ebbae0b
commit de2e2b6e8b
3 changed files with 16 additions and 3 deletions

View File

@@ -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;

View File

@@ -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,

View File

@@ -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;
}