From 3c2c45c031014b4503161442ec7ed5eaa32e7742 Mon Sep 17 00:00:00 2001 From: "Guilherme G. Menaldo" Date: Sat, 27 Apr 2024 01:52:03 -0300 Subject: [PATCH] Add ZC_SOULENERGY packet for soul balls spirit spheres and soul balls are handled separately in newer clients, and thus, using ZC_SPIRITS always show spirit balls, even for classes that would show soul balls before --- src/map/clif.c | 10 ++++++++-- src/map/packets_struct.h | 11 ++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/map/clif.c b/src/map/clif.c index e2289272bcb..2f8ecb359dd 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8103,6 +8103,7 @@ static void clif_devotion(struct block_list *src, struct map_session_data *tsd) * Server tells clients nearby 'sd' (and itself) to display soulballs. * Notifies clients in an area or self of an object's soulballs. * 01d0 .L .W (ZC_SPIRITS) + * 0b73 .L .W (ZC_SOULENERGY) * * @param bl Source block list. * @param soulballs amount of soulballs @@ -8112,12 +8113,17 @@ static void clif_soulball(struct block_list *bl, int soulballs, enum send_target { nullpo_retv(bl); +#if PACKETVER_MAIN_NUM >= 20200414 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20200506 + struct PACKET_ZC_SOULENERGY p = { 0 }; + p.PacketType = HEADER_ZC_SOULENERGY; +#else struct PACKET_ZC_SPIRITS p = { 0 }; - p.PacketType = HEADER_ZC_SPIRITS; +#endif + p.AID = bl->id; p.num = soulballs; - clif->send(&p, sizeof(struct PACKET_ZC_SPIRITS), bl, target); + clif->send(&p, sizeof(p), bl, target); } /** diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 7b43e821e1e..e8480c5ab8c 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -4768,7 +4768,7 @@ struct PACKET_ZC_NOTIFY_SKILL { int8 action; } __attribute__((packed)); DEFINE_PACKET_HEADER(ZC_NOTIFY_SKILL, 0x01de); -#endif +#endif #if PACKETVER_MAIN_NUM >= 20130731 || PACKETVER_RE_NUM >= 20130724 || defined(PACKETVER_ZERO) struct PACKET_ZC_USE_SKILL { @@ -5558,6 +5558,15 @@ struct PACKET_ZC_SPIRITS { } __attribute__((packed)); DEFINE_PACKET_HEADER(ZC_SPIRITS, 0x01d0) +#if PACKETVER_MAIN_NUM >= 20200414 || PACKETVER_RE_NUM >= 20200723 || PACKETVER_ZERO_NUM >= 20200506 +struct PACKET_ZC_SOULENERGY { + int16 PacketType; + uint32 AID; + uint16 num; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_SOULENERGY, 0x0b73) +#endif + struct PACKET_ZC_SAY_DIALOG { int16 PacketType; int16 PacketLength;