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