diff options
author | Andrei Karas <akaras@inbox.ru> | 2020-04-17 06:57:42 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2020-05-04 01:00:43 +0300 |
commit | fa8ff3c40d6b476f41a288a579b6aaaeab8c872d (patch) | |
tree | 2a9eb9604dec9df134904d3c1f6bfa107b231bd1 | |
parent | f8a668055872b0c542e0a8bf7b4637bc2f6ae9f1 (diff) | |
download | hercules-fa8ff3c40d6b476f41a288a579b6aaaeab8c872d.tar.gz hercules-fa8ff3c40d6b476f41a288a579b6aaaeab8c872d.tar.bz2 hercules-fa8ff3c40d6b476f41a288a579b6aaaeab8c872d.tar.xz hercules-fa8ff3c40d6b476f41a288a579b6aaaeab8c872d.zip |
Add packet ZC_LAPINEUPGRADE_RESULT
-rw-r--r-- | src/map/clif.c | 18 | ||||
-rw-r--r-- | src/map/clif.h | 6 | ||||
-rw-r--r-- | src/map/packets_struct.h | 8 |
3 files changed, 31 insertions, 1 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index c16de60e2..7be5c6978 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -23895,9 +23895,26 @@ static void clif_parse_lapineUpgrade_makeItem(int fd, struct map_session_data *s { #if PACKETVER_MAIN_NUM >= 20170111 || PACKETVER_RE_NUM >= 20170111 || defined(PACKETVER_ZERO) ShowError("Lapin upgrade not implimented yet"); + clif->lapineUpgrade_result(sd, LAPINE_UPGRADE_FAILED); #endif // PACKETVER_MAIN_NUM >= 20170111 || PACKETVER_RE_NUM >= 20170111 || defined(PACKETVER_ZERO) } +static bool clif_lapineUpgrade_result(struct map_session_data *sd, enum lapineUpgrade_result result) +{ +#if PACKETVER_MAIN_NUM >= 20170726 || PACKETVER_RE_NUM >= 20170621 || defined(PACKETVER_ZERO) + nullpo_retr(false, sd); + struct PACKET_ZC_LAPINEUPGRADE_RESULT p; + + p.packetType = HEADER_ZC_LAPINEUPGRADE_RESULT; + p.result = result; + clif->send(&p, sizeof(p), &sd->bl, SELF); + + return true; +#else + return false; +#endif // PACKETVER_MAIN_NUM >= 20170726 || PACKETVER_RE_NUM >= 20170621 || defined(PACKETVER_ZERO) +} + /*========================================== * Main client packet processing function *------------------------------------------*/ @@ -25144,6 +25161,7 @@ void clif_defaults(void) clif->plapineDdukDdak_ack = clif_parse_lapineDdukDdak_ack; clif->plapineDdukDdak_close = clif_parse_lapineDdukDdak_close; clif->lapineUpgrade_open = clif_lapineUpgrade_open; + clif->lapineUpgrade_result = clif_lapineUpgrade_result; clif->pLapineUpgrade_close = clif_parse_lapineUpgrade_close; clif->pLapineUpgrade_makeItem = clif_parse_lapineUpgrade_makeItem; clif->pReqGearOff = clif_parse_reqGearOff; diff --git a/src/map/clif.h b/src/map/clif.h index 6a5db8ab4..fdaaf85e3 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -733,6 +733,11 @@ enum lapineddukddak_result { LAPINEDDKUKDDAK_INVALID_ITEM = 7, }; +enum lapineUpgrade_result { + LAPINE_UPGRADE_SUCCESS = 0, + LAPINE_UPGRADE_FAILED = 1 +}; + enum removeGear_flag { REMOVE_MOUNT_0 = 0, // unused REMOVE_MOUNT_DRAGON = 1, @@ -1691,6 +1696,7 @@ struct clif_interface { void (*plapineDdukDdak_ack) (int fd, struct map_session_data *sd); void (*plapineDdukDdak_close) (int fd, struct map_session_data *sd); bool (*lapineUpgrade_open) (struct map_session_data *sd, int item_id); + bool (*lapineUpgrade_result) (struct map_session_data *sd, enum lapineUpgrade_result result); void (*pLapineUpgrade_close) (int fd, struct map_session_data *sd); void (*pLapineUpgrade_makeItem) (int fd, struct map_session_data *sd); void (*pReqGearOff) (int fd, struct map_session_data *sd); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 7ddddcc8b..3129a05d9 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -3901,7 +3901,13 @@ struct PACKET_ZC_LAPINEUPGRADE_OPEN { #endif } __attribute__((packed)); DEFINE_PACKET_HEADER(ZC_LAPINEUPGRADE_OPEN, 0x0ab4); -#endif + +struct PACKET_ZC_LAPINEUPGRADE_RESULT { + int16 packetType; + uint16 result; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_LAPINEUPGRADE_RESULT, 0x0ab7); +#endif // PACKETVER_MAIN_NUM >= 20170726 || PACKETVER_RE_NUM >= 20170621 || defined(PACKETVER_ZERO) #if PACKETVER_MAIN_NUM >= 20170111 || PACKETVER_RE_NUM >= 20170111 || defined(PACKETVER_ZERO) struct PACKET_CZ_LAPINEUPGRADE_CLOSE { |