viewing paste Unknown #5777 | Diff

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
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,
Viewed 239 times, submitted by unknown.