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();
}
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();
}
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();
}
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();
}
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();
}
Aggregations