summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-07-10 22:03:45 +0300
committerAndrei Karas <akaras@inbox.ru>2018-07-15 20:36:27 +0300
commitfd081fbacb8cc1a8fdcbacfa1923c4b7c17510a4 (patch)
tree6a2897782bf46bcacdaced9a713d3150087d58d4 /src
parent8c62eb43def49ebd089b4287d78f9b64ea673090 (diff)
downloadhercules-fd081fbacb8cc1a8fdcbacfa1923c4b7c17510a4.tar.gz
hercules-fd081fbacb8cc1a8fdcbacfa1923c4b7c17510a4.tar.bz2
hercules-fd081fbacb8cc1a8fdcbacfa1923c4b7c17510a4.tar.xz
hercules-fd081fbacb8cc1a8fdcbacfa1923c4b7c17510a4.zip
Update packet ZC_NOTIFY_WEAPONITEMLIST.
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c30
-rw-r--r--src/map/packets_struct.h17
2 files changed, 34 insertions, 13 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index e1825203d..410ef1b7d 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -6359,30 +6359,34 @@ static void clif_item_refine_list(struct map_session_data *sd)
{
int i,c;
int fd;
+ int len;
+ struct PACKET_ZC_NOTIFY_WEAPONITEMLIST *p;
uint16 skill_lv;
nullpo_retv(sd);
- skill_lv = pc->checkskill(sd,WS_WEAPONREFINE);
-
- fd=sd->fd;
+ skill_lv = pc->checkskill(sd, WS_WEAPONREFINE);
- WFIFOHEAD(fd, MAX_INVENTORY * 13 + 4);
- WFIFOW(fd,0)=0x221;
+ fd = sd->fd;
+ len = MAX_INVENTORY * sizeof(struct PACKET_ZC_NOTIFY_WEAPONITEMLIST_sub) + sizeof(struct PACKET_ZC_NOTIFY_WEAPONITEMLIST);
+ WFIFOHEAD(fd, len);
+ p = WFIFOP(fd, 0);
+ p->packetType = 0x221;
for (i = c = 0; i < MAX_INVENTORY; i++) {
- if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify
+ if (sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify
&& itemdb_wlv(sd->status.inventory[i].nameid) >= 1
&& !sd->inventory_data[i]->flag.no_refine
- && !(sd->status.inventory[i].equip&EQP_ARMS)){
- WFIFOW(fd,c*13+ 4)=i+2;
- WFIFOW(fd,c*13+ 6)=sd->status.inventory[i].nameid;
- WFIFOB(fd,c*13+ 8)=sd->status.inventory[i].refine;
- clif->addcards((struct EQUIPSLOTINFO*)WFIFOP(fd, c * 13 + 9), &sd->status.inventory[i]);
+ && !(sd->status.inventory[i].equip & EQP_ARMS)) {
+ p->items[c].index = i + 2;
+ p->items[c].itemId = sd->status.inventory[i].nameid;
+ p->items[c].refine = sd->status.inventory[i].refine;
+ clif->addcards(&p->items[c].slot, &sd->status.inventory[i]);
c++;
}
}
- WFIFOW(fd,2)=c*13+4;
- WFIFOSET(fd,WFIFOW(fd,2));
+ len = c * sizeof(struct PACKET_ZC_NOTIFY_WEAPONITEMLIST_sub) + sizeof(struct PACKET_ZC_NOTIFY_WEAPONITEMLIST);
+ p->packetLength = len;
+ WFIFOSET(fd, len);
if (c > 0) {
sd->menuskill_id = WS_WEAPONREFINE;
sd->menuskill_val = skill_lv;
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 1a2bcec76..f86d87f2f 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -2442,6 +2442,23 @@ struct PACKET_ZC_REPAIRITEMLIST {
struct PACKET_ZC_REPAIRITEMLIST_sub items[];
} __attribute__((packed));
+struct PACKET_ZC_NOTIFY_WEAPONITEMLIST_sub {
+ int16 index;
+#if PACKETVER_RE_NUM >= 20180704
+ uint32 itemId;
+#else
+ uint16 itemId;
+#endif
+ uint8 refine; // unused?
+ struct EQUIPSLOTINFO slot; // unused?
+} __attribute__((packed));
+
+struct PACKET_ZC_NOTIFY_WEAPONITEMLIST {
+ int16 packetType;
+ int16 packetLength;
+ struct PACKET_ZC_NOTIFY_WEAPONITEMLIST_sub items[];
+} __attribute__((packed));
+
#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