Spellforce-Spell-framework
Loading...
Searching...
No Matches
sf_spelleffect_hook.c
Go to the documentation of this file.
1
9#include "../sf_wrappers.h"
10#include "../sf_hooks.h"
12#include "sf_spelleffect_hook.h"
13
14void __thiscall sf_spelleffect_hook(SF_CGdSpell *_this)
15{
16 uint16_t spell_index;
17 for (spell_index = 1; spell_index <= _this->max_used; ++spell_index)
18 {
19 if (_this->active_spell_list[spell_index].spell_id != 0)
20 {
21 short to_do_count =
22 _this->active_spell_list[spell_index].to_do_count;
23 if (to_do_count <= 0)
24 {
25 to_do_count = 0;
26 }
27 else
28 {
29 to_do_count = to_do_count + -1;
30 }
31 _this->active_spell_list[spell_index].to_do_count = to_do_count;
32 if (to_do_count == 0)
33 {
34 uint16_t spell_job =
35 _this->active_spell_list[spell_index].spell_job;
36 handler_ptr func = get_spell_effect(spell_job);
37 if (func != NULL)
38 {
39 func(_this, spell_index);
40 }
41 }
42 }
43 }
44}
45
void __thiscall sf_spelleffect_hook(SF_CGdSpell *_this)
void(__thiscall * handler_ptr)(SF_CGdSpell *, uint16_t)
handler_ptr get_spell_effect(uint16_t spell_job)
SF_GdSpell active_spell_list[800]