diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc | 28 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HookingPoints.inc | 7 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Hooks.inc | 205 |
3 files changed, 234 insertions, 6 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc index d26779ccb..8d5449b4b 100644 --- a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc @@ -61,6 +61,8 @@ struct { struct HPMHookPoint *HP_atcommand_doload_post; struct HPMHookPoint *HP_atcommand_base_commands_pre; struct HPMHookPoint *HP_atcommand_base_commands_post; + struct HPMHookPoint *HP_atcommand_add_pre; + struct HPMHookPoint *HP_atcommand_add_post; struct HPMHookPoint *HP_battle_init_pre; struct HPMHookPoint *HP_battle_init_post; struct HPMHookPoint *HP_battle_final_pre; @@ -2097,6 +2099,8 @@ struct { struct HPMHookPoint *HP_instance_init_post; struct HPMHookPoint *HP_instance_final_pre; struct HPMHookPoint *HP_instance_final_post; + struct HPMHookPoint *HP_instance_reload_pre; + struct HPMHookPoint *HP_instance_reload_post; struct HPMHookPoint *HP_instance_create_pre; struct HPMHookPoint *HP_instance_create_post; struct HPMHookPoint *HP_instance_add_map_pre; @@ -2107,6 +2111,12 @@ struct { struct HPMHookPoint *HP_instance_map2imap_post; struct HPMHookPoint *HP_instance_mapid2imapid_pre; struct HPMHookPoint *HP_instance_mapid2imapid_post; + struct HPMHookPoint *HP_instance_mapname2imap_pre; + struct HPMHookPoint *HP_instance_mapname2imap_post; + struct HPMHookPoint *HP_instance_map_npcsub_pre; + struct HPMHookPoint *HP_instance_map_npcsub_post; + struct HPMHookPoint *HP_instance_init_npc_pre; + struct HPMHookPoint *HP_instance_init_npc_post; struct HPMHookPoint *HP_instance_destroy_pre; struct HPMHookPoint *HP_instance_destroy_post; struct HPMHookPoint *HP_instance_start_pre; @@ -2847,6 +2857,8 @@ struct { struct HPMHookPoint *HP_map_addblcell_post; struct HPMHookPoint *HP_map_delblcell_pre; struct HPMHookPoint *HP_map_delblcell_post; + struct HPMHookPoint *HP_map_get_new_bonus_id_pre; + struct HPMHookPoint *HP_map_get_new_bonus_id_post; struct HPMHookPoint *HP_mapit_alloc_pre; struct HPMHookPoint *HP_mapit_alloc_post; struct HPMHookPoint *HP_mapit_free_pre; @@ -4511,6 +4523,8 @@ struct { struct HPMHookPoint *HP_skill_maelstrom_suction_post; struct HPMHookPoint *HP_skill_get_new_group_id_pre; struct HPMHookPoint *HP_skill_get_new_group_id_post; + struct HPMHookPoint *HP_skill_check_shadowform_pre; + struct HPMHookPoint *HP_skill_check_shadowform_post; struct HPMHookPoint *HP_status_init_pre; struct HPMHookPoint *HP_status_init_post; struct HPMHookPoint *HP_status_final_pre; @@ -4938,6 +4952,8 @@ struct { int HP_atcommand_doload_post; int HP_atcommand_base_commands_pre; int HP_atcommand_base_commands_post; + int HP_atcommand_add_pre; + int HP_atcommand_add_post; int HP_battle_init_pre; int HP_battle_init_post; int HP_battle_final_pre; @@ -6974,6 +6990,8 @@ struct { int HP_instance_init_post; int HP_instance_final_pre; int HP_instance_final_post; + int HP_instance_reload_pre; + int HP_instance_reload_post; int HP_instance_create_pre; int HP_instance_create_post; int HP_instance_add_map_pre; @@ -6984,6 +7002,12 @@ struct { int HP_instance_map2imap_post; int HP_instance_mapid2imapid_pre; int HP_instance_mapid2imapid_post; + int HP_instance_mapname2imap_pre; + int HP_instance_mapname2imap_post; + int HP_instance_map_npcsub_pre; + int HP_instance_map_npcsub_post; + int HP_instance_init_npc_pre; + int HP_instance_init_npc_post; int HP_instance_destroy_pre; int HP_instance_destroy_post; int HP_instance_start_pre; @@ -7724,6 +7748,8 @@ struct { int HP_map_addblcell_post; int HP_map_delblcell_pre; int HP_map_delblcell_post; + int HP_map_get_new_bonus_id_pre; + int HP_map_get_new_bonus_id_post; int HP_mapit_alloc_pre; int HP_mapit_alloc_post; int HP_mapit_free_pre; @@ -9388,6 +9414,8 @@ struct { int HP_skill_maelstrom_suction_post; int HP_skill_get_new_group_id_pre; int HP_skill_get_new_group_id_post; + int HP_skill_check_shadowform_pre; + int HP_skill_check_shadowform_post; int HP_status_init_pre; int HP_status_init_post; int HP_status_final_pre; diff --git a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc index 7f7d9d40d..4db9e28f2 100644 --- a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc @@ -34,6 +34,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(atcommand->cmd_db_clear_sub, HP_atcommand_cmd_db_clear_sub) }, { HP_POP(atcommand->doload, HP_atcommand_doload) }, { HP_POP(atcommand->base_commands, HP_atcommand_base_commands) }, + { HP_POP(atcommand->add, HP_atcommand_add) }, /* battle */ { HP_POP(battle->init, HP_battle_init) }, { HP_POP(battle->final, HP_battle_final) }, @@ -1064,11 +1065,15 @@ struct HookingPointData HookingPoints[] = { /* instance */ { HP_POP(instance->init, HP_instance_init) }, { HP_POP(instance->final, HP_instance_final) }, + { HP_POP(instance->reload, HP_instance_reload) }, { HP_POP(instance->create, HP_instance_create) }, { HP_POP(instance->add_map, HP_instance_add_map) }, { HP_POP(instance->del_map, HP_instance_del_map) }, { HP_POP(instance->map2imap, HP_instance_map2imap) }, { HP_POP(instance->mapid2imapid, HP_instance_mapid2imapid) }, + { HP_POP(instance->mapname2imap, HP_instance_mapname2imap) }, + { HP_POP(instance->map_npcsub, HP_instance_map_npcsub) }, + { HP_POP(instance->init_npc, HP_instance_init_npc) }, { HP_POP(instance->destroy, HP_instance_destroy) }, { HP_POP(instance->start, HP_instance_start) }, { HP_POP(instance->check_idle, HP_instance_check_idle) }, @@ -1445,6 +1450,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(map->arg_next_value, HP_map_arg_next_value) }, { HP_POP(map->addblcell, HP_map_addblcell) }, { HP_POP(map->delblcell, HP_map_delblcell) }, + { HP_POP(map->get_new_bonus_id, HP_map_get_new_bonus_id) }, /* mapit */ { HP_POP(mapit->alloc, HP_mapit_alloc) }, { HP_POP(mapit->free, HP_mapit_free) }, @@ -2290,6 +2296,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(skill->cooldown_save, HP_skill_cooldown_save) }, { HP_POP(skill->maelstrom_suction, HP_skill_maelstrom_suction) }, { HP_POP(skill->get_new_group_id, HP_skill_get_new_group_id) }, + { HP_POP(skill->check_shadowform, HP_skill_check_shadowform) }, /* status */ { HP_POP(status->init, HP_status_init) }, { HP_POP(status->final, HP_status_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking.Hooks.inc b/src/plugins/HPMHooking/HPMHooking.Hooks.inc index 8823eedae..67a3ae731 100644 --- a/src/plugins/HPMHooking/HPMHooking.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking.Hooks.inc @@ -763,6 +763,32 @@ void HP_atcommand_base_commands(void) { } return; } +bool HP_atcommand_add(char *name, AtCommandFunc func) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_atcommand_add_pre ) { + bool (*preHookFunc) (char *name, AtCommandFunc *func); + for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_add_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_atcommand_add_pre[hIndex].func; + retVal___ = preHookFunc(name, &func); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.atcommand.add(name, func); + } + if( HPMHooks.count.HP_atcommand_add_post ) { + bool (*postHookFunc) (bool retVal___, char *name, AtCommandFunc *func); + for(hIndex = 0; hIndex < HPMHooks.count.HP_atcommand_add_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_atcommand_add_post[hIndex].func; + retVal___ = postHookFunc(retVal___, name, &func); + } + } + return retVal___; +} /* battle */ void HP_battle_init(void) { int hIndex = 0; @@ -26694,6 +26720,31 @@ void HP_instance_final(void) { } return; } +void HP_instance_reload(void) { + int hIndex = 0; + if( HPMHooks.count.HP_instance_reload_pre ) { + void (*preHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_reload_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_instance_reload_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.instance.reload(); + } + if( HPMHooks.count.HP_instance_reload_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_reload_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_instance_reload_post[hIndex].func; + postHookFunc(); + } + } + return; +} int HP_instance_create(int party_id, const char *name, enum instance_owner_type type) { int hIndex = 0; int retVal___ = 0; @@ -26823,6 +26874,96 @@ int HP_instance_mapid2imapid(int16 m, int instance_id) { } return retVal___; } +int HP_instance_mapname2imap(const char *map_name, int instance_id) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_instance_mapname2imap_pre ) { + int (*preHookFunc) (const char *map_name, int *instance_id); + for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_mapname2imap_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_instance_mapname2imap_pre[hIndex].func; + retVal___ = preHookFunc(map_name, &instance_id); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.instance.mapname2imap(map_name, instance_id); + } + if( HPMHooks.count.HP_instance_mapname2imap_post ) { + int (*postHookFunc) (int retVal___, const char *map_name, int *instance_id); + for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_mapname2imap_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_instance_mapname2imap_post[hIndex].func; + retVal___ = postHookFunc(retVal___, map_name, &instance_id); + } + } + return retVal___; +} +int HP_instance_map_npcsub(struct block_list *bl, va_list args) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_instance_map_npcsub_pre ) { + int (*preHookFunc) (struct block_list *bl, va_list args); + for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_map_npcsub_pre; hIndex++ ) { + va_list args___copy; va_copy(args___copy, args); + preHookFunc = HPMHooks.list.HP_instance_map_npcsub_pre[hIndex].func; + retVal___ = preHookFunc(bl, args___copy); + va_end(args___copy); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + va_list args___copy; va_copy(args___copy, args); + retVal___ = HPMHooks.source.instance.map_npcsub(bl, args___copy); + va_end(args___copy); + } + if( HPMHooks.count.HP_instance_map_npcsub_post ) { + int (*postHookFunc) (int retVal___, struct block_list *bl, va_list args); + for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_map_npcsub_post; hIndex++ ) { + va_list args___copy; va_copy(args___copy, args); + postHookFunc = HPMHooks.list.HP_instance_map_npcsub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, bl, args___copy); + va_end(args___copy); + } + } + return retVal___; +} +int HP_instance_init_npc(struct block_list *bl, va_list args) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_instance_init_npc_pre ) { + int (*preHookFunc) (struct block_list *bl, va_list args); + for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_init_npc_pre; hIndex++ ) { + va_list args___copy; va_copy(args___copy, args); + preHookFunc = HPMHooks.list.HP_instance_init_npc_pre[hIndex].func; + retVal___ = preHookFunc(bl, args___copy); + va_end(args___copy); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + va_list args___copy; va_copy(args___copy, args); + retVal___ = HPMHooks.source.instance.init_npc(bl, args___copy); + va_end(args___copy); + } + if( HPMHooks.count.HP_instance_init_npc_post ) { + int (*postHookFunc) (int retVal___, struct block_list *bl, va_list args); + for(hIndex = 0; hIndex < HPMHooks.count.HP_instance_init_npc_post; hIndex++ ) { + va_list args___copy; va_copy(args___copy, args); + postHookFunc = HPMHooks.list.HP_instance_init_npc_post[hIndex].func; + retVal___ = postHookFunc(retVal___, bl, args___copy); + va_end(args___copy); + } + } + return retVal___; +} void HP_instance_destroy(int instance_id) { int hIndex = 0; if( HPMHooks.count.HP_instance_destroy_pre ) { @@ -36471,6 +36612,32 @@ void HP_map_delblcell(struct block_list *bl) { } return; } +int HP_map_get_new_bonus_id(void) { + int hIndex = 0; + int retVal___ = 0; + if( HPMHooks.count.HP_map_get_new_bonus_id_pre ) { + int (*preHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_map_get_new_bonus_id_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_map_get_new_bonus_id_pre[hIndex].func; + retVal___ = preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.map.get_new_bonus_id(); + } + if( HPMHooks.count.HP_map_get_new_bonus_id_post ) { + int (*postHookFunc) (int retVal___); + for(hIndex = 0; hIndex < HPMHooks.count.HP_map_get_new_bonus_id_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_map_get_new_bonus_id_post[hIndex].func; + retVal___ = postHookFunc(retVal___); + } + } + return retVal___; +} /* mapit */ struct s_mapiterator* HP_mapit_alloc(enum e_mapitflags flags, enum bl_type types) { int hIndex = 0; @@ -56265,14 +56432,14 @@ int HP_skill_castend_pos2(struct block_list *src, int x, int y, uint16 skill_id, } return retVal___; } -int HP_skill_blockpc_start(struct map_session_data *sd, uint16 skill_id, int tick, bool load) { +int HP_skill_blockpc_start(struct map_session_data *sd, uint16 skill_id, int tick) { int hIndex = 0; int retVal___ = 0; if( HPMHooks.count.HP_skill_blockpc_start_pre ) { - int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, int *tick, bool *load); + int (*preHookFunc) (struct map_session_data *sd, uint16 *skill_id, int *tick); for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockpc_start_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_skill_blockpc_start_pre[hIndex].func; - retVal___ = preHookFunc(sd, &skill_id, &tick, &load); + retVal___ = preHookFunc(sd, &skill_id, &tick); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -56280,13 +56447,13 @@ int HP_skill_blockpc_start(struct map_session_data *sd, uint16 skill_id, int tic } } { - retVal___ = HPMHooks.source.skill.blockpc_start(sd, skill_id, tick, load); + retVal___ = HPMHooks.source.skill.blockpc_start(sd, skill_id, tick); } if( HPMHooks.count.HP_skill_blockpc_start_post ) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id, int *tick, bool *load); + int (*postHookFunc) (int retVal___, struct map_session_data *sd, uint16 *skill_id, int *tick); for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_blockpc_start_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_skill_blockpc_start_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, &skill_id, &tick, &load); + retVal___ = postHookFunc(retVal___, sd, &skill_id, &tick); } } return retVal___; @@ -58454,6 +58621,32 @@ int HP_skill_get_new_group_id(void) { } return retVal___; } +bool HP_skill_check_shadowform(struct block_list *bl, int64 damage, int hit) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_skill_check_shadowform_pre ) { + bool (*preHookFunc) (struct block_list *bl, int64 *damage, int *hit); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_shadowform_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_skill_check_shadowform_pre[hIndex].func; + retVal___ = preHookFunc(bl, &damage, &hit); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.skill.check_shadowform(bl, damage, hit); + } + if( HPMHooks.count.HP_skill_check_shadowform_post ) { + bool (*postHookFunc) (bool retVal___, struct block_list *bl, int64 *damage, int *hit); + for(hIndex = 0; hIndex < HPMHooks.count.HP_skill_check_shadowform_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_skill_check_shadowform_post[hIndex].func; + retVal___ = postHookFunc(retVal___, bl, &damage, &hit); + } + } + return retVal___; +} /* status */ int HP_status_init(void) { int hIndex = 0; |