This commit is contained in:
Rochet2
2014-09-15 09:48:54 +03:00
4 changed files with 37 additions and 9 deletions

View File

@@ -9,8 +9,6 @@
#include "Common.h"
#include "SharedDefines.h"
#include <unordered_map>
#include <unordered_set>
#ifdef TRINITY
#include "QueryResult.h"
#ifdef CATA

View File

@@ -340,7 +340,7 @@ ElunaRegister<Unit> 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<Player> 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

View File

@@ -1744,9 +1744,16 @@ namespace LuaPlayer
{
std::string text = Eluna::CHECKVAL<std::string>(L, 2);
uint32 lang = Eluna::CHECKVAL<uint32>(L, 3);
#ifdef TRINITY
Player* receiver = Eluna::CHECKOBJ<Player>(L, 4);
#else
uint64 guid = Eluna::CHECKVAL<uint64>(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<std::string>(L, 2);
uint32 lang = Eluna::CHECKVAL<uint32>(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<std::string>(L, 2);
uint32 lang = Eluna::CHECKVAL<uint32>(L, 3);
#ifdef TRINITY
player->Say(text, (Language)lang);
#else
player->Say(text, lang);
#endif
return 0;
}

View File

@@ -1307,10 +1307,15 @@ namespace LuaUnit
int SendUnitWhisper(lua_State* L, Unit* unit)
{
const char* msg = Eluna::CHECKVAL<const char*>(L, 2);
Player* receiver = Eluna::CHECKOBJ<Player>(L, 3);
bool bossWhisper = Eluna::CHECKVAL<bool>(L, 4, false);
uint32 lang = Eluna::CHECKVAL<uint32>(L, 3);
Player* receiver = Eluna::CHECKOBJ<Player>(L, 4);
bool bossWhisper = Eluna::CHECKVAL<bool>(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<Unit>(L, 3, false);
bool bossEmote = Eluna::CHECKVAL<bool>(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<const char*>(L, 2);
uint32 language = Eluna::CHECKVAL<uint32>(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<const char*>(L, 2);
uint32 language = Eluna::CHECKVAL<uint32>(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;
}