summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking
diff options
context:
space:
mode:
authorHercules.ws <Hercules@efficiently.awesome>2014-12-23 08:59:08 +0100
committerHerculesWSAPI <Hercules@efficiently.awesome>2014-12-23 08:59:08 +0100
commit6c9a4296dd8406c65b4b33dcd0c2c58cb1608301 (patch)
tree740d823c1849f92efef498457daf7f8ba5629113 /src/plugins/HPMHooking
parent474f517404484ebe1d99b1b807e3e73e72166191 (diff)
downloadhercules-6c9a4296dd8406c65b4b33dcd0c2c58cb1608301.tar.gz
hercules-6c9a4296dd8406c65b4b33dcd0c2c58cb1608301.tar.bz2
hercules-6c9a4296dd8406c65b4b33dcd0c2c58cb1608301.tar.xz
hercules-6c9a4296dd8406c65b4b33dcd0c2c58cb1608301.zip
HPM Hooks Update
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
Diffstat (limited to 'src/plugins/HPMHooking')
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc1
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc27
3 files changed, 32 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index b4c98894e..88f2a4575 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -2591,6 +2591,8 @@ struct {
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_itemdb_lookup_const_pre;
+ struct HPMHookPoint *HP_itemdb_lookup_const_post;
struct HPMHookPoint *HP_logs_pick_pc_pre;
struct HPMHookPoint *HP_logs_pick_pc_post;
struct HPMHookPoint *HP_logs_pick_mob_pre;
@@ -7672,6 +7674,8 @@ struct {
int HP_itemdb_id2combo_post;
int HP_itemdb_is_item_usable_pre;
int HP_itemdb_is_item_usable_post;
+ int HP_itemdb_lookup_const_pre;
+ int HP_itemdb_lookup_const_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 a92bf59f5..57f2f37a2 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -1314,6 +1314,7 @@ struct HookingPointData HookingPoints[] = {
{ 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) },
+ { HP_POP(itemdb->lookup_const, HP_itemdb_lookup_const) },
/* 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 cc8f95353..3f466a165 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -34317,6 +34317,33 @@ bool HP_itemdb_is_item_usable(struct item_data *item) {
}
return retVal___;
}
+bool HP_itemdb_lookup_const(const config_setting_t *it, const char *name, int *value) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if( HPMHooks.count.HP_itemdb_lookup_const_pre ) {
+ bool (*preHookFunc) (const config_setting_t *it, const char *name, int *value);
+ *HPMforce_return = false;
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_lookup_const_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_itemdb_lookup_const_pre[hIndex].func;
+ retVal___ = preHookFunc(it, name, value);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.itemdb.lookup_const(it, name, value);
+ }
+ if( HPMHooks.count.HP_itemdb_lookup_const_post ) {
+ bool (*postHookFunc) (bool retVal___, const config_setting_t *it, const char *name, int *value);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_lookup_const_post; hIndex++ ) {
+ postHookFunc = HPMHooks.list.HP_itemdb_lookup_const_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, it, name, value);
+ }
+ }
+ 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;