summaryrefslogtreecommitdiff
path: root/src/emap
diff options
context:
space:
mode:
Diffstat (limited to 'src/emap')
-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
5 files changed, 35 insertions, 0 deletions
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