本文整理匯總了Java中server.stores.MaplePlayerShopItem類的典型用法代碼示例。如果您正苦於以下問題:Java MaplePlayerShopItem類的具體用法?Java MaplePlayerShopItem怎麽用?Java MaplePlayerShopItem使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MaplePlayerShopItem類屬於server.stores包,在下文中一共展示了MaplePlayerShopItem類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: shopItemUpdate
import server.stores.MaplePlayerShopItem; //導入依賴的package包/類
public static final byte[] shopItemUpdate(final IMaplePlayerShop shop) {
final PacketWriter pw = new PacketWriter();
pw.writeShort(SendPacketOpcode.PLAYER_INTERACTION.getValue());
pw.write(77);//was50
if (shop.getShopType() == 1) {
pw.writeLong(0L);
}
pw.write(shop.getItems().size());
for (final MaplePlayerShopItem item : shop.getItems()) {
pw.writeShort(item.bundles);
pw.writeShort(item.item.getQuantity());
pw.writeLong(item.price);
PacketHelper.addItemInfo(pw, item.item);
}
pw.writeShort(0);
return pw.getPacket();
}
示例2: shopItemUpdate
import server.stores.MaplePlayerShopItem; //導入依賴的package包/類
public static final byte[] shopItemUpdate(final IMaplePlayerShop shop) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendPacketOpcode.PLAYER_INTERACTION.getValue());
mplew.write(77);//was50
if (shop.getShopType() == 1) {
mplew.writeLong(0L);
}
mplew.write(shop.getItems().size());
for (final MaplePlayerShopItem item : shop.getItems()) {
mplew.writeShort(item.bundles);
mplew.writeShort(item.item.getQuantity());
mplew.writeLong(item.price);
PacketHelper.addItemInfo(mplew, item.item);
}
mplew.writeShort(0);
return mplew.getPacket();
}
示例3: getHiredMerch
import server.stores.MaplePlayerShopItem; //導入依賴的package包/類
public static byte[] getHiredMerch(MapleCharacter chr, HiredMerchant merch, boolean firstTime) {
PacketWriter pw = new PacketWriter();
pw.writeShort(SendPacketOpcode.PLAYER_INTERACTION.getValue());
pw.write(20);//was11
pw.write(6);
pw.write(7);
pw.writeShort(merch.getVisitorSlot(chr));
pw.writeInt(merch.getItemId());
pw.writeMapleAsciiString("Hired Merchant");
for (Pair storechr : merch.getVisitors()) {
pw.write(((Byte) storechr.left).byteValue());
PacketHelper.addCharLook(pw, (MapleCharacterLook) storechr.right, false, false);
pw.writeMapleAsciiString(((MapleCharacter) storechr.right).getName());
pw.writeShort(((MapleCharacter) storechr.right).getJob());
}
pw.write(-1);
pw.writeShort(0);
pw.writeMapleAsciiString(merch.getOwnerName());
if (merch.isOwner(chr)) {
pw.writeInt(merch.getTimeLeft());
pw.write(firstTime ? 1 : 0);
pw.write(merch.getBoughtItems().size());
for (final BoughtItem SoldItem : merch.getBoughtItems()) {
pw.writeInt(SoldItem.id);
pw.writeShort(SoldItem.quantity);
pw.writeLong(SoldItem.totalPrice);
pw.writeMapleAsciiString(SoldItem.buyer);
}
pw.writeLong(merch.getMeso());
}
pw.writeInt(263);
pw.writeMapleAsciiString(merch.getDescription());
pw.write(16);
pw.writeLong(merch.getMeso());
pw.write(merch.getItems().size());
for (MaplePlayerShopItem item : merch.getItems()) {
pw.writeShort(item.bundles);
pw.writeShort(item.item.getQuantity());
pw.writeLong(item.price);
PacketHelper.addItemInfo(pw, item.item);
}
pw.writeShort(0);
return pw.getPacket();
}
示例4: getPlayerStore
import server.stores.MaplePlayerShopItem; //導入依賴的package包/類
public static final byte[] getPlayerStore(final MapleCharacter chr, final boolean firstTime) {
final PacketWriter pw = new PacketWriter();
pw.writeShort(SendPacketOpcode.PLAYER_INTERACTION.getValue());
IMaplePlayerShop ips = chr.getPlayerShop();
pw.write(11);
switch (ips.getShopType()) {
case 2:
pw.write(4);
pw.write(4);
break;
case 3:
pw.write(2);
pw.write(2);
break;
case 4:
pw.write(1);
pw.write(2);
break;
}
pw.writeShort(ips.getVisitorSlot(chr));
PacketHelper.addCharLook(pw, ((MaplePlayerShop) ips).getMCOwner(), false, false);
pw.writeMapleAsciiString(ips.getOwnerName());
pw.writeShort(((MaplePlayerShop) ips).getMCOwner().getJob());
for (final Pair<Byte, MapleCharacter> storechr : ips.getVisitors()) {
pw.write(storechr.left);
PacketHelper.addCharLook(pw, storechr.right, false, false);
pw.writeMapleAsciiString(storechr.right.getName());
pw.writeShort(storechr.right.getJob());
}
pw.write(255);
pw.writeMapleAsciiString(ips.getDescription());
pw.write(10);
pw.write(ips.getItems().size());
for (final MaplePlayerShopItem item : ips.getItems()) {
pw.writeShort(item.bundles);
pw.writeShort(item.item.getQuantity());
pw.writeInt(item.price);
PacketHelper.addItemInfo(pw, item.item);
}
return pw.getPacket();
}
示例5: getHiredMerch
import server.stores.MaplePlayerShopItem; //導入依賴的package包/類
public static byte[] getHiredMerch(MapleCharacter chr, HiredMerchant merch, boolean firstTime) {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendPacketOpcode.PLAYER_INTERACTION.getValue());
mplew.write(20);//was11
mplew.write(6);
mplew.write(7);
mplew.writeShort(merch.getVisitorSlot(chr));
mplew.writeInt(merch.getItemId());
mplew.writeMapleAsciiString("Hired Merchant");
for (Pair storechr : merch.getVisitors()) {
mplew.write(((Byte) storechr.left).byteValue());
PacketHelper.addCharLook(mplew, (MapleCharacterLook) storechr.right, false, false);
mplew.writeMapleAsciiString(((MapleCharacter) storechr.right).getName());
mplew.writeShort(((MapleCharacter) storechr.right).getJob());
}
mplew.write(-1);
mplew.writeShort(0);
mplew.writeMapleAsciiString(merch.getOwnerName());
if (merch.isOwner(chr)) {
mplew.writeInt(merch.getTimeLeft());
mplew.write(firstTime ? 1 : 0);
mplew.write(merch.getBoughtItems().size());
for (final BoughtItem SoldItem : merch.getBoughtItems()) {
mplew.writeInt(SoldItem.id);
mplew.writeShort(SoldItem.quantity);
mplew.writeLong(SoldItem.totalPrice);
mplew.writeMapleAsciiString(SoldItem.buyer);
}
mplew.writeLong(merch.getMeso());
}
mplew.writeInt(263);
mplew.writeMapleAsciiString(merch.getDescription());
mplew.write(16);
mplew.writeLong(merch.getMeso());
mplew.write(merch.getItems().size());
for (MaplePlayerShopItem item : merch.getItems()) {
mplew.writeShort(item.bundles);
mplew.writeShort(item.item.getQuantity());
mplew.writeLong(item.price);
PacketHelper.addItemInfo(mplew, item.item);
}
mplew.writeShort(0);
return mplew.getPacket();
}
示例6: getPlayerStore
import server.stores.MaplePlayerShopItem; //導入依賴的package包/類
public static final byte[] getPlayerStore(final MapleCharacter chr, final boolean firstTime) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendPacketOpcode.PLAYER_INTERACTION.getValue());
IMaplePlayerShop ips = chr.getPlayerShop();
mplew.write(GameConstants.GMS ? 11 : 5);
switch (ips.getShopType()) {
case 2:
mplew.write(4);
mplew.write(4);
break;
case 3:
mplew.write(2);
mplew.write(2);
break;
case 4:
mplew.write(1);
mplew.write(2);
break;
}
mplew.writeShort(ips.getVisitorSlot(chr));
PacketHelper.addCharLook(mplew, ((MaplePlayerShop) ips).getMCOwner(), false, false);
mplew.writeMapleAsciiString(ips.getOwnerName());
mplew.writeShort(((MaplePlayerShop) ips).getMCOwner().getJob());
for (final Pair<Byte, MapleCharacter> storechr : ips.getVisitors()) {
mplew.write(storechr.left);
PacketHelper.addCharLook(mplew, storechr.right, false, false);
mplew.writeMapleAsciiString(storechr.right.getName());
mplew.writeShort(storechr.right.getJob());
}
mplew.write(255);
mplew.writeMapleAsciiString(ips.getDescription());
mplew.write(10);
mplew.write(ips.getItems().size());
for (final MaplePlayerShopItem item : ips.getItems()) {
mplew.writeShort(item.bundles);
mplew.writeShort(item.item.getQuantity());
mplew.writeInt(item.price);
PacketHelper.addItemInfo(mplew, item.item);
}
return mplew.getPacket();
}