Merge branch 'ElunaLuaEngine:master' into feat/arena-methods

This commit is contained in:
Axel Cocat
2021-09-20 09:51:29 +02:00
committed by GitHub
6 changed files with 18 additions and 11 deletions

View File

@@ -769,7 +769,7 @@ namespace LuaCreature
#elif defined(TRINITY) #elif defined(TRINITY)
auto const& threatlist = creature->GetThreatManager().GetSortedThreatList(); auto const& threatlist = creature->GetThreatManager().GetSortedThreatList();
#elif defined(AZEROTHCORE) #elif defined(AZEROTHCORE)
auto const& threatlist = creature->getThreatManager().getThreatList(); auto const& threatlist = creature->getThreatMgr().getThreatList();
#endif #endif
#ifndef TRINITY #ifndef TRINITY
if (threatlist.empty()) if (threatlist.empty())
@@ -860,7 +860,7 @@ namespace LuaCreature
#if defined(TRINITY) #if defined(TRINITY)
auto const& threatlist = creature->GetThreatManager().GetThreatenedByMeList(); auto const& threatlist = creature->GetThreatManager().GetThreatenedByMeList();
#elif defined(AZEROTHCORE) #elif defined(AZEROTHCORE)
auto const& threatlist = creature->getThreatManager().getThreatList(); auto const& threatlist = creature->getThreatMgr().getThreatList();
#else #else
ThreatList const& threatlist = creature->GetThreatManager().getThreatList(); ThreatList const& threatlist = creature->GetThreatManager().getThreatList();
#endif #endif
@@ -894,7 +894,7 @@ auto const& threatlist = creature->getThreatManager().getThreatList();
#if defined(TRINITY) #if defined(TRINITY)
Eluna::Push(L, creature->GetThreatManager().GetThreatenedByMeList().size()); Eluna::Push(L, creature->GetThreatManager().GetThreatenedByMeList().size());
#elif defined(AZEROTHCORE) #elif defined(AZEROTHCORE)
Eluna::Push(L, creature->getThreatManager().getThreatList().size()); Eluna::Push(L, creature->getThreatMgr().getThreatList().size());
#else #else
Eluna::Push(L, creature->GetThreatManager().getThreatList().size()); Eluna::Push(L, creature->GetThreatManager().getThreatList().size());
#endif #endif

View File

@@ -90,16 +90,20 @@ struct ElunaCreatureAI : ScriptedAI
#endif #endif
// Called at any Damage from any attacker (before damage apply) // Called at any Damage from any attacker (before damage apply)
#if AZEROTHCORE #if defined AZEROTHCORE
void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
#elif defined TRINITY
void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType damageType, SpellInfo const* spellInfo) override
#else #else
void DamageTaken(Unit* attacker, uint32& damage) override void DamageTaken(Unit* attacker, uint32& damage) override
#endif #endif
{ {
if (!sEluna->DamageTaken(me, attacker, damage)) if (!sEluna->DamageTaken(me, attacker, damage))
{ {
#if AZEROTHCORE #if defined AZEROTHCORE
ScriptedAI::DamageTaken(attacker, damage, damagetype, damageSchoolMask); ScriptedAI::DamageTaken(attacker, damage, damagetype, damageSchoolMask);
#elif defined TRINITY
ScriptedAI::DamageTaken(attacker, damage, damageType, spellInfo);
#else #else
ScriptedAI::DamageTaken(attacker, damage); ScriptedAI::DamageTaken(attacker, damage);
#endif #endif

View File

@@ -24,7 +24,6 @@
#include "GuildMgr.h" #include "GuildMgr.h"
#include "Language.h" #include "Language.h"
#include "Mail.h" #include "Mail.h"
#include "MapManager.h"
#include "ObjectAccessor.h" #include "ObjectAccessor.h"
#include "ObjectMgr.h" #include "ObjectMgr.h"
#include "Opcodes.h" #include "Opcodes.h"
@@ -43,6 +42,12 @@
#include "SpellHistory.h" #include "SpellHistory.h"
#endif #endif
#if defined AZEROTHCORE
#include "MapMgr.h"
#else
#include "MapManager.h"
#endif
#if defined TRINITY || defined AZEROTHCORE #if defined TRINITY || defined AZEROTHCORE
#include "Config.h" #include "Config.h"
#include "GameEventMgr.h" #include "GameEventMgr.h"

View File

@@ -11,7 +11,7 @@
#ifdef AZEROTHCORE #ifdef AZEROTHCORE
#include "BanManager.h" #include "BanMgr.h"
enum BanMode enum BanMode
{ {

View File

@@ -190,12 +190,10 @@ namespace LuaMap
float x = Eluna::CHECKVAL<float>(L, 2); float x = Eluna::CHECKVAL<float>(L, 2);
float y = Eluna::CHECKVAL<float>(L, 3); float y = Eluna::CHECKVAL<float>(L, 3);
float z = Eluna::CHECKVAL<float>(L, 4); float z = Eluna::CHECKVAL<float>(L, 4);
#if defined TRINITY #if defined TRINITY || defined AZEROTHCORE
float phasemask = Eluna::CHECKVAL<uint32>(L, 5, PHASEMASK_NORMAL); float phasemask = Eluna::CHECKVAL<uint32>(L, 5, PHASEMASK_NORMAL);
Eluna::Push(L, map->GetAreaId(phasemask, x, y, z)); Eluna::Push(L, map->GetAreaId(phasemask, x, y, z));
#elif defined AZEROTHCORE
Eluna::Push(L, map->GetAreaId(x, y, z));
#else #else
Eluna::Push(L, map->GetTerrain()->GetAreaId(x, y, z)); Eluna::Push(L, map->GetTerrain()->GetAreaId(x, y, z));
#endif #endif

View File

@@ -2006,7 +2006,7 @@ namespace LuaUnit
#ifdef TRINITY #ifdef TRINITY
unit->GetThreatManager().ClearAllThreat(); unit->GetThreatManager().ClearAllThreat();
#elif AZEROTHCORE #elif AZEROTHCORE
unit->getThreatManager().clearReferences(); unit->getThreatMgr().clearReferences();
#else #else
unit->GetThreatManager().clearReferences(); unit->GetThreatManager().clearReferences();
#endif #endif