[Release] Increase Storage Space from Cash Shop

Junior Spellweaver
Joined
Jan 21, 2009
Messages
162
Reaction score
1
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.
 
Last edited:
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)
 
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
 
Back