fix(Core/Commands): Add detailed quest availability info to .quest info (#24721)

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
Andrew
2026-02-15 11:35:02 -03:00
committed by GitHub
parent ce3ebadbec
commit f8cfcf9c55
3 changed files with 128 additions and 3 deletions

View File

@@ -0,0 +1,25 @@
--
DELETE FROM `acore_string` WHERE `entry` IN (5089, 5090, 5091, 5092, 5093, 5094, 5095, 5096, 5097, 5098, 5099, 5100, 5101, 5102, 5103, 5104, 5105, 5106, 5107, 5108, 5109, 5110);
INSERT INTO `acore_string` (`entry`, `content_default`) VALUES
(5089, 'Quest {} cannot be taken. Reasons:'),
(5090, ' - Quest is disabled.'),
(5091, ' - Quest has already been taken or completed.'),
(5092, ' - Class requirement not met.'),
(5093, ' - Race requirement not met.'),
(5094, ' - Player level too low (required: {}).'),
(5095, ' - Player level too high (max: {}).'),
(5096, ' - Skill requirement not met.'),
(5097, ' - Reputation requirement not met.'),
(5098, ' - Previous quest in chain not completed.'),
(5099, ' - Already on a timed quest.'),
(5100, ' - Exclusive group quest conflict.'),
(5101, ' - Next quest in chain already started.'),
(5102, ' - Previous chain quest still active.'),
(5103, ' - Breadcrumb quest conflict.'),
(5104, ' - Daily quest not available today.'),
(5105, ' - Weekly quest already completed this week.'),
(5106, ' - Monthly quest already completed this month.'),
(5107, ' - Seasonal quest already completed this season.'),
(5108, ' - Condition requirements not met:'),
(5109, ' - Quest log is full.'),
(5110, ' - Condition not met: type {} value1: {} value2: {} value3: {}');

View File

@@ -1161,8 +1161,29 @@ enum AcoreStrings
LANG_CMD_QUEST_STATUS = 5088,
LANG_CMD_QUEST_UNAVAILABLE = 5089,
LANG_CMD_QUEST_STATUS_DISABLED = 5090,
LANG_CMD_QUEST_STATUS_ALREADY_DONE = 5091,
LANG_CMD_QUEST_STATUS_CLASS = 5092,
LANG_CMD_QUEST_STATUS_RACE = 5093,
LANG_CMD_QUEST_STATUS_LOW_LEVEL = 5094,
LANG_CMD_QUEST_STATUS_HIGH_LEVEL = 5095,
LANG_CMD_QUEST_STATUS_SKILL = 5096,
LANG_CMD_QUEST_STATUS_REPUTATION = 5097,
LANG_CMD_QUEST_STATUS_PREV_QUEST = 5098,
LANG_CMD_QUEST_STATUS_TIMED = 5099,
LANG_CMD_QUEST_STATUS_EXCLUSIVE = 5100,
LANG_CMD_QUEST_STATUS_NEXT_CHAIN = 5101,
LANG_CMD_QUEST_STATUS_PREV_CHAIN = 5102,
LANG_CMD_QUEST_STATUS_BREADCRUMB = 5103,
LANG_CMD_QUEST_STATUS_DAY = 5104,
LANG_CMD_QUEST_STATUS_WEEK = 5105,
LANG_CMD_QUEST_STATUS_MONTH = 5106,
LANG_CMD_QUEST_STATUS_SEASONAL = 5107,
LANG_CMD_QUEST_STATUS_CONDITION = 5108,
LANG_CMD_QUEST_STATUS_LOG_FULL = 5109,
LANG_CMD_QUEST_STATUS_COND_DETAIL = 5110,
// Room for more strings 5090-9999
// Room for more strings 5111-9999
// Level requirement notifications
LANG_SAY_REQ = 6604,

View File

@@ -17,6 +17,8 @@
#include "Chat.h"
#include "CommandScript.h"
#include "ConditionMgr.h"
#include "DisableMgr.h"
#include "GameTime.h"
#include "ObjectMgr.h"
#include "Player.h"
@@ -766,8 +768,85 @@ public:
handler->PSendSysMessage(LANG_CMD_QUEST_STATUS, quest->GetTitle(), entry, status);
if (!player->CanTakeQuest(quest, true))
handler->PSendSysMessage(LANG_CMD_QUEST_UNAVAILABLE, entry, status);
if (!player->CanTakeQuest(quest, false))
{
handler->PSendSysMessage(LANG_CMD_QUEST_UNAVAILABLE, entry);
if (sDisableMgr->IsDisabledFor(DISABLE_TYPE_QUEST, entry, player))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_DISABLED);
if (!player->SatisfyQuestStatus(quest, false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_ALREADY_DONE);
if (!player->SatisfyQuestClass(quest, false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_CLASS);
if (!player->SatisfyQuestRace(quest, false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_RACE);
if (player->GetLevel() < quest->GetMinLevel())
handler->PSendSysMessage(LANG_CMD_QUEST_STATUS_LOW_LEVEL, quest->GetMinLevel());
if (quest->GetMaxLevel() > 0 && player->GetLevel() > quest->GetMaxLevel())
handler->PSendSysMessage(LANG_CMD_QUEST_STATUS_HIGH_LEVEL, quest->GetMaxLevel());
if (!player->SatisfyQuestSkill(quest, false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_SKILL);
if (!player->SatisfyQuestReputation(quest, false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_REPUTATION);
if (!player->SatisfyQuestPreviousQuest(quest, false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_PREV_QUEST);
if (!player->SatisfyQuestTimed(quest, false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_TIMED);
if (!player->SatisfyQuestExclusiveGroup(quest, false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_EXCLUSIVE);
if (!player->SatisfyQuestNextChain(quest, false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_NEXT_CHAIN);
if (!player->SatisfyQuestPrevChain(quest, false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_PREV_CHAIN);
if (!player->SatisfyQuestBreadcrumb(quest, false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_BREADCRUMB);
if (!player->SatisfyQuestDay(quest, false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_DAY);
if (!player->SatisfyQuestWeek(quest, false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_WEEK);
if (!player->SatisfyQuestMonth(quest, false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_MONTH);
if (!player->SatisfyQuestSeasonal(quest, false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_SEASONAL);
if (!player->SatisfyQuestConditions(quest, false))
{
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_CONDITION);
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_QUEST_AVAILABLE, entry);
ConditionSourceInfo srcInfo = ConditionSourceInfo(player);
for (Condition* cond : conditions)
{
if (!cond->Meets(srcInfo))
handler->PSendSysMessage(LANG_CMD_QUEST_STATUS_COND_DETAIL, uint32(cond->ConditionType), cond->ConditionValue1, cond->ConditionValue2, cond->ConditionValue3);
}
}
if (!player->SatisfyQuestLog(false))
handler->SendSysMessage(LANG_CMD_QUEST_STATUS_LOG_FULL);
}
}
else
{
handler->SendErrorMessage(LANG_PLAYER_NOT_FOUND);
return false;
}
return true;