Here are some fixes to cash shop (Note: I won't help you with any errors)
There was a couple things that annoyed me about the cash shop.
One was that it would put you back in to channel that you were in before entering the cs which was a pain, and another is that it didn't check to see if you had enough nx to buy something, or if you were in the cash shop.
So I fixed all that.
In MapleCharacter.java
Add:
After:
Add:
Also add this if you don't have it already....
After:
In EnterCashShopHandler.java
Add:
After
In ChangeMapHandler.java
Replace:
With:
In BuyCSItemHandler.java
Add import:
Add:
After:
Add
After:
Add:
After:
I think that's it.
There may be a couple errors as I kind of rushed this, so if there is just post (I'll help with these kind of errors).
CREDITS:
Acrylic and the others who made the cash shop
Me I guess
There was a couple things that annoyed me about the cash shop.
One was that it would put you back in to channel that you were in before entering the cs which was a pain, and another is that it didn't check to see if you had enough nx to buy something, or if you were in the cash shop.
So I fixed all that.
In MapleCharacter.java
Add:
Code:
private int lastChannel;
Code:
private boolean incs;
Code:
public void setLastChannel(int ch)
{
this.lastChannel = ch;
}
public int getLastChannel()
{
return this.lastChannel;
}
Code:
public int getNX()
{
return this.nxcash;
}
Code:
public boolean inCS() {
return this.incs;
}
Add:
Code:
c.getPlayer().setLastChannel(c.getChannel());
Code:
c.getPlayer().setInCS(true);
Replace:
Code:
int channel = 1;
Code:
int channel = c.getPlayer().getLastChannel();
Add import:
Code:
import net.sf.odinms.server.AutobanManager;
Code:
if(c.getPlayer().inCS())
{
Code:
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
Code:
if(c.getPlayer().getNX() >= item.getPrice())
{
Code:
CashItemInfo item = CashItemFactory.getItem(snCS);
Code:
} else { // hax
AutobanManager.getInstance().autoban(c.getPlayer().getClient(),
"Attempting to buy a cash item with insufficient funds (NX: " + c.getPlayer().getNX() + " REQ NX: " + item.getPrice() + ")");
}
} else { // hax
AutobanManager.getInstance().autoban(c.getPlayer().getClient(),
"Attempting to buy a cash item outside of the cash shop");
}
Code:
log.info(slea.toString());
I think that's it.
There may be a couple errors as I kind of rushed this, so if there is just post (I'll help with these kind of errors).
CREDITS:
Acrylic and the others who made the cash shop
Me I guess