Spellforce-Spell-framework
Loading...
Searching...
No Matches
sf_subeffect_hook.c
Go to the documentation of this file.
1
8
10#include "../sf_wrappers.h"
11#include "../sf_hooks.h"
12
13#include "sf_subeffect_hook.h"
14
15void __thiscall sf_subeffect_hook(SF_CGdEffect *_this, uint16_t effect_id)
16{
17 uint16_t spell_id = effectAPI.getEffectXData(_this, effect_id, EFFECT_SUBSPELL_ID);
18 if (spell_id)
19 {
20 SF_CGdResourceSpell spell_data;
21 spellAPI.getResourceSpellData(_this->SF_CGdResource, &spell_data, spell_id);
23 if (handler != NULL)
24 {
25 uint16_t source_index = effectAPI.getEffectXData(_this, effect_id, EFFECT_ENTITY_INDEX);
26 log_debug(DEBUG_HIGH, "Spell line [%d] from figure %d", spell_data.spell_line_id, source_index);
27 handler(_this, effect_id);
28 }
29 }
30}
31
SpellFunctions * spellAPI
Definition TestMod.cpp:11
EffectFunctions effectAPI
Definition sf_hooks.c:45
void __thiscall sf_subeffect_hook(SF_CGdEffect *_this, uint16_t effect_id)
void log_debug(DebugLevel level, const char *format,...)
void(__thiscall * sub_effect_handler_ptr)(SF_CGdEffect *, uint16_t effect_index)
@ EFFECT_SUBSPELL_ID
@ EFFECT_ENTITY_INDEX
sub_effect_handler_ptr get_sub_effect_handler(uint16_t spell_line)
SF_CGdResource * SF_CGdResource