From 1a444e3861985b53ac3abf0d95d94471d5eb261f Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 31 May 2015 16:39:53 -0400 Subject: send pvp channel and rank to client --- tools/protocol.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tools') diff --git a/tools/protocol.py b/tools/protocol.py index 86b625f..d6667af 100755 --- a/tools/protocol.py +++ b/tools/protocol.py @@ -4280,6 +4280,21 @@ def build_context(): ) # 0x0199 define='SMSG_PVP_MAP_MODE', # 0x019a define='SMSG_PVP_SET', + map_user.s(0x019a, 'being pvp status', + define='SMSG_BEING_SELFEFFECT', + fixed=[ + at(0, u16, 'packet id'), + at(2, block_id, 'block id'), + at(6, u32, 'rank'), + at(10, u32, 'channel'), + ], + fixed_size=14, + pre=[NOTHING], + post=[PRETTY], + desc=''' + Send the pvp status + ''', + ) map_user.s(0x019b, 'being effect', define='SMSG_BEING_SELFEFFECT', fixed=[ -- cgit v1.2.3-60-g2f50 From a8c5e27698455abbf24da88d487c9f4c8887ea5c Mon Sep 17 00:00:00 2001 From: mekolat Date: Sun, 31 May 2015 17:55:29 -0400 Subject: send map pvp status --- src/map/clif.cpp | 16 ++++++++++++++++ src/map/clif.hpp | 1 + tools/protocol.py | 17 ++++++++++++++--- 3 files changed, 31 insertions(+), 3 deletions(-) (limited to 'tools') 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 bl, int type) return 0; } +void clif_map_pvp(dumb_ptr 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 sd) { nullpo_retv(sd); @@ -3470,6 +3484,8 @@ RecvResult clif_parse_LoadEndAck(Session *s, dumb_ptr 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, BlockId); //self void clif_scriptmenu(dumb_ptr, BlockId, XString); //self void clif_scriptinput(dumb_ptr, BlockId); //self void clif_scriptinputstr(dumb_ptr sd, BlockId npcid); // self +void clif_map_pvp(dumb_ptr); // self int clif_additem(dumb_ptr, IOff0, int, PickupFail); //self void clif_delitem(dumb_ptr, 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'), -- cgit v1.2.3-60-g2f50