summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHercules.ws <dev@herc.ws>2018-06-03 22:47:34 +0200
committerHerculesWSAPI <dev@herc.ws>2018-06-03 22:47:34 +0200
commit1670e2b6e5eca660d73aafb8cbb4830bd453e79e (patch)
tree0e85fe9041895b1b34366d87d4b98b570adbc7a7
parent4cdc2b379e486c7e436330f56fcbff386b580150 (diff)
downloadhercules-1670e2b6e5eca660d73aafb8cbb4830bd453e79e.tar.gz
hercules-1670e2b6e5eca660d73aafb8cbb4830bd453e79e.tar.bz2
hercules-1670e2b6e5eca660d73aafb8cbb4830bd453e79e.tar.xz
hercules-1670e2b6e5eca660d73aafb8cbb4830bd453e79e.zip
HPM Hooks Update
Signed-off-by: HerculesWSAPI <dev@herc.ws>
-rw-r--r--src/common/HPMDataCheck.h2
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc12
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc24
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc6
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc160
5 files changed, 204 insertions, 0 deletions
diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h
index 0a54038b5..e82f9fed3 100644
--- a/src/common/HPMDataCheck.h
+++ b/src/common/HPMDataCheck.h
@@ -722,6 +722,8 @@ HPExport const struct s_HPMDataCheck HPMDataCheck[] = {
#endif // MAP_PC_GROUPS_H
#ifdef MAP_PC_H
{ "autotrade_vending", sizeof(struct autotrade_vending), SERVER_TYPE_MAP },
+ { "class_exp_group", sizeof(struct class_exp_group), SERVER_TYPE_MAP },
+ { "class_exp_tables", sizeof(struct class_exp_tables), SERVER_TYPE_MAP },
{ "item_cd", sizeof(struct item_cd), SERVER_TYPE_MAP },
{ "map_session_data", sizeof(struct map_session_data), SERVER_TYPE_MAP },
{ "pc_combos", sizeof(struct pc_combos), SERVER_TYPE_MAP },
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 82d2c5563..1884507b2 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -5838,6 +5838,12 @@ typedef int (*HPMHOOK_pre_pc_set_hate_mob) (struct map_session_data **sd, int *p
typedef int (*HPMHOOK_post_pc_set_hate_mob) (int retVal___, struct map_session_data *sd, int pos, struct block_list *bl);
typedef int (*HPMHOOK_pre_pc_readdb) (void);
typedef int (*HPMHOOK_post_pc_readdb) (int retVal___);
+typedef bool (*HPMHOOK_pre_pc_read_exp_db) (void);
+typedef bool (*HPMHOOK_post_pc_read_exp_db) (bool retVal___);
+typedef int (*HPMHOOK_pre_pc_read_exp_db_sub) (struct config_setting_t **conf, bool *base);
+typedef int (*HPMHOOK_post_pc_read_exp_db_sub) (int retVal___, struct config_setting_t *conf, bool base);
+typedef bool (*HPMHOOK_pre_pc_read_exp_db_sub_class) (struct config_setting_t **t, bool *base);
+typedef bool (*HPMHOOK_post_pc_read_exp_db_sub_class) (bool retVal___, struct config_setting_t *t, bool base);
typedef int (*HPMHOOK_pre_pc_map_day_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
typedef int (*HPMHOOK_post_pc_map_day_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
typedef int (*HPMHOOK_pre_pc_map_night_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
@@ -5950,6 +5956,12 @@ typedef void (*HPMHOOK_pre_pc_validate_levels) (void);
typedef void (*HPMHOOK_post_pc_validate_levels) (void);
typedef void (*HPMHOOK_pre_pc_update_job_and_level) (struct map_session_data **sd);
typedef void (*HPMHOOK_post_pc_update_job_and_level) (struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_pc_clear_exp_groups) (void);
+typedef void (*HPMHOOK_post_pc_clear_exp_groups) (void);
+typedef void (*HPMHOOK_pre_pc_init_exp_groups) (void);
+typedef void (*HPMHOOK_post_pc_init_exp_groups) (void);
+typedef bool (*HPMHOOK_pre_pc_job_is_dummy) (int *job);
+typedef bool (*HPMHOOK_post_pc_job_is_dummy) (bool retVal___, int job);
typedef void (*HPMHOOK_pre_pc_autotrade_load) (void);
typedef void (*HPMHOOK_post_pc_autotrade_load) (void);
typedef void (*HPMHOOK_pre_pc_autotrade_update) (struct map_session_data **sd, enum e_pc_autotrade_update_action *action);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 747ec357e..5c8fc9d68 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -4494,6 +4494,12 @@ struct {
struct HPMHookPoint *HP_pc_set_hate_mob_post;
struct HPMHookPoint *HP_pc_readdb_pre;
struct HPMHookPoint *HP_pc_readdb_post;
+ struct HPMHookPoint *HP_pc_read_exp_db_pre;
+ struct HPMHookPoint *HP_pc_read_exp_db_post;
+ struct HPMHookPoint *HP_pc_read_exp_db_sub_pre;
+ struct HPMHookPoint *HP_pc_read_exp_db_sub_post;
+ struct HPMHookPoint *HP_pc_read_exp_db_sub_class_pre;
+ struct HPMHookPoint *HP_pc_read_exp_db_sub_class_post;
struct HPMHookPoint *HP_pc_map_day_timer_pre;
struct HPMHookPoint *HP_pc_map_day_timer_post;
struct HPMHookPoint *HP_pc_map_night_timer_pre;
@@ -4606,6 +4612,12 @@ struct {
struct HPMHookPoint *HP_pc_validate_levels_post;
struct HPMHookPoint *HP_pc_update_job_and_level_pre;
struct HPMHookPoint *HP_pc_update_job_and_level_post;
+ struct HPMHookPoint *HP_pc_clear_exp_groups_pre;
+ struct HPMHookPoint *HP_pc_clear_exp_groups_post;
+ struct HPMHookPoint *HP_pc_init_exp_groups_pre;
+ struct HPMHookPoint *HP_pc_init_exp_groups_post;
+ struct HPMHookPoint *HP_pc_job_is_dummy_pre;
+ struct HPMHookPoint *HP_pc_job_is_dummy_post;
struct HPMHookPoint *HP_pc_autotrade_load_pre;
struct HPMHookPoint *HP_pc_autotrade_load_post;
struct HPMHookPoint *HP_pc_autotrade_update_pre;
@@ -10839,6 +10851,12 @@ struct {
int HP_pc_set_hate_mob_post;
int HP_pc_readdb_pre;
int HP_pc_readdb_post;
+ int HP_pc_read_exp_db_pre;
+ int HP_pc_read_exp_db_post;
+ int HP_pc_read_exp_db_sub_pre;
+ int HP_pc_read_exp_db_sub_post;
+ int HP_pc_read_exp_db_sub_class_pre;
+ int HP_pc_read_exp_db_sub_class_post;
int HP_pc_map_day_timer_pre;
int HP_pc_map_day_timer_post;
int HP_pc_map_night_timer_pre;
@@ -10951,6 +10969,12 @@ struct {
int HP_pc_validate_levels_post;
int HP_pc_update_job_and_level_pre;
int HP_pc_update_job_and_level_post;
+ int HP_pc_clear_exp_groups_pre;
+ int HP_pc_clear_exp_groups_post;
+ int HP_pc_init_exp_groups_pre;
+ int HP_pc_init_exp_groups_post;
+ int HP_pc_job_is_dummy_pre;
+ int HP_pc_job_is_dummy_post;
int HP_pc_autotrade_load_pre;
int HP_pc_autotrade_load_post;
int HP_pc_autotrade_update_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 06c1b2c88..64f9a39e0 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -2303,6 +2303,9 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pc->famelist_type, HP_pc_famelist_type) },
{ HP_POP(pc->set_hate_mob, HP_pc_set_hate_mob) },
{ HP_POP(pc->readdb, HP_pc_readdb) },
+ { HP_POP(pc->read_exp_db, HP_pc_read_exp_db) },
+ { HP_POP(pc->read_exp_db_sub, HP_pc_read_exp_db_sub) },
+ { HP_POP(pc->read_exp_db_sub_class, HP_pc_read_exp_db_sub_class) },
{ HP_POP(pc->map_day_timer, HP_pc_map_day_timer) },
{ HP_POP(pc->map_night_timer, HP_pc_map_night_timer) },
{ HP_POP(pc->inventory_rentals, HP_pc_inventory_rentals) },
@@ -2359,6 +2362,9 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pc->db_checkid, HP_pc_db_checkid) },
{ HP_POP(pc->validate_levels, HP_pc_validate_levels) },
{ HP_POP(pc->update_job_and_level, HP_pc_update_job_and_level) },
+ { HP_POP(pc->clear_exp_groups, HP_pc_clear_exp_groups) },
+ { HP_POP(pc->init_exp_groups, HP_pc_init_exp_groups) },
+ { HP_POP(pc->job_is_dummy, HP_pc_job_is_dummy) },
{ HP_POP(pc->autotrade_load, HP_pc_autotrade_load) },
{ HP_POP(pc->autotrade_update, HP_pc_autotrade_update) },
{ HP_POP(pc->autotrade_start, HP_pc_autotrade_start) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index cdb1df7f2..e39dc4c2c 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -59824,6 +59824,87 @@ int HP_pc_readdb(void) {
}
return retVal___;
}
+bool HP_pc_read_exp_db(void) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_pc_read_exp_db_pre > 0) {
+ bool (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_read_exp_db_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_read_exp_db_pre[hIndex].func;
+ retVal___ = preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.pc.read_exp_db();
+ }
+ if (HPMHooks.count.HP_pc_read_exp_db_post > 0) {
+ bool (*postHookFunc) (bool retVal___);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_read_exp_db_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_read_exp_db_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___);
+ }
+ }
+ return retVal___;
+}
+int HP_pc_read_exp_db_sub(struct config_setting_t *conf, bool base) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_pc_read_exp_db_sub_pre > 0) {
+ int (*preHookFunc) (struct config_setting_t **conf, bool *base);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_read_exp_db_sub_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_read_exp_db_sub_pre[hIndex].func;
+ retVal___ = preHookFunc(&conf, &base);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.pc.read_exp_db_sub(conf, base);
+ }
+ if (HPMHooks.count.HP_pc_read_exp_db_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct config_setting_t *conf, bool base);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_read_exp_db_sub_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_read_exp_db_sub_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, conf, base);
+ }
+ }
+ return retVal___;
+}
+bool HP_pc_read_exp_db_sub_class(struct config_setting_t *t, bool base) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_pc_read_exp_db_sub_class_pre > 0) {
+ bool (*preHookFunc) (struct config_setting_t **t, bool *base);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_read_exp_db_sub_class_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_read_exp_db_sub_class_pre[hIndex].func;
+ retVal___ = preHookFunc(&t, &base);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.pc.read_exp_db_sub_class(t, base);
+ }
+ if (HPMHooks.count.HP_pc_read_exp_db_sub_class_post > 0) {
+ bool (*postHookFunc) (bool retVal___, struct config_setting_t *t, bool base);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_read_exp_db_sub_class_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_read_exp_db_sub_class_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, t, base);
+ }
+ }
+ return retVal___;
+}
int HP_pc_map_day_timer(int tid, int64 tick, int id, intptr_t data) {
int hIndex = 0;
int retVal___ = 0;
@@ -61341,6 +61422,85 @@ void HP_pc_update_job_and_level(struct map_session_data *sd) {
}
return;
}
+void HP_pc_clear_exp_groups(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_pc_clear_exp_groups_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_clear_exp_groups_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_clear_exp_groups_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.pc.clear_exp_groups();
+ }
+ if (HPMHooks.count.HP_pc_clear_exp_groups_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_clear_exp_groups_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_clear_exp_groups_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+void HP_pc_init_exp_groups(void) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_pc_init_exp_groups_pre > 0) {
+ void (*preHookFunc) (void);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_init_exp_groups_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_init_exp_groups_pre[hIndex].func;
+ preHookFunc();
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.pc.init_exp_groups();
+ }
+ if (HPMHooks.count.HP_pc_init_exp_groups_post > 0) {
+ void (*postHookFunc) (void);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_init_exp_groups_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_init_exp_groups_post[hIndex].func;
+ postHookFunc();
+ }
+ }
+ return;
+}
+bool HP_pc_job_is_dummy(int job) {
+ int hIndex = 0;
+ bool retVal___ = false;
+ if (HPMHooks.count.HP_pc_job_is_dummy_pre > 0) {
+ bool (*preHookFunc) (int *job);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_job_is_dummy_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_job_is_dummy_pre[hIndex].func;
+ retVal___ = preHookFunc(&job);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.pc.job_is_dummy(job);
+ }
+ if (HPMHooks.count.HP_pc_job_is_dummy_post > 0) {
+ bool (*postHookFunc) (bool retVal___, int job);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_job_is_dummy_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_job_is_dummy_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, job);
+ }
+ }
+ return retVal___;
+}
void HP_pc_autotrade_load(void) {
int hIndex = 0;
if (HPMHooks.count.HP_pc_autotrade_load_pre > 0) {