diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-18 00:34:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-21 01:38:16 +0300 |
commit | 2c6fd58d633e4139a6f0f3b4bb0262e64fc957e2 (patch) | |
tree | 3c5f077c6537f7e165039d3bf68d8052253b7dc2 /src/plugins | |
parent | a75f608ed23e2d6ac06582abb833c2a874cd7815 (diff) | |
download | hercules-2c6fd58d633e4139a6f0f3b4bb0262e64fc957e2.tar.gz hercules-2c6fd58d633e4139a6f0f3b4bb0262e64fc957e2.tar.bz2 hercules-2c6fd58d633e4139a6f0f3b4bb0262e64fc957e2.tar.xz hercules-2c6fd58d633e4139a6f0f3b4bb0262e64fc957e2.zip |
Update HPM hooks.
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc | 8 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc | 2 | ||||
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 52 |
3 files changed, 62 insertions, 0 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index 7b9eadb91..b4c98894e 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -2567,6 +2567,8 @@ struct { struct HPMHookPoint *HP_itemdb_gendercheck_post; struct HPMHookPoint *HP_itemdb_validate_entry_pre; struct HPMHookPoint *HP_itemdb_validate_entry_post; + struct HPMHookPoint *HP_itemdb_readdb_additional_fields_pre; + struct HPMHookPoint *HP_itemdb_readdb_additional_fields_post; struct HPMHookPoint *HP_itemdb_readdb_sql_sub_pre; struct HPMHookPoint *HP_itemdb_readdb_sql_sub_post; struct HPMHookPoint *HP_itemdb_readdb_libconfig_sub_pre; @@ -3191,6 +3193,8 @@ struct { struct HPMHookPoint *HP_mob_load_post; struct HPMHookPoint *HP_mob_clear_spawninfo_pre; struct HPMHookPoint *HP_mob_clear_spawninfo_post; + struct HPMHookPoint *HP_mob_destroy_mob_db_pre; + struct HPMHookPoint *HP_mob_destroy_mob_db_post; struct HPMHookPoint *HP_npc_init_pre; struct HPMHookPoint *HP_npc_init_post; struct HPMHookPoint *HP_npc_final_pre; @@ -7644,6 +7648,8 @@ struct { int HP_itemdb_gendercheck_post; int HP_itemdb_validate_entry_pre; int HP_itemdb_validate_entry_post; + int HP_itemdb_readdb_additional_fields_pre; + int HP_itemdb_readdb_additional_fields_post; int HP_itemdb_readdb_sql_sub_pre; int HP_itemdb_readdb_sql_sub_post; int HP_itemdb_readdb_libconfig_sub_pre; @@ -8268,6 +8274,8 @@ struct { int HP_mob_load_post; int HP_mob_clear_spawninfo_pre; int HP_mob_clear_spawninfo_post; + int HP_mob_destroy_mob_db_pre; + int HP_mob_destroy_mob_db_post; int HP_npc_init_pre; int HP_npc_init_post; int HP_npc_final_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 58af99107..a92bf59f5 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -1302,6 +1302,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(itemdb->read_combos, HP_itemdb_read_combos) }, { HP_POP(itemdb->gendercheck, HP_itemdb_gendercheck) }, { HP_POP(itemdb->validate_entry, HP_itemdb_validate_entry) }, + { HP_POP(itemdb->readdb_additional_fields, HP_itemdb_readdb_additional_fields) }, { HP_POP(itemdb->readdb_sql_sub, HP_itemdb_readdb_sql_sub) }, { HP_POP(itemdb->readdb_libconfig_sub, HP_itemdb_readdb_libconfig_sub) }, { HP_POP(itemdb->readdb_libconfig, HP_itemdb_readdb_libconfig) }, @@ -1621,6 +1622,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mob->readdb_itemratio, HP_mob_readdb_itemratio) }, { HP_POP(mob->load, HP_mob_load) }, { HP_POP(mob->clear_spawninfo, HP_mob_clear_spawninfo) }, + { HP_POP(mob->destroy_mob_db, HP_mob_destroy_mob_db) }, /* npc */ { HP_POP(npc->init, HP_npc_init) }, { HP_POP(npc->final, HP_npc_final) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 62b1be620..cc8f95353 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -33991,6 +33991,32 @@ int HP_itemdb_validate_entry(struct item_data *entry, int n, const char *source) } return retVal___; } +void HP_itemdb_readdb_additional_fields(int itemid, config_setting_t *it, int n, const char *source) { + int hIndex = 0; + if( HPMHooks.count.HP_itemdb_readdb_additional_fields_pre ) { + void (*preHookFunc) (int *itemid, config_setting_t *it, int *n, const char *source); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_additional_fields_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_itemdb_readdb_additional_fields_pre[hIndex].func; + preHookFunc(&itemid, it, &n, source); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.itemdb.readdb_additional_fields(itemid, it, n, source); + } + if( HPMHooks.count.HP_itemdb_readdb_additional_fields_post ) { + void (*postHookFunc) (int *itemid, config_setting_t *it, int *n, const char *source); + for(hIndex = 0; hIndex < HPMHooks.count.HP_itemdb_readdb_additional_fields_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_itemdb_readdb_additional_fields_post[hIndex].func; + postHookFunc(&itemid, it, &n, source); + } + } + return; +} int HP_itemdb_readdb_sql_sub(Sql *handle, int n, const char *source) { int hIndex = 0; int retVal___ = 0; @@ -42588,6 +42614,32 @@ void HP_mob_clear_spawninfo(void) { } return; } +void HP_mob_destroy_mob_db(int index) { + int hIndex = 0; + if( HPMHooks.count.HP_mob_destroy_mob_db_pre ) { + void (*preHookFunc) (int *index); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_destroy_mob_db_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mob_destroy_mob_db_pre[hIndex].func; + preHookFunc(&index); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mob.destroy_mob_db(index); + } + if( HPMHooks.count.HP_mob_destroy_mob_db_post ) { + void (*postHookFunc) (int *index); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_destroy_mob_db_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mob_destroy_mob_db_post[hIndex].func; + postHookFunc(&index); + } + } + return; +} /* npc */ int HP_npc_init(bool minimal) { int hIndex = 0; |