summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAsheraf <acheraf1998@gmail.com>2018-06-30 00:42:45 +0100
committerAsheraf <acheraf1998@gmail.com>2018-06-30 00:43:07 +0100
commit096a0398183203cfc23060a33950746f8d4dd0a0 (patch)
treec84899e0c9071cd34f81942b7726c081f649354d /src
parentdff7e258eb1e4eefc5d455212a912fe454b7d3d3 (diff)
downloadhercules-096a0398183203cfc23060a33950746f8d4dd0a0.tar.gz
hercules-096a0398183203cfc23060a33950746f8d4dd0a0.tar.bz2
hercules-096a0398183203cfc23060a33950746f8d4dd0a0.tar.xz
hercules-096a0398183203cfc23060a33950746f8d4dd0a0.zip
HPM Hooks Update
Diffstat (limited to 'src')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc6
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc4
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc1
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc36
4 files changed, 40 insertions, 7 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 8aa1c6512..ceff001ea 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -1446,8 +1446,10 @@ typedef void (*HPMHOOK_pre_clif_messagecolor_self) (int *fd, uint32 *color, cons
typedef void (*HPMHOOK_post_clif_messagecolor_self) (int fd, uint32 color, const char *msg);
typedef void (*HPMHOOK_pre_clif_messagecolor) (struct block_list **bl, uint32 *color, const char **msg);
typedef void (*HPMHOOK_post_clif_messagecolor) (struct block_list *bl, uint32 color, const char *msg);
-typedef void (*HPMHOOK_pre_clif_disp_overhead) (struct block_list **bl, const char **mes);
-typedef void (*HPMHOOK_post_clif_disp_overhead) (struct block_list *bl, const char *mes);
+typedef void (*HPMHOOK_pre_clif_disp_overhead) (struct block_list **bl, const char **mes, enum send_target *target, struct block_list **target_bl);
+typedef void (*HPMHOOK_post_clif_disp_overhead) (struct block_list *bl, const char *mes, enum send_target target, struct block_list *target_bl);
+typedef void (*HPMHOOK_pre_clif_notify_playerchat) (struct block_list **bl, const char **mes);
+typedef void (*HPMHOOK_post_clif_notify_playerchat) (struct block_list *bl, const char *mes);
typedef void (*HPMHOOK_pre_clif_msgtable) (struct map_session_data **sd, enum clif_messages *msg_id);
typedef void (*HPMHOOK_post_clif_msgtable) (struct map_session_data *sd, enum clif_messages msg_id);
typedef void (*HPMHOOK_pre_clif_msgtable_num) (struct map_session_data **sd, enum clif_messages *msg_id, int *value);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 803948d89..94e86df4d 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -1044,6 +1044,8 @@ struct {
struct HPMHookPoint *HP_clif_messagecolor_post;
struct HPMHookPoint *HP_clif_disp_overhead_pre;
struct HPMHookPoint *HP_clif_disp_overhead_post;
+ struct HPMHookPoint *HP_clif_notify_playerchat_pre;
+ struct HPMHookPoint *HP_clif_notify_playerchat_post;
struct HPMHookPoint *HP_clif_msgtable_pre;
struct HPMHookPoint *HP_clif_msgtable_post;
struct HPMHookPoint *HP_clif_msgtable_num_pre;
@@ -7431,6 +7433,8 @@ struct {
int HP_clif_messagecolor_post;
int HP_clif_disp_overhead_pre;
int HP_clif_disp_overhead_post;
+ int HP_clif_notify_playerchat_pre;
+ int HP_clif_notify_playerchat_post;
int HP_clif_msgtable_pre;
int HP_clif_msgtable_post;
int HP_clif_msgtable_num_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 2658bef00..9135ed08d 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -545,6 +545,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->messagecolor_self, HP_clif_messagecolor_self) },
{ HP_POP(clif->messagecolor, HP_clif_messagecolor) },
{ HP_POP(clif->disp_overhead, HP_clif_disp_overhead) },
+ { HP_POP(clif->notify_playerchat, HP_clif_notify_playerchat) },
{ HP_POP(clif->msgtable, HP_clif_msgtable) },
{ HP_POP(clif->msgtable_num, HP_clif_msgtable_num) },
{ HP_POP(clif->msgtable_skill, HP_clif_msgtable_skill) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 497d1b646..c055c6c09 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -13570,14 +13570,14 @@ void HP_clif_messagecolor(struct block_list *bl, uint32 color, const char *msg)
}
return;
}
-void HP_clif_disp_overhead(struct block_list *bl, const char *mes) {
+void HP_clif_disp_overhead(struct block_list *bl, const char *mes, enum send_target target, struct block_list *target_bl) {
int hIndex = 0;
if (HPMHooks.count.HP_clif_disp_overhead_pre > 0) {
- void (*preHookFunc) (struct block_list **bl, const char **mes);
+ void (*preHookFunc) (struct block_list **bl, const char **mes, enum send_target *target, struct block_list **target_bl);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_disp_overhead_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_disp_overhead_pre[hIndex].func;
- preHookFunc(&bl, &mes);
+ preHookFunc(&bl, &mes, &target, &target_bl);
}
if (*HPMforce_return) {
*HPMforce_return = false;
@@ -13585,12 +13585,38 @@ void HP_clif_disp_overhead(struct block_list *bl, const char *mes) {
}
}
{
- HPMHooks.source.clif.disp_overhead(bl, mes);
+ HPMHooks.source.clif.disp_overhead(bl, mes, target, target_bl);
}
if (HPMHooks.count.HP_clif_disp_overhead_post > 0) {
- void (*postHookFunc) (struct block_list *bl, const char *mes);
+ void (*postHookFunc) (struct block_list *bl, const char *mes, enum send_target target, struct block_list *target_bl);
for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_disp_overhead_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_disp_overhead_post[hIndex].func;
+ postHookFunc(bl, mes, target, target_bl);
+ }
+ }
+ return;
+}
+void HP_clif_notify_playerchat(struct block_list *bl, const char *mes) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_notify_playerchat_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, const char **mes);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_notify_playerchat_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_notify_playerchat_pre[hIndex].func;
+ preHookFunc(&bl, &mes);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.notify_playerchat(bl, mes);
+ }
+ if (HPMHooks.count.HP_clif_notify_playerchat_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, const char *mes);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_notify_playerchat_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_notify_playerchat_post[hIndex].func;
postHookFunc(bl, mes);
}
}