Eluna implementation (#847)
* azerothcore + eluna done. * Remove the Eluna single thread limit. * Read Eluna Settings file. * submodule change. * fix(test) Ubuntu - Cant Link Library after Compile * The ELUNA is disabled by default. * remove submodule luaEngine. * some change * fix a error * change cmake * fix: some onplayerchat does not have hooks. * Eluna: Add BG event Hooks. * fix:cmake hook AFTER_LOAD_CONF not work. * Remove the eluna switch. * Remove some define in the core. * fix conf file not read in the linux. * eluna : change bg hook parameter type * Remove TC log function call * change bg hook OnBGEnd parameter type. Note: to enable Eluna, the module is required
This commit is contained in:
@@ -38,6 +38,9 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "Transport.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
class LoginQueryHolder : public SQLQueryHolder
|
||||
{
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
#include "Util.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "AccountMgr.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
{
|
||||
@@ -151,6 +154,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
return;
|
||||
|
||||
sScriptMgr->OnPlayerChat(sender, type, lang, msg, receiver);
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(sender, type, lang, msg, receiver))
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -390,7 +397,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
return;
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, group))
|
||||
return;
|
||||
#endif
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, ChatMsg(type), Language(lang), sender, NULL, msg);
|
||||
group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetGUID()));
|
||||
@@ -403,6 +413,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
{
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, guild);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, guild))
|
||||
return;
|
||||
#endif
|
||||
guild->BroadcastToGuild(this, false, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
|
||||
}
|
||||
}
|
||||
@@ -415,6 +429,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
{
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, guild);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, guild))
|
||||
return;
|
||||
#endif
|
||||
guild->BroadcastToGuild(this, true, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL);
|
||||
}
|
||||
}
|
||||
@@ -431,7 +449,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, group))
|
||||
return;
|
||||
#endif
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID, Language(lang), sender, NULL, msg);
|
||||
group->BroadcastPacket(&data, false);
|
||||
@@ -448,7 +469,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, group))
|
||||
return;
|
||||
#endif
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_LEADER, Language(lang), sender, NULL, msg);
|
||||
group->BroadcastPacket(&data, false);
|
||||
@@ -460,7 +484,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
return;
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, group))
|
||||
return;
|
||||
#endif
|
||||
WorldPacket data;
|
||||
//in battleground, raid warning is sent only to players in battleground - code is ok
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_WARNING, Language(lang), sender, NULL, msg);
|
||||
@@ -474,7 +501,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
return;
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, group))
|
||||
return;
|
||||
#endif
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_BATTLEGROUND, Language(lang), sender, NULL, msg);
|
||||
group->BroadcastPacket(&data, false);
|
||||
@@ -487,7 +517,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
return;
|
||||
|
||||
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(GetPlayer(), type, lang, msg, group))
|
||||
return;
|
||||
#endif
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_BATTLEGROUND_LEADER, Language(lang), sender, NULL, msg);
|
||||
group->BroadcastPacket(&data, false);
|
||||
@@ -509,6 +542,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
{
|
||||
sScriptMgr->OnPlayerChat(sender, type, lang, msg, chn);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(sender, type, lang, msg, chn))
|
||||
return;
|
||||
#endif
|
||||
chn->Say(sender->GetGUID(), msg.c_str(), lang);
|
||||
}
|
||||
}
|
||||
@@ -535,6 +572,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(sender, type, lang, msg);
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(sender, type, lang, msg))
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -558,7 +599,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recvData)
|
||||
}
|
||||
|
||||
sScriptMgr->OnPlayerChat(sender, type, lang, msg);
|
||||
|
||||
#ifdef ELUNA
|
||||
if (!sEluna->OnChat(sender, type, lang, msg))
|
||||
return;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
#include "WorldSession.h"
|
||||
#include "ObjectMgr.h"
|
||||
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recvData)
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
@@ -200,7 +204,9 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recvData*/)
|
||||
data << uint8(1); // "You loot..."
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
#ifdef ELUNA
|
||||
sEluna->OnLootMoney(player, loot->gold);
|
||||
#endif
|
||||
loot->gold = 0;
|
||||
|
||||
// Delete the money loot record from the DB
|
||||
@@ -493,6 +499,10 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData)
|
||||
target->SendNewItem(newitem, uint32(item.count), false, false, true);
|
||||
target->UpdateLootAchievements(&item, loot);
|
||||
|
||||
#ifdef ELUNA
|
||||
sEluna->OnLootItem(target, newitem, item.count, lootguid);
|
||||
#endif
|
||||
|
||||
// mark as looted
|
||||
item.count=0;
|
||||
item.is_looted=true;
|
||||
|
||||
@@ -43,6 +43,9 @@
|
||||
#include "AccountMgr.h"
|
||||
#include "Spell.h"
|
||||
#include "WhoListCache.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
@@ -71,6 +74,10 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data)
|
||||
GetPlayer()->KillPlayer();
|
||||
}
|
||||
|
||||
#ifdef ELUNA
|
||||
sEluna->OnRepop(GetPlayer());
|
||||
#endif
|
||||
|
||||
//this is spirit release confirm?
|
||||
GetPlayer()->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
|
||||
GetPlayer()->BuildPlayerRepop();
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
#include "BattlegroundAV.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "GameObjectAI.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recvData)
|
||||
{
|
||||
@@ -89,6 +92,11 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recvData)
|
||||
//if (!creature->GetTransport()) // pussywizard: reverted with new spline (old: without this check, npc would stay in place and the transport would continue moving, so the npc falls off. NPCs on transports don't have waypoints, so stopmoving is not needed)
|
||||
creature->StopMoving();
|
||||
|
||||
#ifdef ELUNA
|
||||
if (sEluna->OnGossipHello(_player, creature))
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (sScriptMgr->OnGossipHello(_player, creature))
|
||||
return;
|
||||
|
||||
@@ -412,7 +420,9 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData)
|
||||
_player->TakeQuestSourceItem(questId, true); // remove quest src item from player
|
||||
_player->RemoveActiveQuest(questId);
|
||||
_player->RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, questId);
|
||||
|
||||
#ifdef ELUNA
|
||||
sEluna->OnQuestAbandon(_player, questId);
|
||||
#endif
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDetail("Player %u abandoned quest %u", _player->GetGUIDLow(), questId);
|
||||
#endif
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
#include "GameObjectAI.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "Player.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
void WorldSession::HandleClientCastFlags(WorldPacket& recvPacket, uint8 castFlags, SpellCastTargets& targets)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user