Core/Chat: Updated quest chat link format

This commit is contained in:
Shauren
2018-11-12 23:27:28 +01:00
parent d087f113ca
commit 5bfb1cc960
6 changed files with 39 additions and 11 deletions

View File

@@ -0,0 +1 @@
UPDATE `trinity_string` SET `content_default`='%u - |cffffffff|Hquest:%u:%d:%d:%d:%d|h[%s]|h|r %s' WHERE `entry`=513;

View File

@@ -455,7 +455,7 @@ bool ChatHandler::isValidChatMessage(char const* message)
/*
Valid examples:
|cffa335ee|Hitem:812:0:0:0:0:0:0:0:70|h[Glowing Brightwood Staff]|h|r
|cff808080|Hquest:2278:47|h[The Platinum Discs]|h|r
|cffffff00|Hquest:51101:-1:110:120:5|h[The Wounded King]|h|r
|cffffd000|Htrade:4037:1:150:1:6AAAAAAAAAAAAAAAAAAAAAAOAADAAAAAAAAAAAAAAAAIAAAAAAAAA|h[Engineering]|h|r
|cff4e96f7|Htalent:2232:-1|h[Taste for Blood]|h|r
|cff71d5ff|Hspell:21563|h[Command]|h|r

View File

@@ -40,7 +40,8 @@
// - client, item icon shift click
// |color|Hitemset:itemset_id|h[name]|h|r
// |color|Hplayer:name|h[name]|h|r - client, in some messages, at click copy only name instead link
// |color|Hquest:quest_id:quest_level|h[name]|h|r - client, quest list name shift-click
// |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r
// - client, quest list name shift-click
// |color|Hskill:skill_id|h[name]|h|r
// |color|Hspell:spell_id|h[name]|h|r - client, spellbook spell icon shift-click
// |color|Htalent:talent_id, rank|h[name]|h|r - client, talent icon shift-click
@@ -395,8 +396,8 @@ bool ItemChatLink::ValidateName(char* buffer, char const* context)
return false;
}
// |color|Hquest:quest_id:quest_level|h[name]|h|r
// |cff808080|Hquest:2278:47|h[The Platinum Discs]|h|r
// |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r
// |cffffff00|Hquest:51101:-1:110:120:5|h[The Wounded King]|h|r
bool QuestChatLink::Initialize(std::istringstream& iss)
{
// Read quest id
@@ -428,6 +429,21 @@ bool QuestChatLink::Initialize(std::istringstream& iss)
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): quest level %d is too big", iss.str().c_str(), _questLevel);
return false;
}
if (!ReadInt32(iss, _minLevel))
{
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading quest min level", iss.str().c_str());
return false;
}
if (!ReadInt32(iss, _maxLevel))
{
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading quest max level", iss.str().c_str());
return false;
}
if (!ReadInt32(iss, _scalingFaction))
{
TC_LOG_TRACE("chat.system", "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading quest scaling faction", iss.str().c_str());
return false;
}
return true;
}

View File

@@ -90,13 +90,16 @@ protected:
class TC_GAME_API QuestChatLink : public ChatLink
{
public:
QuestChatLink() : ChatLink(), _quest(nullptr), _questLevel(0) { }
QuestChatLink() : ChatLink(), _quest(nullptr), _questLevel(0), _minLevel(0), _maxLevel(0), _scalingFaction(0) { }
virtual bool Initialize(std::istringstream& iss) override;
virtual bool ValidateName(char* buffer, const char* context) override;
protected:
Quest const* _quest;
int32 _questLevel;
int32 _minLevel;
int32 _maxLevel;
int32 _scalingFaction;
};
// SpellChatLink - link to quest

View File

@@ -658,7 +658,11 @@ public:
}
if (handler->GetSession())
handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), qInfo->GetQuestLevel(), title.c_str(), statusStr);
handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(),
handler->GetSession()->GetPlayer()->GetQuestLevel(qInfo),
handler->GetSession()->GetPlayer()->GetQuestMinLevel(qInfo),
qInfo->GetQuestMaxScalingLevel(), qInfo->GetQuestScalingFactionGroup(),
title.c_str(), statusStr);
else
handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qInfo->GetQuestId(), title.c_str(), statusStr);
@@ -706,7 +710,11 @@ public:
}
if (handler->GetSession())
handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), qInfo->GetQuestLevel(), title.c_str(), statusStr);
handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(),
handler->GetSession()->GetPlayer()->GetQuestLevel(qInfo),
handler->GetSession()->GetPlayer()->GetQuestMinLevel(qInfo),
qInfo->GetQuestMaxScalingLevel(), qInfo->GetQuestScalingFactionGroup(),
title.c_str(), statusStr);
else
handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qInfo->GetQuestId(), title.c_str(), statusStr);

View File

@@ -64,7 +64,7 @@ public:
}
// .addquest #entry'
// number or [name] Shift-click form |color|Hquest:quest_id:quest_level|h[name]|h|r
// number or [name] Shift-click form |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r
char* cId = handler->extractKeyFromLink((char*)args, "Hquest");
if (!cId)
return false;
@@ -112,7 +112,7 @@ public:
}
// .removequest #entry'
// number or [name] Shift-click form |color|Hquest:quest_id:quest_level|h[name]|h|r
// number or [name] Shift-click form |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r
char* cId = handler->extractKeyFromLink((char*)args, "Hquest");
if (!cId)
return false;
@@ -170,7 +170,7 @@ public:
}
// .quest complete #entry
// number or [name] Shift-click form |color|Hquest:quest_id:quest_level|h[name]|h|r
// number or [name] Shift-click form |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r
char* cId = handler->extractKeyFromLink((char*)args, "Hquest");
if (!cId)
return false;
@@ -268,7 +268,7 @@ public:
}
// .quest reward #entry
// number or [name] Shift-click form |color|Hquest:quest_id:quest_level|h[name]|h|r
// number or [name] Shift-click form |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r
char* cId = handler->extractKeyFromLink((char*)args, "Hquest");
if (!cId)
return false;