diff options
author | mekolat <mekolat@users.noreply.github.com> | 2015-05-31 17:55:29 -0400 |
---|---|---|
committer | mekolat <mekolat@users.noreply.github.com> | 2015-06-16 12:15:35 -0400 |
commit | a8c5e27698455abbf24da88d487c9f4c8887ea5c (patch) | |
tree | 85c34faa912c5330c3c9c58c1d14d7f296de5e62 | |
parent | 1a444e3861985b53ac3abf0d95d94471d5eb261f (diff) | |
download | tmwa-a8c5e27698455abbf24da88d487c9f4c8887ea5c.tar.gz tmwa-a8c5e27698455abbf24da88d487c9f4c8887ea5c.tar.bz2 tmwa-a8c5e27698455abbf24da88d487c9f4c8887ea5c.tar.xz tmwa-a8c5e27698455abbf24da88d487c9f4c8887ea5c.zip |
send map pvp status
-rw-r--r-- | src/map/clif.cpp | 16 | ||||
-rw-r--r-- | src/map/clif.hpp | 1 | ||||
-rwxr-xr-x | tools/protocol.py | 17 |
3 files changed, 31 insertions, 3 deletions
diff --git a/src/map/clif.cpp b/src/map/clif.cpp index fbca96a..8c8b853 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -2050,6 +2050,20 @@ int clif_misceffect(dumb_ptr<block_list> bl, int type) return 0; } +void clif_map_pvp(dumb_ptr<map_session_data> sd) +{ + nullpo_retv(sd); + + if (sd->client_version < 3) + return; + + Packet_Fixed<0x0199> fixed_199; + fixed_199.status = sd->bl_m->flag.get(MapFlag::PVP)? 1: 0; + Buffer buf = create_fpacket<0x0199, 4>(fixed_199); + + clif_send(buf, sd, SendWho::SELF); +} + void clif_pvpstatus(dumb_ptr<map_session_data> sd) { nullpo_retv(sd); @@ -3470,6 +3484,8 @@ RecvResult clif_parse_LoadEndAck(Session *s, dumb_ptr<map_session_data> sd) map_addblock(sd); // ブロック登録 clif_spawnpc(sd); // spawn + clif_map_pvp(sd); // send map pvp status + // weight max , now clif_updatestatus(sd, SP::MAXWEIGHT); clif_updatestatus(sd, SP::WEIGHT); diff --git a/src/map/clif.hpp b/src/map/clif.hpp index 63d3d6a..ecfdb15 100644 --- a/src/map/clif.hpp +++ b/src/map/clif.hpp @@ -72,6 +72,7 @@ void clif_scriptclose(dumb_ptr<map_session_data>, BlockId); //self void clif_scriptmenu(dumb_ptr<map_session_data>, BlockId, XString); //self void clif_scriptinput(dumb_ptr<map_session_data>, BlockId); //self void clif_scriptinputstr(dumb_ptr<map_session_data> sd, BlockId npcid); // self +void clif_map_pvp(dumb_ptr<map_session_data>); // self int clif_additem(dumb_ptr<map_session_data>, IOff0, int, PickupFail); //self void clif_delitem(dumb_ptr<map_session_data>, IOff0, int); //self diff --git a/tools/protocol.py b/tools/protocol.py index d6667af..1a59399 100755 --- a/tools/protocol.py +++ b/tools/protocol.py @@ -4278,10 +4278,21 @@ def build_context(): Being adds/removes a persistent status effect. ''', ) - # 0x0199 define='SMSG_PVP_MAP_MODE', - # 0x019a define='SMSG_PVP_SET', + map_user.s(0x0199, 'map pvp status', + define='SMSG_PVP_MAP_MODE', + fixed=[ + at(0, u16, 'packet id'), + at(2, u16, 'status'), + ], + fixed_size=4, + pre=[NOTHING], + post=[PRETTY], + desc=''' + Send the map pvp status + ''', + ) map_user.s(0x019a, 'being pvp status', - define='SMSG_BEING_SELFEFFECT', + define='SMSG_PVP_SET', fixed=[ at(0, u16, 'packet id'), at(2, block_id, 'block id'), |