diff options
author | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-01-26 22:55:54 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2020-02-09 23:56:02 +0100 |
commit | 1d0bd5baf6364822e48ba64010a52377c6abb776 (patch) | |
tree | 946a0681413b5ad39716d7cac0a7a90e8b04770d /src/map | |
parent | 29dfb34968fe42945bad712ce3ac8806d49ba473 (diff) | |
download | hercules-1d0bd5baf6364822e48ba64010a52377c6abb776.tar.gz hercules-1d0bd5baf6364822e48ba64010a52377c6abb776.tar.bz2 hercules-1d0bd5baf6364822e48ba64010a52377c6abb776.tar.xz hercules-1d0bd5baf6364822e48ba64010a52377c6abb776.zip |
Converted packet ZC_AUTORUN_SKILL to structure.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 27 | ||||
-rw-r--r-- | src/map/packets_struct.h | 12 |
2 files changed, 26 insertions, 13 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 23fc3a74d..660c516d7 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -6754,27 +6754,28 @@ static void clif_item_refine_list(struct map_session_data *sd) /// 0147 <skill id>.W <type>.L <level>.W <sp cost>.W <atk range>.W <skill name>.24B <upgradeable>.B static void clif_item_skill(struct map_session_data *sd, uint16 skill_id, uint16 skill_lv) { - int fd; - nullpo_retv(sd); - fd=sd->fd; + int fd = sd->fd; + + WFIFOHEAD(fd, sizeof(struct PACKET_ZC_AUTORUN_SKILL)); + struct PACKET_ZC_AUTORUN_SKILL *p = WFIFOP(fd, 0); int type = skill->get_inf(skill_id); if (sd->state.itemskill_castonself == 1 && skill->is_item_skill(sd, skill_id, skill_lv)) type = INF_SELF_SKILL; - WFIFOHEAD(fd,packet_len(0x147)); - WFIFOW(fd, 0)=0x147; - WFIFOW(fd, 2)=skill_id; - WFIFOL(fd, 4) = type; - WFIFOW(fd, 8)=skill_lv; - WFIFOW(fd,10)=skill->get_sp(skill_id,skill_lv); - WFIFOW(fd,12)=skill->get_range2(&sd->bl, skill_id,skill_lv); - safestrncpy(WFIFOP(fd,14),skill->get_name(skill_id),NAME_LENGTH); - WFIFOB(fd,38)=0; - WFIFOSET(fd,packet_len(0x147)); + p->packetType = HEADER_ZC_AUTORUN_SKILL; + p->skill_id = skill_id; + p->skill_type = type; + p->skill_lv = skill_lv; + p->skill_sp = skill->get_sp(skill_id, skill_lv); + p->skill_range = skill->get_range2(&sd->bl, skill_id, skill_lv); + safestrncpy(p->skill_name, skill->get_name(skill_id), NAME_LENGTH); + p->up_flag = 0; + + WFIFOSET(fd, sizeof(struct PACKET_ZC_AUTORUN_SKILL)); } /// Adds an item to character's cart. diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 31b28e831..b604c77b8 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -3873,6 +3873,18 @@ struct PACKET_ZC_STATE_CHANGE { DEFINE_PACKET_HEADER(ZC_STATE_CHANGE, 0x0119); #endif +struct PACKET_ZC_AUTORUN_SKILL { + int16 packetType; + uint16 skill_id; + uint32 skill_type; + uint16 skill_lv; + uint16 skill_sp; + uint16 skill_range; + char skill_name[NAME_LENGTH]; + char up_flag; +} __attribute__((packed)); +DEFINE_PACKET_HEADER(ZC_AUTORUN_SKILL, 0x0147); + #if !defined(sun) && (!defined(__NETBSD__) || __NetBSD_Version__ >= 600000000) // NetBSD 5 and Solaris don't like pragma pack but accept the packed attribute #pragma pack(pop) #endif // not NetBSD < 6 / Solaris |