diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-27 21:09:53 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-27 21:09:53 +0300 |
commit | 457e6e04f2f8c4b0ce5f73db8c17a2fe3c3951ed (patch) | |
tree | aabdd9b3a280aa6a6257fc65b384c1be9386c320 | |
parent | 24a5f119b798bce791775943da06c1feaff16027 (diff) | |
download | evol-hercules-457e6e04f2f8c4b0ce5f73db8c17a2fe3c3951ed.tar.gz evol-hercules-457e6e04f2f8c4b0ce5f73db8c17a2fe3c3951ed.tar.bz2 evol-hercules-457e6e04f2f8c4b0ce5f73db8c17a2fe3c3951ed.tar.xz evol-hercules-457e6e04f2f8c4b0ce5f73db8c17a2fe3c3951ed.zip |
Add killer id packet.
Change plugin version to 14.
-rw-r--r-- | src/elogin/send.c | 2 | ||||
-rw-r--r-- | src/emap/init.c | 1 | ||||
-rw-r--r-- | src/emap/pc.c | 13 | ||||
-rw-r--r-- | src/emap/pc.h | 4 | ||||
-rw-r--r-- | src/emap/send.c | 15 | ||||
-rw-r--r-- | src/emap/send.h | 2 |
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 |