Excellzone

Forum and disscussions since 2010


You are not connected. Please login or register

View previous topic View next topic Go down Message [Page 1 of 1]

#1


Code:
public static MaplePacket hiredMerchantBox() {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(3);
mplew.writeShort(SendPacketOpcode.SEND_TITLE_BOX);
mplew.write(0x07);
return mplew.getPacket();
}

public static MaplePacket getHiredMerchant(MapleCharacter chr, HiredMerchant hm, boolean firstTime) {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendPacketOpcode.PLAYER_INTERACTION); // header.
mplew.write(5);
mplew.write(5);
mplew.write(4);
mplew.write(hm.isOwner(chr) ? 0 : hm.getVisitorSlot(chr));
mplew.write(0);
mplew.writeInt(hm.getItemId());
mplew.writeMapleAsciiString("Hired Merchant");
for (int i = 0; i < 3; i++) {
if (hm.getVisitors()[i] != null) {
mplew.write(i + 1);
addCharLook(mplew, hm.getVisitors()[i], false);
mplew.writeMapleAsciiString(hm.getVisitors()[i].getName());
}
}
mplew.write(0xFF);
mplew.writeShort(0); // number of chats there structure: for (int i = 0; i < num; i++) masciistring, byte slot
mplew.writeMapleAsciiString(hm.getOwner());
if (hm.isOwner(chr)) {
mplew.writeInt(chr.getId());
mplew.write(firstTime ? 1 : 0);
mplew.write(0); // sold items
mplew.writeInt((int) Math.min(hm.getMerchantMesos(), Integer.MAX_VALUE));
}
mplew.writeMapleAsciiString(hm.getDescription());
mplew.write(0x10); // slot max
mplew.writeInt((int) Math.min(hm.getMerchantMesos(), Integer.MAX_VALUE));
mplew.write(hm.getItems().size());
if (hm.getItems().size() == 0) {
mplew.write(0);
} else {
for (MaplePlayerShopItem item : hm.getItems()) {
mplew.writeShort(item.getBundles());
mplew.writeShort(item.getItem().getQuantity());
mplew.writeInt(item.getPrice());
addItemInfo(mplew, item.getItem(), true, true);
}
}
return mplew.getPacket();
}

public static MaplePacket updateHiredMerchant(HiredMerchant hm) {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendPacketOpcode.PLAYER_INTERACTION);
mplew.write(0x19);
mplew.writeInt((int) Math.min(hm.getMerchantMesos(), Integer.MAX_VALUE)); // mesos?
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, true);
}
return mplew.getPacket();
}

public static MaplePacket hiredMerchantChat(String message, int slot) {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendPacketOpcode.PLAYER_INTERACTION);
mplew.write(PlayerInteractionHandler.Action.CHAT.getCode());
mplew.write(Cool;
mplew.write(slot); // slot
mplew.writeMapleAsciiString(message);
return mplew.getPacket();
}

public static MaplePacket hiredMerchantVisitorLeave(int slot, boolean owner) {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendPacketOpcode.PLAYER_INTERACTION);
mplew.write(PlayerInteractionHandler.Action.EXIT.getCode());
if (!owner) {
mplew.write(slot);
}
mplew.writeInt(0);
return mplew.getPacket();
}

public static MaplePacket hiredMerchantOwnerLeave() {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(4);
mplew.writeShort(SendPacketOpcode.PLAYER_INTERACTION);
mplew.write(0x2A);
mplew.write(0);
return mplew.getPacket();
}

public static MaplePacket hiredMerchantMaintenanceMessage() {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(5);
mplew.writeShort(SendPacketOpcode.PLAYER_INTERACTION);
mplew.write(PlayerInteractionHandler.Action.ROOM.getCode());
mplew.write(0x00);
mplew.write(0x12);
return mplew.getPacket();
}

public static MaplePacket hiredMerchantVisitorAdd(MapleCharacter chr, int slot) {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendPacketOpcode.PLAYER_INTERACTION);
mplew.write(PlayerInteractionHandler.Action.VISIT.getCode());
mplew.write(slot);
addCharLook(mplew, chr, false);
mplew.writeMapleAsciiString(chr.getName());
return mplew.getPacket();
}

public static MaplePacket spawnHiredMerchant(HiredMerchant hm) {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendPacketOpcode.SPAWN_HIRED_MERCHANT);
mplew.writeInt(hm.getOwnerId());
mplew.writeInt(hm.getItemId());
mplew.writeShort((short) hm.getPosition().getX());
mplew.writeShort((short) hm.getPosition().getY());
mplew.writeShort(0);
mplew.writeMapleAsciiString(hm.getOwner());
mplew.write(0x05);
mplew.writeInt(hm.getObjectId());
mplew.writeMapleAsciiString(hm.getDescription());
mplew.write(hm.getItemId() % 10);
mplew.write(0);
mplew.write(4);
return mplew.getPacket();
}

public static MaplePacket destroyHiredMerchant(int id) {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(6);
mplew.writeShort(SendPacketOpcode.DESTROY_HIRED_MERCHANT);
mplew.writeInt(id);
return mplew.getPacket();
}

public static MaplePacket leaveHiredMerchant(int slot, int status2) {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendPacketOpcode.PLAYER_INTERACTION);
mplew.write(PlayerInteractionHandler.Action.EXIT.getCode());
mplew.write(slot);
mplew.write(status2);
return mplew.getPacket();
}
Player Interaction Packets:
Code:
CREATE(0),
INVITE(2),
DECLINE(3),
VISIT(4),
ROOM(5),
CHAT(6),
CHAT_THING(Cool,
EXIT(0xA),
OPEN(0xB),
SET_ITEMS(0xF),
SET_MESO(0x10),
CONFIRM(0x11),
TRANSACTION(0x14),
ADD_ITEM(0x16),
BUY(0x17),
UPDATE_MERCHANT(0x19),
REMOVE_ITEM(0x1B),
BAN_PLAYER(0x1C),
MERCHANT_THING(0x1D),
OPEN_STORE(0x1E),
PUT_ITEM(0x21),
MERCHANT_BUY(0x22),
TAKE_ITEM_BACK(0x26),
MAINTENANCE_OFF(0x27),
MERCHANT_ORGANIZE(0x28),
CLOSE_MERCHANT(0x29),
REAL_CLOSE_MERCHANT(0x2A),
SOMETHING(0x2D),
VIEW_VISITORS(0x2E),
SendOps:
Code:
SPAWN_HIRED_MERCHANT(0x109),
DESTROY_HIRED_MERCHANT(0x10A),
UPDATE_HIRED_MERCHANT(0x10B),
Recv Ops:
Code:
HIRED_MERCHANT_REQUEST(0x3F),







Credits- Control

View user profile

View previous topic View next topic Back to top Message [Page 1 of 1]


Permissions in this forum:
You cannot reply to topics in this forum