Apply MHP limit based on bLv (#3003)

* Fixes #814.
* Applies the official maximum HP limit on players.
* Official notice: http://ro.gnjoy.com/news/notice/View.asp?BBSMode=10001&seq=6322
* Levels caps are as follows: Lv 99 = 330k; Lv 150 = 660k; Lv 175 = 1.1m
Thanks to @flamefury!
This commit is contained in:
flamefury
2018-04-06 09:29:54 -07:00
committed by Aleos
parent e509930a67
commit 7f2c6cf2f5
5 changed files with 30 additions and 6 deletions

View File

@@ -8249,7 +8249,12 @@ bool pc_setparam(struct map_session_data *sd,int type,int val)
sd->battle_status.hp = cap_value(val, 1, (int)sd->battle_status.max_hp);
break;
case SP_MAXHP:
sd->battle_status.max_hp = cap_value(val, 1, battle_config.max_hp);
if (sd->status.base_level < 100)
sd->battle_status.max_hp = cap_value(val, 1, battle_config.max_hp_lv99);
else if (sd->status.base_level < 151)
sd->battle_status.max_hp = cap_value(val, 1, battle_config.max_hp_lv150);
else
sd->battle_status.max_hp = cap_value(val, 1, battle_config.max_hp);
if( sd->battle_status.max_hp < sd->battle_status.hp )
{