viewing paste newrankinglist.diff | 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 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361
diff --git a/db/packet_db.txt b/db/packet_db.txt
index dee8941..f48c461 100644
--- a/db/packet_db.txt
+++ b/db/packet_db.txt
@@ -1995,7 +1995,7 @@ packet_ver: 38
 0x0361,5,hommenu,2,4
 0x0883,36,storagepassword,2:4:20
 
-//2013-06-05 Ragexe (Shakto)
+//2013-06-12 Ragexe (Shakto)
 packet_ver: 39
 0x0369,7,actionrequest,2:6
 0x083C,10,useskilltoid,2:4:6
@@ -2026,3 +2026,164 @@ packet_ver: 39
 0x0940,26,friendslistadd,2
 0x093A,5,hommenu,2:4
 0x0964,36,storagepassword,2:4:20
+
+//2013-06-18 Ragexe (Shaktoh)
+packet_ver: 40
+0x0889,7,actionrequest,2:6
+0x0951,10,useskilltoid,2:4:6
+0x088E,5,walktoxy,2
+0x0930,6,ticksend,2
+0x08A6,5,changedir,2:4
+0x0962,6,takeitem,2
+0x0917,6,dropitem,2:4
+0x0885,8,movetokafra,2:4
+0x0936,8,movefromkafra,2:4
+0x096A,10,useskilltopos,2:4:6:8
+0x094F,90,useskilltoposinfo,2:4:6:8:10
+0x0944,6,getcharnamerequest,2
+0x0945,6,solvecharname,2
+0x0890,12,searchstoreinfolistitemclick,2:6:10
+0x0363,2,searchstoreinfonextpage,0
+0x0281,-1,searchstoreinfo,2:4:5:9:13:14:15
+0x0891,-1,reqtradebuyingstore,2:4:8:12
+0x0862,6,reqclickbuyingstore,2
+0x085A,2,reqclosebuyingstore,0
+0x0932,-1,reqopenbuyingstore,2:4:8:9:89
+0x08A7,18,bookingregreq,2:4:6
+// 0x087A,8 CZ_JOIN_BATTLE_FIELD
+0x0942,-1,itemlistwindowselected,2:4:8:12
+0x095B,19,wanttoconnection,2:6:10:14:18
+0x0887,26,partyinvite2,2
+// 0x0878,4 CZ_GANGSI_RANK
+0x0953,26,friendslistadd,2
+0x02C4,5,hommenu,2:4
+0x0864,36,storagepassword,2:4:20
+
+//2013-06-26 Ragexe
+packet_ver: 41
+0x0369,7,actionrequest,2:6
+0x083C,10,useskilltoid,2:4:6
+0x0437,5,walktoxy,2
+0x035F,6,ticksend,2
+0x094D,5,changedir,2:4
+0x088B,6,takeitem,2
+0x0952,6,dropitem,2:4
+0x0921,8,movetokafra,2:4
+0x0817,8,movefromkafra,2:4
+0x0438,10,useskilltopos,2:4:6:8
+0x0366,90,useskilltoposinfo,2:4:6:8:10
+0x096A,6,getcharnamerequest,2
+0x0368,6,solvecharname,2
+0x0838,12,searchstoreinfolistitemclick,2:6:10
+0x0835,2,searchstoreinfonextpage,0
+0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15
+0x0811,-1,reqtradebuyingstore,2:4:8:12
+0x0360,6,reqclickbuyingstore,2
+0x0365,2,reqclosebuyingstore,0
+0x0815,-1,reqopenbuyingstore,2:4:8:9:89
+0x0894,18,bookingregreq,2:4:6
+// 0x0860,8 CZ_JOIN_BATTLE_FIELD
+0x08A5,-1,itemlistwindowselected,2:4:8:12
+0x088C,19,wanttoconnection,2:6:10:14:18
+0x0895,26,partyinvite2,2
+// 0x088F,4 CZ_GANGSI_RANK
+0x08AB,26,friendslistadd,2
+0x0960,5,hommenu,2:4
+0x0930,36,storagepassword,2:4:20
+
+//2013-07-03 Ragexe
+packet_ver: 42
+0x0369,7,actionrequest,2:6
+0x083C,10,useskilltoid,2:4:6
+0x0437,5,walktoxy,2
+0x035F,6,ticksend,2
+0x0930,5,changedir,2:4
+0x07E4,6,takeitem,2
+0x0362,6,dropitem,2:4
+0x07EC,8,movetokafra,2:4
+0x0364,8,movefromkafra,2:4
+0x0438,10,useskilltopos,2:4:6:8
+0x0366,90,useskilltoposinfo,2:4:6:8:10
+0x096A,6,getcharnamerequest,2
+0x0368,6,solvecharname,2
+0x0838,12,searchstoreinfolistitemclick,2:6:10
+0x0835,2,searchstoreinfonextpage,0
+0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15
+0x0811,-1,reqtradebuyingstore,2:4:8:12
+0x0202,6,reqclickbuyingstore,2
+0x0817,2,reqclosebuyingstore,0
+0x0815,-1,reqopenbuyingstore,2:4:8:9:89
+0x0365,18,bookingregreq,2:4:6
+// 0x0363,8 CZ_JOIN_BATTLE_FIELD
+0x0281,-1,itemlistwindowselected,2:4:8:12
+0x022D,19,wanttoconnection,2:6:10:14:18
+0x0802,26,partyinvite2,2
+// 0x0436,4 CZ_GANGSI_RANK
+0x0360,26,friendslistadd,2
+0x094A,5,hommenu,2:4
+0x0873,36,storagepassword,2:4:20
+
+//2013-07-10 Ragexe
+packet_ver: 43
+0x0369,7,actionrequest,2:6
+0x083C,10,useskilltoid,2:4:6
+0x0437,5,walktoxy,2
+0x035F,6,ticksend,2
+0x0202,5,changedir,2:4
+0x07E4,6,takeitem,2
+0x0362,6,dropitem,2:4
+0x07EC,8,movetokafra,2:4
+0x0364,8,movefromkafra,2:4
+0x0438,10,useskilltopos,2:4:6:8
+0x0366,90,useskilltoposinfo,2:4:6:8:10
+0x096A,6,getcharnamerequest,2
+0x0368,6,solvecharname,2
+0x0838,12,searchstoreinfolistitemclick,2:6:10
+0x0835,2,searchstoreinfonextpage,0
+0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15
+0x0811,-1,reqtradebuyingstore,2:4:8:12
+0x0360,6,reqclickbuyingstore,2
+0x0817,2,reqclosebuyingstore,0
+0x0815,-1,reqopenbuyingstore,2:4:8:9:89
+0x0365,18,bookingregreq,2:4:6
+// 0x0363,8 CZ_JOIN_BATTLE_FIELD
+0x0281,-1,itemlistwindowselected,2:4:8:12
+0x022D,19,wanttoconnection,2:6:10:14:18
+0x0802,26,partyinvite2,2
+// 0x0436,4 CZ_GANGSI_RANK
+0x023B,26,friendslistadd,2
+0x0361,5,hommenu,2:4
+0x0880,36,storagepassword,2:4:20
+0x097c,4,ranklist,2
+
+//2013-07-17 Ragexe
+packet_ver: 44
+0x0918,7,actionrequest,2:6
+0x091E,10,useskilltoid,2:4:6
+0x083C,5,walktoxy,2
+0x02C4,6,ticksend,2
+0x088C,5,changedir,2:4
+0x08A9,6,takeitem,2
+0x0917,6,dropitem,2:4
+0x089B,8,movetokafra,2:4
+0x0956,8,movefromkafra,2:4
+0x0882,10,useskilltopos,2:4:6:8
+0x0952,90,useskilltoposinfo,2:4:6:8:10
+0x0958,6,getcharnamerequest,2
+0x0967,6,solvecharname,2
+0x0960,12,searchstoreinfolistitemclick,2:6:10
+0x0819,2,searchstoreinfonextpage,0
+0x086B,-1,searchstoreinfo,2:4:5:9:13:14:15
+0x093B,-1,reqtradebuyingstore,2:4:8:12
+0x0898,6,reqclickbuyingstore,2
+0x096A,2,reqclosebuyingstore,0
+0x08AA,-1,reqopenbuyingstore,2:4:8:9:89
+0x0862,18,bookingregreq,2:4:6
+// 0x08A6,8 CZ_JOIN_BATTLE_FIELD
+0x0897,-1,itemlistwindowselected,2:4:8:12
+0x091D,19,wanttoconnection,2:6:10:14:18
+0x092F,26,partyinvite2,2
+// 0x086C,4 CZ_GANGSI_RANK
+0x0863,26,friendslistadd,2
+0x088A,5,hommenu,2:4
+0x095B,36,storagepassword,2:4:20
diff --git a/src/map/clif.c b/src/map/clif.c
index 4e3a3f8..879daaf 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -2520,7 +2520,7 @@ void clif_storagelist(struct map_session_data* sd, struct item* items, int items
                WBUFW(buf,0)=0x2ea;
 #else
                WBUFW(buf,0)=0x995;
-               memset((char*)WBUFP(buf,6),0,24); //storename
+               memset((char*)WBUFP(buf,4),0,24); //storename
 #endif
                WBUFW(buf,2)=n*s+sidx;
                clif_send(buf, WBUFW(buf,2), &sd->bl, SELF);
@@ -2533,7 +2533,7 @@ void clif_storagelist(struct map_session_data* sd, struct item* items, int items
                WBUFW(bufe,0)=0x2d1;
 #else
                WBUFW(bufe,0)=0x996;
-               memset((char*)WBUFP(bufe,6),0,24); //storename
+               memset((char*)WBUFP(bufe,4),0,24); //storename
 #endif
                WBUFW(bufe,2)=ne*se+sidxe;
                clif_send(bufe, WBUFW(bufe,2), &sd->bl, SELF);
@@ -16562,6 +16562,97 @@ void clif_parse_client_version(int fd,struct map_session_data *sd){
        ;
 }
 
+/// Ranking list
+
+/// ranking pointlist  { <name>.24B <point>.L }*10
+void clif_sub_ranklist(unsigned char *buf,int idx,struct map_session_data* sd, int listid){
+       const char* name;  
+       struct fame_list* list;
+       int i, skip;
+
+       switch(listid+1) //to keep the same case as char.c
+       {
+       case 1: list = smith_fame_list; break;
+       case 2: list = chemist_fame_list; break;
+       case 3: list = taekwon_fame_list; break;
+       default: skip=1; break;
+       }
+      
+       if(!skip){
+               //Packet size limits this list to 10 elements. [Skotlex]
+               for (i = 0; i < 10 && i < MAX_FAME_LIST; i++) {
+                       if (list[i].id > 0) {
+                               if (strcmp(list[i].name, "-") == 0 &&
+                                       (name = map_charid2nick(list[i].id)) != NULL)
+                               {
+                                       strncpy((char *)(WBUFP(buf,idx + 24 * i)), name, NAME_LENGTH);
+                               } else
+                                       strncpy((char *)(WBUFP(buf,idx + 24 * i)), list[i].name, NAME_LENGTH);
+                       } else
+                               strncpy((char *)(WBUFP(buf, idx + 24 * i)), "None", 5);
+                       WBUFL(buf, idx+24*10 + i * 4) = list[i].fame; //points
+               }
+               for(;i < 10; i++) { //In case the MAX is less than 10.
+                       strncpy((char *)(WBUFP(buf, idx + 24 * i)), "Unavailable", 12);
+                       WBUFL(buf, idx+24*10 + i * 4) = 0;
+               }
+       }
+}
+
+/// 097d <RankingType>.W {<CharName>.24B <point>L}*10 <mypoint>L (ZC_ACK_RANKING)
+void clif_ranklist(struct map_session_data *sd, int rankingType){
+       unsigned char buf[MAX_FAME_LIST * sizeof(struct fame_list)];
+       int mypoint=0, fd=sd->fd;
+      
+       WFIFOHEAD(fd,288);
+       WFIFOW(fd,0) = 0x97d;
+       WFIFOW(fd,2) = rankingType;
+      
+       clif_sub_ranklist(WBUFP(buf,0),4,sd,rankingType);
+
+       switch(sd->class_&MAPID_UPPERMASK){ //mypoint (checking if valid type)
+               case MAPID_BLACKSMITH:
+               case MAPID_ALCHEMIST:
+               case MAPID_TAEKWON:
+                       mypoint = sd->status.fame;
+       }
+       WFIFOL(fd,284) = mypoint; //mypoint
+       WFIFOSET(fd,288);
+}
+
+/*
+ *  097c <type> (CZ_REQ_RANKING)
+ * type
+ *  0: /blacksmith
+ *  1: /alchemist
+ *  2: /taekwon
+ *  3: /pk
+ * */
+void clif_parse_ranklist(int fd,struct map_session_data *sd){
+       struct s_packet_db* info = &packet_db[sd->packet_ver][RFIFOW(fd,0)];
+       int listid = RFIFOL(fd,info->pos[0]); //type
+       if(listid != 3) clif_ranklist(sd,listid); // pk_list unsuported atm
+}
+
+// 097e <RankingType>.W <point>.L <TotalPoint>.L (unused atm) (ZC_UPDATE_RANKING_POINT)
+void clif_update_rankingpoint(struct map_session_data *sd, int rankingtype, int point){
+#if PACKETVER < 20130710
+       switch(ranktype){
+               case 0: clif_fame_blacksmith(sd,point); break;  // Blacksmith
+               case 1: clif_fame_alchemist(sd,point); break; //Alchemist
+               case 2: clif_fame_taekwon(sd,point); break; // Taekwon
+       }
+#else
+       int fd=sd->fd;
+       WFIFOHEAD(fd,14);
+       WFIFOW(fd,0) = 0x97e;
+       WFIFOW(fd,2) = rankingtype;
+       WFIFOL(fd,4) = point;
+       WFIFOL(fd,8) = sd->status.fame;
+       WFIFOSET(fd,12);
+#endif
+}
+
 #ifdef DUMP_UNKNOWN_PACKET
 void DumpUnknow(int fd,TBL_PC *sd,int cmd,int packet_len){
        const char* packet_txt = "save/packet.txt";
@@ -17190,6 +17281,7 @@ void packetdb_readdb(void)
                { clif_parse_reqworldinfo, "reqworldinfo"},
                { clif_parse_client_version, "clientversion"},
                { clif_parse_blocking_playcancel, "booking_playcancel"},
+               { clif_parse_ranklist, "ranklist"},
                {NULL,NULL}
        };
 
diff --git a/src/map/clif.h b/src/map/clif.h
index 177afc5..4778d0d 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -35,7 +35,7 @@ struct party_booking_ad_info;
 enum
 {// packet DB
        MAX_PACKET_DB  = 0xf00,
-       MAX_PACKET_VER = 39,
+       MAX_PACKET_VER = 44,
        MAX_PACKET_POS = 20,
 };
 
diff --git a/src/map/pc.c b/src/map/pc.c
index 8caecad..dec0c54 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -353,21 +353,19 @@ int pc_banding(struct map_session_data *sd, uint16 skill_lv) {
 // Increases a player's fame points and displays a notice to him
 void pc_addfame(struct map_session_data *sd,int count)
 {
+       int ranktype=-1;
        nullpo_retv(sd);
        sd->status.fame += count;
        if(sd->status.fame > MAX_FAME)
                sd->status.fame = MAX_FAME;
+              
        switch(sd->class_&MAPID_UPPERMASK){
-               case MAPID_BLACKSMITH: // Blacksmith
-                       clif_fame_blacksmith(sd,count);
-                       break;
-               case MAPID_ALCHEMIST: // Alchemist
-                       clif_fame_alchemist(sd,count);
-                       break;
-               case MAPID_TAEKWON: // Taekwon
-                       clif_fame_taekwon(sd,count);
-                       break;
+               case MAPID_BLACKSMITH: ranktype=0; break;
+               case MAPID_ALCHEMIST:  ranktype=1; break;
+               case MAPID_TAEKWON: ranktype=2; break;
        }
+      
+       clif_update_rankingpoint(sd,ranktype,count);
        chrif_updatefamelist(sd);
 }
 
@@ -8541,6 +8539,7 @@ int pc_load_combo(struct map_session_data *sd) {
        }
        return ret;
 }
+
 /*==========================================
  * Equip item on player sd at req_pos from inventory index n
  *------------------------------------------*/
 
Viewed 898 times, submitted by lighta.