summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-15 01:46:48 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-25 01:43:47 +0300
commit06799a7e56924dac393c71b1f9a5c4fcecf1a1f1 (patch)
tree15245b4a8242082eded4accbf3a5d9fda62171c3 /src/plugins/HPMHooking
parentccf79c7d339dcfb1b95b1adbff5f26d80c013d16 (diff)
downloadhercules-06799a7e56924dac393c71b1f9a5c4fcecf1a1f1.tar.gz
hercules-06799a7e56924dac393c71b1f9a5c4fcecf1a1f1.tar.bz2
hercules-06799a7e56924dac393c71b1f9a5c4fcecf1a1f1.tar.xz
hercules-06799a7e56924dac393c71b1f9a5c4fcecf1a1f1.zip
Update HPM hooks.
Diffstat (limited to 'src/plugins/HPMHooking')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc10
-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.inc91
4 files changed, 108 insertions, 8 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 469020fc4..88a6f826c 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -1424,6 +1424,8 @@ typedef void (*HPMHOOK_pre_clif_party_member_info) (struct party_data **p, struc
typedef void (*HPMHOOK_post_clif_party_member_info) (struct party_data *p, struct map_session_data *sd);
typedef void (*HPMHOOK_pre_clif_party_info) (struct party_data **p, struct map_session_data **sd);
typedef void (*HPMHOOK_post_clif_party_info) (struct party_data *p, struct map_session_data *sd);
+typedef void (*HPMHOOK_pre_clif_party_job_and_level) (struct map_session_data **sd);
+typedef void (*HPMHOOK_post_clif_party_job_and_level) (struct map_session_data *sd);
typedef void (*HPMHOOK_pre_clif_party_invite) (struct map_session_data **sd, struct map_session_data **tsd);
typedef void (*HPMHOOK_post_clif_party_invite) (struct map_session_data *sd, struct map_session_data *tsd);
typedef void (*HPMHOOK_pre_clif_party_inviteack) (struct map_session_data **sd, const char **nick, int *result);
@@ -2530,8 +2532,8 @@ typedef int (*HPMHOOK_pre_guild_dobreak) (struct map_session_data **sd, const ch
typedef int (*HPMHOOK_post_guild_dobreak) (int retVal___, struct map_session_data *sd, const char *name);
typedef int (*HPMHOOK_pre_guild_broken) (int *guild_id, int *flag);
typedef int (*HPMHOOK_post_guild_broken) (int retVal___, int guild_id, int flag);
-typedef int (*HPMHOOK_pre_guild_gm_change) (int *guild_id, struct map_session_data **sd);
-typedef int (*HPMHOOK_post_guild_gm_change) (int retVal___, int guild_id, struct map_session_data *sd);
+typedef int (*HPMHOOK_pre_guild_gm_change) (int *guild_id, int *char_id);
+typedef int (*HPMHOOK_post_guild_gm_change) (int retVal___, int guild_id, int char_id);
typedef int (*HPMHOOK_pre_guild_gm_changed) (int *guild_id, int *account_id, int *char_id);
typedef int (*HPMHOOK_post_guild_gm_changed) (int retVal___, int guild_id, int account_id, int char_id);
typedef void (*HPMHOOK_pre_guild_castle_map_init) (void);
@@ -5196,6 +5198,8 @@ typedef int (*HPMHOOK_pre_pc_isequip) (struct map_session_data **sd, int *n);
typedef int (*HPMHOOK_post_pc_isequip) (int retVal___, struct map_session_data *sd, int n);
typedef int (*HPMHOOK_pre_pc_equippoint) (struct map_session_data **sd, int *n);
typedef int (*HPMHOOK_post_pc_equippoint) (int retVal___, struct map_session_data *sd, int n);
+typedef int (*HPMHOOK_pre_pc_item_equippoint) (struct map_session_data **sd, struct item_data **id);
+typedef int (*HPMHOOK_post_pc_item_equippoint) (int retVal___, struct map_session_data *sd, struct item_data *id);
typedef int (*HPMHOOK_pre_pc_setinventorydata) (struct map_session_data **sd);
typedef int (*HPMHOOK_post_pc_setinventorydata) (int retVal___, struct map_session_data *sd);
typedef int (*HPMHOOK_pre_pc_checkskill) (struct map_session_data **sd, uint16 *skill_id);
@@ -5578,6 +5582,8 @@ typedef bool (*HPMHOOK_pre_pc_db_checkid) (int *class);
typedef bool (*HPMHOOK_post_pc_db_checkid) (bool retVal___, int class);
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_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 a6b98f13a..c4e48e05b 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -1062,6 +1062,8 @@ struct {
struct HPMHookPoint *HP_clif_party_member_info_post;
struct HPMHookPoint *HP_clif_party_info_pre;
struct HPMHookPoint *HP_clif_party_info_post;
+ struct HPMHookPoint *HP_clif_party_job_and_level_pre;
+ struct HPMHookPoint *HP_clif_party_job_and_level_post;
struct HPMHookPoint *HP_clif_party_invite_pre;
struct HPMHookPoint *HP_clif_party_invite_post;
struct HPMHookPoint *HP_clif_party_inviteack_pre;
@@ -4016,6 +4018,8 @@ struct {
struct HPMHookPoint *HP_pc_isequip_post;
struct HPMHookPoint *HP_pc_equippoint_pre;
struct HPMHookPoint *HP_pc_equippoint_post;
+ struct HPMHookPoint *HP_pc_item_equippoint_pre;
+ struct HPMHookPoint *HP_pc_item_equippoint_post;
struct HPMHookPoint *HP_pc_setinventorydata_pre;
struct HPMHookPoint *HP_pc_setinventorydata_post;
struct HPMHookPoint *HP_pc_checkskill_pre;
@@ -4398,6 +4402,8 @@ struct {
struct HPMHookPoint *HP_pc_db_checkid_post;
struct HPMHookPoint *HP_pc_validate_levels_pre;
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_autotrade_load_pre;
struct HPMHookPoint *HP_pc_autotrade_load_post;
struct HPMHookPoint *HP_pc_autotrade_update_pre;
@@ -7129,6 +7135,8 @@ struct {
int HP_clif_party_member_info_post;
int HP_clif_party_info_pre;
int HP_clif_party_info_post;
+ int HP_clif_party_job_and_level_pre;
+ int HP_clif_party_job_and_level_post;
int HP_clif_party_invite_pre;
int HP_clif_party_invite_post;
int HP_clif_party_inviteack_pre;
@@ -10083,6 +10091,8 @@ struct {
int HP_pc_isequip_post;
int HP_pc_equippoint_pre;
int HP_pc_equippoint_post;
+ int HP_pc_item_equippoint_pre;
+ int HP_pc_item_equippoint_post;
int HP_pc_setinventorydata_pre;
int HP_pc_setinventorydata_post;
int HP_pc_checkskill_pre;
@@ -10465,6 +10475,8 @@ struct {
int HP_pc_db_checkid_post;
int HP_pc_validate_levels_pre;
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_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 2be49919c..d26050f08 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -553,6 +553,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->party_created, HP_clif_party_created) },
{ HP_POP(clif->party_member_info, HP_clif_party_member_info) },
{ HP_POP(clif->party_info, HP_clif_party_info) },
+ { HP_POP(clif->party_job_and_level, HP_clif_party_job_and_level) },
{ HP_POP(clif->party_invite, HP_clif_party_invite) },
{ HP_POP(clif->party_inviteack, HP_clif_party_inviteack) },
{ HP_POP(clif->party_option, HP_clif_party_option) },
@@ -2063,6 +2064,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pc->reg_received, HP_pc_reg_received) },
{ HP_POP(pc->isequip, HP_pc_isequip) },
{ HP_POP(pc->equippoint, HP_pc_equippoint) },
+ { HP_POP(pc->item_equippoint, HP_pc_item_equippoint) },
{ HP_POP(pc->setinventorydata, HP_pc_setinventorydata) },
{ HP_POP(pc->checkskill, HP_pc_checkskill) },
{ HP_POP(pc->checkskill2, HP_pc_checkskill2) },
@@ -2254,6 +2256,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pc->expire_check, HP_pc_expire_check) },
{ 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->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 0ee1b2efa..970e7cd45 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -13811,6 +13811,32 @@ void HP_clif_party_info(struct party_data *p, struct map_session_data *sd) {
}
return;
}
+void HP_clif_party_job_and_level(struct map_session_data *sd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_party_job_and_level_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_job_and_level_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_party_job_and_level_pre[hIndex].func;
+ preHookFunc(&sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.party_job_and_level(sd);
+ }
+ if (HPMHooks.count.HP_clif_party_job_and_level_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_party_job_and_level_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_party_job_and_level_post[hIndex].func;
+ postHookFunc(sd);
+ }
+ }
+ return;
+}
void HP_clif_party_invite(struct map_session_data *sd, struct map_session_data *tsd) {
int hIndex = 0;
if (HPMHooks.count.HP_clif_party_invite_pre > 0) {
@@ -27994,15 +28020,15 @@ int HP_guild_broken(int guild_id, int flag) {
}
return retVal___;
}
-int HP_guild_gm_change(int guild_id, struct map_session_data *sd) {
+int HP_guild_gm_change(int guild_id, int char_id) {
int hIndex = 0;
int retVal___ = 0;
if (HPMHooks.count.HP_guild_gm_change_pre > 0) {
- int (*preHookFunc) (int *guild_id, struct map_session_data **sd);
+ int (*preHookFunc) (int *guild_id, int *char_id);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_gm_change_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_guild_gm_change_pre[hIndex].func;
- retVal___ = preHookFunc(&guild_id, &sd);
+ retVal___ = preHookFunc(&guild_id, &char_id);
}
if (*HPMforce_return) {
*HPMforce_return = false;
@@ -28010,13 +28036,13 @@ int HP_guild_gm_change(int guild_id, struct map_session_data *sd) {
}
}
{
- retVal___ = HPMHooks.source.guild.gm_change(guild_id, sd);
+ retVal___ = HPMHooks.source.guild.gm_change(guild_id, char_id);
}
if (HPMHooks.count.HP_guild_gm_change_post > 0) {
- int (*postHookFunc) (int retVal___, int guild_id, struct map_session_data *sd);
+ int (*postHookFunc) (int retVal___, int guild_id, int char_id);
for (hIndex = 0; hIndex < HPMHooks.count.HP_guild_gm_change_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_guild_gm_change_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, guild_id, sd);
+ retVal___ = postHookFunc(retVal___, guild_id, char_id);
}
}
return retVal___;
@@ -53450,6 +53476,33 @@ int HP_pc_equippoint(struct map_session_data *sd, int n) {
}
return retVal___;
}
+int HP_pc_item_equippoint(struct map_session_data *sd, struct item_data *id) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_pc_item_equippoint_pre > 0) {
+ int (*preHookFunc) (struct map_session_data **sd, struct item_data **id);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_item_equippoint_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_item_equippoint_pre[hIndex].func;
+ retVal___ = preHookFunc(&sd, &id);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.pc.item_equippoint(sd, id);
+ }
+ if (HPMHooks.count.HP_pc_item_equippoint_post > 0) {
+ int (*postHookFunc) (int retVal___, struct map_session_data *sd, struct item_data *id);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_item_equippoint_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_item_equippoint_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd, id);
+ }
+ }
+ return retVal___;
+}
int HP_pc_setinventorydata(struct map_session_data *sd) {
int hIndex = 0;
int retVal___ = 0;
@@ -58595,6 +58648,32 @@ void HP_pc_validate_levels(void) {
}
return;
}
+void HP_pc_update_job_and_level(struct map_session_data *sd) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_pc_update_job_and_level_pre > 0) {
+ void (*preHookFunc) (struct map_session_data **sd);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_update_job_and_level_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_pc_update_job_and_level_pre[hIndex].func;
+ preHookFunc(&sd);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.pc.update_job_and_level(sd);
+ }
+ if (HPMHooks.count.HP_pc_update_job_and_level_post > 0) {
+ void (*postHookFunc) (struct map_session_data *sd);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_pc_update_job_and_level_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_pc_update_job_and_level_post[hIndex].func;
+ postHookFunc(sd);
+ }
+ }
+ return;
+}
void HP_pc_autotrade_load(void) {
int hIndex = 0;
if (HPMHooks.count.HP_pc_autotrade_load_pre > 0) {