Search in sources :

Example 81 with MaplePacketLittleEndianWriter

use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.

the class MaplePacketCreator method finishedSort2.

public static byte[] finishedSort2(int inv) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(4);
    mplew.writeShort(SendOpcode.SORT_ITEM_RESULT.getValue());
    mplew.write(0);
    mplew.write(inv);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 82 with MaplePacketLittleEndianWriter

use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.

the class MaplePacketCreator method stopControllingMonster.

/**
 * Gets a stop control monster packet.
 *
 * @param oid The ObjectID of the monster to stop controlling.
 * @return The stop control monster packet.
 */
public static byte[] stopControllingMonster(int oid) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(7);
    mplew.writeShort(SendOpcode.SPAWN_MONSTER_CONTROL.getValue());
    mplew.write(0);
    mplew.writeInt(oid);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 83 with MaplePacketLittleEndianWriter

use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.

the class MaplePacketCreator method getFredrick.

public static byte[] getFredrick(MapleCharacter chr) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.FREDRICK.getValue());
    mplew.write(0x23);
    // Fredrick
    mplew.writeInt(9030000);
    // id
    mplew.writeInt(32272);
    mplew.skip(5);
    mplew.writeInt(chr.getMerchantMeso());
    mplew.write(0);
    try {
        List<Pair<Item, MapleInventoryType>> items = ItemFactory.MERCHANT.loadItems(chr.getId(), false);
        mplew.write(items.size());
        for (int i = 0; i < items.size(); i++) {
            addItemInfo(mplew, items.get(i).getLeft(), true);
        }
    } catch (SQLException e) {
        e.printStackTrace();
    }
    mplew.skip(3);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter) SQLException(java.sql.SQLException) Point(java.awt.Point)

Example 84 with MaplePacketLittleEndianWriter

use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.

the class MaplePacketCreator method shopTransaction.

/* 00 = /
         * 01 = You don't have enough in stock
         * 02 = You do not have enough mesos
         * 03 = Please check if your inventory is full or not
         * 05 = You don't have enough in stock
         * 06 = Due to an error, the trade did not happen
         * 07 = Due to an error, the trade did not happen
         * 08 = /
         * 0D = You need more items
         * 0E = CRASH; LENGTH NEEDS TO BE LONGER :O
         */
public static byte[] shopTransaction(byte code) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(3);
    mplew.writeShort(SendOpcode.CONFIRM_SHOP_TRANSACTION.getValue());
    mplew.write(code);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 85 with MaplePacketLittleEndianWriter

use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.

the class MaplePacketCreator method showInfoText.

public static byte[] showInfoText(String text) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.SHOW_STATUS_INFO.getValue());
    mplew.write(9);
    mplew.writeMapleAsciiString(text);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Aggregations

MaplePacketLittleEndianWriter (tools.data.output.MaplePacketLittleEndianWriter)431 Point (java.awt.Point)44 MaplePlayerShopItem (server.maps.MaplePlayerShopItem)15 Item (client.inventory.Item)11 SpecialCashItem (server.CashShop.SpecialCashItem)11 MapleShopItem (server.MapleShopItem)11 MapleMapItem (server.maps.MapleMapItem)11 CashItem (server.CashShop.CashItem)10 MapleCharacter (client.MapleCharacter)8 MapleBuffStat (client.MapleBuffStat)4 MaplePet (client.inventory.MaplePet)3 MTSItemInfo (server.MTSItemInfo)3 MapleDisease (client.MapleDisease)2 SQLException (java.sql.SQLException)2 ArrayList (java.util.ArrayList)2 LinkedHashMap (java.util.LinkedHashMap)2 Channel (net.server.channel.Channel)2 MapleGuild (net.server.guild.MapleGuild)2 MapleMonster (server.life.MapleMonster)2 BuddylistEntry (client.BuddylistEntry)1