-
[Release] Increase Storage Space from Cash Shop
BuyCSItemHandler.java
Code:
else if (action == 7) { // Increase slot space
//C6 00 - Header
//07 - action
//00 - (?) Not needed so skipped.
//01 - What to charge, Paypal NX, MaplePoints etc.
//00 00 00 00 - Ussually itemId but it's 0 inside this case.
slea.skip(1);
byte toCharge = slea.readByte();
int toIncrease = slea.readInt();
if (c.getPlayer().getCSPoints(toCharge) >= 4000 && c.getPlayer().getStorage().getSlots() < 48) { // 48 is max.
c.getPlayer().modifyCSPoints(toCharge, 4000);
if (toIncrease == 0) { // Increase Storage
c.getPlayer().getStorage().increaseSlots((byte)4);
}
c.getSession().write(MaplePacketCreator.showNXMapleTokens(c.getPlayer()));
c.getSession().write(MaplePacketCreator.enableCSorMTS());
c.getSession().write(MaplePacketCreator.enableCSUse1());
c.getSession().write(MaplePacketCreator.enableCSUse2());
c.getSession().write(MaplePacketCreator.enableCSUse3());
c.getSession().write(MaplePacketCreator.enableActions());
}
}
MapleStorage.java
Code:
public int getSlots() {
return slots;
}
public void increaseSlots(byte gain) {
this.slots += gain;
}
public void setSlots(byte set) {
this.slots = set;
}
Replace your create() function with
Code:
public static MapleStorage create(int id) {
try {
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO storages (accountid, slots, meso) VALUES (?, ?, ?)");
ps.setInt(1, id);
ps.setInt(2, 4);
ps.setInt(3, 0);
ps.executeUpdate();
ps.close();
} catch (SQLException ex) {
log.error("Error creating storage", ex);
}
return loadOrCreateFromDB(id);
}
It's MORE GMS Like.
--
MaplePacketCreator
--
warpCS()
replace
the //storage slots part with
Code:
mplew.write(chr.getStorage().getSlots()); // storage slots
--
Small release so I released it.
Feel free to put it in any forum you want, provide credits is all.
Credits to RaptorJesus for being my lover(Telling me how many slots you get default)
--
If this passes 150 views, I'll leave another present.
-
Re: [Release] Increase Storage Space from Cash Shop
-
Re: [Release] Increase Storage Space from Cash Shop
W00T Great Release going to add it to my server :D
-
Re: [Release] Increase Storage Space from Cash Shop
-
Re: [Release] Increase Storage Space from Cash Shop
Decent!
G
R
E
A
T
J
O
B
I'm
Going
To
Use
It!
-
Re: [Release] Increase Storage Space from Cash Shop
Thats for teh cr3d1tz J4y, 1r s0 pr0 w1t g|\|\$ l13k fu|\|ct10nz
-
Re: [Release] Increase Storage Space from Cash Shop
-
Re: [Release] Increase Storage Space from Cash Shop
I'm going to leave another small present if this passes 150 views.
-
Re: [Release] Increase Storage Space from Cash Shop
Quote:
Originally Posted by
FloppyDisk
I'm going to leave another small present if this passes 150 views.
LOL, It's kind of obvious it will pass 150 view as all releases.
Well done btw :)
-
Re: [Release] Increase Storage Space from Cash Shop
Pretty nice release, good job.
-
Re: [Release] Increase Storage Space from Cash Shop
Quote:
Originally Posted by
XxOsirisxX
LOL, It's kind of obvious it will pass 150 view as all releases.
Well done btw :)
lol agreed :P
-
Re: [Release] Increase Storage Space from Cash Shop
Hmm, Quite decent xP
No need for me though o.o I think
-
Re: [Release] Increase Storage Space from Cash Shop
I finished coding all of the other inventory space things.
-
Re: [Release] Increase Storage Space from Cash Shop
181!!!!!!!!!!!!!!!!! lol
wats ur other thing?
-
Re: [Release] Increase Storage Space from Cash Shop
Quote:
Originally Posted by
Hector
181!!!!!!!!!!!!!!!!! lol
wats ur other thing?
Just wait. Hopefully it'll be good =]
-
Re: [Release] Increase Storage Space from Cash Shop
get this error..am i missing something?
Code:
init:
deps-jar:
Compiling 4 source files to E:\ThePackRev80\build\classes
E:\ThePackRev80\ThePack\src\net\sf\odinms\net\channel\handler\BuyCSItemHandler.java:43: cannot find symbol
symbol : variable action
location: class net.sf.odinms.net.channel.handler.BuyCSItemHandler
} else if (action == 7) { // Increase slot space
^
1 error
BUILD FAILED (total time: 1 second)
-
Re: [Release] Increase Storage Space from Cash Shop
Nice error ;]! Hmm, Define a var?
-
Re: [Release] Increase Storage Space from Cash Shop
-
Re: [Release] Increase Storage Space from Cash Shop
Quote:
Originally Posted by
yvonneywm
get this error..am i missing something?
Code:
init:
deps-jar:
Compiling 4 source files to E:\ThePackRev80\build\classes
E:\ThePackRev80\ThePack\src\net\sf\odinms\net\channel\handler\BuyCSItemHandler.java:43: cannot find symbol
symbol : variable action
location: class net.sf.odinms.net.channel.handler.BuyCSItemHandler
} else if (action == 7) { // Increase slot space
^
1 error
BUILD FAILED (total time: 1 second)
im getting the same error oO
-
Re: [Release] Increase Storage Space from Cash Shop
Why ?
I test...It doesn't work
-
Re: [Release] Increase Storage Space from Cash Shop
Quote:
Originally Posted by
3esah
im getting the same error oO
lol yea :X still duno how to fix it
-
Re: [Release] Increase Storage Space from Cash Shop
Post your buyitemcshandler here ill see if I can fix it.
-
Re: [Release] Increase Storage Space from Cash Shop
ur all so noobys, he gave you the base, its so easy to edit and fix all the problems
i fixed every thing and got it work in less then 10 mins
-
Re: [Release] Increase Storage Space from Cash Shop
Quote:
Originally Posted by
3esah
im getting the same error oO
It means that variable wasn't declared, tard.
-
Re: [Release] Increase Storage Space from Cash Shop
Here I think I fixed it[haven't test but it should work].
Code:
else if (action == 7) { // Increase slot space
slea.readByte();
byte toCharge = slea.readByte();
slea.readInt();
if (c.getPlayer().getCSPoints(toCharge) >= 4000) {
if (c.getPlayer().getStorage().getSlots() < 48) { // 48 is max.
c.getPlayer().modifyCSPoints(toCharge, -4000);
c.getPlayer().getStorage().increaseSlots((byte) 4);
c.getPlayer().getStorage().saveToDB();
c.getSession().write(MaplePacketCreator.serverNotice(1, "You're storage slots have been increased by 4."));
c.getSession().write(MaplePacketCreator.showNXMapleTokens(c.getPlayer()));
c.getSession().write(MaplePacketCreator.enableCSUse0());
c.getSession().write(MaplePacketCreator.enableCSUse1());
c.getSession().write(MaplePacketCreator.enableCSUse2());
c.getSession().write(MaplePacketCreator.enableCSUse3());
c.getSession().write(MaplePacketCreator.enableActions());
} else {
c.getSession().write(MaplePacketCreator.serverNotice(1, "The maximum storage slot is 48, you cannot increase more then that!"));
c.getSession().write(MaplePacketCreator.enableActions());
return;
}
}
}
fix my grammer errors and your done :D