This commit is contained in:
luis
2026-03-18 01:55:55 -03:00
parent 1f90dc60df
commit 1eb0b1d8b7
10 changed files with 63 additions and 0 deletions
@@ -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
+3
View File
@@ -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)
{
+4
View File
@@ -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.
+17
View File
@@ -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>
+8
View File
@@ -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;
+3
View File
@@ -37,6 +37,9 @@
#include "Player.h"
#include "SpellMgr.h"
#include "World.h"
#ifdef ELUNA
#include "LuaEngine.h"
#endif
class AELootCreatureCheck
{
+3
View File
@@ -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)
{