summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/elogin/send.c2
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/pc.c13
-rw-r--r--src/emap/pc.h4
-rw-r--r--src/emap/send.c15
-rw-r--r--src/emap/send.h2
6 files changed, 36 insertions, 1 deletions
diff --git a/src/elogin/send.c b/src/elogin/send.c
index ee5ffcb..a8bc99b 100644
--- a/src/elogin/send.c
+++ b/src/elogin/send.c
@@ -24,7 +24,7 @@ void send_server_version(int fd)
WFIFOW(fd, 0) = 0x7531;
WFIFOW(fd, 2) = 16;
WFIFOL(fd, 4) = 0; // unused
- WFIFOL(fd, 8) = 12; // plugin version
+ WFIFOL(fd, 8) = 14; // plugin version
WFIFOL(fd, 12) = serverPacketVersion; // server packet version
WFIFOSET(fd, WFIFOW(fd,2));
diff --git a/src/emap/init.c b/src/emap/init.c
index c92f503..6531d40 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -259,6 +259,7 @@ HPExport void plugin_init (void)
addHookPost("pc->equipitem", epc_equipitem_post);
addHookPost("pc->unequipitem", epc_unequipitem_post);
addHookPost("pc->setnewpc", epc_setnewpc_post);
+ addHookPost("pc->dead", epc_dead_post);
addHookPost("pc->delitem", epc_delitem_post);
addHookPost("pc->dropitem", epc_dropitem_post);
addHookPost("pc->takeitem", epc_takeitem_post);
diff --git a/src/emap/pc.c b/src/emap/pc.c
index 42669ae..3ad18e8 100644
--- a/src/emap/pc.c
+++ b/src/emap/pc.c
@@ -696,3 +696,16 @@ bool epc_process_chat_message_pre(struct map_session_data *sd, const char *messa
hookStop();
return true;
}
+
+int epc_dead_post(int retVal,
+ struct map_session_data *sd,
+ struct block_list *src)
+{
+ ShowInfo("epc_dead_post\n");
+ if (retVal > 0)
+ {
+ if (sd)
+ send_pc_killed(sd->fd, src);
+ }
+ return retVal;
+}
diff --git a/src/emap/pc.h b/src/emap/pc.h
index 058561f..a56eb4d 100644
--- a/src/emap/pc.h
+++ b/src/emap/pc.h
@@ -77,4 +77,8 @@ bool epc_adoption_pre(struct map_session_data *p1_sd,
bool epc_process_chat_message_pre(struct map_session_data *sd,
const char *message);
+int epc_dead_post(int retVal,
+ struct map_session_data *sd,
+ struct block_list *src);
+
#endif // EVOL_MAP_PC
diff --git a/src/emap/send.c b/src/emap/send.c
index 8a5c5a3..7078410 100644
--- a/src/emap/send.c
+++ b/src/emap/send.c
@@ -459,3 +459,18 @@ void send_pc_skin(int fd, int npcId, const char *const skin)
strcpy(WFIFOP (fd, 8), skin);
WFIFOSET(fd, sz);
}
+
+void send_pc_killed(int fd, struct block_list* bl)
+{
+ struct SessionExt *data = session_get(fd);
+ if (!data || data->clientVersion < 17)
+ return;
+
+ WFIFOHEAD (fd, 6);
+ WFIFOW(fd, 0) = 0xb1d;
+ if (bl)
+ WFIFOL(fd, 2) = bl->id;
+ else
+ WFIFOL(fd, 2) = 0;
+ WFIFOSET(fd, 6);
+}
diff --git a/src/emap/send.h b/src/emap/send.h
index 2d6ca56..8ebb7d1 100644
--- a/src/emap/send.h
+++ b/src/emap/send.h
@@ -48,5 +48,7 @@ void send_setwall_single(int fd,
void send_pc_skin(int fd,
int npcId,
const char *const skin);
+void send_pc_killed(int fd,
+ struct block_list* bl);
#endif // EVOL_MAP_SEND