From c3a8bd0cd39d678f17b17f061f938107db6942eb Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 19 May 2021 23:22:28 +0000 Subject: [PATCH] Support for 5 limit shop products. --- .../dist/game/data/xsd/LimitShop.xsd | 6 +++ .../data/xml/LimitShopCraftData.java | 14 +++++- .../gameserver/data/xml/LimitShopData.java | 2 +- .../model/holders/LimitShopProductHolder.java | 44 ++++++++++++++++++- .../RequestPurchaseLimitShopItemBuy.java | 12 ++++- .../dist/game/data/xsd/LimitShop.xsd | 6 +++ .../data/xml/LimitShopClanData.java | 2 +- .../data/xml/LimitShopCraftData.java | 14 +++++- .../gameserver/data/xml/LimitShopData.java | 2 +- .../model/holders/LimitShopProductHolder.java | 44 ++++++++++++++++++- .../RequestPurchaseLimitShopItemBuy.java | 12 ++++- 11 files changed, 149 insertions(+), 9 deletions(-) diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/xsd/LimitShop.xsd b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/xsd/LimitShop.xsd index a53fcf1178..4aae79a14a 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/xsd/LimitShop.xsd +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/xsd/LimitShop.xsd @@ -28,6 +28,12 @@ + + + + + + diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LimitShopCraftData.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LimitShopCraftData.java index 7e99a875ca..5477c51679 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LimitShopCraftData.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LimitShopCraftData.java @@ -105,11 +105,17 @@ public class LimitShopCraftData implements IXmlReader int productionId = 0; int productionId2 = 0; int productionId3 = 0; + int productionId4 = 0; + int productionId5 = 0; long count = 1L; long count2 = 1L; long count3 = 1L; + long count4 = 1L; + long count5 = 1L; float chance = 100f; float chance2 = 100f; + float chance3 = 100f; + float chance4 = 100f; int accountDailyLimit = 0; int accountBuyLimit = 0; for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling()) @@ -178,6 +184,12 @@ public class LimitShopCraftData implements IXmlReader chance2 = parseFloat(attrs, "chance2", 100f); productionId3 = parseInteger(attrs, "id3", 0); count3 = parseLong(attrs, "count3", 1L); + chance3 = parseFloat(attrs, "chance3", 100f); + productionId4 = parseInteger(attrs, "id4", 0); + count4 = parseLong(attrs, "count4", 1L); + chance4 = parseFloat(attrs, "chance4", 100f); + productionId5 = parseInteger(attrs, "id5", 0); + count5 = parseLong(attrs, "count5", 1L); accountDailyLimit = parseInteger(attrs, "accountDailyLimit", 0); accountBuyLimit = parseInteger(attrs, "accountBuyLimit", 0); @@ -190,7 +202,7 @@ public class LimitShopCraftData implements IXmlReader } } - _products.add(new LimitShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, ingredientEnchants, productionId, count, chance, productionId2, count2, chance2, productionId3, count3, accountDailyLimit, accountBuyLimit)); + _products.add(new LimitShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, ingredientEnchants, productionId, count, chance, productionId2, count2, chance2, productionId3, count3, chance3, productionId4, count4, chance4, productionId5, count5, accountDailyLimit, accountBuyLimit)); } } } diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LimitShopData.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LimitShopData.java index 8e6b379545..6c50469128 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LimitShopData.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/LimitShopData.java @@ -176,7 +176,7 @@ public class LimitShopData implements IXmlReader } } - _products.add(new LimitShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, ingredientEnchants, productionId, 0, 0, 0, 0, 0, 0, 0, accountDailyLimit, accountBuyLimit)); + _products.add(new LimitShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, ingredientEnchants, productionId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, accountDailyLimit, accountBuyLimit)); } } } diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/LimitShopProductHolder.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/LimitShopProductHolder.java index 244131e4b6..6f103dedaa 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/LimitShopProductHolder.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/LimitShopProductHolder.java @@ -36,10 +36,16 @@ public class LimitShopProductHolder private final float _chance2; private final int _productionId3; private final long _count3; + private final float _chance3; + private final int _productionId4; + private final long _count4; + private final float _chance4; + private final int _productionId5; + private final long _count5; private final int _accountDailyLimit; private final int _accountBuyLimit; - public LimitShopProductHolder(int id, int category, int minLevel, int maxLevel, int[] ingredientIds, long[] ingredientQuantities, int[] ingredientEnchants, int productionId, long count, float chance, int productionId2, long count2, float chance2, int productionId3, long count3, int accountDailyLimit, int accountBuyLimit) + public LimitShopProductHolder(int id, int category, int minLevel, int maxLevel, int[] ingredientIds, long[] ingredientQuantities, int[] ingredientEnchants, int productionId, long count, float chance, int productionId2, long count2, float chance2, int productionId3, long count3, float chance3, int productionId4, long count4, float chance4, int productionId5, long count5, int accountDailyLimit, int accountBuyLimit) { _id = id; _category = category; @@ -56,6 +62,12 @@ public class LimitShopProductHolder _chance2 = chance2; _productionId3 = productionId3; _count3 = count3; + _chance3 = chance3; + _productionId4 = productionId4; + _count4 = count4; + _chance4 = chance4; + _productionId5 = productionId5; + _count5 = count5; _accountDailyLimit = accountDailyLimit; _accountBuyLimit = accountBuyLimit; } @@ -135,6 +147,36 @@ public class LimitShopProductHolder return _count3; } + public float getChance3() + { + return _chance3; + } + + public int getProductionId4() + { + return _productionId4; + } + + public long getCount4() + { + return _count4; + } + + public float getChance4() + { + return _chance4; + } + + public int getProductionId5() + { + return _productionId5; + } + + public long getCount5() + { + return _count5; + } + 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 45240dff94..31fe1573a5 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 @@ -215,11 +215,21 @@ public class RequestPurchaseLimitShopItemBuy implements IClientIncomingPacket rewards.add(new LimitShopRandomCraftReward(_product.getProductionId2(), (int) _product.getCount2(), 1)); player.addItem("LCoinShop", _product.getProductionId2(), _product.getCount2(), player, true); } - else if (_product.getProductionId3() > 0) + else if (Rnd.get(100) < _product.getChance3()) { rewards.add(new LimitShopRandomCraftReward(_product.getProductionId3(), (int) _product.getCount3(), 2)); player.addItem("LCoinShop", _product.getProductionId3(), _product.getCount3(), player, true); } + else if (Rnd.get(100) < _product.getChance4()) + { + rewards.add(new LimitShopRandomCraftReward(_product.getProductionId4(), (int) _product.getCount4(), 3)); + player.addItem("LCoinShop", _product.getProductionId4(), _product.getCount4(), player, true); + } + else if (_product.getProductionId5() > 0) + { + rewards.add(new LimitShopRandomCraftReward(_product.getProductionId5(), (int) _product.getCount5(), 4)); + player.addItem("LCoinShop", _product.getProductionId5(), _product.getCount5(), player, true); + } } } else diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/xsd/LimitShop.xsd b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/xsd/LimitShop.xsd index 1cf8cc4aab..c0e0fe5fc3 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/xsd/LimitShop.xsd +++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/xsd/LimitShop.xsd @@ -28,6 +28,12 @@ + + + + + + diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LimitShopClanData.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LimitShopClanData.java index d4edfa84fe..9afeb4db5c 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LimitShopClanData.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LimitShopClanData.java @@ -206,7 +206,7 @@ public class LimitShopClanData implements IXmlReader } } - _products.add(new LimitShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, ingredientEnchants, productionId, 0, 0, 0, 0, 0, 0, 0, accountDailyLimit, accountBuyLimit)); + _products.add(new LimitShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, ingredientEnchants, productionId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, accountDailyLimit, accountBuyLimit)); } } } diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LimitShopCraftData.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LimitShopCraftData.java index 19409010a0..089c095926 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LimitShopCraftData.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LimitShopCraftData.java @@ -111,11 +111,17 @@ public class LimitShopCraftData implements IXmlReader int productionId = 0; int productionId2 = 0; int productionId3 = 0; + int productionId4 = 0; + int productionId5 = 0; long count = 1L; long count2 = 1L; long count3 = 1L; + long count4 = 1L; + long count5 = 1L; float chance = 100f; float chance2 = 100f; + float chance3 = 100f; + float chance4 = 100f; int accountDailyLimit = 0; int accountBuyLimit = 0; for (Node b = d.getFirstChild(); b != null; b = b.getNextSibling()) @@ -208,6 +214,12 @@ public class LimitShopCraftData implements IXmlReader chance2 = parseFloat(attrs, "chance2", 100f); productionId3 = parseInteger(attrs, "id3", 0); count3 = parseLong(attrs, "count3", 1L); + chance3 = parseFloat(attrs, "chance3", 100f); + productionId4 = parseInteger(attrs, "id4", 0); + count4 = parseLong(attrs, "count4", 1L); + chance4 = parseFloat(attrs, "chance4", 100f); + productionId5 = parseInteger(attrs, "id5", 0); + count5 = parseLong(attrs, "count5", 1L); accountDailyLimit = parseInteger(attrs, "accountDailyLimit", 0); accountBuyLimit = parseInteger(attrs, "accountBuyLimit", 0); @@ -220,7 +232,7 @@ public class LimitShopCraftData implements IXmlReader } } - _products.add(new LimitShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, ingredientEnchants, productionId, count, chance, productionId2, count2, chance2, productionId3, count3, accountDailyLimit, accountBuyLimit)); + _products.add(new LimitShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, ingredientEnchants, productionId, count, chance, productionId2, count2, chance2, productionId3, count3, chance3, productionId4, count4, chance4, productionId5, count5, accountDailyLimit, accountBuyLimit)); } } } diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LimitShopData.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LimitShopData.java index 34d76bd86c..43b16eae41 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LimitShopData.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/data/xml/LimitShopData.java @@ -206,7 +206,7 @@ public class LimitShopData implements IXmlReader } } - _products.add(new LimitShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, ingredientEnchants, productionId, 0, 0, 0, 0, 0, 0, 0, accountDailyLimit, accountBuyLimit)); + _products.add(new LimitShopProductHolder(id, category, minLevel, maxLevel, ingredientIds, ingredientQuantities, ingredientEnchants, productionId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, accountDailyLimit, accountBuyLimit)); } } } diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/holders/LimitShopProductHolder.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/holders/LimitShopProductHolder.java index 244131e4b6..6f103dedaa 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/holders/LimitShopProductHolder.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/model/holders/LimitShopProductHolder.java @@ -36,10 +36,16 @@ public class LimitShopProductHolder private final float _chance2; private final int _productionId3; private final long _count3; + private final float _chance3; + private final int _productionId4; + private final long _count4; + private final float _chance4; + private final int _productionId5; + private final long _count5; private final int _accountDailyLimit; private final int _accountBuyLimit; - public LimitShopProductHolder(int id, int category, int minLevel, int maxLevel, int[] ingredientIds, long[] ingredientQuantities, int[] ingredientEnchants, int productionId, long count, float chance, int productionId2, long count2, float chance2, int productionId3, long count3, int accountDailyLimit, int accountBuyLimit) + public LimitShopProductHolder(int id, int category, int minLevel, int maxLevel, int[] ingredientIds, long[] ingredientQuantities, int[] ingredientEnchants, int productionId, long count, float chance, int productionId2, long count2, float chance2, int productionId3, long count3, float chance3, int productionId4, long count4, float chance4, int productionId5, long count5, int accountDailyLimit, int accountBuyLimit) { _id = id; _category = category; @@ -56,6 +62,12 @@ public class LimitShopProductHolder _chance2 = chance2; _productionId3 = productionId3; _count3 = count3; + _chance3 = chance3; + _productionId4 = productionId4; + _count4 = count4; + _chance4 = chance4; + _productionId5 = productionId5; + _count5 = count5; _accountDailyLimit = accountDailyLimit; _accountBuyLimit = accountBuyLimit; } @@ -135,6 +147,36 @@ public class LimitShopProductHolder return _count3; } + public float getChance3() + { + return _chance3; + } + + public int getProductionId4() + { + return _productionId4; + } + + public long getCount4() + { + return _count4; + } + + public float getChance4() + { + return _chance4; + } + + public int getProductionId5() + { + return _productionId5; + } + + public long getCount5() + { + return _count5; + } + 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 ad9629acc2..7a9ba4cb2e 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 @@ -235,11 +235,21 @@ public class RequestPurchaseLimitShopItemBuy implements IClientIncomingPacket rewards.add(new LimitShopRandomCraftReward(_product.getProductionId2(), (int) _product.getCount2(), 1)); player.addItem("LCoinShop", _product.getProductionId2(), _product.getCount2(), player, true); } - else if (_product.getProductionId3() > 0) + else if (Rnd.get(100) < _product.getChance3()) { rewards.add(new LimitShopRandomCraftReward(_product.getProductionId3(), (int) _product.getCount3(), 2)); player.addItem("LCoinShop", _product.getProductionId3(), _product.getCount3(), player, true); } + else if (Rnd.get(100) < _product.getChance4()) + { + rewards.add(new LimitShopRandomCraftReward(_product.getProductionId4(), (int) _product.getCount4(), 3)); + player.addItem("LCoinShop", _product.getProductionId4(), _product.getCount4(), player, true); + } + else if (_product.getProductionId5() > 0) + { + rewards.add(new LimitShopRandomCraftReward(_product.getProductionId5(), (int) _product.getCount5(), 4)); + player.addItem("LCoinShop", _product.getProductionId5(), _product.getCount5(), player, true); + } } } else