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

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