diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/xsd/LCoinShop.xsd b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/xsd/LCoinShop.xsd index a5faea8ffe..3173c4933d 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/xsd/LCoinShop.xsd +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/xsd/LCoinShop.xsd @@ -20,6 +20,13 @@ + + + + + + + diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LCoinShopData.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LCoinShopData.java index 5c48bf717e..39134e8caa 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LCoinShopData.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LCoinShopData.java @@ -158,7 +158,7 @@ public class LCoinShopData implements IXmlReader } } - _products.add(new LCoinShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, productionId, accountDailyLimit, accountBuyLimit)); + _products.add(new LCoinShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, productionId, 0, 0, 0, 0, 0, 0, 0, accountDailyLimit, accountBuyLimit)); } } } diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LCoinShopSpecialCraftData.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LCoinShopSpecialCraftData.java index 225ef5f031..1fe3b06764 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LCoinShopSpecialCraftData.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LCoinShopSpecialCraftData.java @@ -99,6 +99,13 @@ public class LCoinShopSpecialCraftData implements IXmlReader ingredientQuantities[1] = 0; ingredientQuantities[2] = 0; int productionId = 0; + int productionId2 = 0; + int productionId3 = 0; + long count = 0; + long count2 = 0; + long count3 = 0; + float chance = 0; + float chance2 = 0; int accountDailyLimit = 0; int accountBuyLimit = 0; for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling()) @@ -146,6 +153,13 @@ public class LCoinShopSpecialCraftData implements IXmlReader else if ("production".equalsIgnoreCase(b.getNodeName())) { productionId = parseInteger(attrs, "id"); + count = parseLong(attrs, "count", 1L); + chance = parseFloat(attrs, "chance", 33.3f); + productionId2 = parseInteger(attrs, "id2"); + count2 = parseLong(attrs, "count2", 1L); + chance2 = parseFloat(attrs, "chance2", 33.3f); + productionId3 = parseInteger(attrs, "id3"); + count3 = parseLong(attrs, "count3", 1L); accountDailyLimit = parseInteger(attrs, "accountDailyLimit", 0); accountBuyLimit = parseInteger(attrs, "accountBuyLimit", 0); @@ -158,7 +172,7 @@ public class LCoinShopSpecialCraftData implements IXmlReader } } - _products.add(new LCoinShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, productionId, accountDailyLimit, accountBuyLimit)); + _products.add(new LCoinShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, productionId, count, chance, productionId2, count2, chance2, productionId3, count3, accountDailyLimit, accountBuyLimit)); } } } diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/LCoinShopProductHolder.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/LCoinShopProductHolder.java index e5049dde97..1980d20214 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/LCoinShopProductHolder.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/LCoinShopProductHolder.java @@ -28,10 +28,17 @@ public class LCoinShopProductHolder private final int[] _ingredientIds; private final long[] _ingredientQuantities; private final int _productionId; + private final long _count; + private final float _chance; + private final int _productionId2; + private final long _count2; + private final float _chance2; + private final int _productionId3; + private final long _count3; private final int _accountDailyLimit; private final int _accountBuyLimit; - public LCoinShopProductHolder(int id, int category, int minLevel, int maxLevel, int[] ingredientIds, long[] ingredientQuantities, int productionId, int accountDailyLimit, int accountBuyLimit) + public LCoinShopProductHolder(int id, int category, int minLevel, int maxLevel, int[] ingredientIds, long[] ingredientQuantities, int productionId, long count, float chance, int productionId2, long count2, float chance2, int productionId3, long count3, int accountDailyLimit, int accountBuyLimit) { _id = id; _category = category; @@ -40,6 +47,13 @@ public class LCoinShopProductHolder _ingredientIds = ingredientIds; _ingredientQuantities = ingredientQuantities; _productionId = productionId; + _count = count; + _chance = chance; + _productionId2 = productionId2; + _count2 = count2; + _chance2 = chance2; + _productionId3 = productionId3; + _count3 = count3; _accountDailyLimit = accountDailyLimit; _accountBuyLimit = accountBuyLimit; } @@ -79,6 +93,41 @@ public class LCoinShopProductHolder return _productionId; } + public long getCount() + { + return _count; + } + + public float getChance() + { + return _chance; + } + + public int getProductionId2() + { + return _productionId2; + } + + public long getCount2() + { + return _count2; + } + + public float getChance2() + { + return _chance2; + } + + public int getProductionId3() + { + return _productionId3; + } + + public long getCount3() + { + return _count3; + } + public int getAccountDailyLimit() { return _accountDailyLimit; diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/limitshop/RequestPurchaseLimitShopItemBuy.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/limitshop/RequestPurchaseLimitShopItemBuy.java index 2fe19a9269..1bfef55b46 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/limitshop/RequestPurchaseLimitShopItemBuy.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/limitshop/RequestPurchaseLimitShopItemBuy.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets.limitshop; import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.util.Chronos; +import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.gameserver.data.xml.LCoinShopData; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.request.PrimeShopRequest; @@ -149,7 +150,25 @@ public class RequestPurchaseLimitShopItemBuy implements IClientIncomingPacket } // Reward. - player.addItem("LCoinShop", product.getProductionId(), _amount, player, true); + if (product.getProductionId2() > 0) + { + if (Rnd.get(100) < product.getChance()) + { + player.addItem("LCoinShop", product.getProductionId(), product.getCount(), player, true); + } + else if (Rnd.get(100) < product.getChance2()) + { + player.addItem("LCoinShop", product.getProductionId2(), product.getCount2(), player, true); + } + else if (product.getProductionId3() > 0) + { + player.addItem("LCoinShop", product.getProductionId3(), product.getCount3(), player, true); + } + } + else + { + player.addItem("LCoinShop", product.getProductionId(), _amount, player, true); + } // Update account variables. if (product.getAccountDailyLimit() > 0) diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/xsd/LCoinShop.xsd b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/xsd/LCoinShop.xsd index a5faea8ffe..3173c4933d 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/xsd/LCoinShop.xsd +++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/xsd/LCoinShop.xsd @@ -20,6 +20,13 @@ + + + + + + + diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LCoinShopData.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LCoinShopData.java index f0c56c3d75..3db7ed140d 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LCoinShopData.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LCoinShopData.java @@ -178,7 +178,7 @@ public class LCoinShopData implements IXmlReader } } - _products.add(new LCoinShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, productionId, accountDailyLimit, accountBuyLimit)); + _products.add(new LCoinShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, productionId, 0, 0, 0, 0, 0, 0, 0, accountDailyLimit, accountBuyLimit)); } } } diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LCoinShopSpecialCraftData.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LCoinShopSpecialCraftData.java index 225ef5f031..1fe3b06764 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LCoinShopSpecialCraftData.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LCoinShopSpecialCraftData.java @@ -99,6 +99,13 @@ public class LCoinShopSpecialCraftData implements IXmlReader ingredientQuantities[1] = 0; ingredientQuantities[2] = 0; int productionId = 0; + int productionId2 = 0; + int productionId3 = 0; + long count = 0; + long count2 = 0; + long count3 = 0; + float chance = 0; + float chance2 = 0; int accountDailyLimit = 0; int accountBuyLimit = 0; for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling()) @@ -146,6 +153,13 @@ public class LCoinShopSpecialCraftData implements IXmlReader else if ("production".equalsIgnoreCase(b.getNodeName())) { productionId = parseInteger(attrs, "id"); + count = parseLong(attrs, "count", 1L); + chance = parseFloat(attrs, "chance", 33.3f); + productionId2 = parseInteger(attrs, "id2"); + count2 = parseLong(attrs, "count2", 1L); + chance2 = parseFloat(attrs, "chance2", 33.3f); + productionId3 = parseInteger(attrs, "id3"); + count3 = parseLong(attrs, "count3", 1L); accountDailyLimit = parseInteger(attrs, "accountDailyLimit", 0); accountBuyLimit = parseInteger(attrs, "accountBuyLimit", 0); @@ -158,7 +172,7 @@ public class LCoinShopSpecialCraftData implements IXmlReader } } - _products.add(new LCoinShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, productionId, accountDailyLimit, accountBuyLimit)); + _products.add(new LCoinShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, productionId, count, chance, productionId2, count2, chance2, productionId3, count3, accountDailyLimit, accountBuyLimit)); } } } diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/holders/LCoinShopProductHolder.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/holders/LCoinShopProductHolder.java index e5049dde97..1980d20214 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/holders/LCoinShopProductHolder.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/holders/LCoinShopProductHolder.java @@ -28,10 +28,17 @@ public class LCoinShopProductHolder private final int[] _ingredientIds; private final long[] _ingredientQuantities; private final int _productionId; + private final long _count; + private final float _chance; + private final int _productionId2; + private final long _count2; + private final float _chance2; + private final int _productionId3; + private final long _count3; private final int _accountDailyLimit; private final int _accountBuyLimit; - public LCoinShopProductHolder(int id, int category, int minLevel, int maxLevel, int[] ingredientIds, long[] ingredientQuantities, int productionId, int accountDailyLimit, int accountBuyLimit) + public LCoinShopProductHolder(int id, int category, int minLevel, int maxLevel, int[] ingredientIds, long[] ingredientQuantities, int productionId, long count, float chance, int productionId2, long count2, float chance2, int productionId3, long count3, int accountDailyLimit, int accountBuyLimit) { _id = id; _category = category; @@ -40,6 +47,13 @@ public class LCoinShopProductHolder _ingredientIds = ingredientIds; _ingredientQuantities = ingredientQuantities; _productionId = productionId; + _count = count; + _chance = chance; + _productionId2 = productionId2; + _count2 = count2; + _chance2 = chance2; + _productionId3 = productionId3; + _count3 = count3; _accountDailyLimit = accountDailyLimit; _accountBuyLimit = accountBuyLimit; } @@ -79,6 +93,41 @@ public class LCoinShopProductHolder return _productionId; } + public long getCount() + { + return _count; + } + + public float getChance() + { + return _chance; + } + + public int getProductionId2() + { + return _productionId2; + } + + public long getCount2() + { + return _count2; + } + + public float getChance2() + { + return _chance2; + } + + public int getProductionId3() + { + return _productionId3; + } + + public long getCount3() + { + return _count3; + } + public int getAccountDailyLimit() { return _accountDailyLimit; diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/limitshop/RequestPurchaseLimitShopItemBuy.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/limitshop/RequestPurchaseLimitShopItemBuy.java index 2fe19a9269..1bfef55b46 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/limitshop/RequestPurchaseLimitShopItemBuy.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/clientpackets/limitshop/RequestPurchaseLimitShopItemBuy.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.network.clientpackets.limitshop; import org.l2jmobius.commons.network.PacketReader; import org.l2jmobius.commons.util.Chronos; +import org.l2jmobius.commons.util.Rnd; import org.l2jmobius.gameserver.data.xml.LCoinShopData; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.actor.request.PrimeShopRequest; @@ -149,7 +150,25 @@ public class RequestPurchaseLimitShopItemBuy implements IClientIncomingPacket } // Reward. - player.addItem("LCoinShop", product.getProductionId(), _amount, player, true); + if (product.getProductionId2() > 0) + { + if (Rnd.get(100) < product.getChance()) + { + player.addItem("LCoinShop", product.getProductionId(), product.getCount(), player, true); + } + else if (Rnd.get(100) < product.getChance2()) + { + player.addItem("LCoinShop", product.getProductionId2(), product.getCount2(), player, true); + } + else if (product.getProductionId3() > 0) + { + player.addItem("LCoinShop", product.getProductionId3(), product.getCount3(), player, true); + } + } + else + { + player.addItem("LCoinShop", product.getProductionId(), _amount, player, true); + } // Update account variables. if (product.getAccountDailyLimit() > 0)