mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Merge branch 'master' of https://github.com/ElunaLuaEngine/Eluna
This commit is contained in:
@@ -9,8 +9,6 @@
|
||||
|
||||
#include "Common.h"
|
||||
#include "SharedDefines.h"
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#ifdef TRINITY
|
||||
#include "QueryResult.h"
|
||||
#ifdef CATA
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user