Skip to content

Commit 1d9e2c5

Browse files
committed
TC Retail: Spell Method Changes
Untested and some methods disabled
1 parent c18e985 commit 1d9e2c5

8 files changed

Lines changed: 168 additions & 29 deletions

File tree

ElunaSpellWrapper.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
#include "ElunaIncludes.h"
88
#include "ElunaTemplate.h"
99

10+
#if ELUNA_EXPANSION < EXP_RETAIL
1011
ElunaProcInfo::ElunaProcInfo(Unit* actor, Unit* actionTarget, uint32 typeMask,
12+
#else
13+
ElunaProcInfo::ElunaProcInfo(Unit* actor, Unit* actionTarget, ProcFlagsInit typeMask,
14+
#endif
1115
uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask,
1216
Spell* spell, SpellInfo const* spellInfo, SpellSchoolMask schoolMask, Map* map)
1317
: _actor(actor), _actionTarget(actionTarget), _typeMask(typeMask), _spellTypeMask(spellTypeMask), _spellPhaseMask(spellPhaseMask)
@@ -123,7 +127,11 @@ void ElunaProcInfo::ApplyToProcEventInfo(ProcEventInfo& procInfo) const
123127
}
124128
}
125129

130+
#if ELUNA_EXPANSION < EXP_RETAIL
126131
ElunaSpellInfo::ElunaSpellInfo(uint32 spellId) : _spellInfo(sSpellMgr->GetSpellInfo(spellId))
132+
#else
133+
ElunaSpellInfo::ElunaSpellInfo(uint32 spellId) : _spellInfo(sSpellMgr->GetSpellInfo(spellId, DIFFICULTY_NONE))
134+
#endif
127135
{
128136
#ifdef ELUNA_TRINITY
129137
if (_spellInfo)

ElunaSpellWrapper.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ class ElunaProcInfo
3636
private:
3737
Unit* _actor;
3838
Unit* _actionTarget;
39+
#if ELUNA_EXPANSION < EXP_RETAIL
3940
uint32 _typeMask;
41+
#else
42+
ProcFlagsInit _typeMask;
43+
#endif
4044
uint32 _spellTypeMask;
4145
uint32 _spellPhaseMask;
4246
uint32 _hitMask;
@@ -63,7 +67,11 @@ class ElunaProcInfo
6367
#endif
6468

6569
public:
70+
#if ELUNA_EXPANSION < EXP_RETAIL
6671
ElunaProcInfo(Unit* actor, Unit* actionTarget, uint32 typeMask,
72+
#else
73+
ElunaProcInfo(Unit* actor, Unit* actionTarget, ProcFlagsInit typeMask,
74+
#endif
6775
uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask,
6876
Spell* spell, SpellInfo const* spellInfo, SpellSchoolMask schoolMask, Map* map);
6977

@@ -76,7 +84,11 @@ class ElunaProcInfo
7684
}
7785
Unit* GetActor() const { return _actor; }
7886
Unit* GetActionTarget() const { return _actionTarget; }
87+
#if ELUNA_EXPANSION < EXP_RETAIL
7988
uint32 GetTypeMask() const { return _typeMask; }
89+
#else
90+
ProcFlagsInit GetTypeMask() const { return _typeMask; }
91+
#endif
8092
uint32 GetSpellTypeMask() const { return _spellTypeMask; }
8193
uint32 GetSpellPhaseMask() const { return _spellPhaseMask; }
8294
uint32 GetHitMask() const { return _hitMask; }

LuaEngine.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,11 @@ class ELUNA_GAME_API Eluna
656656
void OnAuraDispel(Aura* aura, DispelInfo* dispelInfo);
657657
bool OnPeriodicTick(Aura* aura, AuraEffect const* auraEff, Unit* target);
658658
void OnPeriodicUpdate(Aura* aura, AuraEffect const* auraEff);
659+
#if ELUNA_EXPANSION < EXP_RETAIL
659660
void OnAuraCalcAmount(Aura* aura, AuraEffect const* auraEff, int32& amount, bool& canBeRecalculated);
661+
#else
662+
void OnAuraCalcAmount(Aura* aura, AuraEffect const* auraEff, double& amount, bool& canBeRecalculated);
663+
#endif
660664
void OnCalcPeriodic(Aura* aura, AuraEffect const* auraEff, bool& isPeriodic, int32& amplitude);
661665
bool OnAuraCanProc(Aura* aura, ProcEventInfo& procInfo);
662666
bool OnAuraProc(Aura* aura, ProcEventInfo& procInfo);

hooks/SpellHooks.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ void Eluna::OnPeriodicUpdate(Aura* aura, AuraEffect const* auraEff)
7171
CallAllFunctions(binding, key);
7272
}
7373

74+
#if ELUNA_EXPANSION < EXP_RETAIL
7475
void Eluna::OnAuraCalcAmount(Aura* aura, AuraEffect const* auraEff, int32& amount, bool& canBeRecalculated)
76+
#else
77+
void Eluna::OnAuraCalcAmount(Aura* aura, AuraEffect const* auraEff, double& amount, bool& canBeRecalculated)
78+
#endif
7579
{
7680
START_HOOK(SPELL_EVENT_ON_AURA_CALC_AMOUNT, aura);
7781

methods/TrinityCore/ElunaProcInfoMethods.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ namespace LuaElunaProcInfo
2525
return 1;
2626
}
2727

28+
#if ELUNA_EXPANSION < EXP_RETAIL
2829
/**
2930
* Returns the type mask of the proc event.
3031
*
@@ -35,6 +36,7 @@ namespace LuaElunaProcInfo
3536
E->Push(procInfo->GetTypeMask());
3637
return 1;
3738
}
39+
#endif
3840

3941
/**
4042
* Returns the spell type mask of the proc event.
@@ -330,7 +332,11 @@ namespace LuaElunaProcInfo
330332
// Getters
331333
{ "GetActor", &LuaElunaProcInfo::GetActor },
332334
{ "GetActionTarget", &LuaElunaProcInfo::GetActionTarget },
335+
#if ELUNA_EXPANSION < EXP_RETAIL
333336
{ "GetTypeMask", &LuaElunaProcInfo::GetTypeMask },
337+
#else
338+
{ "GetTypeMask", METHOD_REG_NONE },
339+
#endif
334340
{ "GetSpellTypeMask", &LuaElunaProcInfo::GetSpellTypeMask },
335341
{ "GetSpellPhaseMask", &LuaElunaProcInfo::GetSpellPhaseMask },
336342
{ "GetHitMask", &LuaElunaProcInfo::GetHitMask },

methods/TrinityCore/GlobalMethods.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3262,12 +3262,18 @@ namespace LuaGlobalFunctions
32623262
* Returns the [SpellInfo] for the given spell ID, or nil if the spell does not exist.
32633263
*
32643264
* @param uint32 spellId : the spell ID to look up
3265+
* @param uint32 spellDiff : the difficulty level of the spell
32653266
* @return [SpellInfo] spellInfo
32663267
*/
32673268
int GetSpellInfo(Eluna* E)
32683269
{
32693270
uint32 spellId = E->CHECKVAL<uint32>(1);
3271+
#if ELUNA_EXPANSION < EXP_RETAIL
32703272
if (!sSpellMgr->GetSpellInfo(spellId))
3273+
#else
3274+
uint32 spellDiff = E->CHECKVAL<uint32>(2);
3275+
if (!sSpellMgr->GetSpellInfo(spellId, static_cast<Difficulty>(spellDiff)))
3276+
#endif
32713277
return luaL_argerror(E->L, 1, "invalid spell id");
32723278
ElunaSpellInfo info(spellId);
32733279
E->Push(&info);

0 commit comments

Comments
 (0)