- Joined
- Jan 21, 2009
- Messages
- 162
- Reaction score
- 1
BuyCSItemHandler.java
MapleStorage.java
Replace your create() function with
It's MORE GMS Like.
--
MaplePacketCreator
--
warpCS()
replace
the //storage slots part with
--
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.
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);
}
--
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.
Last edited: