fix build

This commit is contained in:
luis
2026-03-19 22:21:41 -03:00
parent 65fa4999a0
commit f19aab2fee
9 changed files with 12 additions and 53 deletions
+1
View File
@@ -80,6 +80,7 @@ endif()
if(ELUNA)
# Add Eluna source files to game library
target_include_directories(game PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/LuaEngine")
target_include_directories(game PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/LuaEngine/methods/TrinityCore")
target_compile_definitions(game PRIVATE -DELUNA -DELUNA_TRINITY -DELUNA_EXPANSION=9)
# Link lualib
+1 -1
View File
@@ -1185,7 +1185,7 @@ void WorldObject::SetMap(Map* map)
#ifdef ELUNA
if (Eluna* e = map->GetEluna())
if (!elunaEvents)
elunaEvents = new ElunaEventProcessor(e, this);
elunaEvents = new ElunaEventProcessor(e->eventMgr.get(), this);
#endif
if (IsStoredInWorldObjectGridContainer())
m_currMap->AddWorldObject(this);
+2 -4
View File
@@ -64,7 +64,7 @@ class WorldObject;
class ZoneScript;
#ifdef ELUNA
class Eluna;
class ElunaEventProcessor;
#include "ElunaEventMgr.h"
#include "LuaValue.h"
#endif
struct FactionTemplateEntry;
@@ -580,12 +580,10 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation
#ifdef ELUNA
Eluna* GetEluna() const { return _eluna; }
ElunaEventProcessor* GetElunaEvents([[maybe_unused]] int32 mapId) const { return elunaEvents; }
ElunaEventProcessor* elunaEvents;
LuaVal lua_data = LuaVal({});
private:
Eluna* _eluna;
#else
private:
#endif
// Event handler
+1 -16
View File
@@ -15124,11 +15124,6 @@ void Player::CompleteQuest(uint32 quest_id)
{
if (qInfo->HasFlag(QUEST_FLAGS_TRACKING_EVENT))
RewardQuest(qInfo, LootItemType::Item, 0, this, false);
#ifdef ELUNA
if (sWorld->GetEluna())
sWorld->GetEluna()->OnQuestComplete(this, quest_id);
#endif
}
}
@@ -16868,13 +16863,8 @@ void Player::KilledMonster(Creature const* creature)
if (cInfo->KillCredit[i])
KilledMonsterCredit(cInfo->KillCredit[i], ObjectGuid::Empty);
for (int32 label : creature->GetLabels())
for (int32 label : creature->GetLabels())
UpdateQuestObjectiveProgress(QUEST_OBJECTIVE_KILL_WITH_LABEL, label, 1, creature->GetGUID());
#ifdef ELUNA
if (sWorld->GetEluna())
sWorld->GetEluna()->OnKilledMonster(this, cInfo->Entry, creature->GetGUID());
#endif
}
void Player::KilledMonsterCredit(uint32 entry, ObjectGuid guid /*= ObjectGuid::Empty*/)
@@ -22569,11 +22559,6 @@ void Player::ResetInstances(InstanceResetMethod method)
default:
break;
}
#ifdef ELUNA
if (sWorld->GetEluna())
sWorld->GetEluna()->OnQuestAccept(this, quest);
#endif
}
}
+3 -13
View File
@@ -95,6 +95,9 @@
#include "WorldPacket.h"
#include "WorldSession.h"
#include "../../modules/Playerbot/Core/PlayerBotHooks.h"
#ifdef ELUNA
#include "ElunaEventMgr.h"
#endif
#include <queue>
#include <sstream>
#include <cmath>
@@ -849,13 +852,6 @@ bool Unit::HasBreakableByDamageCrowdControlAura(Unit const* excludeCasterChannel
// Hook for OnDamage Event
sScriptMgr->OnDamage(attacker, victim, tmpDamage);
#ifdef ELUNA
if (attacker && attacker->GetMap() && attacker->GetMap()->GetEluna())
attacker->GetMap()->GetEluna()->OnDamageDealt(attacker, victim, tmpDamage, damagetype);
if (victim && victim->GetMap() && victim->GetMap()->GetEluna())
victim->GetMap()->GetEluna()->OnDamageReceived(victim, attacker, tmpDamage, damagetype);
#endif
// PLAYERBOT HOOK: Notify bots of damage event
if (Playerbot::PlayerBotHooks::OnDamageDealt)
Playerbot::PlayerBotHooks::OnDamageDealt(attacker, victim, tmpDamage, damagetype, spellProto);
@@ -12338,12 +12334,6 @@ Aura* Unit::AddAura(SpellInfo const* spellInfo, uint32 effMask, Unit* target)
{
aura->ApplyForTargets();
#ifdef ELUNA
if (target && target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->GetSession())
if (target->GetMap() && target->GetMap()->GetEluna())
target->GetMap()->GetEluna()->OnAuraApplied(target, caster, spellInfo);
#endif
return aura;
}
return nullptr;
+1 -6
View File
@@ -3004,12 +3004,7 @@ bool Guild::DeleteMember(CharacterDatabaseTransaction trans, ObjectGuid guid, bo
#ifdef ELUNA
if (sWorld->GetEluna())
{
if (Player* player = ObjectAccessor::FindConnectedPlayer(guid))
sWorld->GetEluna()->OnRemoveMember(this, player, isDisbanding);
else
sWorld->GetEluna()->OnRemoveMember(this, guid, isDisbanding);
}
sWorld->GetEluna()->OnRemoveMember(this, guid, isDisbanding);
#endif
m_members.erase(guid);
+2
View File
@@ -80,6 +80,7 @@ struct UpdateBossStateSaveDataEvent;
class Transport;
#ifdef ELUNA
class Eluna;
#include "LuaEngine/LuaValue.h"
#endif
enum Difficulty : int16;
enum WeatherState : uint32;
@@ -597,6 +598,7 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
#ifdef ELUNA
Eluna* GetEluna() const { return _eluna; }
LuaVal lua_data = LuaVal({});
private:
Eluna* _eluna;
#else
+1 -1
View File
@@ -3698,7 +3698,7 @@ void Spell::_cast(bool skipCheck)
#ifdef ELUNA
if (playerCaster->GetMap() && playerCaster->GetMap()->GetEluna())
playerCaster->GetMap()->GetEluna()->OnCastSpell(playerCaster, this);
playerCaster->GetMap()->GetEluna()->OnSpellCast(playerCaster, this, skipCheck);
#endif
// As of 3.0.2 pets begin attacking their owner's target immediately
-12
View File
@@ -602,18 +602,6 @@ void Spell::EffectDummy()
// normal DB scripted effect
TC_LOG_DEBUG("spells", "Spell ScriptStart spellid {} in EffectDummy({})", m_spellInfo->Id, effectInfo->EffectIndex);
m_caster->GetMap()->ScriptsStart(sSpellScripts, uint32(m_spellInfo->Id | (effectInfo->EffectIndex << 24)), m_caster, unitTarget);
#ifdef ELUNA
if (m_caster->GetMap() && m_caster->GetMap()->GetEluna())
{
if (unitTarget)
m_caster->GetMap()->GetEluna()->OnDummyEffect(m_caster, m_spellInfo->Id, effectInfo->EffectIndex, unitTarget);
else if (gameObjTarget)
m_caster->GetMap()->GetEluna()->OnDummyEffect(m_caster, m_spellInfo->Id, effectInfo->EffectIndex, gameObjTarget);
else if (itemTarget)
m_caster->GetMap()->GetEluna()->OnDummyEffect(m_caster, m_spellInfo->Id, effectInfo->EffectIndex, itemTarget);
}
#endif
}
void Spell::EffectTriggerSpell()