From 445bb7d0595832b3fed3ad3218073c4f6b6bb207 Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Tue, 16 Dec 2014 21:05:23 +0100 Subject: HPM Hooks Update Signed-off-by: HerculesWSAPI --- src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc') diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 5d0545f82..e615b9767 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1629,6 +1629,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(npc->isnear, HP_npc_isnear) }, { HP_POP(npc->ontouch_event, HP_npc_ontouch_event) }, { HP_POP(npc->ontouch2_event, HP_npc_ontouch2_event) }, + { HP_POP(npc->onuntouch_event, HP_npc_onuntouch_event) }, { HP_POP(npc->enable_sub, HP_npc_enable_sub) }, { HP_POP(npc->enable, HP_npc_enable) }, { HP_POP(npc->name2id, HP_npc_name2id) }, @@ -1653,6 +1654,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(npc->touch_areanpc_sub, HP_npc_touch_areanpc_sub) }, { HP_POP(npc->touchnext_areanpc, HP_npc_touchnext_areanpc) }, { HP_POP(npc->touch_areanpc, HP_npc_touch_areanpc) }, + { HP_POP(npc->untouch_areanpc, HP_npc_untouch_areanpc) }, { HP_POP(npc->touch_areanpc2, HP_npc_touch_areanpc2) }, { HP_POP(npc->check_areanpc, HP_npc_check_areanpc) }, { HP_POP(npc->checknear, HP_npc_checknear) }, -- cgit v1.2.3-60-g2f50 From dd6393551b6c93a9c6ebf9fcbe45c3eecf89dc81 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 17 Dec 2014 00:38:15 +0300 Subject: Update HPM hooks. --- .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 4 ++++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 1 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 27 ++++++++++++++++++++++ 3 files changed, 32 insertions(+) (limited to 'src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc') diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index a68afc9ed..7b9eadb91 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -2587,6 +2587,8 @@ struct { struct HPMHookPoint *HP_itemdb_clear_post; struct HPMHookPoint *HP_itemdb_id2combo_pre; struct HPMHookPoint *HP_itemdb_id2combo_post; + struct HPMHookPoint *HP_itemdb_is_item_usable_pre; + struct HPMHookPoint *HP_itemdb_is_item_usable_post; struct HPMHookPoint *HP_logs_pick_pc_pre; struct HPMHookPoint *HP_logs_pick_pc_post; struct HPMHookPoint *HP_logs_pick_mob_pre; @@ -7662,6 +7664,8 @@ struct { int HP_itemdb_clear_post; int HP_itemdb_id2combo_pre; int HP_itemdb_id2combo_post; + int HP_itemdb_is_item_usable_pre; + int HP_itemdb_is_item_usable_post; int HP_logs_pick_pc_pre; int HP_logs_pick_pc_post; int HP_logs_pick_mob_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index e615b9767..58af99107 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1312,6 +1312,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(itemdb->final_sub, HP_itemdb_final_sub) }, { HP_POP(itemdb->clear, HP_itemdb_clear) }, { HP_POP(itemdb->id2combo, HP_itemdb_id2combo) }, + { HP_POP(itemdb->is_item_usable, HP_itemdb_is_item_usable) }, /* logs */ { HP_POP(logs->pick_pc, HP_logs_pick_pc) }, { HP_POP(logs->pick_mob, HP_logs_pick_mob) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index cf4e0e871..62b1be620 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -34264,6 +34264,33 @@ struct item_combo* HP_itemdb_id2combo(unsigned short id) { } return retVal___; } +bool HP_itemdb_is_item_usable(struct item_data *item) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_itemdb_is_item_usable_pre ) { + bool (*preHookFunc) (struct item_data *item); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_is_item_usable_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_itemdb_is_item_usable_pre[hIndex].func; + retVal___ = preHookFunc(item); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.itemdb.is_item_usable(item); + } + if( HPMHooks.count.HP_itemdb_is_item_usable_post ) { + bool (*postHookFunc) (bool retVal___, struct item_data *item); + for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_is_item_usable_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_itemdb_is_item_usable_post[hIndex].func; + retVal___ = postHookFunc(retVal___, item); + } + } + 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; -- cgit v1.2.3-60-g2f50