summaryrefslogtreecommitdiff
path: root/src/emap
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-04-19 23:02:26 +0300
committerAndrei Karas <akaras@inbox.ru>2018-04-19 23:02:26 +0300
commit82b22caa7a2c58777dd3daa8f4365a71754b0b04 (patch)
tree77d427b1c86b51f9c6098a7814f5b02ef1bc90b8 /src/emap
parentd849f17f97e7b203435ab387c356d20976651c00 (diff)
downloadevol-hercules-82b22caa7a2c58777dd3daa8f4365a71754b0b04.tar.gz
evol-hercules-82b22caa7a2c58777dd3daa8f4365a71754b0b04.tar.bz2
evol-hercules-82b22caa7a2c58777dd3daa8f4365a71754b0b04.tar.xz
evol-hercules-82b22caa7a2c58777dd3daa8f4365a71754b0b04.zip
Use configured respawn hp for all jobs.s20180503
Diffstat (limited to 'src/emap')
-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