Add message(color, message) and whisper(message) to Perl/Lua.

- Add quest::message(color, message) to Perl.
- Add eq.message(color, message) to Lua.
- Add quest::whisper(message) to Perl.
- Add eq.whisper(message) to Lua.

These methods allow you to use implied client references. The whisper method also converts a widely used plugin in Perl to a Perl and Lua method that works on both Clients and NPCs.
This commit is contained in:
Kinglykrab
2021-01-23 10:46:36 -05:00
parent 0f5a7e1317
commit 19ae461e36
4 changed files with 55 additions and 0 deletions
+18
View File
@@ -2580,6 +2580,24 @@ void QuestManager::we(int type, const char *str) {
worldserver.SendEmoteMessage(0, 0, type, str);
}
void QuestManager::message(int color, const char *message) {
QuestManagerCurrentQuestVars();
if (!initiator)
return;
initiator->Message(color, message);
}
void QuestManager::whisper(const char *message) {
QuestManagerCurrentQuestVars();
if (!initiator || !owner)
return;
std::string mob_name = owner->GetCleanName();
std::string new_message = fmt::format("{} whispers, '{}'", mob_name, message);
initiator->Message(315, new_message.c_str());
}
int QuestManager::getlevel(uint8 type)
{
QuestManagerCurrentQuestVars();