forked from ElunaLuaEngine/Eluna
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpellHooks.cpp
More file actions
32 lines (27 loc) · 957 Bytes
/
SpellHooks.cpp
File metadata and controls
32 lines (27 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
* Copyright (C) 2010 - 2024 Eluna Lua Engine <https://elunaluaengine.github.io/>
* This program is free software licensed under GPL version 3
* Please see the included DOCS/LICENSE.md for more information
*/
#include "Hooks.h"
#include "HookHelpers.h"
#include "LuaEngine.h"
#include "BindingMap.h"
#include "ElunaIncludes.h"
#include "ElunaTemplate.h"
using namespace Hooks;
#define START_HOOK(EVENT, SPELL) \
auto key = EntryKey<SpellEvents>(EVENT, SPELL->m_spellInfo->Id);\
if (!SpellEventBindings->HasBindingsFor(key))\
return;
#define START_HOOK_WITH_RETVAL(EVENT, SPELL, RETVAL) \
auto key = EntryKey<SpellEvents>(EVENT, SPELL->m_spellInfo->Id);\
if (!SpellEventBindings->HasBindingsFor(key))\
return RETVAL;
void Eluna::OnSpellCast(Spell* pSpell, bool skipCheck)
{
START_HOOK(SPELL_EVENT_ON_CAST, pSpell);
HookPush(pSpell);
HookPush(skipCheck);
CallAllFunctions(SpellEventBindings, key);
}