diff options
author | Haru <haru@dotalux.com> | 2019-12-15 15:23:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-15 15:23:04 +0100 |
commit | 8c4a85d6f9927826dc6a1815f0e6d197bcb2ed7f (patch) | |
tree | c1fc8e1e89e7f05f1645262d4a0f8f715290f289 /src/map/clif.c | |
parent | 7d5ce7b3a33fb27cf838d863b8f017220abb624a (diff) | |
parent | c5a7fac25b79669253c1f7a3ef5775ac362b6491 (diff) | |
download | hercules-8c4a85d6f9927826dc6a1815f0e6d197bcb2ed7f.tar.gz hercules-8c4a85d6f9927826dc6a1815f0e6d197bcb2ed7f.tar.bz2 hercules-8c4a85d6f9927826dc6a1815f0e6d197bcb2ed7f.tar.xz hercules-8c4a85d6f9927826dc6a1815f0e6d197bcb2ed7f.zip |
Merge pull request #2585 from 4144/updatepackets
Update packets up to 2019-12-11
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 50 |
1 files changed, 39 insertions, 11 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index b9ca44dec..31fb00c37 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9087,21 +9087,44 @@ static void clif_specialeffect_single(struct block_list *bl, int type, int fd) /// @see doc/effect_list.txt /// num data: /// effect-dependent value -static void clif_specialeffect_value(struct block_list *bl, int effect_id, int num, send_target target) -{ - uint8 buf[14]; - - WBUFW(buf,0) = 0x284; - WBUFL(buf,2) = bl->id; - WBUFL(buf,6) = effect_id; - WBUFL(buf,10) = num; +static void clif_specialeffect_value(struct block_list *bl, int effect_id, uint64 num, send_target target) +{ +#if PACKETVER_MAIN_NUM >= 20060911 || PACKETVER_AD_NUM >= 20060911 || PACKETVER_SAK_NUM >= 20060911 || defined(PACKETVER_RE) || defined(PACKETVER_ZERO) + struct PACKET_ZC_NOTIFY_EFFECT3 packet; + packet.packetType = HEADER_ZC_NOTIFY_EFFECT3; + packet.aid = bl->id; + packet.effectId = effect_id; +#if PACKETVER >= 20191127 + packet.num = num; +#else + packet.num = (uint32)num; +#endif - clif->send(buf, packet_len(0x284), bl, target); + clif->send(&packet, sizeof(struct PACKET_ZC_NOTIFY_EFFECT3), bl, target); if (clif->isdisguised(bl)) { - WBUFL(buf,2) = -bl->id; - clif->send(buf, packet_len(0x284), bl, SELF); + packet.aid = -bl->id; + clif->send(&packet, sizeof(struct PACKET_ZC_NOTIFY_EFFECT3), bl, SELF); } +#endif +} + +static void clif_specialeffect_value_single(struct block_list *bl, int effect_id, uint64 num, int fd) +{ +#if PACKETVER_MAIN_NUM >= 20060911 || defined(PACKETVER_RE) || defined(PACKETVER_ZERO) + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_NOTIFY_EFFECT3)); + + struct PACKET_ZC_NOTIFY_EFFECT3 *packet = WFIFOP(fd, 0); + packet->packetType = HEADER_ZC_NOTIFY_EFFECT3; + packet->aid = bl->id; + packet->effectId = effect_id; +#if PACKETVER >= 20191127 + packet->num = num; +#else + packet->num = (uint32)num; +#endif + WFIFOSET(fd, sizeof(struct PACKET_ZC_NOTIFY_EFFECT3)); +#endif } /// Remove special effects (ZC_REMOVE_EFFECT). @@ -9315,6 +9338,8 @@ static void clif_refresh(struct map_session_data *sd) mail->clear(sd); + clif->loadConfirm(sd); + if (clif->isdisguised(&sd->bl)) {/* refresh-da */ short disguise = sd->disguise; pc->disguise(sd, -1); @@ -19960,6 +19985,7 @@ static void clif_parse_dull(int fd, struct map_session_data *sd) static void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); static void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) { +#if PACKETVER >= 20100824 if (sd->state.trading || pc_isdead(sd) || pc_isvending(sd)) return; @@ -19973,6 +19999,7 @@ static void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) WFIFOL(fd, 2) = sd->cashPoints; //[Ryuuzaki] - switched positions to reflect proper values WFIFOL(fd, 6) = sd->kafraPoints; WFIFOSET(fd, 10); +#endif } static void clif_parse_CashShopClose(int fd, struct map_session_data *sd) __attribute__((nonnull (2))); @@ -24064,6 +24091,7 @@ void clif_defaults(void) clif->specialeffect = clif_specialeffect; clif->specialeffect_single = clif_specialeffect_single; clif->specialeffect_value = clif_specialeffect_value; + clif->specialeffect_value_single = clif_specialeffect_value_single; clif->removeSpecialEffect = clif_removeSpecialEffect; clif->removeSpecialEffect_single = clif_removeSpecialEffect_single; clif->millenniumshield = clif_millenniumshield; |