Rename and clean up MaplePlayerShopItem
This commit is contained in:
@@ -5545,7 +5545,7 @@ public class Character extends AbstractCharacterObject {
|
|||||||
mps.setOpen(false);
|
mps.setOpen(false);
|
||||||
getWorldServer().unregisterPlayerShop(mps);
|
getWorldServer().unregisterPlayerShop(mps);
|
||||||
|
|
||||||
for (MaplePlayerShopItem mpsi : mps.getItems()) {
|
for (PlayerShopItem mpsi : mps.getItems()) {
|
||||||
if (mpsi.getBundles() >= 2) {
|
if (mpsi.getBundles() >= 2) {
|
||||||
Item iItem = mpsi.getItem().copy();
|
Item iItem = mpsi.getItem().copy();
|
||||||
iItem.setQuantity((short) (mpsi.getBundles() * iItem.getQuantity()));
|
iItem.setQuantity((short) (mpsi.getBundles() * iItem.getQuantity()));
|
||||||
|
|||||||
@@ -599,7 +599,7 @@ public final class PlayerInteractionHandler extends AbstractPacketHandler {
|
|||||||
sellItem.setQuantity(perBundle);
|
sellItem.setQuantity(perBundle);
|
||||||
}
|
}
|
||||||
|
|
||||||
MaplePlayerShopItem shopItem = new MaplePlayerShopItem(sellItem, bundles, price);
|
PlayerShopItem shopItem = new PlayerShopItem(sellItem, bundles, price);
|
||||||
PlayerShop shop = chr.getPlayerShop();
|
PlayerShop shop = chr.getPlayerShop();
|
||||||
HiredMerchant merchant = chr.getHiredMerchant();
|
HiredMerchant merchant = chr.getHiredMerchant();
|
||||||
if (shop != null && shop.isOwner(chr)) {
|
if (shop != null && shop.isOwner(chr)) {
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ public final class UseCashItemHandler extends AbstractPacketHandler {
|
|||||||
c.getWorldServer().addOwlItemSearch(itemid);
|
c.getWorldServer().addOwlItemSearch(itemid);
|
||||||
}
|
}
|
||||||
player.setOwlSearch(itemid);
|
player.setOwlSearch(itemid);
|
||||||
List<Pair<MaplePlayerShopItem, AbstractMapObject>> hmsAvailable = c.getWorldServer().getAvailableItemBundles(itemid);
|
List<Pair<PlayerShopItem, AbstractMapObject>> hmsAvailable = c.getWorldServer().getAvailableItemBundles(itemid);
|
||||||
if (!hmsAvailable.isEmpty()) {
|
if (!hmsAvailable.isEmpty()) {
|
||||||
remove(c, position, itemId);
|
remove(c, position, itemId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1813,21 +1813,21 @@ public class World {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Pair<MaplePlayerShopItem, AbstractMapObject>> getAvailableItemBundles(int itemid) {
|
public List<Pair<PlayerShopItem, AbstractMapObject>> getAvailableItemBundles(int itemid) {
|
||||||
List<Pair<MaplePlayerShopItem, AbstractMapObject>> hmsAvailable = new ArrayList<>();
|
List<Pair<PlayerShopItem, AbstractMapObject>> hmsAvailable = new ArrayList<>();
|
||||||
|
|
||||||
for (HiredMerchant hm : getActiveMerchants()) {
|
for (HiredMerchant hm : getActiveMerchants()) {
|
||||||
List<MaplePlayerShopItem> itemBundles = hm.sendAvailableBundles(itemid);
|
List<PlayerShopItem> itemBundles = hm.sendAvailableBundles(itemid);
|
||||||
|
|
||||||
for(MaplePlayerShopItem mpsi : itemBundles) {
|
for(PlayerShopItem mpsi : itemBundles) {
|
||||||
hmsAvailable.add(new Pair<>(mpsi, hm));
|
hmsAvailable.add(new Pair<>(mpsi, hm));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (PlayerShop ps : getActivePlayerShops()) {
|
for (PlayerShop ps : getActivePlayerShops()) {
|
||||||
List<MaplePlayerShopItem> itemBundles = ps.sendAvailableBundles(itemid);
|
List<PlayerShopItem> itemBundles = ps.sendAvailableBundles(itemid);
|
||||||
|
|
||||||
for(MaplePlayerShopItem mpsi : itemBundles) {
|
for(PlayerShopItem mpsi : itemBundles) {
|
||||||
hmsAvailable.add(new Pair<>(mpsi, ps));
|
hmsAvailable.add(new Pair<>(mpsi, ps));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class HiredMerchant extends AbstractMapObject {
|
|||||||
private String ownerName = "";
|
private String ownerName = "";
|
||||||
private String description = "";
|
private String description = "";
|
||||||
private final Character[] visitors = new Character[3];
|
private final Character[] visitors = new Character[3];
|
||||||
private final List<MaplePlayerShopItem> items = new LinkedList<>();
|
private final List<PlayerShopItem> items = new LinkedList<>();
|
||||||
private final List<Pair<String, Byte>> messages = new LinkedList<>();
|
private final List<Pair<String, Byte>> messages = new LinkedList<>();
|
||||||
private final List<SoldItem> sold = new LinkedList<>();
|
private final List<SoldItem> sold = new LinkedList<>();
|
||||||
private final AtomicBoolean open = new AtomicBoolean();
|
private final AtomicBoolean open = new AtomicBoolean();
|
||||||
@@ -216,7 +216,7 @@ public class HiredMerchant extends AbstractMapObject {
|
|||||||
|
|
||||||
public void takeItemBack(int slot, Character chr) {
|
public void takeItemBack(int slot, Character chr) {
|
||||||
synchronized (items) {
|
synchronized (items) {
|
||||||
MaplePlayerShopItem shopItem = items.get(slot);
|
PlayerShopItem shopItem = items.get(slot);
|
||||||
if (shopItem.isExist()) {
|
if (shopItem.isExist()) {
|
||||||
if (shopItem.getBundles() > 0) {
|
if (shopItem.getBundles() > 0) {
|
||||||
Item iitem = shopItem.getItem().copy();
|
Item iitem = shopItem.getItem().copy();
|
||||||
@@ -249,7 +249,7 @@ public class HiredMerchant extends AbstractMapObject {
|
|||||||
synchronized (items) {
|
synchronized (items) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
for (MaplePlayerShopItem mpsi : items) {
|
for (PlayerShopItem mpsi : items) {
|
||||||
if (mpsi.getItem().getItemId() == itemid) {
|
if (mpsi.getItem().getItemId() == itemid) {
|
||||||
count += (mpsi.getBundles() * mpsi.getItem().getQuantity());
|
count += (mpsi.getBundles() * mpsi.getItem().getQuantity());
|
||||||
}
|
}
|
||||||
@@ -261,7 +261,7 @@ public class HiredMerchant extends AbstractMapObject {
|
|||||||
|
|
||||||
public void buy(Client c, int item, short quantity) {
|
public void buy(Client c, int item, short quantity) {
|
||||||
synchronized (items) {
|
synchronized (items) {
|
||||||
MaplePlayerShopItem pItem = items.get(item);
|
PlayerShopItem pItem = items.get(item);
|
||||||
Item newItem = pItem.getItem().copy();
|
Item newItem = pItem.getItem().copy();
|
||||||
|
|
||||||
newItem.setQuantity((short) ((pItem.getItem().getQuantity() * quantity)));
|
newItem.setQuantity((short) ((pItem.getItem().getQuantity() * quantity)));
|
||||||
@@ -408,9 +408,9 @@ public class HiredMerchant extends AbstractMapObject {
|
|||||||
this.removeOwner(c.getPlayer());
|
this.removeOwner(c.getPlayer());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
List<MaplePlayerShopItem> copyItems = getItems();
|
List<PlayerShopItem> copyItems = getItems();
|
||||||
if (check(c.getPlayer(), copyItems) && !timeout) {
|
if (check(c.getPlayer(), copyItems) && !timeout) {
|
||||||
for (MaplePlayerShopItem mpsi : copyItems) {
|
for (PlayerShopItem mpsi : copyItems) {
|
||||||
if (mpsi.isExist()) {
|
if (mpsi.isExist()) {
|
||||||
if (mpsi.getItem().getInventoryType().equals(InventoryType.EQUIP)) {
|
if (mpsi.getItem().getInventoryType().equals(InventoryType.EQUIP)) {
|
||||||
InventoryManipulator.addFromDrop(c, mpsi.getItem(), false);
|
InventoryManipulator.addFromDrop(c, mpsi.getItem(), false);
|
||||||
@@ -512,14 +512,14 @@ public class HiredMerchant extends AbstractMapObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MaplePlayerShopItem> getItems() {
|
public List<PlayerShopItem> getItems() {
|
||||||
synchronized (items) {
|
synchronized (items) {
|
||||||
return Collections.unmodifiableList(items);
|
return Collections.unmodifiableList(items);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasItem(int itemid) {
|
public boolean hasItem(int itemid) {
|
||||||
for (MaplePlayerShopItem mpsi : getItems()) {
|
for (PlayerShopItem mpsi : getItems()) {
|
||||||
if (mpsi.getItem().getItemId() == itemid && mpsi.isExist() && mpsi.getBundles() > 0) {
|
if (mpsi.getItem().getItemId() == itemid && mpsi.isExist() && mpsi.getBundles() > 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -528,7 +528,7 @@ public class HiredMerchant extends AbstractMapObject {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean addItem(MaplePlayerShopItem item) {
|
public boolean addItem(PlayerShopItem item) {
|
||||||
synchronized (items) {
|
synchronized (items) {
|
||||||
if (items.size() >= 16) {
|
if (items.size() >= 16) {
|
||||||
return false;
|
return false;
|
||||||
@@ -609,9 +609,9 @@ public class HiredMerchant extends AbstractMapObject {
|
|||||||
broadcastToVisitorsThreadsafe(PacketCreator.hiredMerchantChat(message, slot));
|
broadcastToVisitorsThreadsafe(PacketCreator.hiredMerchantChat(message, slot));
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MaplePlayerShopItem> sendAvailableBundles(int itemid) {
|
public List<PlayerShopItem> sendAvailableBundles(int itemid) {
|
||||||
List<MaplePlayerShopItem> list = new LinkedList<>();
|
List<PlayerShopItem> list = new LinkedList<>();
|
||||||
List<MaplePlayerShopItem> all = new ArrayList<>();
|
List<PlayerShopItem> all = new ArrayList<>();
|
||||||
|
|
||||||
if (!open.get()) {
|
if (!open.get()) {
|
||||||
return list;
|
return list;
|
||||||
@@ -621,7 +621,7 @@ public class HiredMerchant extends AbstractMapObject {
|
|||||||
all.addAll(items);
|
all.addAll(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (MaplePlayerShopItem mpsi : all) {
|
for (PlayerShopItem mpsi : all) {
|
||||||
if (mpsi.getItem().getItemId() == itemid && mpsi.getBundles() > 0 && mpsi.isExist()) {
|
if (mpsi.getItem().getItemId() == itemid && mpsi.getBundles() > 0 && mpsi.isExist()) {
|
||||||
list.add(mpsi);
|
list.add(mpsi);
|
||||||
}
|
}
|
||||||
@@ -633,7 +633,7 @@ public class HiredMerchant extends AbstractMapObject {
|
|||||||
List<Pair<Item, InventoryType>> itemsWithType = new ArrayList<>();
|
List<Pair<Item, InventoryType>> itemsWithType = new ArrayList<>();
|
||||||
List<Short> bundles = new ArrayList<>();
|
List<Short> bundles = new ArrayList<>();
|
||||||
|
|
||||||
for (MaplePlayerShopItem pItems : getItems()) {
|
for (PlayerShopItem pItems : getItems()) {
|
||||||
Item newItem = pItems.getItem();
|
Item newItem = pItems.getItem();
|
||||||
short newBundle = pItems.getBundles();
|
short newBundle = pItems.getBundles();
|
||||||
|
|
||||||
@@ -655,9 +655,9 @@ public class HiredMerchant extends AbstractMapObject {
|
|||||||
FredrickProcessor.insertFredrickLog(this.ownerId);
|
FredrickProcessor.insertFredrickLog(this.ownerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean check(Character chr, List<MaplePlayerShopItem> items) {
|
private static boolean check(Character chr, List<PlayerShopItem> items) {
|
||||||
List<Pair<Item, InventoryType>> li = new ArrayList<>();
|
List<Pair<Item, InventoryType>> li = new ArrayList<>();
|
||||||
for (MaplePlayerShopItem item : items) {
|
for (PlayerShopItem item : items) {
|
||||||
Item it = item.getItem().copy();
|
Item it = item.getItem().copy();
|
||||||
it.setQuantity((short) (it.getQuantity() * item.getBundles()));
|
it.setQuantity((short) (it.getQuantity() * item.getBundles()));
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class PlayerShop extends AbstractMapObject {
|
|||||||
private final int itemid;
|
private final int itemid;
|
||||||
|
|
||||||
private final Character[] visitors = new Character[3];
|
private final Character[] visitors = new Character[3];
|
||||||
private final List<MaplePlayerShopItem> items = new ArrayList<>();
|
private final List<PlayerShopItem> items = new ArrayList<>();
|
||||||
private final List<SoldItem> sold = new LinkedList<>();
|
private final List<SoldItem> sold = new LinkedList<>();
|
||||||
private String description;
|
private String description;
|
||||||
private int boughtnumber = 0;
|
private int boughtnumber = 0;
|
||||||
@@ -204,7 +204,7 @@ public class PlayerShop extends AbstractMapObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean addItem(MaplePlayerShopItem item) {
|
public boolean addItem(PlayerShopItem item) {
|
||||||
synchronized (items) {
|
synchronized (items) {
|
||||||
if (items.size() >= 16) {
|
if (items.size() >= 16) {
|
||||||
return false;
|
return false;
|
||||||
@@ -225,7 +225,7 @@ public class PlayerShop extends AbstractMapObject {
|
|||||||
|
|
||||||
public void takeItemBack(int slot, Character chr) {
|
public void takeItemBack(int slot, Character chr) {
|
||||||
synchronized (items) {
|
synchronized (items) {
|
||||||
MaplePlayerShopItem shopItem = items.get(slot);
|
PlayerShopItem shopItem = items.get(slot);
|
||||||
if (shopItem.isExist()) {
|
if (shopItem.isExist()) {
|
||||||
if (shopItem.getBundles() > 0) {
|
if (shopItem.getBundles() > 0) {
|
||||||
Item iitem = shopItem.getItem().copy();
|
Item iitem = shopItem.getItem().copy();
|
||||||
@@ -256,7 +256,7 @@ public class PlayerShop extends AbstractMapObject {
|
|||||||
public boolean buy(Client c, int item, short quantity) {
|
public boolean buy(Client c, int item, short quantity) {
|
||||||
synchronized (items) {
|
synchronized (items) {
|
||||||
if (isVisitor(c.getPlayer())) {
|
if (isVisitor(c.getPlayer())) {
|
||||||
MaplePlayerShopItem pItem = items.get(item);
|
PlayerShopItem pItem = items.get(item);
|
||||||
Item newItem = pItem.getItem().copy();
|
Item newItem = pItem.getItem().copy();
|
||||||
|
|
||||||
newItem.setQuantity((short) ((pItem.getItem().getQuantity() * quantity)));
|
newItem.setQuantity((short) ((pItem.getItem().getQuantity() * quantity)));
|
||||||
@@ -473,14 +473,14 @@ public class PlayerShop extends AbstractMapObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MaplePlayerShopItem> getItems() {
|
public List<PlayerShopItem> getItems() {
|
||||||
synchronized (items) {
|
synchronized (items) {
|
||||||
return Collections.unmodifiableList(items);
|
return Collections.unmodifiableList(items);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasItem(int itemid) {
|
public boolean hasItem(int itemid) {
|
||||||
for (MaplePlayerShopItem mpsi : getItems()) {
|
for (PlayerShopItem mpsi : getItems()) {
|
||||||
if (mpsi.getItem().getItemId() == itemid && mpsi.isExist() && mpsi.getBundles() > 0) {
|
if (mpsi.getItem().getItemId() == itemid && mpsi.isExist() && mpsi.getBundles() > 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -552,15 +552,15 @@ public class PlayerShop extends AbstractMapObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<MaplePlayerShopItem> sendAvailableBundles(int itemid) {
|
public List<PlayerShopItem> sendAvailableBundles(int itemid) {
|
||||||
List<MaplePlayerShopItem> list = new LinkedList<>();
|
List<PlayerShopItem> list = new LinkedList<>();
|
||||||
List<MaplePlayerShopItem> all = new ArrayList<>();
|
List<PlayerShopItem> all = new ArrayList<>();
|
||||||
|
|
||||||
synchronized (items) {
|
synchronized (items) {
|
||||||
all.addAll(items);
|
all.addAll(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (MaplePlayerShopItem mpsi : all) {
|
for (PlayerShopItem mpsi : all) {
|
||||||
if (mpsi.getItem().getItemId() == itemid && mpsi.getBundles() > 0 && mpsi.isExist()) {
|
if (mpsi.getItem().getItemId() == itemid && mpsi.getBundles() > 0 && mpsi.isExist()) {
|
||||||
list.add(mpsi);
|
list.add(mpsi);
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-5
@@ -24,16 +24,15 @@ package server.maps;
|
|||||||
import client.inventory.Item;
|
import client.inventory.Item;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Matze
|
* @author Matze
|
||||||
*/
|
*/
|
||||||
public class MaplePlayerShopItem {
|
public class PlayerShopItem {
|
||||||
private Item item;
|
private final Item item;
|
||||||
private short bundles;
|
private short bundles;
|
||||||
private int price;
|
private final int price;
|
||||||
private boolean doesExist;
|
private boolean doesExist;
|
||||||
|
|
||||||
public MaplePlayerShopItem(Item item, short bundles, int price) {
|
public PlayerShopItem(Item item, short bundles, int price) {
|
||||||
this.item = item;
|
this.item = item;
|
||||||
this.bundles = bundles;
|
this.bundles = bundles;
|
||||||
this.price = price;
|
this.price = price;
|
||||||
@@ -3172,7 +3172,7 @@ public class PacketCreator {
|
|||||||
final OutPacket p = OutPacket.create(SendOpcode.PLAYER_INTERACTION);
|
final OutPacket p = OutPacket.create(SendOpcode.PLAYER_INTERACTION);
|
||||||
p.writeByte(PlayerInteractionHandler.Action.UPDATE_MERCHANT.getCode());
|
p.writeByte(PlayerInteractionHandler.Action.UPDATE_MERCHANT.getCode());
|
||||||
p.writeByte(shop.getItems().size());
|
p.writeByte(shop.getItems().size());
|
||||||
for (MaplePlayerShopItem item : shop.getItems()) {
|
for (PlayerShopItem item : shop.getItems()) {
|
||||||
p.writeShort(item.getBundles());
|
p.writeShort(item.getBundles());
|
||||||
p.writeShort(item.getItem().getQuantity());
|
p.writeShort(item.getItem().getQuantity());
|
||||||
p.writeInt(item.getPrice());
|
p.writeInt(item.getPrice());
|
||||||
@@ -3231,10 +3231,10 @@ public class PacketCreator {
|
|||||||
|
|
||||||
p.writeByte(0xFF);
|
p.writeByte(0xFF);
|
||||||
p.writeString(shop.getDescription());
|
p.writeString(shop.getDescription());
|
||||||
List<MaplePlayerShopItem> items = shop.getItems();
|
List<PlayerShopItem> items = shop.getItems();
|
||||||
p.writeByte(0x10); //TODO SLOTS, which is 16 for most stores...slotMax
|
p.writeByte(0x10); //TODO SLOTS, which is 16 for most stores...slotMax
|
||||||
p.writeByte(items.size());
|
p.writeByte(items.size());
|
||||||
for (MaplePlayerShopItem item : items) {
|
for (PlayerShopItem item : items) {
|
||||||
p.writeShort(item.getBundles());
|
p.writeShort(item.getBundles());
|
||||||
p.writeShort(item.getItem().getQuantity());
|
p.writeShort(item.getItem().getQuantity());
|
||||||
p.writeInt(item.getPrice());
|
p.writeInt(item.getPrice());
|
||||||
@@ -5004,7 +5004,7 @@ public class PacketCreator {
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Packet owlOfMinerva(Client c, int itemId, List<Pair<MaplePlayerShopItem, AbstractMapObject>> hmsAvailable) {
|
public static Packet owlOfMinerva(Client c, int itemId, List<Pair<PlayerShopItem, AbstractMapObject>> hmsAvailable) {
|
||||||
byte itemType = ItemConstants.getInventoryType(itemId).getType();
|
byte itemType = ItemConstants.getInventoryType(itemId).getType();
|
||||||
|
|
||||||
OutPacket p = OutPacket.create(SendOpcode.SHOP_SCANNER_RESULT);
|
OutPacket p = OutPacket.create(SendOpcode.SHOP_SCANNER_RESULT);
|
||||||
@@ -5012,8 +5012,8 @@ public class PacketCreator {
|
|||||||
p.writeInt(0);
|
p.writeInt(0);
|
||||||
p.writeInt(itemId);
|
p.writeInt(itemId);
|
||||||
p.writeInt(hmsAvailable.size());
|
p.writeInt(hmsAvailable.size());
|
||||||
for (Pair<MaplePlayerShopItem, AbstractMapObject> hme : hmsAvailable) {
|
for (Pair<PlayerShopItem, AbstractMapObject> hme : hmsAvailable) {
|
||||||
MaplePlayerShopItem item = hme.getLeft();
|
PlayerShopItem item = hme.getLeft();
|
||||||
AbstractMapObject mo = hme.getRight();
|
AbstractMapObject mo = hme.getRight();
|
||||||
|
|
||||||
if (mo instanceof PlayerShop ps) {
|
if (mo instanceof PlayerShop ps) {
|
||||||
@@ -5131,7 +5131,7 @@ public class PacketCreator {
|
|||||||
if (hm.getItems().isEmpty()) {
|
if (hm.getItems().isEmpty()) {
|
||||||
p.writeByte(0);//Hmm??
|
p.writeByte(0);//Hmm??
|
||||||
} else {
|
} else {
|
||||||
for (MaplePlayerShopItem item : hm.getItems()) {
|
for (PlayerShopItem item : hm.getItems()) {
|
||||||
p.writeShort(item.getBundles());
|
p.writeShort(item.getBundles());
|
||||||
p.writeShort(item.getItem().getQuantity());
|
p.writeShort(item.getItem().getQuantity());
|
||||||
p.writeInt(item.getPrice());
|
p.writeInt(item.getPrice());
|
||||||
@@ -5146,7 +5146,7 @@ public class PacketCreator {
|
|||||||
p.writeByte(PlayerInteractionHandler.Action.UPDATE_MERCHANT.getCode());
|
p.writeByte(PlayerInteractionHandler.Action.UPDATE_MERCHANT.getCode());
|
||||||
p.writeInt(hm.isOwner(chr) ? chr.getMerchantMeso() : chr.getMeso());
|
p.writeInt(hm.isOwner(chr) ? chr.getMerchantMeso() : chr.getMeso());
|
||||||
p.writeByte(hm.getItems().size());
|
p.writeByte(hm.getItems().size());
|
||||||
for (MaplePlayerShopItem item : hm.getItems()) {
|
for (PlayerShopItem item : hm.getItems()) {
|
||||||
p.writeShort(item.getBundles());
|
p.writeShort(item.getBundles());
|
||||||
p.writeShort(item.getItem().getQuantity());
|
p.writeShort(item.getItem().getQuantity());
|
||||||
p.writeInt(item.getPrice());
|
p.writeInt(item.getPrice());
|
||||||
|
|||||||
Reference in New Issue
Block a user