diff options
author | Haru <haru@dotalux.com> | 2019-12-15 17:06:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-15 17:06:10 +0100 |
commit | 10e0436f36b8934772b9df575deb31ffad834f1d (patch) | |
tree | c8f6c6c86e019e7be5f092016670df27b1a7d48a /src/plugins | |
parent | ed80595290029d9f4909e50e07c99d9e7a6d6625 (diff) | |
parent | 5da4f38b15d6bd6b6dd68ab55a3cedfd8ae6ff25 (diff) | |
download | hercules-10e0436f36b8934772b9df575deb31ffad834f1d.tar.gz hercules-10e0436f36b8934772b9df575deb31ffad834f1d.tar.bz2 hercules-10e0436f36b8934772b9df575deb31ffad834f1d.tar.xz hercules-10e0436f36b8934772b9df575deb31ffad834f1d.zip |
Merge pull request #2572 from Asheraf/mobviewdatadb
Add support for overriding default view data in mob database
Diffstat (limited to 'src/plugins')
4 files changed, 54 insertions, 22 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc index f878f36b8..89c9024cc 100644 --- a/src/plugins/HPMHooking/HPMHooking.Defs.inc +++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc @@ -5482,10 +5482,12 @@ typedef struct optdrop_group* (*HPMHOOK_pre_mob_read_db_drops_option) (struct mo typedef struct optdrop_group* (*HPMHOOK_post_mob_read_db_drops_option) (struct optdrop_group* retVal___, struct mob_db *entry, const char *item_name, struct config_setting_t *drop, int *drop_rate); typedef void (*HPMHOOK_pre_mob_read_db_stats_sub) (struct mob_db **entry, struct config_setting_t **t); typedef void (*HPMHOOK_post_mob_read_db_stats_sub) (struct mob_db *entry, struct config_setting_t *t); +typedef void (*HPMHOOK_pre_mob_read_db_viewdata_sub) (struct mob_db **entry, struct config_setting_t **t); +typedef void (*HPMHOOK_post_mob_read_db_viewdata_sub) (struct mob_db *entry, struct config_setting_t *t); typedef void (*HPMHOOK_pre_mob_name_constants) (void); typedef void (*HPMHOOK_post_mob_name_constants) (void); -typedef bool (*HPMHOOK_pre_mob_readdb_mobavail) (char **str[], int *columns, int *current); -typedef bool (*HPMHOOK_post_mob_readdb_mobavail) (bool retVal___, char *str[], int columns, int current); +typedef void (*HPMHOOK_pre_mob_mobavail_removal_notice) (void); +typedef void (*HPMHOOK_post_mob_mobavail_removal_notice) (void); typedef int (*HPMHOOK_pre_mob_read_randommonster) (void); typedef int (*HPMHOOK_post_mob_read_randommonster) (int retVal___); typedef bool (*HPMHOOK_pre_mob_parse_row_chatdb) (char ***str, const char **source, int *line, int **last_msg_id); diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index ce716729a..9c4fe9b6f 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -4084,10 +4084,12 @@ struct { struct HPMHookPoint *HP_mob_read_db_drops_option_post; struct HPMHookPoint *HP_mob_read_db_stats_sub_pre; struct HPMHookPoint *HP_mob_read_db_stats_sub_post; + struct HPMHookPoint *HP_mob_read_db_viewdata_sub_pre; + struct HPMHookPoint *HP_mob_read_db_viewdata_sub_post; struct HPMHookPoint *HP_mob_name_constants_pre; struct HPMHookPoint *HP_mob_name_constants_post; - struct HPMHookPoint *HP_mob_readdb_mobavail_pre; - struct HPMHookPoint *HP_mob_readdb_mobavail_post; + struct HPMHookPoint *HP_mob_mobavail_removal_notice_pre; + struct HPMHookPoint *HP_mob_mobavail_removal_notice_post; struct HPMHookPoint *HP_mob_read_randommonster_pre; struct HPMHookPoint *HP_mob_read_randommonster_post; struct HPMHookPoint *HP_mob_parse_row_chatdb_pre; @@ -10919,10 +10921,12 @@ struct { int HP_mob_read_db_drops_option_post; int HP_mob_read_db_stats_sub_pre; int HP_mob_read_db_stats_sub_post; + int HP_mob_read_db_viewdata_sub_pre; + int HP_mob_read_db_viewdata_sub_post; int HP_mob_name_constants_pre; int HP_mob_name_constants_post; - int HP_mob_readdb_mobavail_pre; - int HP_mob_readdb_mobavail_post; + int HP_mob_mobavail_removal_notice_pre; + int HP_mob_mobavail_removal_notice_post; int HP_mob_read_randommonster_pre; int HP_mob_read_randommonster_post; int HP_mob_parse_row_chatdb_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index f29820952..99e3fd5a1 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2091,8 +2091,9 @@ struct HookingPointData HookingPoints[] = { { HP_POP(mob->read_db_mode_sub, HP_mob_read_db_mode_sub) }, { HP_POP(mob->read_db_drops_option, HP_mob_read_db_drops_option) }, { HP_POP(mob->read_db_stats_sub, HP_mob_read_db_stats_sub) }, + { HP_POP(mob->read_db_viewdata_sub, HP_mob_read_db_viewdata_sub) }, { HP_POP(mob->name_constants, HP_mob_name_constants) }, - { HP_POP(mob->readdb_mobavail, HP_mob_readdb_mobavail) }, + { HP_POP(mob->mobavail_removal_notice, HP_mob_mobavail_removal_notice) }, { HP_POP(mob->read_randommonster, HP_mob_read_randommonster) }, { HP_POP(mob->parse_row_chatdb, HP_mob_parse_row_chatdb) }, { HP_POP(mob->readchatdb, HP_mob_readchatdb) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index bcbfb7c3e..147458d09 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -54163,6 +54163,32 @@ void HP_mob_read_db_stats_sub(struct mob_db *entry, struct config_setting_t *t) } return; } +void HP_mob_read_db_viewdata_sub(struct mob_db *entry, struct config_setting_t *t) { + int hIndex = 0; + if (HPMHooks.count.HP_mob_read_db_viewdata_sub_pre > 0) { + void (*preHookFunc) (struct mob_db **entry, struct config_setting_t **t); + *HPMforce_return = false; + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_viewdata_sub_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mob_read_db_viewdata_sub_pre[hIndex].func; + preHookFunc(&entry, &t); + } + if (*HPMforce_return) { + *HPMforce_return = false; + return; + } + } + { + HPMHooks.source.mob.read_db_viewdata_sub(entry, t); + } + if (HPMHooks.count.HP_mob_read_db_viewdata_sub_post > 0) { + void (*postHookFunc) (struct mob_db *entry, struct config_setting_t *t); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_read_db_viewdata_sub_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mob_read_db_viewdata_sub_post[hIndex].func; + postHookFunc(entry, t); + } + } + return; +} void HP_mob_name_constants(void) { int hIndex = 0; if (HPMHooks.count.HP_mob_name_constants_pre > 0) { @@ -54189,32 +54215,31 @@ void HP_mob_name_constants(void) { } return; } -bool HP_mob_readdb_mobavail(char *str[], int columns, int current) { +void HP_mob_mobavail_removal_notice(void) { int hIndex = 0; - bool retVal___ = false; - if (HPMHooks.count.HP_mob_readdb_mobavail_pre > 0) { - bool (*preHookFunc) (char **str[], int *columns, int *current); + if (HPMHooks.count.HP_mob_mobavail_removal_notice_pre > 0) { + void (*preHookFunc) (void); *HPMforce_return = false; - for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_mobavail_pre; hIndex++) { - preHookFunc = HPMHooks.list.HP_mob_readdb_mobavail_pre[hIndex].func; - retVal___ = preHookFunc(&str, &columns, ¤t); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_mobavail_removal_notice_pre; hIndex++) { + preHookFunc = HPMHooks.list.HP_mob_mobavail_removal_notice_pre[hIndex].func; + preHookFunc(); } if (*HPMforce_return) { *HPMforce_return = false; - return retVal___; + return; } } { - retVal___ = HPMHooks.source.mob.readdb_mobavail(str, columns, current); + HPMHooks.source.mob.mobavail_removal_notice(); } - if (HPMHooks.count.HP_mob_readdb_mobavail_post > 0) { - bool (*postHookFunc) (bool retVal___, char *str[], int columns, int current); - for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_readdb_mobavail_post; hIndex++) { - postHookFunc = HPMHooks.list.HP_mob_readdb_mobavail_post[hIndex].func; - retVal___ = postHookFunc(retVal___, str, columns, current); + if (HPMHooks.count.HP_mob_mobavail_removal_notice_post > 0) { + void (*postHookFunc) (void); + for (hIndex = 0; hIndex < HPMHooks.count.HP_mob_mobavail_removal_notice_post; hIndex++) { + postHookFunc = HPMHooks.list.HP_mob_mobavail_removal_notice_post[hIndex].func; + postHookFunc(); } } - return retVal___; + return; } int HP_mob_read_randommonster(void) { int hIndex = 0; |