Search in sources :

Example 86 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method getTradeStart.

public static byte[] getTradeStart(MapleClient c, MapleTrade trade, byte number) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.PLAYER_INTERACTION.getValue());
    mplew.write(PlayerInteractionHandler.Action.ROOM.getCode());
    mplew.write(3);
    mplew.write(2);
    mplew.write(number);
    if (number == 1) {
        mplew.write(0);
        addCharLook(mplew, trade.getPartner().getChr(), false);
        mplew.writeMapleAsciiString(trade.getPartner().getChr().getName());
    }
    mplew.write(number);
    addCharLook(mplew, c.getPlayer(), false);
    mplew.writeMapleAsciiString(c.getPlayer().getName());
    mplew.write(0xFF);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 87 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method showBoughtCharacterSlot.

public static byte[] showBoughtCharacterSlot(short slots) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(5);
    mplew.writeShort(SendOpcode.CASHSHOP_OPERATION.getValue());
    mplew.write(0x64);
    mplew.writeShort(slots);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 88 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method getNPCTalkNum.

public static byte[] getNPCTalkNum(int npc, String talk, int def, int min, int max) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.NPC_TALK.getValue());
    // ?
    mplew.write(4);
    mplew.writeInt(npc);
    mplew.write(3);
    // speaker
    mplew.write(0);
    mplew.writeMapleAsciiString(talk);
    mplew.writeInt(def);
    mplew.writeInt(min);
    mplew.writeInt(max);
    mplew.writeInt(0);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 89 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method getShowItemGain.

/**
 * Gets a packet telling the client to show an item gain.
 *
 * @param itemId The ID of the item gained.
 * @param quantity The number of items gained.
 * @param inChat Show in the chat window?
 * @return The item gain packet.
 */
public static byte[] getShowItemGain(int itemId, short quantity, boolean inChat) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    if (inChat) {
        mplew.writeShort(SendOpcode.SHOW_ITEM_GAIN_INCHAT.getValue());
        mplew.write(3);
        mplew.write(1);
        mplew.writeInt(itemId);
        mplew.writeInt(quantity);
    } else {
        mplew.writeShort(SendOpcode.SHOW_STATUS_INFO.getValue());
        mplew.writeShort(0);
        mplew.writeInt(itemId);
        mplew.writeInt(quantity);
        mplew.writeInt(0);
        mplew.writeInt(0);
    }
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 90 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method removeCharBox.

public static byte[] removeCharBox(MapleCharacter c) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(7);
    mplew.writeShort(SendOpcode.UPDATE_CHAR_BOX.getValue());
    mplew.writeInt(c.getId());
    mplew.write(0);
    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