mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 07:48:02 +00:00
fix (Core/Quest) Correct link quest and fix command lookup quest for multilanguage dbc (#3271)
Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com> Co-authored-by: Stefano Borzì <stefanoborzi32@gmail.com>
This commit is contained in:
@@ -259,6 +259,14 @@ bool QuestChatLink::ValidateName(char* buffer, const char* context)
|
|||||||
ChatLink::ValidateName(buffer, context);
|
ChatLink::ValidateName(buffer, context);
|
||||||
|
|
||||||
bool res = (_quest->GetTitle() == buffer);
|
bool res = (_quest->GetTitle() == buffer);
|
||||||
|
if (!res)
|
||||||
|
if (QuestLocale const* ql = sObjectMgr->GetQuestLocale(_quest->GetQuestId()))
|
||||||
|
for (uint8 i = 0; i < ql->Title.size(); i++)
|
||||||
|
if (ql->Title[i] == buffer)
|
||||||
|
{
|
||||||
|
res = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||||
if (!res)
|
if (!res)
|
||||||
|
|||||||
@@ -634,6 +634,59 @@ public:
|
|||||||
{
|
{
|
||||||
Quest* qInfo = iter->second;
|
Quest* qInfo = iter->second;
|
||||||
|
|
||||||
|
int localeIndex = handler->GetSessionDbLocaleIndex();
|
||||||
|
if (localeIndex >= 0)
|
||||||
|
{
|
||||||
|
uint8 ulocaleIndex = uint8(localeIndex);
|
||||||
|
if (QuestLocale const* questLocale = sObjectMgr->GetQuestLocale(qInfo->GetQuestId()))
|
||||||
|
{
|
||||||
|
if (questLocale->Title.size() > ulocaleIndex && !questLocale->Title[ulocaleIndex].empty())
|
||||||
|
{
|
||||||
|
std::string title = questLocale->Title[ulocaleIndex];
|
||||||
|
|
||||||
|
if (Utf8FitTo(title, wNamePart))
|
||||||
|
{
|
||||||
|
if (maxResults && count++ == maxResults)
|
||||||
|
{
|
||||||
|
handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
char const* statusStr = "";
|
||||||
|
|
||||||
|
if (target)
|
||||||
|
{
|
||||||
|
QuestStatus status = target->GetQuestStatus(qInfo->GetQuestId());
|
||||||
|
|
||||||
|
switch (status)
|
||||||
|
{
|
||||||
|
case QUEST_STATUS_COMPLETE:
|
||||||
|
statusStr = handler->GetAcoreString(LANG_COMMAND_QUEST_COMPLETE);
|
||||||
|
break;
|
||||||
|
case QUEST_STATUS_INCOMPLETE:
|
||||||
|
statusStr = handler->GetAcoreString(LANG_COMMAND_QUEST_ACTIVE);
|
||||||
|
break;
|
||||||
|
case QUEST_STATUS_REWARDED:
|
||||||
|
statusStr = handler->GetAcoreString(LANG_COMMAND_QUEST_REWARDED);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (handler->GetSession())
|
||||||
|
handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), qInfo->GetQuestLevel(), title.c_str(), statusStr);
|
||||||
|
else
|
||||||
|
handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qInfo->GetQuestId(), title.c_str(), statusStr);
|
||||||
|
|
||||||
|
if (!found)
|
||||||
|
found = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::string title = qInfo->GetTitle();
|
std::string title = qInfo->GetTitle();
|
||||||
if (title.empty())
|
if (title.empty())
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user