diff options
author | shennetsind <ind@henn.et> | 2014-02-04 10:44:51 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2014-02-04 10:44:51 -0200 |
commit | 32e6f7a197fea9b4d1e6c541256814c2895a6126 (patch) | |
tree | f8c105c3cef54a343b015b991addb86b628181c3 | |
parent | 144a9eba25cd6773cd85e6446f72ca183bc8cc58 (diff) | |
parent | 619de415690980b2901e7ae10b9ab19dd98c29ae (diff) | |
download | hercules-32e6f7a197fea9b4d1e6c541256814c2895a6126.tar.gz hercules-32e6f7a197fea9b4d1e6c541256814c2895a6126.tar.bz2 hercules-32e6f7a197fea9b4d1e6c541256814c2895a6126.tar.xz hercules-32e6f7a197fea9b4d1e6c541256814c2895a6126.zip |
Merge branch 'master' of https://github.com/HerculesWS/Hercules
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc | 16 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.HookingPoints.inc | 4 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking.Hooks.inc | 102 |
3 files changed, 122 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc index 1767f103a..da77ddef0 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; @@ -5418,6 +5426,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; @@ -7594,6 +7606,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; @@ -7914,6 +7928,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; diff --git a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc index f47a9cc5d..bbd556954 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) }, diff --git a/src/plugins/HPMHooking/HPMHooking.Hooks.inc b/src/plugins/HPMHooking/HPMHooking.Hooks.inc index 9584f4960..c3c6a492f 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; @@ -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; |