Search in sources :

Example 1 with SpecialCashItem

use of server.CashShop.SpecialCashItem in project HeavenMS by ronancpl.

the class MaplePacketCreator method openCashShop.

public static byte[] openCashShop(MapleClient c, boolean mts) throws Exception {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(mts ? SendOpcode.SET_ITC.getValue() : SendOpcode.SET_CASH_SHOP.getValue());
    addCharacterInfo(mplew, c.getPlayer());
    if (!mts) {
        mplew.write(1);
    }
    mplew.writeMapleAsciiString(c.getAccountName());
    if (mts) {
        mplew.write(new byte[] { (byte) 0x88, 19, 0, 0, 7, 0, 0, 0, (byte) 0xF4, 1, 0, 0, (byte) 0x18, 0, 0, 0, (byte) 0xA8, 0, 0, 0, (byte) 0x70, (byte) 0xAA, (byte) 0xA7, (byte) 0xC5, (byte) 0x4E, (byte) 0xC1, (byte) 0xCA, 1 });
    } else {
        mplew.writeInt(0);
        List<SpecialCashItem> lsci = CashItemFactory.getSpecialCashItems();
        // Guess what
        mplew.writeShort(lsci.size());
        for (SpecialCashItem sci : lsci) {
            mplew.writeInt(sci.getSN());
            mplew.writeInt(sci.getModifier());
            mplew.write(sci.getInfo());
        }
        mplew.skip(121);
        for (int i = 1; i <= 8; i++) {
            for (int j = 0; j < 2; j++) {
                mplew.writeInt(i);
                mplew.writeInt(j);
                mplew.writeInt(50200004);
                mplew.writeInt(i);
                mplew.writeInt(j);
                mplew.writeInt(50200069);
                mplew.writeInt(i);
                mplew.writeInt(j);
                mplew.writeInt(50200117);
                mplew.writeInt(i);
                mplew.writeInt(j);
                mplew.writeInt(50100008);
                mplew.writeInt(i);
                mplew.writeInt(j);
                mplew.writeInt(50000047);
            }
        }
        mplew.writeInt(0);
        mplew.writeShort(0);
        mplew.write(0);
        mplew.writeInt(75);
    }
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter) SpecialCashItem(server.CashShop.SpecialCashItem) Point(java.awt.Point)

Aggregations

Point (java.awt.Point)1 SpecialCashItem (server.CashShop.SpecialCashItem)1 MaplePacketLittleEndianWriter (tools.data.output.MaplePacketLittleEndianWriter)1