lua
This commit is contained in:
@@ -115,6 +115,12 @@ Battleground::Battleground(Battleground const&) = default;
|
||||
|
||||
Battleground::~Battleground()
|
||||
{
|
||||
#ifdef ELUNA
|
||||
if (m_Map)
|
||||
if (Eluna* e = m_Map->GetEluna())
|
||||
e->OnBGDestroy(this, GetTypeID(), GetInstanceID());
|
||||
#endif
|
||||
|
||||
// unload map
|
||||
if (m_Map)
|
||||
{
|
||||
@@ -380,6 +386,11 @@ inline void Battleground::_ProcessJoin(uint32 diff)
|
||||
|
||||
GetBgMap()->GetBattlegroundScript()->OnStart();
|
||||
|
||||
#ifdef ELUNA
|
||||
if (Eluna* e = GetBgMap()->GetEluna())
|
||||
e->OnBGStart(this, GetTypeID(), GetInstanceID());
|
||||
#endif
|
||||
|
||||
if (StartMessageIds[BG_STARTING_EVENT_FOURTH])
|
||||
SendBroadcastText(StartMessageIds[BG_STARTING_EVENT_FOURTH], CHAT_MSG_BG_SYSTEM_NEUTRAL);
|
||||
SetStatus(STATUS_IN_PROGRESS);
|
||||
@@ -778,6 +789,11 @@ void Battleground::EndBattleground(Team winner)
|
||||
|
||||
GetBgMap()->GetBattlegroundScript()->OnEnd(winner);
|
||||
}
|
||||
|
||||
#ifdef ELUNA
|
||||
if (Eluna* e = GetBgMap()->GetEluna())
|
||||
e->OnBGEnd(this, GetTypeID(), GetInstanceID(), winner);
|
||||
#endif
|
||||
}
|
||||
|
||||
uint32 Battleground::GetScriptId() const
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
#include "CreatureAI.h"
|
||||
#include "MapUtils.h"
|
||||
#include "Player.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
/*static*/ bool CombatManager::CanBeginCombat(Unit const* a, Unit const* b)
|
||||
{
|
||||
|
||||
@@ -426,6 +426,10 @@ Unit::~Unit()
|
||||
|
||||
void Unit::Update(uint32 p_time)
|
||||
{
|
||||
#ifdef ELUNA
|
||||
if (elunaEvents)
|
||||
elunaEvents->Update(p_time);
|
||||
#endif
|
||||
// WARNING! Order of execution here is important, do not change.
|
||||
// Spells must be processed with event system BEFORE they go to _UpdateSpells.
|
||||
// Or else we may have some SPELL_STATE_FINISHED spells stalled in pointers, that is bad.
|
||||
|
||||
@@ -149,6 +149,11 @@ bool GameEventMgr::StartEvent(uint16 event_id, bool overwrite)
|
||||
if (data.end <= data.start)
|
||||
data.end = data.start + data.length;
|
||||
}
|
||||
#ifdef ELUNA
|
||||
if (IsActiveEvent(event_id))
|
||||
if (Eluna* e = sWorld->GetEluna())
|
||||
e->OnGameEventStart(event_id);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -172,6 +177,12 @@ bool GameEventMgr::StartEvent(uint16 event_id, bool overwrite)
|
||||
if (overwrite && conditions_met)
|
||||
sWorld->ForceGameEventUpdate();
|
||||
|
||||
#ifdef ELUNA
|
||||
if (IsActiveEvent(event_id))
|
||||
if (Eluna* e = sWorld->GetEluna())
|
||||
e->OnGameEventStart(event_id);
|
||||
#endif
|
||||
|
||||
return conditions_met;
|
||||
}
|
||||
}
|
||||
@@ -214,6 +225,12 @@ void GameEventMgr::StopEvent(uint16 event_id, bool overwrite)
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ELUNA
|
||||
if (!IsActiveEvent(event_id))
|
||||
if (Eluna* e = sWorld->GetEluna())
|
||||
e->OnGameEventStop(event_id);
|
||||
#endif
|
||||
}
|
||||
|
||||
void GameEventMgr::LoadFromDB()
|
||||
|
||||
@@ -63,6 +63,9 @@
|
||||
#include "SystemPackets.h"
|
||||
#include "Util.h"
|
||||
#include "World.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
#include <boost/circular_buffer.hpp>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "Util.h"
|
||||
#include "World.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
#include <algorithm>
|
||||
|
||||
enum class ChatWhisperTargetStatus : uint8
|
||||
@@ -233,6 +236,11 @@ ChatMessageResult WorldSession::HandleChatMessage(ChatMsg type, Language lang, s
|
||||
if (ChatHandler(this).ParseCommands(msg.c_str()))
|
||||
return ChatMessageResult::HandledCommand;
|
||||
|
||||
#ifdef ELUNA
|
||||
if (GetPlayer() && sWorld->GetEluna())
|
||||
sWorld->GetEluna()->OnCommand(GetPlayer(), msg.c_str());
|
||||
#endif
|
||||
|
||||
// do message validity checks
|
||||
if (!ValidateMessage(GetPlayer(), msg))
|
||||
return ChatMessageResult::MessageHasInvalidCharacters;
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
#include "Player.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "World.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
class AELootCreatureCheck
|
||||
{
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
#include "SpellInfo.h"
|
||||
#include "Trainer.h"
|
||||
#include "WorldPacket.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
enum class TabardVendorType : int32
|
||||
{
|
||||
|
||||
@@ -41,6 +41,9 @@
|
||||
#include "ReputationMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "World.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPackets::Quest::QuestGiverStatusQuery& packet)
|
||||
{
|
||||
|
||||
@@ -45,6 +45,9 @@
|
||||
#include "TemporarySummon.h"
|
||||
#include "TotemPackets.h"
|
||||
#include "World.h"
|
||||
#ifdef ELUNA
|
||||
#include "LuaEngine.h"
|
||||
#endif
|
||||
|
||||
void WorldSession::HandleUseItemOpcode(WorldPackets::Spells::UseItem& packet)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user