summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/clif.cpp15
-rw-r--r--src/map/clif.hpp1
-rw-r--r--src/map/map.hpp1
-rw-r--r--src/map/pc.cpp5
-rwxr-xr-xtools/protocol.py15
5 files changed, 37 insertions, 0 deletions
diff --git a/src/map/clif.cpp b/src/map/clif.cpp
index 248f74a..fbca96a 100644
--- a/src/map/clif.cpp
+++ b/src/map/clif.cpp
@@ -930,6 +930,8 @@ int clif_spawnpc(dumb_ptr<map_session_data> sd)
clif_send(buf, sd, SendWho::AREA_WOS);
+ clif_pvpstatus(sd);
+
if (sd->bl_m->flag.get(MapFlag::SNOW))
clif_specialeffect(sd, 162, 1);
if (sd->bl_m->flag.get(MapFlag::FOG))
@@ -2048,6 +2050,19 @@ int clif_misceffect(dumb_ptr<block_list> bl, int type)
return 0;
}
+void clif_pvpstatus(dumb_ptr<map_session_data> sd)
+{
+ nullpo_retv(sd);
+
+ Packet_Fixed<0x019a> fixed_19a;
+ fixed_19a.block_id = sd->bl_id;
+ fixed_19a.rank = sd->state.pvp_rank;
+ fixed_19a.channel = sd->state.pvpchannel;
+ Buffer buf = create_fpacket<0x019a, 14>(fixed_19a);
+
+ clif_send(buf, sd, SendWho::AREA);
+}
+
/*==========================================
* 表示オプション変更
*------------------------------------------
diff --git a/src/map/clif.hpp b/src/map/clif.hpp
index 3cc308c..63d3d6a 100644
--- a/src/map/clif.hpp
+++ b/src/map/clif.hpp
@@ -92,6 +92,7 @@ int clif_statusupack(dumb_ptr<map_session_data>, SP, int, int); // self
int clif_equipitemack(dumb_ptr<map_session_data>, IOff0, EPOS, int); // self
int clif_unequipitemack(dumb_ptr<map_session_data>, IOff0, EPOS, int); // self
int clif_misceffect(dumb_ptr<block_list>, int); // area
+void clif_pvpstatus(dumb_ptr<map_session_data>); // area
int clif_changeoption(dumb_ptr<block_list>); // area
int clif_useitemack(dumb_ptr<map_session_data>, IOff0, int, int); // self
diff --git a/src/map/map.hpp b/src/map/map.hpp
index aac646b..2b638d4 100644
--- a/src/map/map.hpp
+++ b/src/map/map.hpp
@@ -143,6 +143,7 @@ struct map_session_data : block_list, SessionData
unsigned shroud_disappears_on_talk:1;
unsigned seen_motd:1;
unsigned pvpchannel;
+ unsigned pvp_rank;
} state;
struct
{
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index d2b2f44..ebe8bca 100644
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -3313,6 +3313,11 @@ int pc_damage(dumb_ptr<block_list> src, dumb_ptr<map_session_data> sd,
};
npc_event_doall_l(stringish<ScriptLabel>("OnPCKilledEvent"_s), sd->bl_id, arg);
npc_event_doall_l(stringish<ScriptLabel>("OnPCKillEvent"_s), src->bl_id, arg);
+
+ sd->state.pvp_rank = 0;
+ src->is_player()->state.pvp_rank++;
+ clif_pvpstatus(sd);
+ clif_pvpstatus(src->is_player());
}
npc_event_doall_l(stringish<ScriptLabel>("OnPCDieEvent"_s), sd->bl_id, nullptr);
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=[