Fixes to cash shop

Status
Not open for further replies.
You've got my respect!
Joined
Apr 8, 2008
Messages
508
Reaction score
147
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:
Code:
private int lastChannel;
After:
Code:
private boolean incs;
Add:
Code:
public void setLastChannel(int ch)
        {
           this.lastChannel = ch;
        }
        
        public int getLastChannel()
        {
            return this.lastChannel;
        }
Also add this if you don't have it already....
Code:
        public int getNX()
        {
            return this.nxcash;
        }
After:
Code:
public boolean inCS() {
		return this.incs;
	}
In EnterCashShopHandler.java
Add:
Code:
c.getPlayer().setLastChannel(c.getChannel());
After
Code:
c.getPlayer().setInCS(true);
In ChangeMapHandler.java
Replace:
Code:
int channel = 1;
With:
Code:
int channel = c.getPlayer().getLastChannel();
In BuyCSItemHandler.java
Add import:
Code:
import net.sf.odinms.server.AutobanManager;
Add:
Code:
if(c.getPlayer().inCS())
{
After:
Code:
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
Add
Code:
if(c.getPlayer().getNX() >= item.getPrice())
{
After:
Code:
CashItemInfo item = CashItemFactory.getItem(snCS);
Add:
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");
                }
After:
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
 
Banned
Banned
Joined
Apr 6, 2008
Messages
80
Reaction score
0
Re: [Release] Fixes to cash shop

i dont think we have this..
public int getMaplePoints(){
return maplepoints;
}
 
You've got my respect!
Joined
Apr 8, 2008
Messages
508
Reaction score
147
Re: [Release] Fixes to cash shop

Oh, I'll edit that one sec.
EDIT
Done.
 
Junior Spellweaver
Joined
Jul 28, 2008
Messages
131
Reaction score
0
Re: [Release] Fixes to cash shop

Nice , Is there a fix to the error like , uhmmm , Someon items in the cash shop , the buy button is disabled
 
You've got my respect!
Joined
Apr 8, 2008
Messages
508
Reaction score
147
Re: [Release] Fixes to cash shop

That's client-sided.
It means the player is too low of a level to purchase the item.
 
Back?
Loyal Member
Joined
Apr 17, 2008
Messages
540
Reaction score
19
Re: [Release] Fixes to cash shop

thanks for this i will surely use this later on
 
Banned
Banned
Joined
Apr 6, 2008
Messages
80
Reaction score
0
Re: [Release] Fixes to cash shop

init:
deps-jar:
Compiling 4 source files to C:\Documents and Settings\Administrator\My Documents\My Music\build\classes
C:\Documents and Settings\Administrator\Desktop\New Folder (4)\src\net\sf\odinms\client\MapleCharacter.java:2718: cannot find symbol
symbol : method unbanMacs()
location: class net.sf.odinms.client.MapleClient
getClient().unbanMacs();
^
C:\Documents and Settings\Administrator\Desktop\New Folder (4)\src\net\sf\odinms\net\channel\handler\BuyCSItemHandler.java:54: cannot find symbol
symbol : variable item
location: class net.sf.odinms.net.channel.handler.BuyCSItemHandler
if(c.getPlayer().getNX() >= item.getPrice())
2 errors
BUILD FAILED (total time: 1 second)
 
Newbie Spellweaver
Joined
May 28, 2008
Messages
35
Reaction score
0
Re: [Release] Fixes to cash shop

but were to add all this? I mean after which lines >.<
 
Newbie Spellweaver
Joined
Jul 14, 2008
Messages
45
Reaction score
0
Re: [Release] Fixes to cash shop

will this keep you from dcing by staying in dere to long?
 
You've got my respect!
Joined
Apr 8, 2008
Messages
508
Reaction score
147
Re: [Release] Fixes to cash shop

@tomer224: I thought I made it pretty obvious where they go.
@Above: that looks like a client-sided problem.
init:
deps-jar:
Compiling 4 source files to C:\Documents and Settings\Administrator\My Documents\My Music\build\classes
C:\Documents and Settings\Administrator\Desktop\New Folder (4)\src\net\sf\odinms\client\MapleCharacter.java:2718: cannot find symbol
symbol : method unbanMacs()
location: class net.sf.odinms.client.MapleClient
getClient().unbanMacs();
^
C:\Documents and Settings\Administrator\Desktop\New Folder (4)\src\net\sf\odinms\net\channel\handler\BuyCSItemHandler.java:54: cannot find symbol
symbol : variable item
location: class net.sf.odinms.net.channel.handler.BuyCSItemHandler
if(c.getPlayer().getNX() >= item.getPrice())
2 errors
BUILD FAILED (total time: 1 second)
For your first error, that has nothing to do with this.
As for your second, add this to your maplecharacter.java
Code:
public int getNX()
        {
            return this.nxcash;
        }
 
Master Summoner
Loyal Member
Joined
Nov 30, 2007
Messages
511
Reaction score
0
Re: [Release] Fixes to cash shop

There's a setinCS(false) in ChangeMapHandler already.
 
Banned
Banned
Joined
Apr 6, 2008
Messages
80
Reaction score
0
Re: [Release] Fixes to cash shop

init:
deps-jar:
Compiling 4 source files to C:\Documents and Settings\Administrator\My Documents\My Music\build\classes
C:\Documents and Settings\Administrator\Desktop\New Folder (4)\src\net\sf\odinms\client\MapleCharacter.java:2521: getNX() is already defined in net.sf.odinms.client.MapleCharacter
public int getNX()
C:\Documents and Settings\Administrator\Desktop\New Folder (4)\src\net\sf\odinms\client\MapleCharacter.java:2722: cannot find symbol
symbol : method unbanMacs()
location: class net.sf.odinms.client.MapleClient
getClient().unbanMacs();
^
C:\Documents and Settings\Administrator\Desktop\New Folder (4)\src\net\sf\odinms\net\channel\handler\BuyCSItemHandler.java:54: cannot find symbol
symbol : variable item
location: class net.sf.odinms.net.channel.handler.BuyCSItemHandler
if(c.getPlayer().getNX() >= item.getPrice())
3 errors
BUILD FAILED (total time: 1 second)

yea i found xD i was gonna say i forgot that, but then i get these o_o
 
Newbie Spellweaver
Joined
Jun 8, 2008
Messages
17
Reaction score
0
Re: [Release] Fixes to cash shop

init:
deps-jar:
Compiling 4 source files to C:\Documents and Settings\Administrator\My Documents\My Music\build\classes
C:\Documents and Settings\Administrator\Desktop\New Folder (4)\src\net\sf\odinms\client\MapleCharacter.java:2718: cannot find symbol
symbol : method unbanMacs()
location: class net.sf.odinms.client.MapleClient
getClient().unbanMacs();

Pretty sure that error isn't from this modification. It's from the RMZero's unban command
 
Master Summoner
Loyal Member
Joined
Apr 20, 2008
Messages
578
Reaction score
76
Re: [Release] Fixes to cash shop

init:
deps-jar:
Compiling 4 source files to C:\Documents and Settings\Administrator\My Documents\My Music\build\classes
C:\Documents and Settings\Administrator\Desktop\New Folder (4)\src\net\sf\odinms\client\MapleCharacter.java:2521: getNX() is already defined in net.sf.odinms.client.MapleCharacter
public int getNX()
C:\Documents and Settings\Administrator\Desktop\New Folder (4)\src\net\sf\odinms\client\MapleCharacter.java:2722: cannot find symbol
symbol : method unbanMacs()
location: class net.sf.odinms.client.MapleClient
getClient().unbanMacs();
^
C:\Documents and Settings\Administrator\Desktop\New Folder (4)\src\net\sf\odinms\net\channel\handler\BuyCSItemHandler.java:54: cannot find symbol
symbol : variable item
location: class net.sf.odinms.net.channel.handler.BuyCSItemHandler
if(c.getPlayer().getNX() >= item.getPrice())
3 errors
BUILD FAILED (total time: 1 second)

yea i found xD i was gonna say i forgot that, but then i get these o_o

Uh, for your second error re-do my !unban.. see step 2 (MapleClient)
 
You've got my respect!
Joined
Apr 8, 2008
Messages
508
Reaction score
147
Re: [Release] Fixes to cash shop

init:
deps-jar:
Compiling 4 source files to C:\Documents and Settings\Administrator\My Documents\My Music\build\classes
C:\Documents and Settings\Administrator\Desktop\New Folder (4)\src\net\sf\odinms\client\MapleCharacter.java:2521: getNX() is already defined in net.sf.odinms.client.MapleCharacter
public int getNX()
C:\Documents and Settings\Administrator\Desktop\New Folder (4)\src\net\sf\odinms\client\MapleCharacter.java:2722: cannot find symbol
symbol : method unbanMacs()
location: class net.sf.odinms.client.MapleClient
getClient().unbanMacs();
^
C:\Documents and Settings\Administrator\Desktop\New Folder (4)\src\net\sf\odinms\net\channel\handler\BuyCSItemHandler.java:54: cannot find symbol
symbol : variable item
location: class net.sf.odinms.net.channel.handler.BuyCSItemHandler
if(c.getPlayer().getNX() >= item.getPrice())
3 errors
BUILD FAILED (total time: 1 second)

yea i found xD i was gonna say i forgot that, but then i get these o_o
okay take the thing I told you to put in out, you already have it in there.
You must not be adding it in the right area.
whoops, while I was editing it I messed it up.
one sec
edit:
okay fixed, undo all your changes to buycsitemhadler.java then do the steps again.
 
Newbie Spellweaver
Joined
May 28, 2008
Messages
35
Reaction score
0
Re: [Release] Fixes to cash shop

Can u upload this files? Please it will be easier >.<, Im getting error when compiling.
 
You've got my respect!
Joined
Apr 8, 2008
Messages
508
Reaction score
147
Re: [Release] Fixes to cash shop

I would upload the files, but I have other edits I don't want to share.
Just undo all the changes in BuyCSItemHandler.java and redo them
 
Status
Not open for further replies.
Back
Top