Skip to content

Commit

Permalink
Add Spell Events
Browse files Browse the repository at this point in the history
Ideally we should deprecate the Player spell event at some point
  • Loading branch information
Foereaper committed Jan 29, 2024
1 parent 00e9aef commit e1f0de5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/server/game/LuaEngine
9 changes: 8 additions & 1 deletion src/server/game/Spells/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"

#ifdef ELUNA
#include "LuaEngine.h"
#endif
extern SpellEffectHandlerFn SpellEffectHandlers[TOTAL_SPELL_EFFECTS];

SpellDestination::SpellDestination()
Expand Down Expand Up @@ -3254,6 +3256,11 @@ void Spell::_cast(bool skipCheck)
return;
}

#ifdef ELUNA
if (Eluna* e = m_caster->GetEluna())
e->OnSpellCast(this, skipCheck);
#endif

if (Player* playerCaster = m_caster->ToPlayer())
{
// now that we've done the basic check, now run the scripts
Expand Down

0 comments on commit e1f0de5

Please sign in to comment.