viewing paste Unknown #5770 | 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 176 177 178 179 180 181 182 183 184 185 186 187 188 189
Index: clif.c
===================================================================
--- clif.c  (revision 17303)
+++ clif.c  (working copy)
@@ -3267,6 +3267,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
@@ -3274,45 +3276,71 @@
 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;
+#elseif PACKETVER < 20120925
+   header = 0x8d0;
+#else
+   header = 0x999;
 
    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)=(long)pos;
+   offs+=2;
+#else
+   WFIFOW(fd,offs+4)=pos;
 #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;
+#elseif PACKETVER < 20120925
+   header = 0x8d1;
+#else
+   header = 0x99a;
+#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)=0xac;
+   WFIFOW(fd,offs+2)=n+2;
+#if PACKETVER >= 20120925
+   WFIFOL(fd,offs+4)=(long)pos;
+   offs +=2;
+#else
+   WFIFOW(fd,offs+4)=pos;
+#endif
+   WFIFOB(fd,offs+6)=ok;
+   WFIFOSET(fd,packet_len(header));
 }
 
 
@@ -5412,6 +5440,26 @@
    }
 }
 
+void clif_displaymessagecolor(struct map_session_data *sd, const char* msg, unsigned long color)
+{
+   int fd;
+   unsigned short len = strlen(msg) + 1;
+   
+   nullpo_retv(sd);
+   
+   color = (color & 0x0000FF) << 16 | (color & 0x00FF00) | (color & 0xFF0000) >> 16; // RGB to BGR
+   
+   fd = sd->fd;
+   WFIFOHEAD(fd, len+12);
+   WFIFOW(fd,0) = 0x2C1;
+   WFIFOW(fd,2) = len+12;
+   WFIFOL(fd,4) = 0;
+   WFIFOL(fd,8) = color;
+   memcpy(WFIFOP(fd,12), msg, len);
+   WFIFOSET(fd, WFIFOW(fd,2));
+}
+
+
 /// Send broadcast message in yellow or blue without font formatting (ZC_BROADCAST).
 /// 009a <packet len>.W <message>.?B
 void clif_broadcast(struct block_list* bl, const char* mes, int len, int type, enum send_target target)
@@ -5480,11 +5528,11 @@
        aFree(buf);
 }
 
-/*
- * Display *msg from *sd to all *users in channel
- */
-void clif_channel_msg(struct Channel *channel, struct map_session_data *sd, char *msg) {
-   DBIterator *iter;
+/* 
+ * Display *msg from *sd to all *users in channel 
+ */ 
+void clif_channel_msg(struct Channel *channel, struct map_session_data *sd, char *msg) { 
+   DBIterator *iter; 
    struct map_session_data *user;
    unsigned short msg_len = strlen(msg) + 1;
 
@@ -10183,9 +10231,15 @@
 
 /// 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 PACKETVER >= 20120925
+       req_pos = RFIFOL(fd,4);
+#else
+       req_pos = RFIFOW(fd,4);
+#endif
 
    if(pc_isdead(sd)) {
        clif_clearunit_area(&sd->bl,CLR_DEAD);
@@ -10220,7 +10274,8 @@
    if(sd->inventory_data[index]->type == IT_AMMO)
        pc_equipitem(sd,index,EQP_AMMO);
    else
-       pc_equipitem(sd,index,RFIFOW(fd,4));
+       pc_equipitem(sd,index,req_pos);
+
 }
 
 
@@ -16727,7 +16839,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
@@ -16742,7 +16854,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,  0,  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 671 times, submitted by Guest.