Index: clif.c
===================================================================
--- clif.c (revision 17304)
+++ clif.c (working copy)
@@ -3270,6 +3270,8 @@
/// Notifies the client about the result of a request to equip an item (ZC_REQ_WEAR_EQUIP_ACK).
/// 00aa <index>.W <equip location>.W <result>.B
/// 00aa <index>.W <equip location>.W <view id>.W <result>.B (PACKETVER >= 20100629)
+/// 08d0 <index>.W <equip location>.W <view id>.W <result>.B
+/// 0999 <index>.W <equip location>.L <view id>.W <result>.B
/// result:
/// 0 = failure
/// 1 = success
@@ -3277,45 +3279,77 @@
void clif_equipitemack(struct map_session_data *sd,int n,int pos,int ok)
{
int fd;
+ int header,offs=0;
+#if PACKETVER < 20110824
+ header = 0xaa;
+#elif PACKETVER < 20120925
+ header = 0x8d0;
+ ok = ok ? 0 : 1;
+#else
+ header = 0x999;
+ ok = ok ? 0 : 1;
+#endif
nullpo_retv(sd);
fd=sd->fd;
- WFIFOHEAD(fd,packet_len(0xaa));
- WFIFOW(fd,0)=0xaa;
- WFIFOW(fd,2)=n+2;
- WFIFOW(fd,4)=pos;
+ WFIFOHEAD(fd,packet_len(header));
+ WFIFOW(fd,offs+0)=header;
+ WFIFOW(fd,offs+2)=n+2;
+#if PACKETVER >= 20120925
+ WFIFOL(fd,offs+4)=pos;
+ offs+=2;
+#else
+ WFIFOW(fd,offs+4)=(int)pos;
+#endif
#if PACKETVER < 20100629
- WFIFOB(fd,6)=ok;
+ WFIFOB(fd,offs+6)=ok;
#else
if (ok && sd->inventory_data[n]->equip&EQP_VISIBLE)
- WFIFOW(fd,6)=sd->inventory_data[n]->look;
+ WFIFOW(fd,offs+6)=sd->inventory_data[n]->look;
else
- WFIFOW(fd,6)=0;
- WFIFOB(fd,8)=ok;
+ WFIFOW(fd,offs+6)=0;
+ WFIFOB(fd,offs+8)=ok;
#endif
- WFIFOSET(fd,packet_len(0xaa));
+ WFIFOSET(fd,packet_len(header));
}
/// Notifies the client about the result of a request to take off an item (ZC_REQ_TAKEOFF_EQUIP_ACK).
/// 00ac <index>.W <equip location>.W <result>.B
+/// 08d1 <index>.W <equip location>.W <result>.B
+/// 099a <index>.W <equip location>.L <result>.B
/// result:
/// 0 = failure
/// 1 = success
void clif_unequipitemack(struct map_session_data *sd,int n,int pos,int ok)
{
- int fd;
-
+ int fd,header,offs=0;
+#if PACKETVER < 20110824
+ header = 0xac;
+#elif PACKETVER < 20120925
+ header = 0x8d1;
+ ok = ok ? 0 : 1;
+#else
+ header = 0x99a;
+ ok = ok ? 0 : 1;
+#endif
nullpo_retv(sd);
fd=sd->fd;
- WFIFOHEAD(fd,packet_len(0xac));
- WFIFOW(fd,0)=0xac;
- WFIFOW(fd,2)=n+2;
- WFIFOW(fd,4)=pos;
- WFIFOB(fd,6)=ok;
- WFIFOSET(fd,packet_len(0xac));
+
+ WFIFOHEAD(fd,packet_len(header));
+ WFIFOW(fd,offs+0)=header;
+ WFIFOW(fd,offs+2)=n+2;
+
+#if PACKETVER >= 20120925
+ WFIFOL(fd,offs+4)=pos;
+ offs +=2;
+#else
+ WFIFOW(fd,offs+4)=(int)pos;
+#endif
+ WFIFOB(fd,offs+6)=ok;
+ WFIFOSET(fd,packet_len(header));
}
@@ -8691,6 +8745,7 @@
/// 02d7 <packet len>.W <name>.24B <class>.W <hairstyle>.W <bottom-viewid>.W <mid-viewid>.W <up-viewid>.W <haircolor>.W <cloth-dye>.W <gender>.B {equip item}.28B* (ZC_EQUIPWIN_MICROSCOPE, PACKETVER >= 20100629)
/// 0859 <packet len>.W <name>.24B <class>.W <hairstyle>.W <bottom-viewid>.W <mid-viewid>.W <up-viewid>.W <haircolor>.W <cloth-dye>.W <gender>.B {equip item}.28B* (ZC_EQUIPWIN_MICROSCOPE2, PACKETVER >= 20101124)
/// 0859 <packet len>.W <name>.24B <class>.W <hairstyle>.W <bottom-viewid>.W <mid-viewid>.W <up-viewid>.W <robe>.W <haircolor>.W <cloth-dye>.W <gender>.B {equip item}.28B* (ZC_EQUIPWIN_MICROSCOPE2, PACKETVER >= 20110111)
+/// 0997 <packet len>.W <name>.24B <class>.W <hairstyle>.W <bottom-viewid>.W <mid-viewid>.W <up-viewid>.W <robe>.W <haircolor>.W <cloth-dye>.W <gender>.B {equip item}.28B* (ZC_EQUIPWIN_MICROSCOPE_V5, PACKETVER >= 20120925)
void clif_viewequip_ack(struct map_session_data* sd, struct map_session_data* tsd)
{
uint8* buf;
@@ -8709,8 +8764,10 @@
#if PACKETVER < 20101124
WBUFW(buf, 0) = 0x2d7;
+#elseif PACKETVER < 20120925
+ WBUFW(buf, 0) = 0x859;
#else
- WBUFW(buf, 0) = 0x859;
+ WBUFW(buf, 0) = 0x997;
#endif
safestrncpy((char*)WBUFP(buf, 4), tsd->status.name, NAME_LENGTH);
WBUFW(buf,28) = tsd->status.class_;
@@ -10186,9 +10243,10 @@
/// Request to equip an item (CZ_REQ_WEAR_EQUIP).
/// 00a9 <index>.W <position>.W
+/// 0998 <index>.W <position>.L
void clif_parse_EquipItem(int fd,struct map_session_data *sd)
{
- int index;
+ int index, req_pos;
if(pc_isdead(sd)) {
clif_clearunit_area(&sd->bl,CLR_DEAD);
@@ -10222,8 +10280,15 @@
//Client doesn't send the position for ammo.
if(sd->inventory_data[index]->type == IT_AMMO)
pc_equipitem(sd,index,EQP_AMMO);
- else
- pc_equipitem(sd,index,RFIFOW(fd,4));
+ else{
+#if PACKETVER >= 20120925
+ req_pos = RFIFOL(fd,4);
+#else
+ req_pos = RFIFOW(fd,4);
+#endif
+ pc_equipitem(sd,index,req_pos);
+ }
+
}
@@ -16730,7 +16852,7 @@
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
//#0x08C0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,
- 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 9, 7, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
//#0x0900
@@ -16745,7 +16867,7 @@
0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0,
//#0x0980
0, 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0,
+ 31, 0, 0, 0, 0, 0, 0, -1, 8, 11, 9, 8, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0,