Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Adding / Removing items from Cash Shop

Newbie Spellweaver
Joined
Apr 30, 2010
Messages
36
Reaction score
27
Flav on KryptoDEV said:
LightPepsi on KryptoDEV said:
You'll have to decode the entire long CS packet first. [It is after the 15 x 4 bytes of teleport rock data]
The first few bytes should be what you'r telling the client to sell on the "sale" or "wanted" list.
Credits go to this smexy guy for pointing it out to me. :D


In your warpToCS packet there's 1 int after the account name which I'm not sure what it is for. And after that there's a short for the number of modified items. For each modified item you do this:
Code:
            mplew.writeInt(sn);
            mplew.writeInt(0x400);
            mplew.write(0);
The 0x400 is a modifier which means that we remove or add an item, the following byte tells the client what we do (0 = remove, 1 = add). There are a couple of other modifiers which I'm not so sure about what they do and how exactly they work, I know that there's one for price discounts and for limitations. Whatever, we find most Cash Items multiple times in Etc.wz/Commodity.img with different prices, so we don't really need the other modifiers.
Anyways, to add or remove items just store them into a List and then use it in your warpToCS packet. Here's a spoonfeed example for leechers:
Code:
        mplew.writeMapleAsciiString(c.getAccountName());
        mplew.writeInt(0);
        mplew.writeShort(CashDataProvider.getModifiedData().size());

        for (int sn : CashDataProvider.getModifiedData()) {
            mplew.writeInt(sn);
            mplew.writeInt(0x400);
            mplew.write(CashDataProvider.getItem(sn).isOnSale() ? 1 : 0);
        }
If you're smart and have an onSale check don't forget to change it for modified items. I'll probably include this in OdinTeh 2 soon where I already have added lots of Cash Shop stuff, then you can leech it out of there. :p

There's another way to do this, simply modify your Etc.wz file and make your users download it but that's gay.
I don't really like this forum but I know that if I don't release it here someone will leak it.
 
Last edited:
may web.very maple.pls.
Loyal Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
Well i don't get it much i know the code but how to like add it u gotta add the id or the code
(gah coding == confusion)
HAII FLAV :DDDD
 
Newbie Spellweaver
Joined
Apr 30, 2010
Messages
36
Reaction score
27
Well i don't get it much i know the code but how to like add it u gotta add the id or the code
(gah coding == confusion)
HAII FLAV :DDDD
Here's an example for adding it directly into the packet, however, I suggest you to use a List and read it from database:
Code:
        mplew.writeMapleAsciiString(c.getAccountName());
        mplew.writeInt(0);
        mplew.writeShort(1); // number of modified items

        mplew.writeInt(10001484); // serial number for Veamoth Package
        mplew.writeInt(0x400); // modifier
        mplew.write(1); // add

imNotFlav - Adding / Removing items from Cash Shop - RaGEZONE Forums
 
may web.very maple.pls.
Loyal Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
HOLY @#$% FLAV U SOOO SMARTTT AND SO AS lIGHTpEPSI

---------- Post added at 09:15 PM ---------- Previous post was at 09:06 PM ----------

Two things:
1)Can't you make it editable in sql ,like add the item u want in mysql and it reads it and shows the items in cashshop?

2)Can you add non-nx items in it ?
 
Newbie Spellweaver
Joined
Apr 30, 2010
Messages
36
Reaction score
27
1) That's exactly what I suggested you to do.
2) No, you add items by their serial numbers which only Cash Items have.
 
may web.very maple.pls.
Loyal Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
Thanks flav u so smart Hope this ends up in odinteh2 =PP
 
Junior Spellweaver
Joined
Oct 5, 2008
Messages
105
Reaction score
16
Here's an example for adding it directly into the packet, however, I suggest you to use a List and read it from database:
Code:
        mplew.writeMapleAsciiString(c.getAccountName());
        mplew.writeInt(0);
        mplew.writeShort(1); // number of modified items

        mplew.writeInt(10001484); // serial number for Veamoth Package
        mplew.writeInt(0x400); // modifier
        mplew.write(1); // add

Odd, my client crashes with that code. Here's my warpCs packet (which also is the packet to warp to the MTS, but the boolean is still false):
Code:
		mplew.writeMapleAsciiString(c.getAccountName());
		if (mts) {
			mplew.writeInt(5000);
			mplew.write(HexTool.getByteArrayFromHexString("0A 00 00 00 64 00 00 00 18 00 00 00 A8 00 00 00 B0 ED 4E 3C FD 68 C9 01"));
		} else {
			mplew.writeInt(0);
			mplew.writeShort(1); // number of modified items

			mplew.writeInt(10001484); // serial number for Veamoth Package
			mplew.writeInt(0x400); // modifier
			mplew.write(1); // add
		}

This is for v62 if that makes any difference.
 
Newbie Spellweaver
Joined
Apr 30, 2010
Messages
36
Reaction score
27
Odd, my client crashes with that code. Here's my warpCs packet (which also is the packet to warp to the MTS, but the boolean is still false):
Code:
		mplew.writeMapleAsciiString(c.getAccountName());
		if (mts) {
			mplew.writeInt(5000);
			mplew.write(HexTool.getByteArrayFromHexString("0A 00 00 00 64 00 00 00 18 00 00 00 A8 00 00 00 B0 ED 4E 3C FD 68 C9 01"));
		} else {
			mplew.writeInt(0);
			mplew.writeShort(1); // number of modified items

			mplew.writeInt(10001484); // serial number for Veamoth Package
			mplew.writeInt(0x400); // modifier
			mplew.write(1); // add
		}

This is for v62 if that makes any difference.

It's possible that the packet is different. Try to change the int before the short that tells you the number of modified items to short as well, maybe NEXON added something in v0.63+.
 
Last edited:
Junior Spellweaver
Joined
Oct 18, 2008
Messages
159
Reaction score
11
Nice i needed this for my new Max Stat items System For NX Clothes
 
Newbie Spellweaver
Joined
Aug 12, 2009
Messages
15
Reaction score
10
Here's an example for adding it directly into the packet, however, I suggest you to use a List and read it from database:
Code:
        mplew.writeMapleAsciiString(c.getAccountName());
        mplew.writeInt(0);
        mplew.writeShort(1); // number of modified items

        mplew.writeInt(10001484); // serial number for Veamoth Package
        mplew.writeInt(0x400); // modifier
        mplew.write(1); // add

imNotFlav - Adding / Removing items from Cash Shop - RaGEZONE Forums

Ya, But. How about like a GM Hat? Or custom prices?
 
Initiate Mage
Joined
Jul 27, 2008
Messages
1
Reaction score
0
This is a great release;
I was wondering how to remove stuff from the CS.
 
Back
Top