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