summaryrefslogtreecommitdiff
path: root/src/plugins/HPMHooking
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-10-18 16:53:38 +0200
committerGitHub <noreply@github.com>2019-10-18 16:53:38 +0200
commit9fb69836caaa3bc46ad1109c3aa9df8ee60cc6fe (patch)
tree26c58b5cbadfe5731ef1902b50e1c095b8321a66 /src/plugins/HPMHooking
parent29b587ae936fc76828cb3982de8c43caaea5fe86 (diff)
parent9e5994866305ef23628020d1605fac43305c2105 (diff)
downloadhercules-9fb69836caaa3bc46ad1109c3aa9df8ee60cc6fe.tar.gz
hercules-9fb69836caaa3bc46ad1109c3aa9df8ee60cc6fe.tar.bz2
hercules-9fb69836caaa3bc46ad1109c3aa9df8ee60cc6fe.tar.xz
hercules-9fb69836caaa3bc46ad1109c3aa9df8ee60cc6fe.zip
Merge pull request #2551 from guilherme-gm/201910-fix-sc-times
Fixes status changes effect timer when relogging
Diffstat (limited to 'src/plugins/HPMHooking')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc12
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc8
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc2
-rw-r--r--src/plugins/HPMHooking/HPMHooking_map.Hooks.inc77
4 files changed, 83 insertions, 16 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index b207e52ba..0f76ba4b0 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -1330,8 +1330,10 @@ typedef void (*HPMHOOK_pre_clif_autospell) (struct map_session_data **sd, uint16
typedef void (*HPMHOOK_post_clif_autospell) (struct map_session_data *sd, uint16 skill_lv);
typedef void (*HPMHOOK_pre_clif_combo_delay) (struct block_list **bl, int *wait);
typedef void (*HPMHOOK_post_clif_combo_delay) (struct block_list *bl, int wait);
-typedef void (*HPMHOOK_pre_clif_status_change) (struct block_list **bl, int *type, int *flag, int *tick, int *val1, int *val2, int *val3);
-typedef void (*HPMHOOK_post_clif_status_change) (struct block_list *bl, int type, int flag, int tick, int val1, int val2, int val3);
+typedef void (*HPMHOOK_pre_clif_status_change) (struct block_list **bl, int *type, int *flag, int *total_tick, int *val1, int *val2, int *val3);
+typedef void (*HPMHOOK_post_clif_status_change) (struct block_list *bl, int type, int flag, int total_tick, int val1, int val2, int val3);
+typedef void (*HPMHOOK_pre_clif_status_change_sub) (struct block_list **bl, int *type, int *flag, int *tick, int *total_tick, int *val1, int *val2, int *val3);
+typedef void (*HPMHOOK_post_clif_status_change_sub) (struct block_list *bl, int type, int flag, int tick, int total_tick, int val1, int val2, int val3);
typedef void (*HPMHOOK_pre_clif_insert_card) (struct map_session_data **sd, int *idx_equip, int *idx_card, int *flag);
typedef void (*HPMHOOK_post_clif_insert_card) (struct map_session_data *sd, int idx_equip, int idx_card, int flag);
typedef void (*HPMHOOK_pre_clif_inventoryList) (struct map_session_data **sd);
@@ -7812,6 +7814,8 @@ typedef int (*HPMHOOK_pre_status_get_sc_def) (struct block_list **src, struct bl
typedef int (*HPMHOOK_post_status_get_sc_def) (int retVal___, struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int tick, int flag);
typedef int (*HPMHOOK_pre_status_change_start) (struct block_list **src, struct block_list **bl, enum sc_type *type, int *rate, int *val1, int *val2, int *val3, int *val4, int *tick, int *flag);
typedef int (*HPMHOOK_post_status_change_start) (int retVal___, struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int val1, int val2, int val3, int val4, int tick, int flag);
+typedef int (*HPMHOOK_pre_status_change_start_sub) (struct block_list **src, struct block_list **bl, enum sc_type *type, int *rate, int *val1, int *val2, int *val3, int *val4, int *tick, int *total_tick, int *flag);
+typedef int (*HPMHOOK_post_status_change_start_sub) (int retVal___, struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int val1, int val2, int val3, int val4, int tick, int total_tick, int flag);
typedef int (*HPMHOOK_pre_status_change_end_) (struct block_list **bl, enum sc_type *type, int *tid, const char **file, int *line);
typedef int (*HPMHOOK_post_status_change_end_) (int retVal___, struct block_list *bl, enum sc_type type, int tid, const char *file, int line);
typedef bool (*HPMHOOK_pre_status_is_immune_to_status) (struct status_change **sc, enum sc_type *type);
@@ -7828,8 +7832,8 @@ typedef int (*HPMHOOK_pre_status_get_val_flag) (enum sc_type *type);
typedef int (*HPMHOOK_post_status_get_val_flag) (int retVal___, enum sc_type type);
typedef void (*HPMHOOK_pre_status_change_start_display) (struct map_session_data **sd, enum sc_type *type, int *val1, int *val2, int *val3, int *val4);
typedef void (*HPMHOOK_post_status_change_start_display) (struct map_session_data *sd, enum sc_type type, int val1, int val2, int val3, int val4);
-typedef bool (*HPMHOOK_pre_status_change_start_unknown_sc) (struct block_list **src, struct block_list **bl, enum sc_type *type, int *calc_flag, int *rate, int *val1, int *val2, int *val3, int *val4, int *tick, int *flag);
-typedef bool (*HPMHOOK_post_status_change_start_unknown_sc) (bool retVal___, struct block_list *src, struct block_list *bl, enum sc_type type, int calc_flag, int rate, int val1, int val2, int val3, int val4, int tick, int flag);
+typedef bool (*HPMHOOK_pre_status_change_start_unknown_sc) (struct block_list **src, struct block_list **bl, enum sc_type *type, int *calc_flag, int *rate, int *val1, int *val2, int *val3, int *val4, int *total_tick, int *flag);
+typedef bool (*HPMHOOK_post_status_change_start_unknown_sc) (bool retVal___, struct block_list *src, struct block_list *bl, enum sc_type type, int calc_flag, int rate, int val1, int val2, int val3, int val4, int total_tick, int flag);
typedef int (*HPMHOOK_pre_status_kaahi_heal_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
typedef int (*HPMHOOK_post_status_kaahi_heal_timer) (int retVal___, int tid, int64 tick, int id, intptr_t data);
typedef int (*HPMHOOK_pre_status_change_timer) (int *tid, int64 *tick, int *id, intptr_t *data);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 6b3cee6b5..266ca74f3 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -922,6 +922,8 @@ struct {
struct HPMHookPoint *HP_clif_combo_delay_post;
struct HPMHookPoint *HP_clif_status_change_pre;
struct HPMHookPoint *HP_clif_status_change_post;
+ struct HPMHookPoint *HP_clif_status_change_sub_pre;
+ struct HPMHookPoint *HP_clif_status_change_sub_post;
struct HPMHookPoint *HP_clif_insert_card_pre;
struct HPMHookPoint *HP_clif_insert_card_post;
struct HPMHookPoint *HP_clif_inventoryList_pre;
@@ -6334,6 +6336,8 @@ struct {
struct HPMHookPoint *HP_status_get_sc_def_post;
struct HPMHookPoint *HP_status_change_start_pre;
struct HPMHookPoint *HP_status_change_start_post;
+ struct HPMHookPoint *HP_status_change_start_sub_pre;
+ struct HPMHookPoint *HP_status_change_start_sub_post;
struct HPMHookPoint *HP_status_change_end__pre;
struct HPMHookPoint *HP_status_change_end__post;
struct HPMHookPoint *HP_status_is_immune_to_status_pre;
@@ -7737,6 +7741,8 @@ struct {
int HP_clif_combo_delay_post;
int HP_clif_status_change_pre;
int HP_clif_status_change_post;
+ int HP_clif_status_change_sub_pre;
+ int HP_clif_status_change_sub_post;
int HP_clif_insert_card_pre;
int HP_clif_insert_card_post;
int HP_clif_inventoryList_pre;
@@ -13149,6 +13155,8 @@ struct {
int HP_status_get_sc_def_post;
int HP_status_change_start_pre;
int HP_status_change_start_post;
+ int HP_status_change_start_sub_pre;
+ int HP_status_change_start_sub_post;
int HP_status_change_end__pre;
int HP_status_change_end__post;
int HP_status_is_immune_to_status_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index ad9e7e123..712cd4168 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -485,6 +485,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(clif->autospell, HP_clif_autospell) },
{ HP_POP(clif->combo_delay, HP_clif_combo_delay) },
{ HP_POP(clif->status_change, HP_clif_status_change) },
+ { HP_POP(clif->status_change_sub, HP_clif_status_change_sub) },
{ HP_POP(clif->insert_card, HP_clif_insert_card) },
{ HP_POP(clif->inventoryList, HP_clif_inventoryList) },
{ HP_POP(clif->inventoryItems, HP_clif_inventoryItems) },
@@ -3239,6 +3240,7 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(status->isimmune, HP_status_isimmune) },
{ HP_POP(status->get_sc_def, HP_status_get_sc_def) },
{ HP_POP(status->change_start, HP_status_change_start) },
+ { HP_POP(status->change_start_sub, HP_status_change_start_sub) },
{ HP_POP(status->change_end_, HP_status_change_end_) },
{ HP_POP(status->is_immune_to_status, HP_status_is_immune_to_status) },
{ HP_POP(status->is_boss_resist_sc, HP_status_is_boss_resist_sc) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index 6dd6cb34f..7a817f45d 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -11995,14 +11995,14 @@ void HP_clif_combo_delay(struct block_list *bl, int wait) {
}
return;
}
-void HP_clif_status_change(struct block_list *bl, int type, int flag, int tick, int val1, int val2, int val3) {
+void HP_clif_status_change(struct block_list *bl, int type, int flag, int total_tick, int val1, int val2, int val3) {
int hIndex = 0;
if (HPMHooks.count.HP_clif_status_change_pre > 0) {
- void (*preHookFunc) (struct block_list **bl, int *type, int *flag, int *tick, int *val1, int *val2, int *val3);
+ void (*preHookFunc) (struct block_list **bl, int *type, int *flag, int *total_tick, int *val1, int *val2, int *val3);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_status_change_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_clif_status_change_pre[hIndex].func;
- preHookFunc(&bl, &type, &flag, &tick, &val1, &val2, &val3);
+ preHookFunc(&bl, &type, &flag, &total_tick, &val1, &val2, &val3);
}
if (*HPMforce_return) {
*HPMforce_return = false;
@@ -12010,13 +12010,39 @@ void HP_clif_status_change(struct block_list *bl, int type, int flag, int tick,
}
}
{
- HPMHooks.source.clif.status_change(bl, type, flag, tick, val1, val2, val3);
+ HPMHooks.source.clif.status_change(bl, type, flag, total_tick, val1, val2, val3);
}
if (HPMHooks.count.HP_clif_status_change_post > 0) {
- void (*postHookFunc) (struct block_list *bl, int type, int flag, int tick, int val1, int val2, int val3);
+ void (*postHookFunc) (struct block_list *bl, int type, int flag, int total_tick, int val1, int val2, int val3);
for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_status_change_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_clif_status_change_post[hIndex].func;
- postHookFunc(bl, type, flag, tick, val1, val2, val3);
+ postHookFunc(bl, type, flag, total_tick, val1, val2, val3);
+ }
+ }
+ return;
+}
+void HP_clif_status_change_sub(struct block_list *bl, int type, int flag, int tick, int total_tick, int val1, int val2, int val3) {
+ int hIndex = 0;
+ if (HPMHooks.count.HP_clif_status_change_sub_pre > 0) {
+ void (*preHookFunc) (struct block_list **bl, int *type, int *flag, int *tick, int *total_tick, int *val1, int *val2, int *val3);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_status_change_sub_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_clif_status_change_sub_pre[hIndex].func;
+ preHookFunc(&bl, &type, &flag, &tick, &total_tick, &val1, &val2, &val3);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.clif.status_change_sub(bl, type, flag, tick, total_tick, val1, val2, val3);
+ }
+ if (HPMHooks.count.HP_clif_status_change_sub_post > 0) {
+ void (*postHookFunc) (struct block_list *bl, int type, int flag, int tick, int total_tick, int val1, int val2, int val3);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_clif_status_change_sub_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_clif_status_change_sub_post[hIndex].func;
+ postHookFunc(bl, type, flag, tick, total_tick, val1, val2, val3);
}
}
return;
@@ -84732,6 +84758,33 @@ int HP_status_change_start(struct block_list *src, struct block_list *bl, enum s
}
return retVal___;
}
+int HP_status_change_start_sub(struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int val1, int val2, int val3, int val4, int tick, int total_tick, int flag) {
+ int hIndex = 0;
+ int retVal___ = 0;
+ if (HPMHooks.count.HP_status_change_start_sub_pre > 0) {
+ int (*preHookFunc) (struct block_list **src, struct block_list **bl, enum sc_type *type, int *rate, int *val1, int *val2, int *val3, int *val4, int *tick, int *total_tick, int *flag);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_start_sub_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_status_change_start_sub_pre[hIndex].func;
+ retVal___ = preHookFunc(&src, &bl, &type, &rate, &val1, &val2, &val3, &val4, &tick, &total_tick, &flag);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.status.change_start_sub(src, bl, type, rate, val1, val2, val3, val4, tick, total_tick, flag);
+ }
+ if (HPMHooks.count.HP_status_change_start_sub_post > 0) {
+ int (*postHookFunc) (int retVal___, struct block_list *src, struct block_list *bl, enum sc_type type, int rate, int val1, int val2, int val3, int val4, int tick, int total_tick, int flag);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_start_sub_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_status_change_start_sub_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, src, bl, type, rate, val1, val2, val3, val4, tick, total_tick, flag);
+ }
+ }
+ return retVal___;
+}
int HP_status_change_end_(struct block_list *bl, enum sc_type type, int tid, const char *file, int line) {
int hIndex = 0;
int retVal___ = 0;
@@ -84946,15 +84999,15 @@ void HP_status_change_start_display(struct map_session_data *sd, enum sc_type ty
}
return;
}
-bool HP_status_change_start_unknown_sc(struct block_list *src, struct block_list *bl, enum sc_type type, int calc_flag, int rate, int val1, int val2, int val3, int val4, int tick, int flag) {
+bool HP_status_change_start_unknown_sc(struct block_list *src, struct block_list *bl, enum sc_type type, int calc_flag, int rate, int val1, int val2, int val3, int val4, int total_tick, int flag) {
int hIndex = 0;
bool retVal___ = false;
if (HPMHooks.count.HP_status_change_start_unknown_sc_pre > 0) {
- bool (*preHookFunc) (struct block_list **src, struct block_list **bl, enum sc_type *type, int *calc_flag, int *rate, int *val1, int *val2, int *val3, int *val4, int *tick, int *flag);
+ bool (*preHookFunc) (struct block_list **src, struct block_list **bl, enum sc_type *type, int *calc_flag, int *rate, int *val1, int *val2, int *val3, int *val4, int *total_tick, int *flag);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_start_unknown_sc_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_change_start_unknown_sc_pre[hIndex].func;
- retVal___ = preHookFunc(&src, &bl, &type, &calc_flag, &rate, &val1, &val2, &val3, &val4, &tick, &flag);
+ retVal___ = preHookFunc(&src, &bl, &type, &calc_flag, &rate, &val1, &val2, &val3, &val4, &total_tick, &flag);
}
if (*HPMforce_return) {
*HPMforce_return = false;
@@ -84962,13 +85015,13 @@ bool HP_status_change_start_unknown_sc(struct block_list *src, struct block_list
}
}
{
- retVal___ = HPMHooks.source.status.change_start_unknown_sc(src, bl, type, calc_flag, rate, val1, val2, val3, val4, tick, flag);
+ retVal___ = HPMHooks.source.status.change_start_unknown_sc(src, bl, type, calc_flag, rate, val1, val2, val3, val4, total_tick, flag);
}
if (HPMHooks.count.HP_status_change_start_unknown_sc_post > 0) {
- bool (*postHookFunc) (bool retVal___, struct block_list *src, struct block_list *bl, enum sc_type type, int calc_flag, int rate, int val1, int val2, int val3, int val4, int tick, int flag);
+ bool (*postHookFunc) (bool retVal___, struct block_list *src, struct block_list *bl, enum sc_type type, int calc_flag, int rate, int val1, int val2, int val3, int val4, int total_tick, int flag);
for (hIndex = 0; hIndex < HPMHooks.count.HP_status_change_start_unknown_sc_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_change_start_unknown_sc_post[hIndex].func;
- retVal___ = postHookFunc(retVal___, src, bl, type, calc_flag, rate, val1, val2, val3, val4, tick, flag);
+ retVal___ = postHookFunc(retVal___, src, bl, type, calc_flag, rate, val1, val2, val3, val4, total_tick, flag);
}
}
return retVal___;