From 31d0adbaccc0331a4ff89d9fa486e1e0d66613b6 Mon Sep 17 00:00:00 2001 From: regneq Date: Thu, 18 Jul 2019 18:20:22 -0700 Subject: [PATCH] added language paramter to Lua_Mob::Say() and Lua_Mob::Shout() (credit to Torven) --- zone/lua_mob.cpp | 16 ++++++++++++++-- zone/lua_mob.h | 2 ++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/zone/lua_mob.cpp b/zone/lua_mob.cpp index e801f07dc..906684dfe 100644 --- a/zone/lua_mob.cpp +++ b/zone/lua_mob.cpp @@ -753,6 +753,11 @@ void Lua_Mob::Say(const char *message) { self->Say(message); } +void Lua_Mob::Say(const char* message, int language) { + Lua_Safe_Call_Void(); + entity_list.ChannelMessage(self, ChatChannel_Say, language, message); // these run through the client channels and probably shouldn't for NPCs, but oh well +} + void Lua_Mob::QuestSay(Lua_Client client, const char *message) { Lua_Safe_Call_Void(); self->QuestJournalledSay(client, message); @@ -763,6 +768,11 @@ void Lua_Mob::Shout(const char *message) { self->Shout(message); } +void Lua_Mob::Shout(const char* message, int language) { + Lua_Safe_Call_Void(); + entity_list.ChannelMessage(self, ChatChannel_Shout, language, message); +} + void Lua_Mob::Emote(const char *message) { Lua_Safe_Call_Void(); self->Emote(message); @@ -2319,9 +2329,11 @@ luabind::scope lua_register_mob() { .def("GetSize", &Lua_Mob::GetSize) .def("Message", &Lua_Mob::Message) .def("Message_StringID", &Lua_Mob::Message_StringID) - .def("Say", &Lua_Mob::Say) + .def("Say", (void(Lua_Mob::*)(const char*))& Lua_Mob::Say) + .def("Say", (void(Lua_Mob::*)(const char*, int))& Lua_Mob::Say) .def("QuestSay", &Lua_Mob::QuestSay) - .def("Shout", &Lua_Mob::Shout) + .def("Shout", (void(Lua_Mob::*)(const char*))& Lua_Mob::Shout) + .def("Shout", (void(Lua_Mob::*)(const char*, int))& Lua_Mob::Shout) .def("Emote", &Lua_Mob::Emote) .def("InterruptSpell", (void(Lua_Mob::*)(void))&Lua_Mob::InterruptSpell) .def("InterruptSpell", (void(Lua_Mob::*)(int))&Lua_Mob::InterruptSpell) diff --git a/zone/lua_mob.h b/zone/lua_mob.h index e7dcc1ee3..be8eb388f 100644 --- a/zone/lua_mob.h +++ b/zone/lua_mob.h @@ -168,8 +168,10 @@ public: void Message(int type, const char *message); void Message_StringID(int type, int string_id, uint32 distance); void Say(const char *message); + void Say(const char* message, int language); void QuestSay(Lua_Client client, const char *message); void Shout(const char *message); + void Shout(const char* message, int language); void Emote(const char *message); void InterruptSpell(); void InterruptSpell(int spell_id);