diff options
Diffstat (limited to 'src/plugins/HPMHooking')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc | 24 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HookingPoints.inc | 6 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Hooks.inc | 178 |
3 files changed, 165 insertions, 43 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc index 3dfa69d4c..ed58b79a3 100644 --- a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc @@ -397,6 +397,10 @@ struct { struct HPMHookPoint *HP_chrif_on_disconnect_post; struct HPMHookPoint *HP_chrif_parse_pre; struct HPMHookPoint *HP_chrif_parse_post; + struct HPMHookPoint *HP_chrif_save_scdata_single_pre; + struct HPMHookPoint *HP_chrif_save_scdata_single_post; + struct HPMHookPoint *HP_chrif_del_scdata_single_pre; + struct HPMHookPoint *HP_chrif_del_scdata_single_post; struct HPMHookPoint *HP_clif_init_pre; struct HPMHookPoint *HP_clif_init_post; struct HPMHookPoint *HP_clif_final_pre; @@ -2573,6 +2577,8 @@ struct { struct HPMHookPoint *HP_itemdb_final_sub_post; struct HPMHookPoint *HP_itemdb_clear_pre; struct HPMHookPoint *HP_itemdb_clear_post; + struct HPMHookPoint *HP_itemdb_id2combo_pre; + struct HPMHookPoint *HP_itemdb_id2combo_post; struct HPMHookPoint *HP_logs_pick_pc_pre; struct HPMHookPoint *HP_logs_pick_pc_post; struct HPMHookPoint *HP_logs_pick_mob_pre; @@ -2893,6 +2899,8 @@ struct { struct HPMHookPoint *HP_map_add_questinfo_post; struct HPMHookPoint *HP_map_remove_questinfo_pre; struct HPMHookPoint *HP_map_remove_questinfo_post; + struct HPMHookPoint *HP_map_merge_zone_pre; + struct HPMHookPoint *HP_map_merge_zone_post; struct HPMHookPoint *HP_mapit_alloc_pre; struct HPMHookPoint *HP_mapit_alloc_post; struct HPMHookPoint *HP_mapit_free_pre; @@ -3649,6 +3657,8 @@ struct { struct HPMHookPoint *HP_pc_gets_status_point_post; struct HPMHookPoint *HP_pc_need_status_point_pre; struct HPMHookPoint *HP_pc_need_status_point_post; + struct HPMHookPoint *HP_pc_maxparameterincrease_pre; + struct HPMHookPoint *HP_pc_maxparameterincrease_post; struct HPMHookPoint *HP_pc_statusup_pre; struct HPMHookPoint *HP_pc_statusup_post; struct HPMHookPoint *HP_pc_statusup2_pre; @@ -4225,8 +4235,6 @@ struct { struct HPMHookPoint *HP_script_soundeffect_sub_post; struct HPMHookPoint *HP_script_buildin_query_sql_sub_pre; struct HPMHookPoint *HP_script_buildin_query_sql_sub_post; - struct HPMHookPoint *HP_script_axtoi_pre; - struct HPMHookPoint *HP_script_axtoi_post; struct HPMHookPoint *HP_script_buildin_instance_warpall_sub_pre; struct HPMHookPoint *HP_script_buildin_instance_warpall_sub_post; struct HPMHookPoint *HP_script_buildin_mobuseskill_sub_pre; @@ -5416,6 +5424,10 @@ struct { int HP_chrif_on_disconnect_post; int HP_chrif_parse_pre; int HP_chrif_parse_post; + int HP_chrif_save_scdata_single_pre; + int HP_chrif_save_scdata_single_post; + int HP_chrif_del_scdata_single_pre; + int HP_chrif_del_scdata_single_post; int HP_clif_init_pre; int HP_clif_init_post; int HP_clif_final_pre; @@ -7592,6 +7604,8 @@ struct { int HP_itemdb_final_sub_post; int HP_itemdb_clear_pre; int HP_itemdb_clear_post; + int HP_itemdb_id2combo_pre; + int HP_itemdb_id2combo_post; int HP_logs_pick_pc_pre; int HP_logs_pick_pc_post; int HP_logs_pick_mob_pre; @@ -7912,6 +7926,8 @@ struct { int HP_map_add_questinfo_post; int HP_map_remove_questinfo_pre; int HP_map_remove_questinfo_post; + int HP_map_merge_zone_pre; + int HP_map_merge_zone_post; int HP_mapit_alloc_pre; int HP_mapit_alloc_post; int HP_mapit_free_pre; @@ -8668,6 +8684,8 @@ struct { int HP_pc_gets_status_point_post; int HP_pc_need_status_point_pre; int HP_pc_need_status_point_post; + int HP_pc_maxparameterincrease_pre; + int HP_pc_maxparameterincrease_post; int HP_pc_statusup_pre; int HP_pc_statusup_post; int HP_pc_statusup2_pre; @@ -9244,8 +9262,6 @@ struct { int HP_script_soundeffect_sub_post; int HP_script_buildin_query_sql_sub_pre; int HP_script_buildin_query_sql_sub_post; - int HP_script_axtoi_pre; - int HP_script_axtoi_post; int HP_script_buildin_instance_warpall_sub_pre; int HP_script_buildin_instance_warpall_sub_post; int HP_script_buildin_mobuseskill_sub_pre; diff --git a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc index 0b7201cdc..d43852d40 100644 --- a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc @@ -207,6 +207,8 @@ struct HookingPointData HookingPoints[] = { { HP_POP(chrif->on_ready, HP_chrif_on_ready) }, { HP_POP(chrif->on_disconnect, HP_chrif_on_disconnect) }, { HP_POP(chrif->parse, HP_chrif_parse) }, + { HP_POP(chrif->save_scdata_single, HP_chrif_save_scdata_single) }, + { HP_POP(chrif->del_scdata_single, HP_chrif_del_scdata_single) }, /* clif */ { HP_POP(clif->init, HP_clif_init) }, { HP_POP(clif->final, HP_clif_final) }, @@ -1305,6 +1307,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(itemdb->destroy_item_data, HP_itemdb_destroy_item_data) }, { HP_POP(itemdb->final_sub, HP_itemdb_final_sub) }, { HP_POP(itemdb->clear, HP_itemdb_clear) }, + { HP_POP(itemdb->id2combo, HP_itemdb_id2combo) }, /* logs */ { HP_POP(logs->pick_pc, HP_logs_pick_pc) }, { HP_POP(logs->pick_mob, HP_logs_pick_mob) }, @@ -1468,6 +1471,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(map->get_new_bonus_id, HP_map_get_new_bonus_id) }, { HP_POP(map->add_questinfo, HP_map_add_questinfo) }, { HP_POP(map->remove_questinfo, HP_map_remove_questinfo) }, + { HP_POP(map->merge_zone, HP_map_merge_zone) }, /* mapit */ { HP_POP(mapit->alloc, HP_mapit_alloc) }, { HP_POP(mapit->free, HP_mapit_free) }, @@ -1855,6 +1859,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(pc->thisjobexp, HP_pc_thisjobexp) }, { HP_POP(pc->gets_status_point, HP_pc_gets_status_point) }, { HP_POP(pc->need_status_point, HP_pc_need_status_point) }, + { HP_POP(pc->maxparameterincrease, HP_pc_maxparameterincrease) }, { HP_POP(pc->statusup, HP_pc_statusup) }, { HP_POP(pc->statusup2, HP_pc_statusup2) }, { HP_POP(pc->skillup, HP_pc_skillup) }, @@ -2146,7 +2151,6 @@ struct HookingPointData HookingPoints[] = { { HP_POP(script->playbgm_foreachpc_sub, HP_script_playbgm_foreachpc_sub) }, { HP_POP(script->soundeffect_sub, HP_script_soundeffect_sub) }, { HP_POP(script->buildin_query_sql_sub, HP_script_buildin_query_sql_sub) }, - { HP_POP(script->axtoi, HP_script_axtoi) }, { HP_POP(script->buildin_instance_warpall_sub, HP_script_buildin_instance_warpall_sub) }, { HP_POP(script->buildin_mobuseskill_sub, HP_script_buildin_mobuseskill_sub) }, { HP_POP(script->cleanfloor_sub, HP_script_cleanfloor_sub) }, diff --git a/src/plugins/HPMHooking/HPMHooking.Hooks.inc b/src/plugins/HPMHooking/HPMHooking.Hooks.inc index 4db53868d..2e8389d59 100644 --- a/src/plugins/HPMHooking/HPMHooking.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking.Hooks.inc @@ -5138,6 +5138,56 @@ int HP_chrif_parse(int fd) { } return retVal___; } +void HP_chrif_save_scdata_single(int account_id, int char_id, short type, struct status_change_entry *sce) { + int hIndex = 0; + if( HPMHooks.count.HP_chrif_save_scdata_single_pre ) { + void (*preHookFunc) (int *account_id, int *char_id, short *type, struct status_change_entry *sce); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_scdata_single_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chrif_save_scdata_single_pre[hIndex].func; + preHookFunc(&account_id, &char_id, &type, sce); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.chrif.save_scdata_single(account_id, char_id, type, sce); + } + if( HPMHooks.count.HP_chrif_save_scdata_single_post ) { + void (*postHookFunc) (int *account_id, int *char_id, short *type, struct status_change_entry *sce); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_save_scdata_single_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chrif_save_scdata_single_post[hIndex].func; + postHookFunc(&account_id, &char_id, &type, sce); + } + } + return; +} +void HP_chrif_del_scdata_single(int account_id, int char_id, short type) { + int hIndex = 0; + if( HPMHooks.count.HP_chrif_del_scdata_single_pre ) { + void (*preHookFunc) (int *account_id, int *char_id, short *type); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_del_scdata_single_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_chrif_del_scdata_single_pre[hIndex].func; + preHookFunc(&account_id, &char_id, &type); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.chrif.del_scdata_single(account_id, char_id, type); + } + if( HPMHooks.count.HP_chrif_del_scdata_single_post ) { + void (*postHookFunc) (int *account_id, int *char_id, short *type); + for(hIndex = 0; hIndex < HPMHooks.count.HP_chrif_del_scdata_single_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_chrif_del_scdata_single_post[hIndex].func; + postHookFunc(&account_id, &char_id, &type); + } + } + return; +} /* clif */ int HP_clif_init(bool minimal) { int hIndex = 0; @@ -10395,13 +10445,13 @@ void HP_clif_specialeffect_value(struct block_list *bl, int effect_id, int num, } return; } -void HP_clif_millenniumshield(struct map_session_data *sd, short shields) { +void HP_clif_millenniumshield(struct block_list *bl, short shields) { int hIndex = 0; if( HPMHooks.count.HP_clif_millenniumshield_pre ) { - void (*preHookFunc) (struct map_session_data *sd, short *shields); + void (*preHookFunc) (struct block_list *bl, short *shields); for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_millenniumshield_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_clif_millenniumshield_pre[hIndex].func; - preHookFunc(sd, &shields); + preHookFunc(bl, &shields); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -10409,13 +10459,13 @@ void HP_clif_millenniumshield(struct map_session_data *sd, short shields) { } } { - HPMHooks.source.clif.millenniumshield(sd, shields); + HPMHooks.source.clif.millenniumshield(bl, shields); } if( HPMHooks.count.HP_clif_millenniumshield_post ) { - void (*postHookFunc) (struct map_session_data *sd, short *shields); + void (*postHookFunc) (struct block_list *bl, short *shields); for(hIndex = 0; hIndex < HPMHooks.count.HP_clif_millenniumshield_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_clif_millenniumshield_post[hIndex].func; - postHookFunc(sd, &shields); + postHookFunc(bl, &shields); } } return; @@ -32801,6 +32851,32 @@ void HP_itemdb_clear(bool total) { } return; } +struct item_combo* HP_itemdb_id2combo(unsigned short id) { + int hIndex = 0; + struct item_combo* retVal___ = NULL; + if( HPMHooks.count.HP_itemdb_id2combo_pre ) { + struct item_combo* (*preHookFunc) (unsigned short *id); + for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_id2combo_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_itemdb_id2combo_pre[hIndex].func; + retVal___ = preHookFunc(&id); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.itemdb.id2combo(id); + } + if( HPMHooks.count.HP_itemdb_id2combo_post ) { + struct item_combo* (*postHookFunc) (struct item_combo* retVal___, unsigned short *id); + for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_id2combo_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_itemdb_id2combo_post[hIndex].func; + retVal___ = postHookFunc(retVal___, &id); + } + } + return retVal___; +} /* logs */ void HP_logs_pick_pc(struct map_session_data *sd, e_log_pick_type type, int amount, struct item *itm, struct item_data *data) { int hIndex = 0; @@ -37054,6 +37130,32 @@ bool HP_map_remove_questinfo(int m, struct npc_data *nd) { } return retVal___; } +struct map_zone_data* HP_map_merge_zone(struct map_zone_data *main, struct map_zone_data *other) { + int hIndex = 0; + struct map_zone_data* retVal___ = NULL; + if( HPMHooks.count.HP_map_merge_zone_pre ) { + struct map_zone_data* (*preHookFunc) (struct map_zone_data *main, struct map_zone_data *other); + for(hIndex = 0; hIndex < HPMHooks.count.HP_map_merge_zone_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_map_merge_zone_pre[hIndex].func; + retVal___ = preHookFunc(main, other); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.map.merge_zone(main, other); + } + if( HPMHooks.count.HP_map_merge_zone_post ) { + struct map_zone_data* (*postHookFunc) (struct map_zone_data* retVal___, struct map_zone_data *main, struct map_zone_data *other); + for(hIndex = 0; hIndex < HPMHooks.count.HP_map_merge_zone_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_map_merge_zone_post[hIndex].func; + retVal___ = postHookFunc(retVal___, main, other); + } + } + return retVal___; +} /* mapit */ struct s_mapiterator* HP_mapit_alloc(enum e_mapitflags flags, enum bl_type types) { int hIndex = 0; @@ -46994,14 +47096,40 @@ int HP_pc_need_status_point(struct map_session_data *sd, int type, int val) { } return retVal___; } -int HP_pc_statusup(struct map_session_data *sd, int type) { +int HP_pc_maxparameterincrease(struct map_session_data *sd, int type) { int hIndex = 0; int retVal___ = 0; - if( HPMHooks.count.HP_pc_statusup_pre ) { + if( HPMHooks.count.HP_pc_maxparameterincrease_pre ) { int (*preHookFunc) (struct map_session_data *sd, int *type); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxparameterincrease_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_pc_maxparameterincrease_pre[hIndex].func; + retVal___ = preHookFunc(sd, &type); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.pc.maxparameterincrease(sd, type); + } + if( HPMHooks.count.HP_pc_maxparameterincrease_post ) { + int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type); + for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_maxparameterincrease_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_pc_maxparameterincrease_post[hIndex].func; + retVal___ = postHookFunc(retVal___, sd, &type); + } + } + return retVal___; +} +bool HP_pc_statusup(struct map_session_data *sd, int type, int increase) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_pc_statusup_pre ) { + bool (*preHookFunc) (struct map_session_data *sd, int *type, int *increase); for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_statusup_pre; hIndex++ ) { preHookFunc = HPMHooks.list.HP_pc_statusup_pre[hIndex].func; - retVal___ = preHookFunc(sd, &type); + retVal___ = preHookFunc(sd, &type, &increase); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -47009,13 +47137,13 @@ int HP_pc_statusup(struct map_session_data *sd, int type) { } } { - retVal___ = HPMHooks.source.pc.statusup(sd, type); + retVal___ = HPMHooks.source.pc.statusup(sd, type, increase); } if( HPMHooks.count.HP_pc_statusup_post ) { - int (*postHookFunc) (int retVal___, struct map_session_data *sd, int *type); + bool (*postHookFunc) (bool retVal___, struct map_session_data *sd, int *type, int *increase); for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_statusup_post; hIndex++ ) { postHookFunc = HPMHooks.list.HP_pc_statusup_post[hIndex].func; - retVal___ = postHookFunc(retVal___, sd, &type); + retVal___ = postHookFunc(retVal___, sd, &type, &increase); } } return retVal___; @@ -54554,32 +54682,6 @@ int HP_script_buildin_query_sql_sub(struct script_state *st, Sql *handle) { } return retVal___; } -int HP_script_axtoi(const char *hexStg) { - int hIndex = 0; - int retVal___ = 0; - if( HPMHooks.count.HP_script_axtoi_pre ) { - int (*preHookFunc) (const char *hexStg); - for(hIndex = 0; hIndex < HPMHooks.count.HP_script_axtoi_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_script_axtoi_pre[hIndex].func; - retVal___ = preHookFunc(hexStg); - } - if( *HPMforce_return ) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.script.axtoi(hexStg); - } - if( HPMHooks.count.HP_script_axtoi_post ) { - int (*postHookFunc) (int retVal___, const char *hexStg); - for(hIndex = 0; hIndex < HPMHooks.count.HP_script_axtoi_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_script_axtoi_post[hIndex].func; - retVal___ = postHookFunc(retVal___, hexStg); - } - } - return retVal___; -} int HP_script_buildin_instance_warpall_sub(struct block_list *bl, va_list ap) { int hIndex = 0; int retVal___ = 0; |