diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 9669e6cd19..1961fae884 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -73,8 +73,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId); if (validatePlayer(item, _count, player)) { - final int price = (item.getPrice() * _count); - final int paymentId = validatePaymentId(item, price); + final int price = item.getPrice() * _count; + final int paymentId = validatePaymentId(item); if (paymentId < 0) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT)); @@ -194,7 +194,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; @@ -209,7 +217,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket return true; } - private static int validatePaymentId(PrimeShopGroup item, long amount) + private static int validatePaymentId(PrimeShopGroup item) { switch (item.getPaymentType()) { diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 9669e6cd19..1961fae884 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -73,8 +73,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId); if (validatePlayer(item, _count, player)) { - final int price = (item.getPrice() * _count); - final int paymentId = validatePaymentId(item, price); + final int price = item.getPrice() * _count; + final int paymentId = validatePaymentId(item); if (paymentId < 0) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT)); @@ -194,7 +194,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; @@ -209,7 +217,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket return true; } - private static int validatePaymentId(PrimeShopGroup item, long amount) + private static int validatePaymentId(PrimeShopGroup item) { switch (item.getPaymentType()) { diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 9669e6cd19..1961fae884 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -73,8 +73,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId); if (validatePlayer(item, _count, player)) { - final int price = (item.getPrice() * _count); - final int paymentId = validatePaymentId(item, price); + final int price = item.getPrice() * _count; + final int paymentId = validatePaymentId(item); if (paymentId < 0) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT)); @@ -194,7 +194,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; @@ -209,7 +217,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket return true; } - private static int validatePaymentId(PrimeShopGroup item, long amount) + private static int validatePaymentId(PrimeShopGroup item) { switch (item.getPaymentType()) { diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 9669e6cd19..1961fae884 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -73,8 +73,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId); if (validatePlayer(item, _count, player)) { - final int price = (item.getPrice() * _count); - final int paymentId = validatePaymentId(item, price); + final int price = item.getPrice() * _count; + final int paymentId = validatePaymentId(item); if (paymentId < 0) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT)); @@ -194,7 +194,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; @@ -209,7 +217,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket return true; } - private static int validatePaymentId(PrimeShopGroup item, long amount) + private static int validatePaymentId(PrimeShopGroup item) { switch (item.getPaymentType()) { diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 9669e6cd19..1961fae884 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -73,8 +73,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId); if (validatePlayer(item, _count, player)) { - final int price = (item.getPrice() * _count); - final int paymentId = validatePaymentId(item, price); + final int price = item.getPrice() * _count; + final int paymentId = validatePaymentId(item); if (paymentId < 0) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT)); @@ -194,7 +194,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; @@ -209,7 +217,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket return true; } - private static int validatePaymentId(PrimeShopGroup item, long amount) + private static int validatePaymentId(PrimeShopGroup item) { switch (item.getPaymentType()) { diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 9669e6cd19..1961fae884 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -73,8 +73,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId); if (validatePlayer(item, _count, player)) { - final int price = (item.getPrice() * _count); - final int paymentId = validatePaymentId(item, price); + final int price = item.getPrice() * _count; + final int paymentId = validatePaymentId(item); if (paymentId < 0) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT)); @@ -194,7 +194,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; @@ -209,7 +217,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket return true; } - private static int validatePaymentId(PrimeShopGroup item, long amount) + private static int validatePaymentId(PrimeShopGroup item) { switch (item.getPaymentType()) { diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 9669e6cd19..1961fae884 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -73,8 +73,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId); if (validatePlayer(item, _count, player)) { - final int price = (item.getPrice() * _count); - final int paymentId = validatePaymentId(item, price); + final int price = item.getPrice() * _count; + final int paymentId = validatePaymentId(item); if (paymentId < 0) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT)); @@ -194,7 +194,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; @@ -209,7 +217,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket return true; } - private static int validatePaymentId(PrimeShopGroup item, long amount) + private static int validatePaymentId(PrimeShopGroup item) { switch (item.getPaymentType()) { diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 9669e6cd19..1961fae884 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -73,8 +73,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId); if (validatePlayer(item, _count, player)) { - final int price = (item.getPrice() * _count); - final int paymentId = validatePaymentId(item, price); + final int price = item.getPrice() * _count; + final int paymentId = validatePaymentId(item); if (paymentId < 0) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT)); @@ -194,7 +194,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; @@ -209,7 +217,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket return true; } - private static int validatePaymentId(PrimeShopGroup item, long amount) + private static int validatePaymentId(PrimeShopGroup item) { switch (item.getPaymentType()) { diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 9669e6cd19..1961fae884 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -73,8 +73,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId); if (validatePlayer(item, _count, player)) { - final int price = (item.getPrice() * _count); - final int paymentId = validatePaymentId(item, price); + final int price = item.getPrice() * _count; + final int paymentId = validatePaymentId(item); if (paymentId < 0) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT)); @@ -194,7 +194,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; @@ -209,7 +217,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket return true; } - private static int validatePaymentId(PrimeShopGroup item, long amount) + private static int validatePaymentId(PrimeShopGroup item) { switch (item.getPaymentType()) { diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 9669e6cd19..1961fae884 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -73,8 +73,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId); if (validatePlayer(item, _count, player)) { - final int price = (item.getPrice() * _count); - final int paymentId = validatePaymentId(item, price); + final int price = item.getPrice() * _count; + final int paymentId = validatePaymentId(item); if (paymentId < 0) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT)); @@ -194,7 +194,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; @@ -209,7 +217,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket return true; } - private static int validatePaymentId(PrimeShopGroup item, long amount) + private static int validatePaymentId(PrimeShopGroup item) { switch (item.getPaymentType()) { diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 9669e6cd19..1961fae884 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -73,8 +73,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId); if (validatePlayer(item, _count, player)) { - final int price = (item.getPrice() * _count); - final int paymentId = validatePaymentId(item, price); + final int price = item.getPrice() * _count; + final int paymentId = validatePaymentId(item); if (paymentId < 0) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT)); @@ -194,7 +194,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; @@ -209,7 +217,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket return true; } - private static int validatePaymentId(PrimeShopGroup item, long amount) + private static int validatePaymentId(PrimeShopGroup item) { switch (item.getPaymentType()) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 6091190154..6e880a17fa 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -78,7 +78,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket { boolean hasItems = true; - // First loop to validate all items + // First loop to validate all items. for (ItemHolder itemHolder : validatePaymentId(item)) { final int paymentId = itemHolder.getId(); @@ -94,8 +94,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket hasItems = false; } } - else - { // this is always 0 + else // This is always 0. + { if (player.getPrimePoints() < price) { hasItems = false; @@ -111,7 +111,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket } // Second loop, only if all criteria has been met! - // this should always be reached if player has all the coins needed for the purchase + // This should always be reached if player has all the coins needed for the purchase. for (ItemHolder itemHolder : validatePaymentId(item)) { final int paymentId = itemHolder.getId(); @@ -233,7 +233,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 6091190154..6e880a17fa 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -78,7 +78,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket { boolean hasItems = true; - // First loop to validate all items + // First loop to validate all items. for (ItemHolder itemHolder : validatePaymentId(item)) { final int paymentId = itemHolder.getId(); @@ -94,8 +94,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket hasItems = false; } } - else - { // this is always 0 + else // This is always 0. + { if (player.getPrimePoints() < price) { hasItems = false; @@ -111,7 +111,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket } // Second loop, only if all criteria has been met! - // this should always be reached if player has all the coins needed for the purchase + // This should always be reached if player has all the coins needed for the purchase. for (ItemHolder itemHolder : validatePaymentId(item)) { final int paymentId = itemHolder.getId(); @@ -233,7 +233,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 6091190154..6e880a17fa 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -78,7 +78,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket { boolean hasItems = true; - // First loop to validate all items + // First loop to validate all items. for (ItemHolder itemHolder : validatePaymentId(item)) { final int paymentId = itemHolder.getId(); @@ -94,8 +94,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket hasItems = false; } } - else - { // this is always 0 + else // This is always 0. + { if (player.getPrimePoints() < price) { hasItems = false; @@ -111,7 +111,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket } // Second loop, only if all criteria has been met! - // this should always be reached if player has all the coins needed for the purchase + // This should always be reached if player has all the coins needed for the purchase. for (ItemHolder itemHolder : validatePaymentId(item)) { final int paymentId = itemHolder.getId(); @@ -233,7 +233,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 6091190154..6e880a17fa 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -78,7 +78,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket { boolean hasItems = true; - // First loop to validate all items + // First loop to validate all items. for (ItemHolder itemHolder : validatePaymentId(item)) { final int paymentId = itemHolder.getId(); @@ -94,8 +94,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket hasItems = false; } } - else - { // this is always 0 + else // This is always 0. + { if (player.getPrimePoints() < price) { hasItems = false; @@ -111,7 +111,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket } // Second loop, only if all criteria has been met! - // this should always be reached if player has all the coins needed for the purchase + // This should always be reached if player has all the coins needed for the purchase. for (ItemHolder itemHolder : validatePaymentId(item)) { final int paymentId = itemHolder.getId(); @@ -233,7 +233,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 6091190154..6e880a17fa 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -78,7 +78,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket { boolean hasItems = true; - // First loop to validate all items + // First loop to validate all items. for (ItemHolder itemHolder : validatePaymentId(item)) { final int paymentId = itemHolder.getId(); @@ -94,8 +94,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket hasItems = false; } } - else - { // this is always 0 + else // This is always 0. + { if (player.getPrimePoints() < price) { hasItems = false; @@ -111,7 +111,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket } // Second loop, only if all criteria has been met! - // this should always be reached if player has all the coins needed for the purchase + // This should always be reached if player has all the coins needed for the purchase. for (ItemHolder itemHolder : validatePaymentId(item)) { final int paymentId = itemHolder.getId(); @@ -233,7 +233,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 6091190154..6e880a17fa 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -78,7 +78,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket { boolean hasItems = true; - // First loop to validate all items + // First loop to validate all items. for (ItemHolder itemHolder : validatePaymentId(item)) { final int paymentId = itemHolder.getId(); @@ -94,8 +94,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket hasItems = false; } } - else - { // this is always 0 + else // This is always 0. + { if (player.getPrimePoints() < price) { hasItems = false; @@ -111,7 +111,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket } // Second loop, only if all criteria has been met! - // this should always be reached if player has all the coins needed for the purchase + // This should always be reached if player has all the coins needed for the purchase. for (ItemHolder itemHolder : validatePaymentId(item)) { final int paymentId = itemHolder.getId(); @@ -233,7 +233,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 9669e6cd19..1961fae884 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -73,8 +73,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId); if (validatePlayer(item, _count, player)) { - final int price = (item.getPrice() * _count); - final int paymentId = validatePaymentId(item, price); + final int price = item.getPrice() * _count; + final int paymentId = validatePaymentId(item); if (paymentId < 0) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT)); @@ -194,7 +194,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; @@ -209,7 +217,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket return true; } - private static int validatePaymentId(PrimeShopGroup item, long amount) + private static int validatePaymentId(PrimeShopGroup item) { switch (item.getPaymentType()) { diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 17a65db854..65fb6e4413 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -73,8 +73,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId); if (validatePlayer(item, _count, player)) { - final int price = (item.getPrice() * _count); - final int paymentId = validatePaymentId(item, price); + final int price = item.getPrice() * _count; + final int paymentId = validatePaymentId(item); if (paymentId < 0) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT)); @@ -208,7 +208,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; @@ -250,7 +258,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket } } - private static int validatePaymentId(PrimeShopGroup item, long amount) + private static int validatePaymentId(PrimeShopGroup item) { switch (item.getPaymentType()) { diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 17a65db854..65fb6e4413 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -73,8 +73,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId); if (validatePlayer(item, _count, player)) { - final int price = (item.getPrice() * _count); - final int paymentId = validatePaymentId(item, price); + final int price = item.getPrice() * _count; + final int paymentId = validatePaymentId(item); if (paymentId < 0) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT)); @@ -208,7 +208,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; @@ -250,7 +258,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket } } - private static int validatePaymentId(PrimeShopGroup item, long amount) + private static int validatePaymentId(PrimeShopGroup item) { switch (item.getPaymentType()) { diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java index 17a65db854..65fb6e4413 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/network/clientpackets/primeshop/RequestBRBuyProduct.java @@ -73,8 +73,8 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final PrimeShopGroup item = PrimeShopData.getInstance().getItem(_brId); if (validatePlayer(item, _count, player)) { - final int price = (item.getPrice() * _count); - final int paymentId = validatePaymentId(item, price); + final int price = item.getPrice() * _count; + final int paymentId = validatePaymentId(item); if (paymentId < 0) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.LACK_OF_POINT)); @@ -208,7 +208,15 @@ public class RequestBRBuyProduct implements IClientIncomingPacket final long slots = item.getCount() * count; if (player.getInventory().validateWeight(weight)) { - if (!player.getInventory().validateCapacity(slots)) + if (item.getCount() == 1) + { + if (!player.getInventory().validateCapacity(slots)) + { + player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); + return false; + } + } + else if (!player.getInventory().validateCapacity(count)) { player.sendPacket(new ExBRBuyProduct(ExBrProductReplyType.INVENTORY_OVERFLOW)); return false; @@ -250,7 +258,7 @@ public class RequestBRBuyProduct implements IClientIncomingPacket } } - private static int validatePaymentId(PrimeShopGroup item, long amount) + private static int validatePaymentId(PrimeShopGroup item) { switch (item.getPaymentType()) {