summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-11-14 19:35:02 +0100
committerGitHub <noreply@github.com>2018-11-14 19:35:02 +0100
commit9f77ce4b9702b1efe079ef9b1abe491482690850 (patch)
tree0a5191147d24ca56b60ca01dac71801974a1a8ce /src/plugins
parent1c315c13f048dc44c5b002ca39095b18d212b9c5 (diff)
parent8269fdcd5d036ddc3c24bc0ebb4ad958b5c19a3a (diff)
downloadhercules-9f77ce4b9702b1efe079ef9b1abe491482690850.tar.gz
hercules-9f77ce4b9702b1efe079ef9b1abe491482690850.tar.bz2
hercules-9f77ce4b9702b1efe079ef9b1abe491482690850.tar.xz
hercules-9f77ce4b9702b1efe079ef9b1abe491482690850.zip
Merge pull request #1215 from HerculesWS/HP_Display
Fixes #889 & #840
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Defs.inc16
-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.inc72
4 files changed, 83 insertions, 15 deletions
diff --git a/src/plugins/HPMHooking/HPMHooking.Defs.inc b/src/plugins/HPMHooking/HPMHooking.Defs.inc
index 72387a8af..0a70f6d1a 100644
--- a/src/plugins/HPMHooking/HPMHooking.Defs.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Defs.inc
@@ -7584,12 +7584,12 @@ typedef int (*HPMHOOK_pre_status_charge) (struct block_list **bl, int64 *hp, int
typedef int (*HPMHOOK_post_status_charge) (int retVal___, struct block_list *bl, int64 hp, int64 sp);
typedef int (*HPMHOOK_pre_status_percent_change) (struct block_list **src, struct block_list **target, signed char *hp_rate, signed char *sp_rate, int *flag);
typedef int (*HPMHOOK_post_status_percent_change) (int retVal___, struct block_list *src, struct block_list *target, signed char hp_rate, signed char sp_rate, int flag);
-typedef int (*HPMHOOK_pre_status_set_hp) (struct block_list **bl, unsigned int *hp, int *flag);
-typedef int (*HPMHOOK_post_status_set_hp) (int retVal___, struct block_list *bl, unsigned int hp, int flag);
-typedef int (*HPMHOOK_pre_status_set_sp) (struct block_list **bl, unsigned int *sp, int *flag);
-typedef int (*HPMHOOK_post_status_set_sp) (int retVal___, struct block_list *bl, unsigned int sp, int flag);
-typedef int (*HPMHOOK_pre_status_heal) (struct block_list **bl, int64 *hp, int64 *sp, int *flag);
-typedef int (*HPMHOOK_post_status_heal) (int retVal___, struct block_list *bl, int64 hp, int64 sp, int flag);
+typedef int (*HPMHOOK_pre_status_set_hp) (struct block_list **bl, unsigned int *hp, enum status_heal_flag *flag);
+typedef int (*HPMHOOK_post_status_set_hp) (int retVal___, struct block_list *bl, unsigned int hp, enum status_heal_flag flag);
+typedef int (*HPMHOOK_pre_status_set_sp) (struct block_list **bl, unsigned int *sp, enum status_heal_flag *flag);
+typedef int (*HPMHOOK_post_status_set_sp) (int retVal___, struct block_list *bl, unsigned int sp, enum status_heal_flag flag);
+typedef int (*HPMHOOK_pre_status_heal) (struct block_list **bl, int64 *hp, int64 *sp, enum status_heal_flag *flag);
+typedef int (*HPMHOOK_post_status_heal) (int retVal___, struct block_list *bl, int64 hp, int64 sp, enum status_heal_flag flag);
typedef int (*HPMHOOK_pre_status_revive) (struct block_list **bl, unsigned char *per_hp, unsigned char *per_sp);
typedef int (*HPMHOOK_post_status_revive) (int retVal___, struct block_list *bl, unsigned char per_hp, unsigned char per_sp);
typedef int (*HPMHOOK_pre_status_fixed_revive) (struct block_list **bl, unsigned int *per_hp, unsigned int *per_sp);
@@ -7732,6 +7732,10 @@ typedef unsigned int (*HPMHOOK_pre_status_get_base_maxhp) (const struct map_sess
typedef unsigned int (*HPMHOOK_post_status_get_base_maxhp) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st);
typedef unsigned int (*HPMHOOK_pre_status_get_base_maxsp) (const struct map_session_data **sd, const struct status_data **st);
typedef unsigned int (*HPMHOOK_post_status_get_base_maxsp) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st);
+typedef unsigned int (*HPMHOOK_pre_status_get_restart_hp) (const struct map_session_data **sd, const struct status_data **st);
+typedef unsigned int (*HPMHOOK_post_status_get_restart_hp) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st);
+typedef unsigned int (*HPMHOOK_pre_status_get_restart_sp) (const struct map_session_data **sd, const struct status_data **st);
+typedef unsigned int (*HPMHOOK_post_status_get_restart_sp) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st);
typedef int (*HPMHOOK_pre_status_calc_npc_) (struct npc_data **nd, enum e_status_calc_opt *opt);
typedef int (*HPMHOOK_post_status_calc_npc_) (int retVal___, struct npc_data *nd, enum e_status_calc_opt opt);
typedef unsigned short (*HPMHOOK_pre_status_calc_str) (struct block_list **bl, struct status_change **sc, int *str);
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
index 873e82c48..5573e4a14 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc
@@ -6242,6 +6242,10 @@ struct {
struct HPMHookPoint *HP_status_get_base_maxhp_post;
struct HPMHookPoint *HP_status_get_base_maxsp_pre;
struct HPMHookPoint *HP_status_get_base_maxsp_post;
+ struct HPMHookPoint *HP_status_get_restart_hp_pre;
+ struct HPMHookPoint *HP_status_get_restart_hp_post;
+ struct HPMHookPoint *HP_status_get_restart_sp_pre;
+ struct HPMHookPoint *HP_status_get_restart_sp_post;
struct HPMHookPoint *HP_status_calc_npc__pre;
struct HPMHookPoint *HP_status_calc_npc__post;
struct HPMHookPoint *HP_status_calc_str_pre;
@@ -12847,6 +12851,10 @@ struct {
int HP_status_get_base_maxhp_post;
int HP_status_get_base_maxsp_pre;
int HP_status_get_base_maxsp_post;
+ int HP_status_get_restart_hp_pre;
+ int HP_status_get_restart_hp_post;
+ int HP_status_get_restart_sp_pre;
+ int HP_status_get_restart_sp_post;
int HP_status_calc_npc__pre;
int HP_status_calc_npc__post;
int HP_status_calc_str_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
index 838968ce0..601441a61 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc
@@ -3190,6 +3190,8 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(status->base_atk, HP_status_base_atk) },
{ HP_POP(status->get_base_maxhp, HP_status_get_base_maxhp) },
{ HP_POP(status->get_base_maxsp, HP_status_get_base_maxsp) },
+ { HP_POP(status->get_restart_hp, HP_status_get_restart_hp) },
+ { HP_POP(status->get_restart_sp, HP_status_get_restart_sp) },
{ HP_POP(status->calc_npc_, HP_status_calc_npc_) },
{ HP_POP(status->calc_str, HP_status_calc_str) },
{ HP_POP(status->calc_agi, HP_status_calc_agi) },
diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
index d8f515444..7a75f57e2 100644
--- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc
@@ -81540,11 +81540,11 @@ int HP_status_percent_change(struct block_list *src, struct block_list *target,
}
return retVal___;
}
-int HP_status_set_hp(struct block_list *bl, unsigned int hp, int flag) {
+int HP_status_set_hp(struct block_list *bl, unsigned int hp, enum status_heal_flag flag) {
int hIndex = 0;
int retVal___ = 0;
if (HPMHooks.count.HP_status_set_hp_pre > 0) {
- int (*preHookFunc) (struct block_list **bl, unsigned int *hp, int *flag);
+ int (*preHookFunc) (struct block_list **bl, unsigned int *hp, enum status_heal_flag *flag);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_hp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_set_hp_pre[hIndex].func;
@@ -81559,7 +81559,7 @@ int HP_status_set_hp(struct block_list *bl, unsigned int hp, int flag) {
retVal___ = HPMHooks.source.status.set_hp(bl, hp, flag);
}
if (HPMHooks.count.HP_status_set_hp_post > 0) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned int hp, int flag);
+ int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned int hp, enum status_heal_flag flag);
for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_hp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_set_hp_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, hp, flag);
@@ -81567,11 +81567,11 @@ int HP_status_set_hp(struct block_list *bl, unsigned int hp, int flag) {
}
return retVal___;
}
-int HP_status_set_sp(struct block_list *bl, unsigned int sp, int flag) {
+int HP_status_set_sp(struct block_list *bl, unsigned int sp, enum status_heal_flag flag) {
int hIndex = 0;
int retVal___ = 0;
if (HPMHooks.count.HP_status_set_sp_pre > 0) {
- int (*preHookFunc) (struct block_list **bl, unsigned int *sp, int *flag);
+ int (*preHookFunc) (struct block_list **bl, unsigned int *sp, enum status_heal_flag *flag);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_sp_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_set_sp_pre[hIndex].func;
@@ -81586,7 +81586,7 @@ int HP_status_set_sp(struct block_list *bl, unsigned int sp, int flag) {
retVal___ = HPMHooks.source.status.set_sp(bl, sp, flag);
}
if (HPMHooks.count.HP_status_set_sp_post > 0) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned int sp, int flag);
+ int (*postHookFunc) (int retVal___, struct block_list *bl, unsigned int sp, enum status_heal_flag flag);
for (hIndex = 0; hIndex < HPMHooks.count.HP_status_set_sp_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_set_sp_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, sp, flag);
@@ -81594,11 +81594,11 @@ int HP_status_set_sp(struct block_list *bl, unsigned int sp, int flag) {
}
return retVal___;
}
-int HP_status_heal(struct block_list *bl, int64 hp, int64 sp, int flag) {
+int HP_status_heal(struct block_list *bl, int64 hp, int64 sp, enum status_heal_flag flag) {
int hIndex = 0;
int retVal___ = 0;
if (HPMHooks.count.HP_status_heal_pre > 0) {
- int (*preHookFunc) (struct block_list **bl, int64 *hp, int64 *sp, int *flag);
+ int (*preHookFunc) (struct block_list **bl, int64 *hp, int64 *sp, enum status_heal_flag *flag);
*HPMforce_return = false;
for (hIndex = 0; hIndex < HPMHooks.count.HP_status_heal_pre; hIndex++) {
preHookFunc = HPMHooks.list.HP_status_heal_pre[hIndex].func;
@@ -81613,7 +81613,7 @@ int HP_status_heal(struct block_list *bl, int64 hp, int64 sp, int flag) {
retVal___ = HPMHooks.source.status.heal(bl, hp, sp, flag);
}
if (HPMHooks.count.HP_status_heal_post > 0) {
- int (*postHookFunc) (int retVal___, struct block_list *bl, int64 hp, int64 sp, int flag);
+ int (*postHookFunc) (int retVal___, struct block_list *bl, int64 hp, int64 sp, enum status_heal_flag flag);
for (hIndex = 0; hIndex < HPMHooks.count.HP_status_heal_post; hIndex++) {
postHookFunc = HPMHooks.list.HP_status_heal_post[hIndex].func;
retVal___ = postHookFunc(retVal___, bl, hp, sp, flag);
@@ -83531,6 +83531,60 @@ unsigned int HP_status_get_base_maxsp(const struct map_session_data *sd, const s
}
return retVal___;
}
+unsigned int HP_status_get_restart_hp(const struct map_session_data *sd, const struct status_data *st) {
+ int hIndex = 0;
+ unsigned int retVal___ = 0;
+ if (HPMHooks.count.HP_status_get_restart_hp_pre > 0) {
+ unsigned int (*preHookFunc) (const struct map_session_data **sd, const struct status_data **st);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_restart_hp_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_status_get_restart_hp_pre[hIndex].func;
+ retVal___ = preHookFunc(&sd, &st);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.status.get_restart_hp(sd, st);
+ }
+ if (HPMHooks.count.HP_status_get_restart_hp_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_restart_hp_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_status_get_restart_hp_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd, st);
+ }
+ }
+ return retVal___;
+}
+unsigned int HP_status_get_restart_sp(const struct map_session_data *sd, const struct status_data *st) {
+ int hIndex = 0;
+ unsigned int retVal___ = 0;
+ if (HPMHooks.count.HP_status_get_restart_sp_pre > 0) {
+ unsigned int (*preHookFunc) (const struct map_session_data **sd, const struct status_data **st);
+ *HPMforce_return = false;
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_restart_sp_pre; hIndex++) {
+ preHookFunc = HPMHooks.list.HP_status_get_restart_sp_pre[hIndex].func;
+ retVal___ = preHookFunc(&sd, &st);
+ }
+ if (*HPMforce_return) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ retVal___ = HPMHooks.source.status.get_restart_sp(sd, st);
+ }
+ if (HPMHooks.count.HP_status_get_restart_sp_post > 0) {
+ unsigned int (*postHookFunc) (unsigned int retVal___, const struct map_session_data *sd, const struct status_data *st);
+ for (hIndex = 0; hIndex < HPMHooks.count.HP_status_get_restart_sp_post; hIndex++) {
+ postHookFunc = HPMHooks.list.HP_status_get_restart_sp_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, sd, st);
+ }
+ }
+ return retVal___;
+}
int HP_status_calc_npc_(struct npc_data *nd, enum e_status_calc_opt opt) {
int hIndex = 0;
int retVal___ = 0;