summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/status.c10
-rw-r--r--src/emap/status.h3
3 files changed, 14 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c
index dfd0f29..2ef06ca 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -293,6 +293,7 @@ HPExport void plugin_init (void)
addHookPre(script, hardcoded_constants, escript_hardcoded_constants_pre);
addHookPre(script, run_use_script, escript_run_use_script_pre);
addHookPre(status, calc_pc_additional, estatus_calc_pc_additional_pre);
+ addHookPre(status, calc_pc_recover_hp, estatus_calc_pc_recover_hp_pre);
addHookPre(homun, gainexp, ehomunculus_gainexp_pre);
addHookPost(battle, calc_weapon_attack, ebattle_calc_weapon_attack_post);
diff --git a/src/emap/status.c b/src/emap/status.c
index 56ebb2c..f782057 100644
--- a/src/emap/status.c
+++ b/src/emap/status.c
@@ -235,3 +235,13 @@ int estatus_change_end__post(int retVal,
*/
return retVal;
}
+
+void estatus_calc_pc_recover_hp_pre(struct map_session_data **sdPtr __attribute__ ((unused)),
+ struct status_data **bstatusPtr)
+{
+ struct status_data *bstatus = *bstatusPtr;
+ nullpo_retv(bstatus);
+
+ bstatus->hp = APPLY_RATE(bstatus->max_hp, battle->bc->restart_hp_rate);
+ hookStop();
+}
diff --git a/src/emap/status.h b/src/emap/status.h
index 11f1695..4fa5a34 100644
--- a/src/emap/status.h
+++ b/src/emap/status.h
@@ -42,4 +42,7 @@ int estatus_change_end__post(int retVal,
enum sc_type type, int tid,
const char* file, int line);
+void estatus_calc_pc_recover_hp_pre(struct map_session_data **sdPtr,
+ struct status_data **bstatusPtr);
+
#endif // EVOL_MAP_STATUS