diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/pc.cpp | 21 | ||||
-rw-r--r-- | src/map/script-fun.cpp | 28 | ||||
-rw-r--r-- | src/mmo/clif.t.hpp | 4 |
3 files changed, 50 insertions, 3 deletions
diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 1440454..0f6c9a6 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -3522,6 +3522,12 @@ int pc_readparam(dumb_ptr<block_list> bl, SP type) case SP::BL_TYPE: val = static_cast<uint8_t>(bl->bl_type); break; + case SP::PARTNER: + val = sd ? unwrap<CharId>(sd->status.partner_id) : 0; + break; + case SP::CHAR_ID: + val = sd ? unwrap<CharId>(sd->status_key.char_id) : 0; + break; } return val; @@ -3663,6 +3669,21 @@ int pc_setparam(dumb_ptr<map_session_data> sd, SP type, int val) case SP::LUK: pc_statusup2(sd, type, (val - sd->status.attrs[sp_to_attr(type)])); break; + case SP::PARTNER: + dumb_ptr<block_list> p_bl; + if (val < 2000000 && val >= 150000) + { + dumb_ptr<map_session_data> p_sd = nullptr; + if ((p_sd = map_nick2sd(map_charid2nick(wrap<CharId>(val)))) != nullptr) + p_bl = map_id2bl(p_sd->bl_id); + } + else + p_bl = map_id2bl(wrap<BlockId>(val)); + if (val < 1) + pc_divorce(sd); + else + p_bl ? pc_marriage(sd, p_bl->is_player()) : 0; + break; } clif_updatestatus(sd, type); diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 3592095..f7108d0 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -995,7 +995,19 @@ void builtin_set(ScriptState *st) } else { - id = wrap<BlockId>(conv_num(st, sdata)); + int num = conv_num(st, sdata); + if (num >= 2000000) + id = wrap<BlockId>(num); + else if (num >= 150000) + { + dumb_ptr<map_session_data> p_sd = nullptr; + if ((p_sd = map_nick2sd(map_charid2nick(wrap<CharId>(num)))) != nullptr) + id = p_sd->bl_id; + else + return; + } + else + return; bl = map_id2bl(id); } } @@ -3399,7 +3411,19 @@ void builtin_get(ScriptState *st) } else { - id = wrap<BlockId>(conv_num(st, sdata)); + int num = conv_num(st, sdata); + if (num >= 2000000) + id = wrap<BlockId>(num); + else if (num >= 150000) + { + dumb_ptr<map_session_data> p_sd = nullptr; + if ((p_sd = map_nick2sd(map_charid2nick(wrap<CharId>(num)))) != nullptr) + id = p_sd->bl_id; + else + return; + } + else + return; bl = map_id2bl(id); } diff --git a/src/mmo/clif.t.hpp b/src/mmo/clif.t.hpp index fec0201..888fd66 100644 --- a/src/mmo/clif.t.hpp +++ b/src/mmo/clif.t.hpp @@ -307,8 +307,9 @@ enum class SP : uint16_t // sent to client JOBLEVEL = 55, -#if 0 PARTNER = 57, + +#if 0 CART = 58, FAME = 59, UNBREAKABLE = 60, @@ -475,6 +476,7 @@ enum class SP : uint16_t PVP_CHANNEL = 1076, BL_ID = 1077, BL_TYPE = 1078, + CHAR_ID = 1079, }; constexpr |