Skip to content

Commit

Permalink
Add ZC_SOULENERGY packet for soul balls
Browse files Browse the repository at this point in the history
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
  • Loading branch information
guilherme-gm committed May 1, 2024
1 parent bcf8df7 commit 3c2c45c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/map/clif.c
Expand Up @@ -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 <id>.L <amount>.W (ZC_SPIRITS)
* 0b73 <id>.L <amount>.W (ZC_SOULENERGY)
*
* @param bl Source block list.
* @param soulballs amount of soulballs
Expand All @@ -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);
}

/**
Expand Down
11 changes: 10 additions & 1 deletion src/map/packets_struct.h
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3c2c45c

Please sign in to comment.