Skip to content

Commit 2697eb9

Browse files
committed
Merge branch 'master' of https://github.com/ElunaLuaEngine/Eluna into aura_application_hook
# Conflicts: # hooks/Hooks.h
2 parents d37167f + 6485473 commit 2697eb9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+18512
-634
lines changed

ElunaConfig.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Please see the included DOCS/LICENSE.md for more information
55
*/
66

7-
#if defined ELUNA_TRINITY
7+
#if defined ELUNA_TRINITY || defined ELUNA_AZEROTHCORE
88
#include "Config.h"
99
#else
1010
#include "Config/Config.h"
@@ -56,6 +56,8 @@ void ElunaConfig::SetConfig(ElunaConfigBoolValues index, char const* fieldname,
5656
{
5757
#if defined ELUNA_TRINITY
5858
SetConfig(index, sConfigMgr->GetBoolDefault(fieldname, defvalue));
59+
#elif defined ELUNA_AZEROTHCORE
60+
SetConfig(index, sConfigMgr->GetOption<bool>(fieldname, defvalue));
5961
#else
6062
SetConfig(index, sConfig.GetBoolDefault(fieldname, defvalue));
6163
#endif
@@ -67,6 +69,8 @@ void ElunaConfig::SetConfig(ElunaConfigStringValues index, char const* fieldname
6769
SetConfig(index, sConfigMgr->GetStringDefault(fieldname, defvalue));
6870
#elif defined ELUNA_CMANGOS
6971
SetConfig(index, sConfig.GetStringDefault(fieldname, defvalue));
72+
#elif defined ELUNA_AZEROTHCORE
73+
SetConfig(index, sConfigMgr->GetOption<std::string>(fieldname, defvalue));
7074
#else
7175
SetConfig(index, sConfig.GetStringDefault(fieldname, defvalue.c_str()));
7276
#endif
@@ -76,6 +80,8 @@ void ElunaConfig::SetConfig(ElunaConfigUInt32Values index, char const* fieldname
7680
{
7781
#if defined ELUNA_TRINITY
7882
SetConfig(index, sConfigMgr->GetIntDefault(fieldname, defvalue));
83+
#elif defined ELUNA_AZEROTHCORE
84+
SetConfig(index, sConfigMgr->GetOption<uint32>(fieldname, defvalue));
7985
#else
8086
SetConfig(index, sConfig.GetIntDefault(fieldname, defvalue));
8187
#endif

ElunaCreatureAI.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "AI/BaseAI/CreatureAI.h"
1313
#endif
1414

15-
#if defined ELUNA_TRINITY
15+
#if defined ELUNA_TRINITY || defined ELUNA_AZEROTHCORE
1616
struct ScriptedAI;
1717
typedef ScriptedAI NativeScriptedAI;
1818
#elif defined ELUNA_CMANGOS || ELUNA_MANGOS
@@ -29,7 +29,7 @@ struct ElunaCreatureAI : NativeScriptedAI
2929
bool justSpawned;
3030
// used to delay movementinform hook (WP hook)
3131
std::vector< std::pair<uint32, uint32> > movepoints;
32-
#if !defined ELUNA_TRINITY
32+
#if !defined ELUNA_TRINITY && !defined ELUNA_AZEROTHCORE
3333
#define me m_creature
3434
#endif
3535
ElunaCreatureAI(Creature* creature) : NativeScriptedAI(creature), justSpawned(true)
@@ -73,7 +73,7 @@ struct ElunaCreatureAI : NativeScriptedAI
7373
}
7474
}
7575

76-
#if defined ELUNA_TRINITY
76+
#if defined ELUNA_TRINITY || defined ELUNA_AZEROTHCORE
7777
// Called for reaction when initially engaged - this will always happen _after_ JustEnteredCombat
7878
// Called at creature aggro either by MoveInLOS or Attack Start
7979
void JustEngagedWith(Unit* target) override
@@ -94,6 +94,8 @@ struct ElunaCreatureAI : NativeScriptedAI
9494
// Called at any Damage from any attacker (before damage apply)
9595
#if defined ELUNA_TRINITY || defined ELUNA_CMANGOS
9696
void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType damageType, SpellInfo const* spellInfo) override
97+
#elif defined ELUNA_AZEROTHCORE
98+
void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override
9799
#else
98100
void DamageTaken(Unit* attacker, uint32& damage) override
99101
#endif
@@ -102,6 +104,8 @@ struct ElunaCreatureAI : NativeScriptedAI
102104
{
103105
#if defined ELUNA_TRINITY || defined ELUNA_CMANGOS
104106
NativeScriptedAI::DamageTaken(attacker, damage, damageType, spellInfo);
107+
#elif defined ELUNA_AZEROTHCORE
108+
NativeScriptedAI::DamageTaken(attacker, damage, damagetype, damageSchoolMask);
105109
#else
106110
NativeScriptedAI::DamageTaken(attacker, damage);
107111
#endif
@@ -151,7 +155,7 @@ struct ElunaCreatureAI : NativeScriptedAI
151155
NativeScriptedAI::AttackStart(target);
152156
}
153157

154-
#if defined ELUNA_TRINITY
158+
#if defined ELUNA_TRINITY || defined ELUNA_AZEROTHCORE
155159
// Called for reaction at stopping attack at no attackers or targets
156160
void EnterEvadeMode(EvadeReason /*why*/) override
157161
#else
@@ -199,7 +203,7 @@ struct ElunaCreatureAI : NativeScriptedAI
199203
NativeScriptedAI::CorpseRemoved(respawnDelay);
200204
}
201205

202-
#if !defined ELUNA_TRINITY && !defined ELUNA_VMANGOS
206+
#if !defined ELUNA_TRINITY && !defined ELUNA_VMANGOS && !defined ELUNA_AZEROTHCORE
203207
// Enables use of MoveInLineOfSight
204208
bool IsVisible(Unit* who) const override
205209
{
@@ -237,7 +241,7 @@ struct ElunaCreatureAI : NativeScriptedAI
237241
NativeScriptedAI::SpellHitTarget(target, spell);
238242
}
239243

240-
#if defined ELUNA_TRINITY
244+
#if defined ELUNA_TRINITY || defined ELUNA_AZEROTHCORE
241245
// Called when the creature is summoned successfully by other creature
242246
void IsSummonedBy(WorldObject* summoner) override
243247
{
@@ -266,7 +270,7 @@ struct ElunaCreatureAI : NativeScriptedAI
266270
}
267271
#endif
268272

269-
#if !defined ELUNA_TRINITY
273+
#if !defined ELUNA_TRINITY && !defined ELUNA_AZEROTHCORE
270274
#undef me
271275
#endif
272276
};

0 commit comments

Comments
 (0)