Jump to content
  • 0

Cash Shop Bug


SlashGeeGee

Question


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

Hello rA :)

don't know where to post this so please transfer me if im in the wrong section :D

when i purchase an item in my cash shop it doesnt get the item and the cash point still remains and my character freezes and nothing to do but alt+f4 to exit :D

see screenshot :

1st i purchase an item and click buy then ok .

2z7mkqe.jpg

2nd nothing happens :D

imjl7s.jpg

3rd i tried returning the item to the shop and this is what it looks like :)

24mrkv9.jpg

SVN : rAthena

Client : 2010-05-11

Badly Needed your Help :D

~ SlashGeeGee

Link to comment
Share on other sites

18 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

- 1st post your script

- 2nd post this in script section

this is the example

prontera,155,170,5 cashshop normalcash_shop 83,502:5,503:1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

My Cash Shop Scripts :


//-- Cash Shops
new_1-2,93,99,4<tab>cashshop<tab>WoE Supplies<tab>1907,14287:100,14288:100
new_1-2,78,101,5<tab>cashshop<tab>Cash Shop Usables<tab>951,12920:100,12921:100,12186:100,13696:100,14158:100,14168:100,13601:100,13500:100,13749:100,13746:50,13755:100,13752:50
new_1-2,121,101,3<tab>cashshop<tab>Cash Shop Items<tab>899,5529:800,5453:500,5495:800,5512:700,5545:700,5569:700,5514:700,5549:700,5325:500,5377:500,13412:1000,13413:1000

Edited by SlashGeeGee
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  592
  • Reputation:   31
  • Joined:  11/14/11
  • Last Seen:  

wait

On npc.c add:

/*==========================================

* Cash Shop Buy List

*------------------------------------------*/

int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, unsigned short* item_list)

{

int i, j, nameid, amount, new_, w, vt;

struct npc_data *nd = (struct npc_data *)map_id2bl(sd->npc_shopid);

if( !nd || nd->subtype != CASHSHOP )

return 1;

if( sd->state.trading )

return 4;

new_ = 0;

w = 0;

vt = 0; // Global Value

// Validating Process ----------------------------------------------------

for( i = 0; i < count; i++ )

{

nameid = item_list[i*2+1];

amount = item_list[i*2+0];

if( !itemdb_exists(nameid) || amount <= 0 )

return 5;

ARR_FIND(0,nd->u.shop.count,j,nd->u.shop.shop_item[j].nameid == nameid);

if( j == nd->u.shop.count || nd->u.shop.shop_item[j].value <= 0 )

return 5;

if( !itemdb_isstackable(nameid) && amount > 1 )

{

ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of nonstackable item %d!n", sd->status.name, sd->status.account_id, sd->status.char_id, amount, nameid);

amount = item_list[i*2+0] = 1;

}

switch( pc_checkadditem(sd,nameid,amount) )

{

case ADDITEM_NEW:

new_++;

break;

case ADDITEM_OVERAMOUNT:

return 3;

}

vt += nd->u.shop.shop_item[j].value * amount;

w += itemdb_weight(nameid) * amount;

}

if( w + sd->weight > sd->max_weight )

return 3;

if( pc_inventoryblank(sd) < new_ )

return 3;

if( points > vt ) points = vt;

// Payment Process ----------------------------------------------------

if( sd->kafraPoints < points || sd->cashPoints < (vt - points) )

return 6;

pc_paycash(sd,vt,points);

// Delivery Process ----------------------------------------------------

for( i = 0; i < count; i++ )

{

struct item item_tmp;

nameid = item_list[i*2+1];

amount = item_list[i*2+0];

memset(&item_tmp,0,sizeof(item_tmp));

if( !pet_create_egg(sd,nameid) )

{

item_tmp.nameid = nameid;

item_tmp.identify = 1;

pc_additem(sd,&item_tmp,amount);

}

if( log_config.enable_logs&0x20 )

log_pick_pc(sd, "S", nameid, amount, NULL);

}

return 0;

}

On npc.h add:

int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, unsigned short* item_list);

on clic.c replace with:

void clif_parse_cashshop_buy(int fd, struct map_session_data *sd)

{

int fail = 0;

struct npc_data *nd;

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);

}

And by last, on packet_db.txt

//2010-11-24aRagexeRE

packet_ver: 26

+0x0288,-1,cashshopbuy,4:8

0x0436,19,wanttoconnection,2:6:10:14:18

- copy right: zephyrus_cr

- i don't know if this is going to work but the said fix is for client 2010

compile your server

cd /home/ra

make clean

make all

done~

Edited by GM Takumirai
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

wait

On npc.c add:

/*==========================================

* Cash Shop Buy List

*------------------------------------------*/

int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, unsigned short* item_list)

{

int i, j, nameid, amount, new_, w, vt;

struct npc_data *nd = (struct npc_data *)map_id2bl(sd->npc_shopid);

if( !nd || nd->subtype != CASHSHOP )

return 1;

if( sd->state.trading )

return 4;

new_ = 0;

w = 0;

vt = 0; // Global Value

// Validating Process ----------------------------------------------------

for( i = 0; i < count; i++ )

{

nameid = item_list[i*2+1];

amount = item_list[i*2+0];

if( !itemdb_exists(nameid) || amount <= 0 )

return 5;

ARR_FIND(0,nd->u.shop.count,j,nd->u.shop.shop_item[j].nameid == nameid);

if( j == nd->u.shop.count || nd->u.shop.shop_item[j].value <= 0 )

return 5;

if( !itemdb_isstackable(nameid) && amount > 1 )

{

ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of nonstackable item %d!n", sd->status.name, sd->status.account_id, sd->status.char_id, amount, nameid);

amount = item_list[i*2+0] = 1;

}

switch( pc_checkadditem(sd,nameid,amount) )

{

case ADDITEM_NEW:

new_++;

break;

case ADDITEM_OVERAMOUNT:

return 3;

}

vt += nd->u.shop.shop_item[j].value * amount;

w += itemdb_weight(nameid) * amount;

}

if( w + sd->weight > sd->max_weight )

return 3;

if( pc_inventoryblank(sd) < new_ )

return 3;

if( points > vt ) points = vt;

// Payment Process ----------------------------------------------------

if( sd->kafraPoints < points || sd->cashPoints < (vt - points) )

return 6;

pc_paycash(sd,vt,points);

// Delivery Process ----------------------------------------------------

for( i = 0; i < count; i++ )

{

struct item item_tmp;

nameid = item_list[i*2+1];

amount = item_list[i*2+0];

memset(&item_tmp,0,sizeof(item_tmp));

if( !pet_create_egg(sd,nameid) )

{

item_tmp.nameid = nameid;

item_tmp.identify = 1;

pc_additem(sd,&item_tmp,amount);

}

if( log_config.enable_logs&0x20 )

log_pick_pc(sd, "S", nameid, amount, NULL);

}

return 0;

}

On npc.h add:

​int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, unsigned short* item_list);

on clic.c replace with:

void clif_parse_cashshop_buy(int fd, struct map_session_data *sd)

{

int fail = 0;

struct npc_data *nd;

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);

}

And by last, on packet_db.txt

//2010-11-24aRagexeRE

packet_ver: 26

+0x0288,-1,cashshopbuy,4:8

0x0436,19,wanttoconnection,2:6:10:14:18

- copy right: zephyrus_cr

- i don't know if this is going to work but the said fix is for client 2010

compile your server

cd /home/ra

make clean

make all

done~

i searched all the lines in the source and packet_db.txt rA already has it but my client date is 2010-05-11 that is for 2010-11-24 is there anyway to change that to my clients date ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  2244
  • Reputation:   182
  • Joined:  11/19/11
  • Last Seen:  

to my knowledge cash shop should work fine before 2010-11-24, there shouldn't be any error.

you're using the msgstringtable for your client date right?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  2244
  • Reputation:   182
  • Joined:  11/19/11
  • Last Seen:  

i'll post back soon, I'll checkout the latest rA, and use the client you have and see what i get

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

i'll post back soon, I'll checkout the latest rA, and use the client you have and see what i get

thanks :D

btw : im using default in packet_db :)

Edited by SlashGeeGee
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  2244
  • Reputation:   182
  • Joined:  11/19/11
  • Last Seen:  

works fine,

you can try this if you want

http://www.sendspace.com/file/ltihet

1) Used your script, custom/cashshop.txt

2) checked out latest rA

3) mmo.h set to 20100511 and recompiled fully

4) packet_db set to 25

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

i need to renew my server files ? the server's already running :D

is there any other way ?

what did you use in the packet_db ?

Thanks Judas , GM Takumirai for the Help

i used packet_db ver : 25

Solved Problems :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  162
  • Reputation:   1
  • Joined:  08/08/12
  • Last Seen:  

where can I set cashpoints or currency items which, will be equal to caspoints?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

where can I set cashpoints or currency items which, will be equal to caspoints?

In order to use the cashshop, you would need to first have cashpoints. You can either get cashpoints by using @cash command or using #CASHPOINTS variable.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   0
  • Joined:  04/05/12
  • Last Seen:  

hello, please show me the new structure for cash shop items (txt)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  9
  • Reputation:   0
  • Joined:  01/14/12
  • Last Seen:  

i have error this my rathena server how to fix this to my own server same problem

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

what your error...show it ....

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  9
  • Reputation:   0
  • Joined:  01/14/12
  • Last Seen:  

my error is npc.c and warning to clif.c if compiling

how to solve this

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  9
  • Reputation:   0
  • Joined:  01/14/12
  • Last Seen:  

1>c:\documents and settings\bozed\my documents\downloads\rathena svn\src\map\npc.c(1350) : error C2143: syntax error : missing '{' before ':'

1>c:\documents and settings\bozed\my documents\downloads\rathena svn\src\map\npc.c(1350) : error C2059: syntax error : ':'

1>c:\documents and settings\bozed\my documents\downloads\rathena svn\src\map\npc.c(1350) : error C2017: illegal escape sequence

1>c:\documents and settings\bozed\my documents\downloads\rathena svn\src\map\npc.c(1350) : error C2017: illegal escape sequence

1>c:\documents and settings\bozed\my documents\downloads\rathena svn\src\map\npc.c(1350) : error C2017: illegal escape sequence

1>c:\documents and settings\bozed\my documents\downloads\rathena svn\src\map\npc.c(1350) : error C2017: illegal escape sequence

1>c:\documents and settings\bozed\my documents\downloads\rathena svn\src\map\npc.c(1350) : error C2017: illegal escape sequence

1>c:\documents and settings\bozed\my documents\downloads\rathena svn\src\map\npc.c(1350) : error C2017: illegal escape sequence

1>c:\documents and settings\bozed\my documents\downloads\rathena svn\src\map\npc.c(1350) : error C2017: illegal escape sequence

1>c:\documents and settings\bozed\my documents\downloads\rathena svn\src\map\npc.c(1350) : error C2017: illegal escape sequence

1>c:\documents and settings\bozed\my documents\downloads\rathena svn\src\map\npc.c(1534) : warning C4013: 'npc_buylist_sub' undefined; assuming extern returning inthow to fix this error

1>c:\documents and settings\bozed\my documents\downloads\rathena svn\src\map\clif.c(14405) : warning C4101: 'nd' : unreferenced local variable

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  54
  • Reputation:   1
  • Joined:  02/21/12
  • Last Seen:  

ive got the same problem can somebody help me ? im using client 20100730

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...