本文整理汇总了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();
}