quick fix for 2012-2013
// TODO: find a more accurate date for this
- #if PACKETVER < 20130320
/// Request to buy item(s) from cash shop (CZ_PC_BUY_CASH_POINT_ITEM).
/// 0288 <name id>.W <amount>.W
/// 0288 <name id>.W <amount>.W <kafra points>.L (PACKETVER >= 20070711)
/// 0288 <packet len>.W <kafra points>.L <count>.W { <amount>.W <name id>.W }.4B*count (PACKETVER >= 20100803)
void clif_parse_cashshop_buy(int fd, struct map_session_data *sd){
int fail = 0;
nullpo_retv(sd);
if( sd->state.trading || !sd->npc_shopid )
fail = 1;
else {
#if PACKETVER < 20101116
short nameid = RFIFOW(fd,2);
short amount = RFIFOW(fd,4);
int points = RFIFOL(fd,6);
fail = npc_cashshop_buy(sd, nameid, amount, points);
#else
int len = RFIFOW(fd,2);
int points = RFIFOL(fd,4);
int count = RFIFOW(fd,8);
unsigned short* item_list = (unsigned short*)RFIFOP(fd,10);
if( len < 10 || len != 10 + count * 4)
{
ShowWarning("Player %u sent incorrect cash shop buy packet (len %u:%u)!\n", sd->status.char_id, len, 10 + count * 4);
return;
}
fail = npc_cashshop_buylist(sd,points,count,item_list);
#endif
}
clif_cashshop_ack(sd,fail);
}
- #endif
and
// TODO: find a more accurate date for this
- #if PACKETVER >= 20130320
- void clif_parse_cashshop_buy( int fd, struct map_session_data *sd ){
+ void clif_parse_cashshop_buy2( int fd, struct map_session_data *sd ){
uint16 length = RFIFOW( fd, 2 );
uint16 count = RFIFOL( fd, 4 );
if( length < 10 || length < ( 10 + count * 6 ) ){
return;
}
cashshop_buylist( sd, RFIFOL( fd, 6 ), count, (uint16 *)RFIFOP( fd, 10 ) );
}
- #endif
and
{ clif_parse_cashshop_open_request, "cashshopopen" },
{ clif_parse_cashshop_close, "cashshopclose" },
{ clif_parse_cashshop_list_request, "cashshopitemlist" },
{ clif_parse_cashshop_buy, "cashshopbuy" },
+ { clif_parse_cashshop_buy2, "cashshopbuy2" },
and packet_db.txt
// New cashshop
+ 0x0844,2,cashshopopen,0
+ 0x084a,2,cashshopclose,0
+ 0x08c9,4,cashshopitemlist,0
+ 0x0848,-1,cashshopbuy2,0
//2010-08-03aRagexeRE
0x0839,66
0x0842,6,recall2,2
0x0843,6,remove2,2