diff --git a/ElunaUtility.h b/ElunaUtility.h index 726ae6e..ffeaaa0 100644 --- a/ElunaUtility.h +++ b/ElunaUtility.h @@ -9,8 +9,6 @@ #include "Common.h" #include "SharedDefines.h" -#include -#include #ifdef TRINITY #include "QueryResult.h" #ifdef CATA diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index ae2927d..38711b7 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -340,7 +340,7 @@ ElunaRegister UnitMethods[] = { "RemoveAllAuras", &LuaUnit::RemoveAllAuras }, // :RemoveAllAuras() - Removes all the unit's auras { "ClearInCombat", &LuaUnit::ClearInCombat }, // :ClearInCombat() - Clears the unit's combat list (unit will be out of combat), resets the timer to 0, etc { "DeMorph", &LuaUnit::DeMorph }, // :DeMorph() - Sets display back to native - { "SendUnitWhisper", &LuaUnit::SendUnitWhisper }, // :SendUnitWhisper(msg, receiver[, bossWhisper]) - Sends a whisper to the receiver + { "SendUnitWhisper", &LuaUnit::SendUnitWhisper }, // :SendUnitWhisper(msg, lang, receiver[, bossWhisper]) - Sends a whisper to the receiver { "SendUnitEmote", &LuaUnit::SendUnitEmote }, // :SendUnitEmote(msg[, receiver, bossEmote]) - Sends a text emote { "SendUnitSay", &LuaUnit::SendUnitSay }, // :SendUnitSay(msg, language) - Sends a "Say" message with the specified language (all languages: 0) { "SendUnitYell", &LuaUnit::SendUnitYell }, // :SendUnitYell(msg, language) - Sends a "Yell" message with the specified language (all languages: 0) @@ -632,7 +632,7 @@ ElunaRegister PlayerMethods[] = { "Say", &LuaPlayer::Say }, // :Say(text, lang) - The player says the text { "Yell", &LuaPlayer::Yell }, // :Yell(text, lang) - The player yells the text { "TextEmote", &LuaPlayer::TextEmote }, // :TextEmote(text) - The player does a textemote with the text - { "Whisper", &LuaPlayer::Whisper }, // :Whisper(text, lang, receiverGuid) - The player whispers the text to the guid + { "Whisper", &LuaPlayer::Whisper }, // :Whisper(text, lang, receiver) - The player whispers the text to the receiver { "CompleteQuest", &LuaPlayer::CompleteQuest }, // :CompleteQuest(entry) - Completes a quest by entry { "IncompleteQuest", &LuaPlayer::IncompleteQuest }, // :IncompleteQuest(entry) - Uncompletes the quest by entry for the player { "FailQuest", &LuaPlayer::FailQuest }, // :FailQuest(entry) - Player fails the quest entry diff --git a/PlayerMethods.h b/PlayerMethods.h index d4b96ec..b899615 100644 --- a/PlayerMethods.h +++ b/PlayerMethods.h @@ -1744,9 +1744,16 @@ namespace LuaPlayer { std::string text = Eluna::CHECKVAL(L, 2); uint32 lang = Eluna::CHECKVAL(L, 3); +#ifdef TRINITY + Player* receiver = Eluna::CHECKOBJ(L, 4); +#else uint64 guid = Eluna::CHECKVAL(L, 4); - +#endif +#ifdef TRINITY + player->Whisper(text, (Language)lang, receiver); +#else player->Whisper(text, lang, ObjectGuid(guid)); +#endif return 0; } @@ -1762,8 +1769,11 @@ namespace LuaPlayer { std::string text = Eluna::CHECKVAL(L, 2); uint32 lang = Eluna::CHECKVAL(L, 3); - +#ifdef TRINITY + player->Yell(text, (Language)lang); +#else player->Yell(text, lang); +#endif return 0; } @@ -1771,8 +1781,11 @@ namespace LuaPlayer { std::string text = Eluna::CHECKVAL(L, 2); uint32 lang = Eluna::CHECKVAL(L, 3); - +#ifdef TRINITY + player->Say(text, (Language)lang); +#else player->Say(text, lang); +#endif return 0; } diff --git a/UnitMethods.h b/UnitMethods.h index c3811e2..12621bb 100644 --- a/UnitMethods.h +++ b/UnitMethods.h @@ -1307,10 +1307,15 @@ namespace LuaUnit int SendUnitWhisper(lua_State* L, Unit* unit) { const char* msg = Eluna::CHECKVAL(L, 2); - Player* receiver = Eluna::CHECKOBJ(L, 3); - bool bossWhisper = Eluna::CHECKVAL(L, 4, false); + uint32 lang = Eluna::CHECKVAL(L, 3); + Player* receiver = Eluna::CHECKOBJ(L, 4); + bool bossWhisper = Eluna::CHECKVAL(L, 5, false); if (std::string(msg).length() > 0) +#ifdef TRINITY + unit->Whisper(msg, (Language)lang, receiver, bossWhisper); +#else unit->MonsterWhisper(msg, receiver, bossWhisper); +#endif return 0; } @@ -1320,7 +1325,11 @@ namespace LuaUnit Unit* receiver = Eluna::CHECKOBJ(L, 3, false); bool bossEmote = Eluna::CHECKVAL(L, 4, false); if (std::string(msg).length() > 0) +#ifdef TRINITY + unit->TextEmote(msg, receiver, bossEmote); +#else unit->MonsterTextEmote(msg, receiver, bossEmote); +#endif return 0; } @@ -1329,7 +1338,11 @@ namespace LuaUnit const char* msg = Eluna::CHECKVAL(L, 2); uint32 language = Eluna::CHECKVAL(L, 3); if (std::string(msg).length() > 0) +#ifdef TRINITY + unit->Say(msg, (Language)language, unit); +#else unit->MonsterSay(msg, language, unit); +#endif return 0; } @@ -1338,7 +1351,11 @@ namespace LuaUnit const char* msg = Eluna::CHECKVAL(L, 2); uint32 language = Eluna::CHECKVAL(L, 3); if (std::string(msg).length() > 0) +#ifdef TRINITY + unit->Yell(msg, (Language)language, unit); +#else unit->MonsterYell(msg, language, unit); +#endif return 0; }