3737#include " Vehicle.h"
3838#include " World.h"
3939#include " WorldPacket.h"
40+ #ifdef ELUNA
41+ #include " LuaEngine.h"
42+ #endif
4043
4144AuraCreateInfo::AuraCreateInfo (SpellInfo const * spellInfo, uint8 auraEffMask, WorldObject* owner) :
4245 _spellInfo(spellInfo), _auraEffectMask(auraEffMask), _owner(owner)
@@ -2203,6 +2206,12 @@ void Aura::CallScriptDispel(DispelInfo* dispelInfo)
22032206
22042207 (*scritr)->_FinishScriptCall ();
22052208 }
2209+
2210+ #ifdef ELUNA
2211+ if (GetCaster ())
2212+ if (Eluna* e = GetCaster ()->GetEluna ())
2213+ e->OnAuraDispel (this , dispelInfo);
2214+ #endif
22062215}
22072216
22082217void Aura::CallScriptAfterDispel (DispelInfo* dispelInfo)
@@ -2235,6 +2244,15 @@ bool Aura::CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplicati
22352244 (*scritr)->_FinishScriptCall ();
22362245 }
22372246
2247+ #ifdef ELUNA
2248+ if (!preventDefault)
2249+ {
2250+ if (aurApp->GetTarget ())
2251+ if (Eluna* e = aurApp->GetTarget ()->GetEluna ())
2252+ preventDefault = e->OnAuraApplication (aurApp->GetBase (), aurEff, aurApp->GetTarget (), mode, true );
2253+ }
2254+ #endif
2255+
22382256 return preventDefault;
22392257}
22402258
@@ -2254,6 +2272,16 @@ bool Aura::CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplicat
22542272
22552273 (*scritr)->_FinishScriptCall ();
22562274 }
2275+
2276+ #ifdef ELUNA
2277+ if (!preventDefault)
2278+ {
2279+ if (aurApp->GetTarget ())
2280+ if (Eluna* e = aurApp->GetTarget ()->GetEluna ())
2281+ preventDefault = e->OnAuraApplication (aurApp->GetBase (), aurEff, aurApp->GetTarget (), mode, false );
2282+ }
2283+ #endif
2284+
22572285 return preventDefault;
22582286}
22592287
@@ -2302,6 +2330,15 @@ bool Aura::CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplic
23022330 (*scritr)->_FinishScriptCall ();
23032331 }
23042332
2333+ #ifdef ELUNA
2334+ if (!preventDefault)
2335+ {
2336+ if (aurApp->GetTarget ())
2337+ if (Eluna* e = aurApp->GetTarget ()->GetEluna ())
2338+ preventDefault = e->OnPerodicTick (aurApp->GetBase (), aurEff, aurApp->GetTarget ());
2339+ }
2340+ #endif
2341+
23052342 return preventDefault;
23062343}
23072344
@@ -2317,6 +2354,12 @@ void Aura::CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff)
23172354
23182355 (*scritr)->_FinishScriptCall ();
23192356 }
2357+
2358+ #ifdef ELUNA
2359+ if (aurEff->GetCaster ())
2360+ if (Eluna* e = aurEff->GetCaster ()->GetEluna ())
2361+ e->OnPerodicTick (aurEff->GetBase (), aurEff);
2362+ #endif
23202363}
23212364
23222365void Aura::CallScriptEffectCalcAmountHandlers (AuraEffect const * aurEff, int32& amount, bool & canBeRecalculated)
@@ -2331,6 +2374,11 @@ void Aura::CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32& a
23312374
23322375 (*scritr)->_FinishScriptCall ();
23332376 }
2377+ #ifdef ELUNA
2378+ if (aurEff->GetCaster ())
2379+ if (Eluna* e = aurEff->GetCaster ()->GetEluna ())
2380+ e->OnAuraCalcAmount (aurEff->GetBase (), aurEff, amount, canBeRecalculated);
2381+ #endif
23342382}
23352383
23362384void Aura::CallScriptEffectCalcPeriodicHandlers (AuraEffect const * aurEff, bool & isPeriodic, int32& amplitude)
@@ -2345,6 +2393,11 @@ void Aura::CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool&
23452393
23462394 (*scritr)->_FinishScriptCall ();
23472395 }
2396+ #ifdef ELUNA
2397+ if (aurEff->GetCaster ())
2398+ if (Eluna* e = aurEff->GetCaster ()->GetEluna ())
2399+ e->OnCalcPerodic (aurEff->GetBase (), aurEff, isPeriodic, amplitude);
2400+ #endif
23482401}
23492402
23502403void Aura::CallScriptEffectCalcSpellModHandlers (AuraEffect const * aurEff, SpellModifier*& spellMod)
0 commit comments