Search in sources :

Example 41 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method destroyReactor.

public static byte[] destroyReactor(MapleReactor reactor) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    Point pos = reactor.getPosition();
    mplew.writeShort(SendOpcode.REACTOR_DESTROY.getValue());
    mplew.writeInt(reactor.getObjectId());
    mplew.write(reactor.getState());
    mplew.writePos(pos);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter) Point(java.awt.Point)

Example 42 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method earnTitleMessage.

public static byte[] earnTitleMessage(String msg) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.SCRIPT_PROGRESS_MESSAGE.getValue());
    mplew.writeMapleAsciiString(msg);
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 43 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method transferInventory.

public static byte[] transferInventory(List<MTSItemInfo> items) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.MTS_OPERATION.getValue());
    mplew.write(0x21);
    mplew.writeInt(items.size());
    if (!items.isEmpty()) {
        for (MTSItemInfo item : items) {
            addItemInfo(mplew, item.getItem(), true);
            // id
            mplew.writeInt(item.getID());
            // taxes
            mplew.writeInt(item.getTaxes());
            // price
            mplew.writeInt(item.getPrice());
            mplew.writeInt(0);
            mplew.writeLong(getTime(item.getEndingDate()));
            // account name (what was nexon thinking?)
            mplew.writeMapleAsciiString(item.getSeller());
            // char name
            mplew.writeMapleAsciiString(item.getSeller());
            for (int i = 0; i < 28; i++) {
                mplew.write(0);
            }
        }
    }
    mplew.write(0xD0 + items.size());
    mplew.write(new byte[] { -1, -1, -1, 0 });
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter) MTSItemInfo(server.MTSItemInfo) Point(java.awt.Point)

Example 44 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method itemMegaphone.

public static byte[] itemMegaphone(String msg, boolean whisper, int channel, Item item) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.writeShort(SendOpcode.SERVERMESSAGE.getValue());
    mplew.write(8);
    mplew.writeMapleAsciiString(msg);
    mplew.write(channel - 1);
    mplew.write(whisper ? 1 : 0);
    if (item == null) {
        mplew.write(0);
    } else {
        mplew.write(item.getPosition());
        addItemInfo(mplew, item, true);
    }
    return mplew.getPacket();
}
Also used : MaplePacketLittleEndianWriter(tools.data.output.MaplePacketLittleEndianWriter)

Example 45 with MaplePacketLittleEndianWriter

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

the class MaplePacketCreator method enableCSUse.

public static byte[] enableCSUse() {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
    mplew.write(0x12);
    mplew.skip(6);
    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