From 0ba08c3ff910c144c3527ac6a625b7226e8c4c64 Mon Sep 17 00:00:00 2001 From: Asheraf Date: Tue, 17 Apr 2018 20:18:05 +0100 Subject: HPM Hooks Update --- src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 108 ++++++++++++++++++------ 1 file changed, 81 insertions(+), 27 deletions(-) (limited to 'src/plugins/HPMHooking/HPMHooking_map.Hooks.inc') diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 02cf68bd2..288d5ec52 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -49796,33 +49796,6 @@ void HP_mob_readchatdb(void) { } return; } -bool HP_mob_parse_row_mobskilldb(char **str, int columns, int current) { - int hIndex = 0; - bool retVal___ = false; - if (HPMHooks.count.HP_mob_parse_row_mobskilldb_pre > 0) { - bool (*preHookFunc) (char ***str, int *columns, int *current); - *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_parse_row_mobskilldb_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mob_parse_row_mobskilldb_pre[hIndex].func; - retVal___ = preHookFunc(&str, &columns, ¤t); - } - if (*HPMforce_return) { - *HPMforce_return = false; - return retVal___; - } - } - { - retVal___ = HPMHooks.source.mob.parse_row_mobskilldb(str, columns, current); - } - if (HPMHooks.count.HP_mob_parse_row_mobskilldb_post > 0) { - bool (*postHookFunc) (bool retVal___, char **str, int columns, int current); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_parse_row_mobskilldb_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mob_parse_row_mobskilldb_post[hIndex].func; - retVal___ = postHookFunc(retVal___, str, columns, current); - } - } - return retVal___; -} void HP_mob_readskilldb(void) { int hIndex = 0; if (HPMHooks.count.HP_mob_readskilldb_pre > 0) { @@ -49981,6 +49954,87 @@ void HP_mob_destroy_mob_db(int index) { } return; } +bool HP_mob_skill_db_libconfig(const char *filename, bool ignore_missing) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_mob_skill_db_libconfig_pre > 0) { + bool (*preHookFunc) (const char **filename, bool *ignore_missing); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_db_libconfig_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mob_skill_db_libconfig_pre[hIndex].func; + retVal___ = preHookFunc(&filename, &ignore_missing); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mob.skill_db_libconfig(filename, ignore_missing); + } + if (HPMHooks.count.HP_mob_skill_db_libconfig_post > 0) { + bool (*postHookFunc) (bool retVal___, const char *filename, bool ignore_missing); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_db_libconfig_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mob_skill_db_libconfig_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename, ignore_missing); + } + } + return retVal___; +} +bool HP_mob_skill_db_libconfig_sub(struct config_setting_t *it, int n) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_mob_skill_db_libconfig_sub_pre > 0) { + bool (*preHookFunc) (struct config_setting_t **it, int *n); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_db_libconfig_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mob_skill_db_libconfig_sub_pre[hIndex].func; + retVal___ = preHookFunc(&it, &n); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mob.skill_db_libconfig_sub(it, n); + } + if (HPMHooks.count.HP_mob_skill_db_libconfig_sub_post > 0) { + bool (*postHookFunc) (bool retVal___, struct config_setting_t *it, int n); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_db_libconfig_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mob_skill_db_libconfig_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, n); + } + } + return retVal___; +} +bool HP_mob_skill_db_libconfig_sub_skill(struct config_setting_t *it, int n, int mob_id) { + int hIndex = 0; + bool retVal___ = false; + if (HPMHooks.count.HP_mob_skill_db_libconfig_sub_skill_pre > 0) { + bool (*preHookFunc) (struct config_setting_t **it, int *n, int *mob_id); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_db_libconfig_sub_skill_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mob_skill_db_libconfig_sub_skill_pre[hIndex].func; + retVal___ = preHookFunc(&it, &n, &mob_id); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mob.skill_db_libconfig_sub_skill(it, n, mob_id); + } + if (HPMHooks.count.HP_mob_skill_db_libconfig_sub_skill_post > 0) { + bool (*postHookFunc) (bool retVal___, struct config_setting_t *it, int n, int mob_id); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_skill_db_libconfig_sub_skill_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mob_skill_db_libconfig_sub_skill_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, n, mob_id); + } + } + return retVal___; +} /* mutex_interface */ struct mutex_data* HP_mutex_create(void) { int hIndex = 0; -- cgit v1.2.3-70-g09d2