mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-18 12:28:26 +00:00
[Dialogue Window / Saylinks] Missing Changes (#1574)
* Implement auto saylink injection * Cover Lua say since it takes a different code path * [Dialogue] Dialogue Window Middleware (#1526) * Dialogue window quest dialogue work * Add rest of DialogueWindow hooks * Remove spacing
This commit is contained in:
+20
-2
@@ -43,6 +43,7 @@
|
||||
#include "water_map.h"
|
||||
#include "npc_scale_manager.h"
|
||||
#include "../common/say_link.h"
|
||||
#include "dialogue_window.h"
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#define snprintf _snprintf
|
||||
@@ -4202,8 +4203,25 @@ void EntityList::QuestJournalledSayClose(
|
||||
buf.WriteInt32(0);
|
||||
buf.WriteInt32(0);
|
||||
|
||||
// auto inject saylinks (say)
|
||||
if (RuleB(Chat, AutoInjectSaylinksToSay)) {
|
||||
if (RuleB(Chat, QuestDialogueUsesDialogueWindow)) {
|
||||
for (auto &e : GetCloseMobList(sender, (dist * dist))) {
|
||||
Mob *mob = e.second;
|
||||
|
||||
if (!mob->IsClient()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Client *client = mob->CastToClient();
|
||||
|
||||
if (client->GetTarget() && client->GetTarget()->IsMob() && client->GetTarget()->CastToMob() == sender) {
|
||||
std::string window_markdown = message;
|
||||
DialogueWindow::Render(client, window_markdown);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
else if (RuleB(Chat, AutoInjectSaylinksToSay)) {
|
||||
std::string new_message = EQ::SayLinkEngine::InjectSaylinksIfNotExist(message);
|
||||
buf.WriteString(new_message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user