Cash shop button

Beret

High Council
Messages
245
Points
28
Age
31
Emulator
Seeing that hercules is adding features that exist in official.

I would suggest if it is possible the addition of cash button thus ending the use of npc's to buy cash items.

20111214_2416262.jpg


nc_cashshop.png


 
this feature is not available to the clients supported. We'd need to add support to the main client, but in order to do that we need to know all the packets -- and they're unknown to us at this time

 
Last edited by a moderator:
Update:

Using different client

At the moment, when I click the icon I just chose it to open a chat window. So the next step is to analyze the packets associated and code it...

Screen_Shot_2013_03_11_at_3_01_49_AM.png


 
Wow, nicely done Judas ! If we can get the packets, that means it can make its way into our emulator ;o?

 
Yeah that's pretty much it.

I'm just trying to find reference posts right now. Yommy stated before that:

'Mysterious', on 22 Jun 2012 - 23:51, said:

'Mysterious' said:
Can you share the packets for that cash shop icon? D:! I wanna have thattt!!
http://rathena.org/wiki/Packets
look around 0x287, these have been public for ages

So if the packets are already available, just the managing the code is what we have to do

'Mysterious' said:
On a side note, what exact client are you using?.. Since you have a Cash shop button.
This is kRO Main client, and this is another example of the power in this tool,
it was simple to capture and understand the packets in this new cash shop 
smile.png


'malufett', on 21 Jun 2012 - 04:03, said:

'malufett' said:
>>>>style="padding: 0px; ">does it work to all official servers??
it works on a packet level, so unless some server uses some strange packets or encryption, it should work or could be made to work 

this is not inside kRO-RE client, because that is test server, there is no cash shop in test server ;P
you need to change to using kRO main client, ragexe.exe.

but this will be hard for you, for some reasons.
1) you need to write some code to manage the cash shop window packets. (Worry about)
2) kRO main client changes alot of connection packets each week. (Don't think we have to worry about this)
3) kRO main client has a small packet encryption system. (Don't think we have to worry about this)

Yom
 
Last edited by a moderator:
What is on my mind also, is can someone explain where those items come from. I wonder where those items will be called/managed.

The images used is from where? Are they placed in the data/grf file?

 
What is on my mind also, is can someone explain where those items come from. I wonder where those items will be called/managed.

The images used is from where? Are they placed in the data/grf file?
By looking at the shots, it feels like it's using the same pathway for items such as the item icons and their collection image. For the storing of the items, I believe they'll be held in a SQL table.
 
hmm yeah that would make sense

 
wow judas! this is cool!

 
I think this is the farthest I can go. I need to know how the itemlist can get filled up. Anyway, good progress for this month =)

 
I think this is the farthest I can go. I need to know how the itemlist can get filled up. Anyway, good progress for this month =)
when you open the map server, does anything appear in the console when you open this shop? Im really thinking it'll be placed in a SQL Table OR if possible, make it into a .txt file like the mob_db, item_db, etc. which then gets parsed into the shop.

 
nothing pops up.

According to the packets, we have to modify this:

struct PACKET_ZC_PC_CASH_POINT_ITEMLIST {
/* this+0x0 */ short PacketType
/* this+0x2 */ short PacketLength
/* this+0x4 */ unsigned long CashPoint
/* this+0x8 */ struct PURCHASE_ITEM itemList[...] { // Size 11
/* this+0x0 */ int price
/* this+0x4 */ int discountprice
/* this+0x8 */ unsigned char type
/* this+0x9 */ unsigned short ITID
}
}
I don't think the existing implementation will work (for cashshop). Since you have to click on the npc for it to work (open the itemlist).

You're probably right, that we have to manage it by parsing. SQL/db file or something

Existing Implementation:

/// List of items offered in a cash shop (ZC_PC_CASH_POINT_ITEMLIST).
/// 0287 <packet len>.W <cash point>.L { <sell price>.L <discount price>.L <item type>.B <name id>.W }*
/// 0287 <packet len>.W <cash point>.L <kafra point>.L { <sell price>.L <discount price>.L <item type>.B <name id>.W }* (PACKETVER >= 20070711)
void clif_cashshop_show(struct map_session_data *sd, struct npc_data *nd)
{
int fd,i;
#if PACKETVER < 20070711
const int offset = 8;
#else
const int offset = 12;
#endif

nullpo_retv(sd);
nullpo_retv(nd);

fd = sd->fd;
sd->npc_shopid = nd->bl.id;
WFIFOHEAD(fd,offset+nd->u.shop.count*11);
WFIFOW(fd,0) = 0x287;
WFIFOW(fd,2) = offset+nd->u.shop.count*11;
WFIFOL(fd,4) = sd->cashPoints; // Cash Points
#if PACKETVER >= 20070711
WFIFOL(fd,8) = sd->kafraPoints; // Kafra Points
#endif

for( i = 0; i < nd->u.shop.count; i++ )
{
struct item_data* id = itemdb_search(nd->u.shop.shop_item.nameid);
WFIFOL(fd,offset+0+i*11) = nd->u.shop.shop_item.value;
WFIFOL(fd,offset+4+i*11) = nd->u.shop.shop_item.value; // Discount Price
WFIFOB(fd,offset+8+i*11) = itemtype(id->type);
WFIFOW(fd,offset+9+i*11) = ( id->view_id > 0 ) ? id->view_id : id->nameid;
}
WFIFOSET(fd,WFIFOW(fd,2));
}
 
Last edited by a moderator:
Awesome work Judas!

I think

An reload-able items_cash?shop.txt can be more usefull ..

 
Back
Top