diff options
author | HoraK-FDF <horak-fdf@web.de> | 2024-07-18 15:49:51 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-08-30 21:05:24 +0200 |
commit | a1caa53ab1ee0cf41d8bbc41c88d8eb84207ee7f (patch) | |
tree | cb43742ed94e2b347002d4feb53a9493b59875ad | |
parent | 561af90af66d336c6c3cc10414029875ecf4902c (diff) | |
download | tmwa-a1caa53ab1ee0cf41d8bbc41c88d8eb84207ee7f.tar.gz tmwa-a1caa53ab1ee0cf41d8bbc41c88d8eb84207ee7f.tar.bz2 tmwa-a1caa53ab1ee0cf41d8bbc41c88d8eb84207ee7f.tar.xz tmwa-a1caa53ab1ee0cf41d8bbc41c88d8eb84207ee7f.zip |
Max Weight Override
-rw-r--r-- | src/map/map.hpp | 2 | ||||
-rw-r--r-- | src/map/pc.cpp | 12 | ||||
-rw-r--r-- | src/mmo/clif.t.hpp | 1 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/map/map.hpp b/src/map/map.hpp index de0e10b..8bb5aa7 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -184,7 +184,7 @@ struct map_session_data : block_list, SessionData None, None, None, None, None, None, None, None, None, None, }}; // explicit is better than implicit earray<IOff0, EQUIP, EQUIP::COUNT> equip_index_maybe; - int weight, max_weight; + int weight, max_weight, max_weight_override; MapName mapname_; Session *sess; // use this, you idiots! short to_x, to_y; diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 0b7cf05..d28dda4 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -870,6 +870,7 @@ int pc_authok(AccountId id, int login_id2, ClientVersion client_version, sd->quick_regeneration_hp.amount = 0; sd->quick_regeneration_sp.amount = 0; sd->heal_xp = 0; + sd->max_weight_override = 0; sd->canact_tick = tick; sd->canmove_tick = tick; sd->attackabletime = tick; @@ -1483,6 +1484,9 @@ int pc_calcstatus(dumb_ptr<map_session_data> sd, int first) sd->hit += skill_power(sd, SkillID::AC_OWL) / 10; // 20 for 200 } + if (sd->max_weight_override) + sd->max_weight = sd->max_weight_override; + sd->max_weight += 1000; bl = sd->status.base_level; @@ -3729,6 +3733,9 @@ int pc_readparam(dumb_ptr<block_list> bl, SP type) case SP::MAXWEIGHT: val = sd ? sd->max_weight : 0; break; + case SP::MAXWEIGHT_OVERRIDE: + val = sd ? sd->max_weight_override : 0; + break; case SP::BASEEXP: val = sd ? sd->status.base_exp : 0; break; @@ -4056,6 +4063,11 @@ int pc_setparam(dumb_ptr<block_list> bl, SP type, int val) sd->max_weight = val; clif_updatestatus(sd, type); break; + case SP::MAXWEIGHT_OVERRIDE: + nullpo_retz(sd); + sd->max_weight_override = val; + pc_calcstatus(sd, (int)CalcStatusKind::NORMAL_RECALC); + break; case SP::HP: nullpo_retz(sd); // TODO: mob mutation diff --git a/src/mmo/clif.t.hpp b/src/mmo/clif.t.hpp index 260ae63..c1f7ed3 100644 --- a/src/mmo/clif.t.hpp +++ b/src/mmo/clif.t.hpp @@ -266,6 +266,7 @@ enum class SP : uint16_t // sent to client MAXWEIGHT = 25, MAXWEIGHT_ADD = 26, + MAXWEIGHT_OVERRIDE = 27, // sent to client USTR = 32, |