diff options
Diffstat (limited to 'src/plugins/HPMHooking/HPMHooking_map.Hooks.inc')
-rw-r--r-- | src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 254 |
1 files changed, 206 insertions, 48 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 7ae0d9d48..b05525734 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -45921,15 +45921,41 @@ void HP_mob_item_dropratio_adjust(int nameid, int mob_id, int *rate_adjust) { } return; } -bool HP_mob_parse_dbrow(char **str) { +void HP_mob_readdb(void) { + int hIndex = 0; + if( HPMHooks.count.HP_mob_readdb_pre ) { + void (*preHookFunc) (void); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mob_readdb_pre[hIndex].func; + preHookFunc(); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mob.readdb(); + } + if( HPMHooks.count.HP_mob_readdb_post ) { + void (*postHookFunc) (void); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mob_readdb_post[hIndex].func; + postHookFunc(); + } + } + return; +} +bool HP_mob_lookup_const(const config_setting_t *it, const char *name, int *value) { int hIndex = 0; bool retVal___ = false; - if( HPMHooks.count.HP_mob_parse_dbrow_pre ) { - bool (*preHookFunc) (char **str); + if( HPMHooks.count.HP_mob_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_mob_parse_dbrow_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_mob_parse_dbrow_pre[hIndex].func; - retVal___ = preHookFunc(str); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_lookup_const_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mob_lookup_const_pre[hIndex].func; + retVal___ = preHookFunc(it, name, value); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -45937,26 +45963,26 @@ bool HP_mob_parse_dbrow(char **str) { } } { - retVal___ = HPMHooks.source.mob.parse_dbrow(str); + retVal___ = HPMHooks.source.mob.lookup_const(it, name, value); } - if( HPMHooks.count.HP_mob_parse_dbrow_post ) { - bool (*postHookFunc) (bool retVal___, char **str); - for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_parse_dbrow_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_mob_parse_dbrow_post[hIndex].func; - retVal___ = postHookFunc(retVal___, str); + if( HPMHooks.count.HP_mob_lookup_const_post ) { + bool (*postHookFunc) (bool retVal___, const config_setting_t *it, const char *name, int *value); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_lookup_const_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mob_lookup_const_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, name, value); } } return retVal___; } -bool HP_mob_readdb_sub(char *fields[], int columns, int current) { +bool HP_mob_get_const(const config_setting_t *it, int *value) { int hIndex = 0; bool retVal___ = false; - if( HPMHooks.count.HP_mob_readdb_sub_pre ) { - bool (*preHookFunc) (char *fields[], int *columns, int *current); + if( HPMHooks.count.HP_mob_get_const_pre ) { + bool (*preHookFunc) (const config_setting_t *it, int *value); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_sub_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_mob_readdb_sub_pre[hIndex].func; - retVal___ = preHookFunc(fields, &columns, ¤t); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_const_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mob_get_const_pre[hIndex].func; + retVal___ = preHookFunc(it, value); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -45964,25 +45990,52 @@ bool HP_mob_readdb_sub(char *fields[], int columns, int current) { } } { - retVal___ = HPMHooks.source.mob.readdb_sub(fields, columns, current); + retVal___ = HPMHooks.source.mob.get_const(it, value); } - if( HPMHooks.count.HP_mob_readdb_sub_post ) { - bool (*postHookFunc) (bool retVal___, char *fields[], int *columns, int *current); - for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_sub_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_mob_readdb_sub_post[hIndex].func; - retVal___ = postHookFunc(retVal___, fields, &columns, ¤t); + if( HPMHooks.count.HP_mob_get_const_post ) { + bool (*postHookFunc) (bool retVal___, const config_setting_t *it, int *value); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_get_const_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mob_get_const_post[hIndex].func; + retVal___ = postHookFunc(retVal___, it, value); } } return retVal___; } -void HP_mob_readdb(void) { +int HP_mob_read_libconfig(const char *filename) { int hIndex = 0; - if( HPMHooks.count.HP_mob_readdb_pre ) { - void (*preHookFunc) (void); + int retVal___ = 0; + if( HPMHooks.count.HP_mob_read_libconfig_pre ) { + int (*preHookFunc) (const char *filename); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_mob_readdb_pre[hIndex].func; - preHookFunc(); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_libconfig_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mob_read_libconfig_pre[hIndex].func; + retVal___ = preHookFunc(filename); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mob.read_libconfig(filename); + } + if( HPMHooks.count.HP_mob_read_libconfig_post ) { + int (*postHookFunc) (int retVal___, const char *filename); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_libconfig_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mob_read_libconfig_post[hIndex].func; + retVal___ = postHookFunc(retVal___, filename); + } + } + return retVal___; +} +void HP_mob_read_db_additional_fields(struct mob_db *entry, int class_, config_setting_t *it, int n, const char *source) { + int hIndex = 0; + if( HPMHooks.count.HP_mob_read_db_additional_fields_pre ) { + void (*preHookFunc) (struct mob_db *entry, int *class_, config_setting_t *it, int *n, const char *source); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_additional_fields_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mob_read_db_additional_fields_pre[hIndex].func; + preHookFunc(entry, &class_, it, &n, source); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -45990,26 +46043,105 @@ void HP_mob_readdb(void) { } } { - HPMHooks.source.mob.readdb(); + HPMHooks.source.mob.read_db_additional_fields(entry, class_, it, n, source); } - if( HPMHooks.count.HP_mob_readdb_post ) { - void (*postHookFunc) (void); - for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_mob_readdb_post[hIndex].func; - postHookFunc(); + if( HPMHooks.count.HP_mob_read_db_additional_fields_post ) { + void (*postHookFunc) (struct mob_db *entry, int *class_, config_setting_t *it, int *n, const char *source); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_additional_fields_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mob_read_db_additional_fields_post[hIndex].func; + postHookFunc(entry, &class_, it, &n, source); + } + } + return; +} +bool HP_mob_read_db_sub(config_setting_t *mobt, int id, const char *source) { + int hIndex = 0; + bool retVal___ = false; + if( HPMHooks.count.HP_mob_read_db_sub_pre ) { + bool (*preHookFunc) (config_setting_t *mobt, int *id, const char *source); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mob_read_db_sub_pre[hIndex].func; + retVal___ = preHookFunc(mobt, &id, source); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return retVal___; + } + } + { + retVal___ = HPMHooks.source.mob.read_db_sub(mobt, id, source); + } + if( HPMHooks.count.HP_mob_read_db_sub_post ) { + bool (*postHookFunc) (bool retVal___, config_setting_t *mobt, int *id, const char *source); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mob_read_db_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, mobt, &id, source); + } + } + return retVal___; +} +void HP_mob_read_db_drops_sub(struct mob_db *entry, struct status_data *mstatus, int class_, config_setting_t *t) { + int hIndex = 0; + if( HPMHooks.count.HP_mob_read_db_drops_sub_pre ) { + void (*preHookFunc) (struct mob_db *entry, struct status_data *mstatus, int *class_, config_setting_t *t); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_drops_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mob_read_db_drops_sub_pre[hIndex].func; + preHookFunc(entry, mstatus, &class_, t); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mob.read_db_drops_sub(entry, mstatus, class_, t); + } + if( HPMHooks.count.HP_mob_read_db_drops_sub_post ) { + void (*postHookFunc) (struct mob_db *entry, struct status_data *mstatus, int *class_, config_setting_t *t); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_drops_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mob_read_db_drops_sub_post[hIndex].func; + postHookFunc(entry, mstatus, &class_, t); } } return; } -int HP_mob_read_sqldb(void) { +void HP_mob_read_db_mvpdrops_sub(struct mob_db *entry, struct status_data *mstatus, int class_, config_setting_t *t) { + int hIndex = 0; + if( HPMHooks.count.HP_mob_read_db_mvpdrops_sub_pre ) { + void (*preHookFunc) (struct mob_db *entry, struct status_data *mstatus, int *class_, config_setting_t *t); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_mvpdrops_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mob_read_db_mvpdrops_sub_pre[hIndex].func; + preHookFunc(entry, mstatus, &class_, t); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mob.read_db_mvpdrops_sub(entry, mstatus, class_, t); + } + if( HPMHooks.count.HP_mob_read_db_mvpdrops_sub_post ) { + void (*postHookFunc) (struct mob_db *entry, struct status_data *mstatus, int *class_, config_setting_t *t); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_mvpdrops_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mob_read_db_mvpdrops_sub_post[hIndex].func; + postHookFunc(entry, mstatus, &class_, t); + } + } + return; +} +int HP_mob_read_db_mode_sub(struct mob_db *entry, struct status_data *mstatus, int class_, config_setting_t *t) { int hIndex = 0; int retVal___ = 0; - if( HPMHooks.count.HP_mob_read_sqldb_pre ) { - int (*preHookFunc) (void); + if( HPMHooks.count.HP_mob_read_db_mode_sub_pre ) { + int (*preHookFunc) (struct mob_db *entry, struct status_data *mstatus, int *class_, config_setting_t *t); *HPMforce_return = false; - for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_sqldb_pre; hIndex++ ) { - preHookFunc = HPMHooks.list.HP_mob_read_sqldb_pre[hIndex].func; - retVal___ = preHookFunc(); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_mode_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mob_read_db_mode_sub_pre[hIndex].func; + retVal___ = preHookFunc(entry, mstatus, &class_, t); } if( *HPMforce_return ) { *HPMforce_return = false; @@ -46017,17 +46149,43 @@ int HP_mob_read_sqldb(void) { } } { - retVal___ = HPMHooks.source.mob.read_sqldb(); + retVal___ = HPMHooks.source.mob.read_db_mode_sub(entry, mstatus, class_, t); } - if( HPMHooks.count.HP_mob_read_sqldb_post ) { - int (*postHookFunc) (int retVal___); - for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_sqldb_post; hIndex++ ) { - postHookFunc = HPMHooks.list.HP_mob_read_sqldb_post[hIndex].func; - retVal___ = postHookFunc(retVal___); + if( HPMHooks.count.HP_mob_read_db_mode_sub_post ) { + int (*postHookFunc) (int retVal___, struct mob_db *entry, struct status_data *mstatus, int *class_, config_setting_t *t); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_mode_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mob_read_db_mode_sub_post[hIndex].func; + retVal___ = postHookFunc(retVal___, entry, mstatus, &class_, t); } } return retVal___; } +void HP_mob_read_db_stats_sub(struct mob_db *entry, struct status_data *mstatus, int class_, config_setting_t *t) { + int hIndex = 0; + if( HPMHooks.count.HP_mob_read_db_stats_sub_pre ) { + void (*preHookFunc) (struct mob_db *entry, struct status_data *mstatus, int *class_, config_setting_t *t); + *HPMforce_return = false; + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_stats_sub_pre; hIndex++ ) { + preHookFunc = HPMHooks.list.HP_mob_read_db_stats_sub_pre[hIndex].func; + preHookFunc(entry, mstatus, &class_, t); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mob.read_db_stats_sub(entry, mstatus, class_, t); + } + if( HPMHooks.count.HP_mob_read_db_stats_sub_post ) { + void (*postHookFunc) (struct mob_db *entry, struct status_data *mstatus, int *class_, config_setting_t *t); + for(hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_stats_sub_post; hIndex++ ) { + postHookFunc = HPMHooks.list.HP_mob_read_db_stats_sub_post[hIndex].func; + postHookFunc(entry, mstatus, &class_, t); + } + } + return; +} void HP_mob_name_constants(void) { int hIndex = 0; if( HPMHooks.count.HP_mob_name_constants_pre ) { |