summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsheraf <acheraf1998@gmail.com>2018-04-17 20:18:05 +0100
committerAsheraf <acheraf1998@gmail.com>2018-04-19 03:36:35 +0100
commit0ba08c3ff910c144c3527ac6a625b7226e8c4c64 (patch)
tree478c3625a79a2e76e5968ae50153084f6d463af1
parentbe90f6c69b6ac54ee83878f603cb9bf733d29d04 (diff)
downloadhercules-0ba08c3ff910c144c3527ac6a625b7226e8c4c64.tar.gz
hercules-0ba08c3ff910c144c3527ac6a625b7226e8c4c64.tar.bz2
hercules-0ba08c3ff910c144c3527ac6a625b7226e8c4c64.tar.xz
hercules-0ba08c3ff910c144c3527ac6a625b7226e8c4c64.zip
HPM Hooks Update
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc8
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc16
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc108
4 files changed, 102 insertions, 34 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index c11c9c3c0..3abef2b05 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -5082,8 +5082,6 @@ typedef bool (*HPMHOOK_pre_mob_parse_row_chatdb) (char ***str, const char **sour
typedef bool (*HPMHOOK_post_mob_parse_row_chatdb) (bool retVal___, char **str, const char *source, int line, int *last_msg_id);
typedef void (*HPMHOOK_pre_mob_readchatdb) (void);
typedef void (*HPMHOOK_post_mob_readchatdb) (void);
-typedef bool (*HPMHOOK_pre_mob_parse_row_mobskilldb) (char ***str, int *columns, int *current);
-typedef bool (*HPMHOOK_post_mob_parse_row_mobskilldb) (bool retVal___, char **str, int columns, int current);
typedef void (*HPMHOOK_pre_mob_readskilldb) (void);
typedef void (*HPMHOOK_post_mob_readskilldb) (void);
typedef bool (*HPMHOOK_pre_mob_readdb_race2) (char **fields[], int *columns, int *current);
@@ -5096,6 +5094,12 @@ typedef void (*HPMHOOK_pre_mob_clear_spawninfo) (void);
typedef void (*HPMHOOK_post_mob_clear_spawninfo) (void);
typedef void (*HPMHOOK_pre_mob_destroy_mob_db) (int *index);
typedef void (*HPMHOOK_post_mob_destroy_mob_db) (int index);
+typedef bool (*HPMHOOK_pre_mob_skill_db_libconfig) (const char **filename, bool *ignore_missing);
+typedef bool (*HPMHOOK_post_mob_skill_db_libconfig) (bool retVal___, const char *filename, bool ignore_missing);
+typedef bool (*HPMHOOK_pre_mob_skill_db_libconfig_sub) (struct config_setting_t **it, int *n);
+typedef bool (*HPMHOOK_post_mob_skill_db_libconfig_sub) (bool retVal___, struct config_setting_t *it, int n);
+typedef bool (*HPMHOOK_pre_mob_skill_db_libconfig_sub_skill) (struct config_setting_t **it, int *n, int *mob_id);
+typedef bool (*HPMHOOK_post_mob_skill_db_libconfig_sub_skill) (bool retVal___, struct config_setting_t *it, int n, int mob_id);
#endif // MAP_MOB_H
#ifdef COMMON_MUTEX_H /* mutex */
typedef struct mutex_data* (*HPMHOOK_pre_mutex_create) (void);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index cbfaf1b65..1dcbdfa4c 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -3752,8 +3752,6 @@ struct {
struct HPMHookPoint *HP_mob_parse_row_chatdb_post;
struct HPMHookPoint *HP_mob_readchatdb_pre;
struct HPMHookPoint *HP_mob_readchatdb_post;
- struct HPMHookPoint *HP_mob_parse_row_mobskilldb_pre;
- struct HPMHookPoint *HP_mob_parse_row_mobskilldb_post;
struct HPMHookPoint *HP_mob_readskilldb_pre;
struct HPMHookPoint *HP_mob_readskilldb_post;
struct HPMHookPoint *HP_mob_readdb_race2_pre;
@@ -3766,6 +3764,12 @@ struct {
struct HPMHookPoint *HP_mob_clear_spawninfo_post;
struct HPMHookPoint *HP_mob_destroy_mob_db_pre;
struct HPMHookPoint *HP_mob_destroy_mob_db_post;
+ struct HPMHookPoint *HP_mob_skill_db_libconfig_pre;
+ struct HPMHookPoint *HP_mob_skill_db_libconfig_post;
+ struct HPMHookPoint *HP_mob_skill_db_libconfig_sub_pre;
+ struct HPMHookPoint *HP_mob_skill_db_libconfig_sub_post;
+ struct HPMHookPoint *HP_mob_skill_db_libconfig_sub_skill_pre;
+ struct HPMHookPoint *HP_mob_skill_db_libconfig_sub_skill_post;
struct HPMHookPoint *HP_mutex_create_pre;
struct HPMHookPoint *HP_mutex_create_post;
struct HPMHookPoint *HP_mutex_destroy_pre;
@@ -10071,8 +10075,6 @@ struct {
int HP_mob_parse_row_chatdb_post;
int HP_mob_readchatdb_pre;
int HP_mob_readchatdb_post;
- int HP_mob_parse_row_mobskilldb_pre;
- int HP_mob_parse_row_mobskilldb_post;
int HP_mob_readskilldb_pre;
int HP_mob_readskilldb_post;
int HP_mob_readdb_race2_pre;
@@ -10085,6 +10087,12 @@ struct {
int HP_mob_clear_spawninfo_post;
int HP_mob_destroy_mob_db_pre;
int HP_mob_destroy_mob_db_post;
+ int HP_mob_skill_db_libconfig_pre;
+ int HP_mob_skill_db_libconfig_post;
+ int HP_mob_skill_db_libconfig_sub_pre;
+ int HP_mob_skill_db_libconfig_sub_post;
+ int HP_mob_skill_db_libconfig_sub_skill_pre;
+ int HP_mob_skill_db_libconfig_sub_skill_post;
int HP_mutex_create_pre;
int HP_mutex_create_post;
int HP_mutex_destroy_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 5fdfd9e03..7e10a4bad 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -1924,13 +1924,15 @@ struct HookingPointData HookingPoints[] = {
{ 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) },
- { HP_POP(mob->parse_row_mobskilldb, HP_mob_parse_row_mobskilldb) },
{ HP_POP(mob->readskilldb, HP_mob_readskilldb) },
{ HP_POP(mob->readdb_race2, HP_mob_readdb_race2) },
{ HP_POP(mob->readdb_itemratio, HP_mob_readdb_itemratio) },
{ HP_POP(mob->load, HP_mob_load) },
{ HP_POP(mob->clear_spawninfo, HP_mob_clear_spawninfo) },
{ HP_POP(mob->destroy_mob_db, HP_mob_destroy_mob_db) },
+ { HP_POP(mob->skill_db_libconfig, HP_mob_skill_db_libconfig) },
+ { HP_POP(mob->skill_db_libconfig_sub, HP_mob_skill_db_libconfig_sub) },
+ { HP_POP(mob->skill_db_libconfig_sub_skill, HP_mob_skill_db_libconfig_sub_skill) },
/* mutex_interface */
{ HP_POP(mutex->create, HP_mutex_create) },
{ HP_POP(mutex->destroy, HP_mutex_destroy) },
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, &current);
- }
- 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;