use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.
the class MaplePacketCreator method sendHint.
/**
* Sends a player hint.
*
* @param hint The hint it's going to send.
* @param width How tall the box is going to be.
* @param height How long the box is going to be.
* @return The player hint packet.
*/
public static byte[] sendHint(String hint, int width, int height) {
if (width < 1) {
width = hint.length() * 10;
if (width < 40) {
width = 40;
}
}
if (height < 5) {
height = 5;
}
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.PLAYER_HINT.getValue());
mplew.writeMapleAsciiString(hint);
mplew.writeShort(width);
mplew.writeShort(height);
mplew.write(1);
return mplew.getPacket();
}
use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.
the class MaplePacketCreator method showWheelsLeft.
public static byte[] showWheelsLeft(int left) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.SHOW_ITEM_GAIN_INCHAT.getValue());
mplew.write(0x15);
mplew.write(left);
return mplew.getPacket();
}
use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.
the class MaplePacketCreator method blockedMessage2.
/**
* Gets a "block" packet (ie. the cash shop is unavailable, etc)
*
* Possible values for <code>type</code>:<br> 1: You cannot move that
* channel. Please try again later.<br> 2: You cannot go into the cash shop.
* Please try again later.<br> 3: The Item-Trading Shop is currently
* unavailable. Please try again later.<br> 4: You cannot go into the trade
* shop, due to limitation of user count.<br> 5: You do not meet the minimum
* level requirement to access the Trade Shop.<br>
*
* @param type The type
* @return The "block" packet.
*/
public static byte[] blockedMessage2(int type) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.BLOCKED_SERVER.getValue());
mplew.write(type);
return mplew.getPacket();
}
use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.
the class MaplePacketCreator method showPetLevelUp.
public static byte[] showPetLevelUp(MapleCharacter chr, byte index) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.SHOW_FOREIGN_EFFECT.getValue());
mplew.writeInt(chr.getId());
mplew.write(4);
mplew.write(0);
mplew.write(index);
return mplew.getPacket();
}
use of tools.data.output.MaplePacketLittleEndianWriter in project HeavenMS by ronancpl.
the class MaplePacketCreator method updateHiredMerchant.
public static byte[] updateHiredMerchant(MapleHiredMerchant hm, MapleCharacter chr) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.PLAYER_INTERACTION.getValue());
mplew.write(PlayerInteractionHandler.Action.UPDATE_MERCHANT.getCode());
mplew.writeInt(chr.getMeso());
mplew.write(hm.getItems().size());
for (MaplePlayerShopItem item : hm.getItems()) {
mplew.writeShort(item.getBundles());
mplew.writeShort(item.getItem().getQuantity());
mplew.writeInt(item.getPrice());
addItemInfo(mplew, item.getItem(), true);
}
return mplew.getPacket();
}
Aggregations