summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking
diff options
context:
space:
mode:
authorAsheraf <acheraf1998@gmail.com>2019-10-29 22:06:50 +0100
committerAsheraf <acheraf1998@gmail.com>2019-10-30 12:11:14 +0100
commit5da4f38b15d6bd6b6dd68ab55a3cedfd8ae6ff25 (patch)
treefb5a4350063f6cec9011db851422573395469a5c /src/plugins/HPMHooking
parent8dc577f32d78808083e0d214e626f97413511e0f (diff)
downloadhercules-5da4f38b15d6bd6b6dd68ab55a3cedfd8ae6ff25.tar.gz
hercules-5da4f38b15d6bd6b6dd68ab55a3cedfd8ae6ff25.tar.bz2
hercules-5da4f38b15d6bd6b6dd68ab55a3cedfd8ae6ff25.tar.xz
hercules-5da4f38b15d6bd6b6dd68ab55a3cedfd8ae6ff25.zip
HPM Hooks Update
Diffstat (limited to 'src/plugins/HPMHooking')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc6
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc12
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc3
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc55
4 files changed, 54 insertions, 22 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 389d273e3..bdab2bd2c 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -5478,10 +5478,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 1196e3a99..d2bb75b74 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -4080,10 +4080,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;
@@ -10909,10 +10911,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 da72b688a..16b8b4f54 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -2089,8 +2089,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 c331d66a9..eaf37b719 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -54111,6 +54111,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) {
@@ -54137,32 +54163,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, &current);
+ 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;