From c45939596829885348463ebdf08aae0635a14ef2 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 17 Feb 2018 14:58:09 +0000 Subject: [PATCH] Combination item rework. Adapted from: L2jUnity free files. --- .../dist/game/data/CombinationItems.xml | 2483 ++++++++++++ .../game/data/stats/items/34900-34999.xml | 2 - .../game/data/stats/items/38100-38199.xml | 8 - .../game/data/stats/items/38400-38499.xml | 80 - .../game/data/stats/items/38500-38599.xml | 8 - .../game/data/stats/items/38800-38899.xml | 82 - .../game/data/stats/items/38900-38999.xml | 8 - .../game/data/stats/items/39600-39699.xml | 46 - .../dist/game/data/xsd/CombinationItems.xsd | 24 + .../dist/game/data/xsd/items.xsd | 2 - .../l2jmobius/commons/util/CommonUtil.java | 14 + .../com/l2jmobius/gameserver/GameServer.java | 2 + .../data/xml/impl/CombinationItemsData.java | 111 + .../gameserver/model/items/L2Item.java | 14 - .../items/combination/CombinationItem.java | 65 + .../combination/CombinationItemReward.java | 38 + .../combination/CombinationItemType.java | 26 + .../compound/RequestNewEnchantPushOne.java | 8 +- .../compound/RequestNewEnchantPushTwo.java | 11 +- .../compound/RequestNewEnchantTry.java | 45 +- .../dist/game/data/CombinationItems.xml | 2787 ++++++++++++++ .../game/data/stats/items/26400-26499.xml | 36 - .../game/data/stats/items/26500-26599.xml | 14 - .../game/data/stats/items/27400-27499.xml | 22 - .../game/data/stats/items/34900-34999.xml | 2 - .../game/data/stats/items/38100-38199.xml | 8 - .../game/data/stats/items/38400-38499.xml | 80 - .../game/data/stats/items/38500-38599.xml | 8 - .../game/data/stats/items/38800-38899.xml | 82 - .../game/data/stats/items/38900-38999.xml | 8 - .../game/data/stats/items/39600-39699.xml | 46 - .../game/data/stats/items/46400-46499.xml | 56 - .../game/data/stats/items/46500-46599.xml | 14 - .../game/data/stats/items/46600-46699.xml | 24 - .../dist/game/data/xsd/CombinationItems.xsd | 24 + .../dist/game/data/xsd/items.xsd | 2 - .../l2jmobius/commons/util/CommonUtil.java | 14 + .../com/l2jmobius/gameserver/GameServer.java | 2 + .../data/xml/impl/CombinationItemsData.java | 111 + .../gameserver/model/items/L2Item.java | 14 - .../items/combination/CombinationItem.java | 65 + .../combination/CombinationItemReward.java | 38 + .../combination/CombinationItemType.java | 26 + .../compound/RequestNewEnchantPushOne.java | 8 +- .../compound/RequestNewEnchantPushTwo.java | 11 +- .../compound/RequestNewEnchantTry.java | 45 +- .../dist/game/data/CombinationItems.xml | 3323 +++++++++++++++++ .../game/data/stats/items/26400-26499.xml | 36 - .../game/data/stats/items/26500-26599.xml | 14 - .../game/data/stats/items/27400-27499.xml | 22 - .../game/data/stats/items/28300-28399.xml | 6 - .../game/data/stats/items/28400-28499.xml | 18 - .../game/data/stats/items/34900-34999.xml | 2 - .../game/data/stats/items/38100-38199.xml | 8 - .../game/data/stats/items/38400-38499.xml | 80 - .../game/data/stats/items/38500-38599.xml | 8 - .../game/data/stats/items/38800-38899.xml | 96 - .../game/data/stats/items/38900-38999.xml | 10 - .../game/data/stats/items/39600-39699.xml | 46 - .../game/data/stats/items/46400-46499.xml | 56 - .../game/data/stats/items/46500-46599.xml | 14 - .../game/data/stats/items/46600-46699.xml | 24 - .../game/data/stats/items/47600-47699.xml | 20 - .../dist/game/data/xsd/CombinationItems.xsd | 24 + .../dist/game/data/xsd/items.xsd | 2 - .../l2jmobius/commons/util/CommonUtil.java | 14 + .../com/l2jmobius/gameserver/GameServer.java | 2 + .../data/xml/impl/CombinationItemsData.java | 111 + .../gameserver/model/items/L2Item.java | 14 - .../items/combination/CombinationItem.java | 65 + .../combination/CombinationItemReward.java | 38 + .../combination/CombinationItemType.java | 26 + .../compound/RequestNewEnchantPushOne.java | 8 +- .../compound/RequestNewEnchantPushTwo.java | 11 +- .../compound/RequestNewEnchantTry.java | 45 +- .../compound/ExEnchantRetryToPutItemFail.java | 40 + .../compound/ExEnchantRetryToPutItemOk.java | 40 + .../dist/game/data/CombinationItems.xml | 3323 +++++++++++++++++ .../game/data/stats/items/26400-26499.xml | 36 - .../game/data/stats/items/26500-26599.xml | 14 - .../game/data/stats/items/27400-27499.xml | 22 - .../game/data/stats/items/28300-28399.xml | 6 - .../game/data/stats/items/28400-28499.xml | 18 - .../game/data/stats/items/29000-29099.xml | 18 - .../game/data/stats/items/34900-34999.xml | 2 - .../game/data/stats/items/38100-38199.xml | 8 - .../game/data/stats/items/38400-38499.xml | 80 - .../game/data/stats/items/38500-38599.xml | 8 - .../game/data/stats/items/38800-38899.xml | 96 - .../game/data/stats/items/38900-38999.xml | 10 - .../game/data/stats/items/39600-39699.xml | 46 - .../game/data/stats/items/46400-46499.xml | 56 - .../game/data/stats/items/46500-46599.xml | 14 - .../game/data/stats/items/46600-46699.xml | 24 - .../game/data/stats/items/47600-47699.xml | 20 - .../dist/game/data/xsd/CombinationItems.xsd | 24 + .../dist/game/data/xsd/items.xsd | 2 - .../l2jmobius/commons/util/CommonUtil.java | 14 + .../com/l2jmobius/gameserver/GameServer.java | 2 + .../data/xml/impl/CombinationItemsData.java | 111 + .../gameserver/model/items/L2Item.java | 14 - .../items/combination/CombinationItem.java | 65 + .../combination/CombinationItemReward.java | 38 + .../combination/CombinationItemType.java | 26 + .../gameserver/network/ExIncomingPackets.java | 1 + .../RequestNewEnchantRetryToPutItems.java | 102 - .../compound/RequestNewEnchantPushOne.java | 8 +- .../compound/RequestNewEnchantPushTwo.java | 11 +- .../RequestNewEnchantRetryToPutItems.java | 210 +- .../compound/RequestNewEnchantTry.java | 45 +- .../compound/ExEnchantRetryToPutItemFail.java | 40 + .../compound/ExEnchantRetryToPutItemOk.java | 40 + .../dist/game/data/CombinationItems.xml | 395 ++ .../dist/game/data/xsd/CombinationItems.xsd | 24 + .../dist/game/data/xsd/items.xsd | 2 - .../l2jmobius/commons/util/CommonUtil.java | 14 + .../com/l2jmobius/gameserver/GameServer.java | 2 + .../data/xml/impl/CombinationItemsData.java | 111 + .../items/combination/CombinationItem.java | 65 + .../combination/CombinationItemReward.java | 38 + .../combination/CombinationItemType.java | 26 + .../compound/RequestNewEnchantPushOne.java | 8 +- .../compound/RequestNewEnchantPushTwo.java | 11 +- .../compound/RequestNewEnchantTry.java | 45 +- .../compound/ExEnchantRetryToPutItemFail.java | 40 + .../compound/ExEnchantRetryToPutItemOk.java | 40 + 126 files changed, 14210 insertions(+), 2012 deletions(-) create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/CombinationItems.xml create mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/CombinationItems.xsd create mode 100644 L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java create mode 100644 L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java create mode 100644 L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java create mode 100644 L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/CombinationItems.xml create mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/xsd/CombinationItems.xsd create mode 100644 L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java create mode 100644 L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java create mode 100644 L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java create mode 100644 L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/CombinationItems.xml create mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/xsd/CombinationItems.xsd create mode 100644 L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java create mode 100644 L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java create mode 100644 L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java create mode 100644 L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java create mode 100644 L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemFail.java create mode 100644 L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemOk.java create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/CombinationItems.xml create mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/xsd/CombinationItems.xsd create mode 100644 L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java create mode 100644 L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java create mode 100644 L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java create mode 100644 L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java delete mode 100644 L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestNewEnchantRetryToPutItems.java rename {L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets => L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound}/RequestNewEnchantRetryToPutItems.java (82%) create mode 100644 L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemFail.java create mode 100644 L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemOk.java create mode 100644 L2J_Mobius_Classic_2.0_Saviors/dist/game/data/CombinationItems.xml create mode 100644 L2J_Mobius_Classic_2.0_Saviors/dist/game/data/xsd/CombinationItems.xsd create mode 100644 L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java create mode 100644 L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java create mode 100644 L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java create mode 100644 L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java create mode 100644 L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemFail.java create mode 100644 L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemOk.java diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/CombinationItems.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/CombinationItems.xml new file mode 100644 index 0000000000..8d6ccb1e66 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/CombinationItems.xml @@ -0,0 +1,2483 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/34900-34999.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/34900-34999.xml index 4f8a6cf424..d117a4d0a4 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/34900-34999.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/34900-34999.xml @@ -1777,8 +1777,6 @@ - - diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38100-38199.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38100-38199.xml index ff086e34be..26e5d10378 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38100-38199.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38100-38199.xml @@ -515,8 +515,6 @@ - - @@ -545,8 +543,6 @@ - - @@ -575,8 +571,6 @@ - - @@ -604,8 +598,6 @@ - - diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38400-38499.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38400-38499.xml index 8d0f11b2b9..7f25e40a77 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38400-38499.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38400-38499.xml @@ -940,8 +940,6 @@ - - @@ -970,8 +968,6 @@ - - @@ -1000,8 +996,6 @@ - - @@ -1029,8 +1023,6 @@ - - @@ -1085,8 +1077,6 @@ - - @@ -1115,8 +1105,6 @@ - - @@ -1145,8 +1133,6 @@ - - @@ -1174,8 +1160,6 @@ - - @@ -1230,8 +1214,6 @@ - - @@ -1260,8 +1242,6 @@ - - @@ -1290,8 +1270,6 @@ - - @@ -1319,8 +1297,6 @@ - - @@ -1375,8 +1351,6 @@ - - @@ -1405,8 +1379,6 @@ - - @@ -1435,8 +1407,6 @@ - - @@ -1464,8 +1434,6 @@ - - @@ -1520,8 +1488,6 @@ - - @@ -1550,8 +1516,6 @@ - - @@ -1580,8 +1544,6 @@ - - @@ -1609,8 +1571,6 @@ - - @@ -1666,8 +1626,6 @@ - - @@ -1696,8 +1654,6 @@ - - @@ -1726,8 +1682,6 @@ - - @@ -1755,8 +1709,6 @@ - - @@ -1811,8 +1763,6 @@ - - @@ -1841,8 +1791,6 @@ - - @@ -1871,8 +1819,6 @@ - - @@ -1900,8 +1846,6 @@ - - @@ -1956,8 +1900,6 @@ - - @@ -1986,8 +1928,6 @@ - - @@ -2016,8 +1956,6 @@ - - @@ -2045,8 +1983,6 @@ - - @@ -2101,8 +2037,6 @@ - - @@ -2131,8 +2065,6 @@ - - @@ -2161,8 +2093,6 @@ - - @@ -2190,8 +2120,6 @@ - - @@ -2246,8 +2174,6 @@ - - @@ -2276,8 +2202,6 @@ - - @@ -2306,8 +2230,6 @@ - - @@ -2336,8 +2258,6 @@ - - diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38500-38599.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38500-38599.xml index 6f56614ce1..e3358d6647 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38500-38599.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38500-38599.xml @@ -3,8 +3,6 @@ - - @@ -33,8 +31,6 @@ - - @@ -63,8 +59,6 @@ - - @@ -92,8 +86,6 @@ - - diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38800-38899.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38800-38899.xml index 12a4114d04..ac82de0eda 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38800-38899.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38800-38899.xml @@ -1503,8 +1503,6 @@ - - @@ -1522,8 +1520,6 @@ - - @@ -1541,8 +1537,6 @@ - - @@ -1560,8 +1554,6 @@ - - @@ -1591,8 +1583,6 @@ - - @@ -1610,8 +1600,6 @@ - - @@ -1629,8 +1617,6 @@ - - @@ -1648,8 +1634,6 @@ - - @@ -1667,8 +1651,6 @@ - - @@ -1683,8 +1665,6 @@ - - @@ -1697,8 +1677,6 @@ - - @@ -1711,8 +1689,6 @@ - - @@ -1725,8 +1701,6 @@ - - @@ -1751,8 +1725,6 @@ - - @@ -1765,8 +1737,6 @@ - - @@ -1779,8 +1749,6 @@ - - @@ -1793,8 +1761,6 @@ - - @@ -1819,8 +1785,6 @@ - - @@ -1838,8 +1802,6 @@ - - @@ -1857,8 +1819,6 @@ - - @@ -1876,8 +1836,6 @@ - - @@ -1909,8 +1867,6 @@ - - @@ -1928,8 +1884,6 @@ - - @@ -1947,8 +1901,6 @@ - - @@ -1966,8 +1918,6 @@ - - @@ -1999,8 +1949,6 @@ - - @@ -2018,8 +1966,6 @@ - - @@ -2038,8 +1984,6 @@ - - @@ -2058,8 +2002,6 @@ - - @@ -2092,8 +2034,6 @@ - - @@ -2112,8 +2052,6 @@ - - @@ -2132,8 +2070,6 @@ - - @@ -2152,8 +2088,6 @@ - - @@ -2186,8 +2120,6 @@ - - @@ -2206,8 +2138,6 @@ - - @@ -2226,8 +2156,6 @@ - - @@ -2246,8 +2174,6 @@ - - @@ -2280,8 +2206,6 @@ - - @@ -2300,8 +2224,6 @@ - - @@ -2320,8 +2242,6 @@ - - @@ -2340,8 +2260,6 @@ - - diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38900-38999.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38900-38999.xml index ee6be364ed..12f94e4a18 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38900-38999.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/38900-38999.xml @@ -231,8 +231,6 @@ - - @@ -252,8 +250,6 @@ - - @@ -273,8 +269,6 @@ - - @@ -293,8 +287,6 @@ - - diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/39600-39699.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/39600-39699.xml index 74d79ecba0..ac134f3751 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/39600-39699.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/stats/items/39600-39699.xml @@ -921,8 +921,6 @@ - - @@ -941,8 +939,6 @@ - - @@ -960,8 +956,6 @@ - - @@ -979,8 +973,6 @@ - - @@ -998,8 +990,6 @@ - - @@ -1017,8 +1007,6 @@ - - @@ -1036,8 +1024,6 @@ - - @@ -1055,8 +1041,6 @@ - - @@ -1074,8 +1058,6 @@ - - @@ -1093,8 +1075,6 @@ - - @@ -1112,8 +1092,6 @@ - - @@ -1131,8 +1109,6 @@ - - @@ -1150,8 +1126,6 @@ - - @@ -1169,8 +1143,6 @@ - - @@ -1187,8 +1159,6 @@ - - @@ -1205,8 +1175,6 @@ - - @@ -1223,8 +1191,6 @@ - - @@ -1241,8 +1207,6 @@ - - @@ -1259,8 +1223,6 @@ - - @@ -1277,8 +1239,6 @@ - - @@ -1295,8 +1255,6 @@ - - @@ -1313,8 +1271,6 @@ - - @@ -1331,8 +1287,6 @@ - - diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/CombinationItems.xsd b/L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/CombinationItems.xsd new file mode 100644 index 0000000000..eb06810c8c --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/CombinationItems.xsd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/items.xsd b/L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/items.xsd index f54adbc12f..9e808080f2 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/items.xsd +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/xsd/items.xsd @@ -134,8 +134,6 @@ - - diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/commons/util/CommonUtil.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/commons/util/CommonUtil.java index bfba2b32b6..16530e4fcf 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/commons/util/CommonUtil.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/commons/util/CommonUtil.java @@ -21,12 +21,15 @@ import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.nio.ByteBuffer; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; import java.time.DayOfWeek; import java.time.LocalDateTime; import java.time.temporal.TemporalAdjusters; import java.util.Arrays; import java.util.Comparator; import java.util.List; +import java.util.Locale; import java.util.StringJoiner; import java.util.StringTokenizer; @@ -573,4 +576,15 @@ public final class CommonUtil } return sj.toString(); } + + /** + * @param val + * @param format + * @return + */ + public static String formatDouble(double val, String format) + { + final DecimalFormat formatter = new DecimalFormat(format, new DecimalFormatSymbols(Locale.ENGLISH)); + return formatter.format(val); + } } diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/GameServer.java index 9cbf10ad41..f1d6736c11 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/GameServer.java @@ -50,6 +50,7 @@ import com.l2jmobius.gameserver.data.xml.impl.CategoryData; import com.l2jmobius.gameserver.data.xml.impl.ClanHallData; import com.l2jmobius.gameserver.data.xml.impl.ClanRewardData; import com.l2jmobius.gameserver.data.xml.impl.ClassListData; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.data.xml.impl.CubicData; import com.l2jmobius.gameserver.data.xml.impl.DoorData; import com.l2jmobius.gameserver.data.xml.impl.EnchantItemData; @@ -203,6 +204,7 @@ public class GameServer CategoryData.getInstance(); SecondaryAuthData.getInstance(); AbilityPointsData.getInstance(); + CombinationItemsData.getInstance(); SayuneData.getInstance(); ClanRewardData.getInstance(); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java new file mode 100644 index 0000000000..a7e90d5f89 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java @@ -0,0 +1,111 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.data.xml.impl; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Logger; +import java.util.stream.Collectors; + +import org.w3c.dom.Document; + +import com.l2jmobius.commons.util.IGameXmlReader; +import com.l2jmobius.gameserver.datatables.ItemTable; +import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemReward; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemType; + +/** + * @author UnAfraid + */ +public class CombinationItemsData implements IGameXmlReader +{ + private static final Logger LOGGER = Logger.getLogger(CombinationItemsData.class.getName()); + private final List _items = new ArrayList<>(); + + protected CombinationItemsData() + { + load(); + } + + @Override + public synchronized void load() + { + _items.clear(); + parseDatapackFile("data/CombinationItems.xml"); + LOGGER.info(getClass().getSimpleName() + ": Loaded " + _items.size() + " combinations."); + } + + @Override + public void parseDocument(Document doc, File f) + { + forEach(doc, "list", listNode -> forEach(listNode, "item", itemNode -> + { + final CombinationItem item = new CombinationItem(new StatsSet(parseAttributes(itemNode))); + + forEach(itemNode, "reward", rewardNode -> + { + final int id = parseInteger(rewardNode.getAttributes(), "id"); + final int count = parseInteger(rewardNode.getAttributes(), "count", 1); + final CombinationItemType type = parseEnum(rewardNode.getAttributes(), CombinationItemType.class, "type"); + item.addReward(new CombinationItemReward(id, count, type)); + if (ItemTable.getInstance().getTemplate(id) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find item with id " + id); + } + }); + _items.add(item); + })); + } + + public int getLoadedElementsCount() + { + return _items.size(); + } + + public List getItems() + { + return _items; + } + + public CombinationItem getItemsBySlots(int firstSlot, int secondSlot) + { + return _items.stream().filter(item -> (item.getItemOne() == firstSlot) && (item.getItemTwo() == secondSlot)).findFirst().orElse(null); + } + + public List getItemsByFirstSlot(int id) + { + return _items.stream().filter(item -> item.getItemOne() == id).collect(Collectors.toList()); + } + + public List getItemsBySecondSlot(int id) + { + return _items.stream().filter(item -> item.getItemTwo() == id).collect(Collectors.toList()); + } + + public static final CombinationItemsData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final CombinationItemsData INSTANCE = new CombinationItemsData(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/L2Item.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/L2Item.java index 2f590854f8..c86ec8ca9b 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/L2Item.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/L2Item.java @@ -170,8 +170,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable private int _sharedReuseGroup; private CommissionItemType _commissionItemType; - private int _compoundItem; - private float _compoundChance; private boolean _isAppearanceable; private boolean _isBlessed; @@ -230,8 +228,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable _reuseDelay = set.getInt("reuse_delay", 0); _sharedReuseGroup = set.getInt("shared_reuse_group", 0); _commissionItemType = set.getEnum("commissionItemType", CommissionItemType.class, CommissionItemType.OTHER_ITEM); - _compoundItem = set.getInt("compoundItem", 0); - _compoundChance = set.getFloat("compoundChance", 0); _common = ((_itemId >= 11605) && (_itemId <= 12361)); _heroItem = ((_itemId >= 6611) && (_itemId <= 6621)) || ((_itemId >= 9388) && (_itemId <= 9390)) || (_itemId == 6842); _pvpItem = ((_itemId >= 10667) && (_itemId <= 10835)) || ((_itemId >= 12852) && (_itemId <= 12977)) || ((_itemId >= 14363) && (_itemId <= 14525)) || (_itemId == 14528) || (_itemId == 14529) || (_itemId == 14558) || ((_itemId >= 15913) && (_itemId <= 16024)) || ((_itemId >= 16134) && (_itemId <= 16147)) || (_itemId == 16149) || (_itemId == 16151) || (_itemId == 16153) || (_itemId == 16155) || (_itemId == 16157) || (_itemId == 16159) || ((_itemId >= 16168) && (_itemId <= 16176)) || ((_itemId >= 16179) && (_itemId <= 16220)); @@ -961,16 +957,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable return _commissionItemType; } - public int getCompoundItem() - { - return _compoundItem; - } - - public float getCompoundChance() - { - return _compoundChance; - } - /** * Usable in HTML windows. * @return the icon link in client files diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java new file mode 100644 index 0000000000..d186f635fe --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java @@ -0,0 +1,65 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.model.items.combination; + +import java.util.EnumMap; +import java.util.Map; + +import com.l2jmobius.gameserver.model.StatsSet; + +/** + * @author UnAfraid + */ +public class CombinationItem +{ + private final int _itemOne; + private final int _itemTwo; + private final int _chance; + private final Map _rewards = new EnumMap<>(CombinationItemType.class); + + public CombinationItem(StatsSet set) + { + _itemOne = set.getInt("one"); + _itemTwo = set.getInt("two"); + _chance = set.getInt("chance"); + } + + public int getItemOne() + { + return _itemOne; + } + + public int getItemTwo() + { + return _itemTwo; + } + + public int getChance() + { + return _chance; + } + + public void addReward(CombinationItemReward item) + { + _rewards.put(item.getType(), item); + } + + public CombinationItemReward getReward(CombinationItemType type) + { + return _rewards.get(type); + } +} diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java new file mode 100644 index 0000000000..c84363b0b2 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java @@ -0,0 +1,38 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.model.items.combination; + +import com.l2jmobius.gameserver.model.holders.ItemHolder; + +/** + * @author UnAfraid + */ +public class CombinationItemReward extends ItemHolder +{ + private final CombinationItemType _type; + + public CombinationItemReward(int id, int count, CombinationItemType type) + { + super(id, count); + _type = type; + } + + public CombinationItemType getType() + { + return _type; + } +} diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java new file mode 100644 index 0000000000..252c81fea6 --- /dev/null +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java @@ -0,0 +1,26 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.model.items.combination; + +/** + * @author UnAfraid + */ +public enum CombinationItemType +{ + ON_SUCCESS, + ON_FAILURE; +} diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java index 198dcb3bc5..4bb19b2b40 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java @@ -16,9 +16,13 @@ */ package com.l2jmobius.gameserver.network.clientpackets.compound; +import java.util.List; + import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -78,8 +82,10 @@ public class RequestNewEnchantPushOne implements IClientIncomingPacket return; } + final List combinationItems = CombinationItemsData.getInstance().getItemsByFirstSlot(itemOne.getId()); + // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) + if (combinationItems.isEmpty()) { client.sendPacket(ExEnchantOneFail.STATIC_PACKET); activeChar.removeRequest(request.getClass()); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java index 9bb1e53e8c..a0317b61be 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java @@ -17,8 +17,10 @@ package com.l2jmobius.gameserver.network.clientpackets.compound; import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -86,15 +88,10 @@ public class RequestNewEnchantPushTwo implements IClientIncomingPacket return; } - // Combining only same items! - if (itemOne.getItem().getId() != itemTwo.getItem().getId()) - { - client.sendPacket(ExEnchantTwoFail.STATIC_PACKET); - return; - } + final CombinationItem combinationItem = CombinationItemsData.getInstance().getItemsBySlots(itemOne.getId(), itemTwo.getId()); // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) + if (combinationItem == null) { client.sendPacket(ExEnchantTwoFail.STATIC_PACKET); return; diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java index 2143d745d5..6858e0b447 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java @@ -18,8 +18,12 @@ package com.l2jmobius.gameserver.network.clientpackets.compound; import com.l2jmobius.commons.network.PacketReader; import com.l2jmobius.commons.util.Rnd; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemReward; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemType; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -82,50 +86,39 @@ public class RequestNewEnchantTry implements IClientIncomingPacket // Lets prevent using same item twice if (itemOne.getObjectId() == itemTwo.getObjectId()) { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); + client.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId())); activeChar.removeRequest(request.getClass()); return; } - // Combining only same items! - if (itemOne.getItem().getId() != itemTwo.getItem().getId()) - { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); - activeChar.removeRequest(request.getClass()); - return; - } + final CombinationItem combinationItem = CombinationItemsData.getInstance().getItemsBySlots(itemOne.getId(), itemTwo.getId()); // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) + if (combinationItem == null) { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); + client.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId())); activeChar.removeRequest(request.getClass()); return; } final InventoryUpdate iu = new InventoryUpdate(); - final double random = Rnd.nextDouble() * 100; + iu.addRemovedItem(itemOne); + iu.addRemovedItem(itemTwo); - // Success - if (random < itemOne.getItem().getCompoundChance()) + if (activeChar.destroyItem("Compound-Item-One", itemOne, 1, null, true) && activeChar.destroyItem("Compound-Item-Two", itemTwo, 1, null, true)) { - iu.addRemovedItem(itemOne); - iu.addRemovedItem(itemTwo); + final double random = (Rnd.nextDouble() * 100); + final boolean success = random <= combinationItem.getChance(); + final CombinationItemReward rewardItem = combinationItem.getReward(success ? CombinationItemType.ON_SUCCESS : CombinationItemType.ON_FAILURE); + final L2ItemInstance item = activeChar.addItem("Compound-Result", rewardItem.getId(), rewardItem.getCount(), null, true); - if (activeChar.destroyItem("Compound-Item-One", itemOne, null, true) && activeChar.destroyItem("Compound-Item-Two", itemTwo, null, true)) + if (success) { - final L2ItemInstance item = activeChar.addItem("Compound-Result", itemOne.getItem().getCompoundItem(), 1, null, true); - client.sendPacket(new ExEnchantSucess(item.getItem().getId())); + client.sendPacket(new ExEnchantSucess(item.getId())); } - } - else - { - iu.addRemovedItem(itemTwo); - - // Upon fail we destroy the second item. - if (activeChar.destroyItem("Compound-Item-Two-Fail", itemTwo, null, true)) + else { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); + client.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId())); } } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/CombinationItems.xml b/L2J_Mobius_2.5_Underground/dist/game/data/CombinationItems.xml new file mode 100644 index 0000000000..4566f70454 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/CombinationItems.xml @@ -0,0 +1,2787 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/26400-26499.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/26400-26499.xml index 2c2d6a0649..cee936f445 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/26400-26499.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/26400-26499.xml @@ -852,8 +852,6 @@ - - @@ -871,8 +869,6 @@ - - @@ -890,8 +886,6 @@ - - @@ -910,8 +904,6 @@ - - @@ -930,8 +922,6 @@ - - @@ -947,8 +937,6 @@ - - @@ -966,8 +954,6 @@ - - @@ -985,8 +971,6 @@ - - @@ -1004,8 +988,6 @@ - - @@ -1023,8 +1005,6 @@ - - @@ -1038,8 +1018,6 @@ - - @@ -1057,8 +1035,6 @@ - - @@ -1076,8 +1052,6 @@ - - @@ -1095,8 +1069,6 @@ - - @@ -1114,8 +1086,6 @@ - - @@ -1214,8 +1184,6 @@ - - @@ -1233,8 +1201,6 @@ - - @@ -1252,8 +1218,6 @@ - - diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/26500-26599.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/26500-26599.xml index c0e36776d5..a7476726ec 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/26500-26599.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/26500-26599.xml @@ -3,8 +3,6 @@ - - @@ -23,8 +21,6 @@ - - @@ -39,8 +35,6 @@ - - @@ -59,8 +53,6 @@ - - @@ -79,8 +71,6 @@ - - @@ -99,8 +89,6 @@ - - @@ -119,8 +107,6 @@ - - diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/27400-27499.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/27400-27499.xml index e5c3e83fae..b5f0e82d69 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/27400-27499.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/27400-27499.xml @@ -992,8 +992,6 @@ - - @@ -1009,8 +1007,6 @@ - - @@ -1021,8 +1017,6 @@ - - @@ -1037,8 +1031,6 @@ - - @@ -1057,8 +1049,6 @@ - - @@ -1077,8 +1067,6 @@ - - @@ -1097,8 +1085,6 @@ - - @@ -1117,8 +1103,6 @@ - - @@ -1154,8 +1138,6 @@ - - @@ -1171,8 +1153,6 @@ - - @@ -1188,8 +1168,6 @@ - - diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/34900-34999.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/34900-34999.xml index f23ee199d8..56f29e633b 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/34900-34999.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/34900-34999.xml @@ -1777,8 +1777,6 @@ - - diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38100-38199.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38100-38199.xml index f5b31fa328..fa64438ca7 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38100-38199.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38100-38199.xml @@ -515,8 +515,6 @@ - - @@ -545,8 +543,6 @@ - - @@ -575,8 +571,6 @@ - - @@ -604,8 +598,6 @@ - - diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38400-38499.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38400-38499.xml index 8d0f11b2b9..7f25e40a77 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38400-38499.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38400-38499.xml @@ -940,8 +940,6 @@ - - @@ -970,8 +968,6 @@ - - @@ -1000,8 +996,6 @@ - - @@ -1029,8 +1023,6 @@ - - @@ -1085,8 +1077,6 @@ - - @@ -1115,8 +1105,6 @@ - - @@ -1145,8 +1133,6 @@ - - @@ -1174,8 +1160,6 @@ - - @@ -1230,8 +1214,6 @@ - - @@ -1260,8 +1242,6 @@ - - @@ -1290,8 +1270,6 @@ - - @@ -1319,8 +1297,6 @@ - - @@ -1375,8 +1351,6 @@ - - @@ -1405,8 +1379,6 @@ - - @@ -1435,8 +1407,6 @@ - - @@ -1464,8 +1434,6 @@ - - @@ -1520,8 +1488,6 @@ - - @@ -1550,8 +1516,6 @@ - - @@ -1580,8 +1544,6 @@ - - @@ -1609,8 +1571,6 @@ - - @@ -1666,8 +1626,6 @@ - - @@ -1696,8 +1654,6 @@ - - @@ -1726,8 +1682,6 @@ - - @@ -1755,8 +1709,6 @@ - - @@ -1811,8 +1763,6 @@ - - @@ -1841,8 +1791,6 @@ - - @@ -1871,8 +1819,6 @@ - - @@ -1900,8 +1846,6 @@ - - @@ -1956,8 +1900,6 @@ - - @@ -1986,8 +1928,6 @@ - - @@ -2016,8 +1956,6 @@ - - @@ -2045,8 +1983,6 @@ - - @@ -2101,8 +2037,6 @@ - - @@ -2131,8 +2065,6 @@ - - @@ -2161,8 +2093,6 @@ - - @@ -2190,8 +2120,6 @@ - - @@ -2246,8 +2174,6 @@ - - @@ -2276,8 +2202,6 @@ - - @@ -2306,8 +2230,6 @@ - - @@ -2336,8 +2258,6 @@ - - diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38500-38599.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38500-38599.xml index 32bb887b1e..67750a2907 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38500-38599.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38500-38599.xml @@ -3,8 +3,6 @@ - - @@ -33,8 +31,6 @@ - - @@ -63,8 +59,6 @@ - - @@ -92,8 +86,6 @@ - - diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38800-38899.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38800-38899.xml index 8432363868..bc9b2b7bee 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38800-38899.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38800-38899.xml @@ -1503,8 +1503,6 @@ - - @@ -1522,8 +1520,6 @@ - - @@ -1541,8 +1537,6 @@ - - @@ -1560,8 +1554,6 @@ - - @@ -1591,8 +1583,6 @@ - - @@ -1610,8 +1600,6 @@ - - @@ -1629,8 +1617,6 @@ - - @@ -1648,8 +1634,6 @@ - - @@ -1667,8 +1651,6 @@ - - @@ -1683,8 +1665,6 @@ - - @@ -1697,8 +1677,6 @@ - - @@ -1711,8 +1689,6 @@ - - @@ -1725,8 +1701,6 @@ - - @@ -1751,8 +1725,6 @@ - - @@ -1765,8 +1737,6 @@ - - @@ -1779,8 +1749,6 @@ - - @@ -1793,8 +1761,6 @@ - - @@ -1819,8 +1785,6 @@ - - @@ -1838,8 +1802,6 @@ - - @@ -1857,8 +1819,6 @@ - - @@ -1876,8 +1836,6 @@ - - @@ -1909,8 +1867,6 @@ - - @@ -1928,8 +1884,6 @@ - - @@ -1947,8 +1901,6 @@ - - @@ -1966,8 +1918,6 @@ - - @@ -1999,8 +1949,6 @@ - - @@ -2018,8 +1966,6 @@ - - @@ -2038,8 +1984,6 @@ - - @@ -2058,8 +2002,6 @@ - - @@ -2092,8 +2034,6 @@ - - @@ -2112,8 +2052,6 @@ - - @@ -2132,8 +2070,6 @@ - - @@ -2152,8 +2088,6 @@ - - @@ -2186,8 +2120,6 @@ - - @@ -2206,8 +2138,6 @@ - - @@ -2226,8 +2156,6 @@ - - @@ -2246,8 +2174,6 @@ - - @@ -2280,8 +2206,6 @@ - - @@ -2300,8 +2224,6 @@ - - @@ -2320,8 +2242,6 @@ - - @@ -2340,8 +2260,6 @@ - - diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38900-38999.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38900-38999.xml index 1ce01ff618..199c013fdb 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38900-38999.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/38900-38999.xml @@ -231,8 +231,6 @@ - - @@ -252,8 +250,6 @@ - - @@ -273,8 +269,6 @@ - - @@ -293,8 +287,6 @@ - - diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/39600-39699.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/39600-39699.xml index 431f4ba8aa..248cd63b2e 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/39600-39699.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/39600-39699.xml @@ -921,8 +921,6 @@ - - @@ -941,8 +939,6 @@ - - @@ -960,8 +956,6 @@ - - @@ -979,8 +973,6 @@ - - @@ -998,8 +990,6 @@ - - @@ -1017,8 +1007,6 @@ - - @@ -1036,8 +1024,6 @@ - - @@ -1055,8 +1041,6 @@ - - @@ -1074,8 +1058,6 @@ - - @@ -1093,8 +1075,6 @@ - - @@ -1112,8 +1092,6 @@ - - @@ -1131,8 +1109,6 @@ - - @@ -1150,8 +1126,6 @@ - - @@ -1169,8 +1143,6 @@ - - @@ -1187,8 +1159,6 @@ - - @@ -1205,8 +1175,6 @@ - - @@ -1223,8 +1191,6 @@ - - @@ -1241,8 +1207,6 @@ - - @@ -1259,8 +1223,6 @@ - - @@ -1277,8 +1239,6 @@ - - @@ -1295,8 +1255,6 @@ - - @@ -1313,8 +1271,6 @@ - - @@ -1331,8 +1287,6 @@ - - diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/46400-46499.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/46400-46499.xml index 6c729d6c8a..e0670f26a7 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/46400-46499.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/46400-46499.xml @@ -592,8 +592,6 @@ - - @@ -601,8 +599,6 @@ - - @@ -610,8 +606,6 @@ - - @@ -619,8 +613,6 @@ - - @@ -628,8 +620,6 @@ - - @@ -637,8 +627,6 @@ - - @@ -646,8 +634,6 @@ - - @@ -711,8 +697,6 @@ - - @@ -720,8 +704,6 @@ - - @@ -729,8 +711,6 @@ - - @@ -738,8 +718,6 @@ - - @@ -747,8 +725,6 @@ - - @@ -756,8 +732,6 @@ - - @@ -765,8 +739,6 @@ - - @@ -830,8 +802,6 @@ - - @@ -839,8 +809,6 @@ - - @@ -848,8 +816,6 @@ - - @@ -857,8 +823,6 @@ - - @@ -866,8 +830,6 @@ - - @@ -875,8 +837,6 @@ - - @@ -884,8 +844,6 @@ - - @@ -949,8 +907,6 @@ - - @@ -958,8 +914,6 @@ - - @@ -967,8 +921,6 @@ - - @@ -976,8 +928,6 @@ - - @@ -985,8 +935,6 @@ - - @@ -994,8 +942,6 @@ - - @@ -1003,8 +949,6 @@ - - diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/46500-46599.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/46500-46599.xml index 1b2b91e173..be89f4a78e 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/46500-46599.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/46500-46599.xml @@ -31,8 +31,6 @@ - - @@ -40,8 +38,6 @@ - - @@ -49,8 +45,6 @@ - - @@ -58,8 +52,6 @@ - - @@ -67,8 +59,6 @@ - - @@ -76,8 +66,6 @@ - - @@ -85,8 +73,6 @@ - - diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/46600-46699.xml b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/46600-46699.xml index 3bc238a709..0af4444823 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/46600-46699.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/stats/items/46600-46699.xml @@ -1021,8 +1021,6 @@ - - @@ -1037,8 +1035,6 @@ - - @@ -1053,8 +1049,6 @@ - - @@ -1069,8 +1063,6 @@ - - @@ -1094,8 +1086,6 @@ - - @@ -1113,8 +1103,6 @@ - - @@ -1132,8 +1120,6 @@ - - @@ -1151,8 +1137,6 @@ - - @@ -1183,8 +1167,6 @@ - - @@ -1202,8 +1184,6 @@ - - @@ -1221,8 +1201,6 @@ - - @@ -1240,8 +1218,6 @@ - - diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/xsd/CombinationItems.xsd b/L2J_Mobius_2.5_Underground/dist/game/data/xsd/CombinationItems.xsd new file mode 100644 index 0000000000..eb06810c8c --- /dev/null +++ b/L2J_Mobius_2.5_Underground/dist/game/data/xsd/CombinationItems.xsd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/xsd/items.xsd b/L2J_Mobius_2.5_Underground/dist/game/data/xsd/items.xsd index 96ebd3accb..d8b9c85651 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/xsd/items.xsd +++ b/L2J_Mobius_2.5_Underground/dist/game/data/xsd/items.xsd @@ -134,8 +134,6 @@ - - diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/commons/util/CommonUtil.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/commons/util/CommonUtil.java index bfba2b32b6..16530e4fcf 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/commons/util/CommonUtil.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/commons/util/CommonUtil.java @@ -21,12 +21,15 @@ import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.nio.ByteBuffer; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; import java.time.DayOfWeek; import java.time.LocalDateTime; import java.time.temporal.TemporalAdjusters; import java.util.Arrays; import java.util.Comparator; import java.util.List; +import java.util.Locale; import java.util.StringJoiner; import java.util.StringTokenizer; @@ -573,4 +576,15 @@ public final class CommonUtil } return sj.toString(); } + + /** + * @param val + * @param format + * @return + */ + public static String formatDouble(double val, String format) + { + final DecimalFormat formatter = new DecimalFormat(format, new DecimalFormatSymbols(Locale.ENGLISH)); + return formatter.format(val); + } } diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/GameServer.java index baa26b607d..be44d58a5a 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/GameServer.java @@ -50,6 +50,7 @@ import com.l2jmobius.gameserver.data.xml.impl.CategoryData; import com.l2jmobius.gameserver.data.xml.impl.ClanHallData; import com.l2jmobius.gameserver.data.xml.impl.ClanRewardData; import com.l2jmobius.gameserver.data.xml.impl.ClassListData; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.data.xml.impl.CubicData; import com.l2jmobius.gameserver.data.xml.impl.DailyMissionData; import com.l2jmobius.gameserver.data.xml.impl.DoorData; @@ -206,6 +207,7 @@ public class GameServer CategoryData.getInstance(); SecondaryAuthData.getInstance(); AbilityPointsData.getInstance(); + CombinationItemsData.getInstance(); SayuneData.getInstance(); ClanRewardData.getInstance(); DailyMissionHandler.getInstance().executeScript(); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java new file mode 100644 index 0000000000..a7e90d5f89 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java @@ -0,0 +1,111 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.data.xml.impl; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Logger; +import java.util.stream.Collectors; + +import org.w3c.dom.Document; + +import com.l2jmobius.commons.util.IGameXmlReader; +import com.l2jmobius.gameserver.datatables.ItemTable; +import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemReward; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemType; + +/** + * @author UnAfraid + */ +public class CombinationItemsData implements IGameXmlReader +{ + private static final Logger LOGGER = Logger.getLogger(CombinationItemsData.class.getName()); + private final List _items = new ArrayList<>(); + + protected CombinationItemsData() + { + load(); + } + + @Override + public synchronized void load() + { + _items.clear(); + parseDatapackFile("data/CombinationItems.xml"); + LOGGER.info(getClass().getSimpleName() + ": Loaded " + _items.size() + " combinations."); + } + + @Override + public void parseDocument(Document doc, File f) + { + forEach(doc, "list", listNode -> forEach(listNode, "item", itemNode -> + { + final CombinationItem item = new CombinationItem(new StatsSet(parseAttributes(itemNode))); + + forEach(itemNode, "reward", rewardNode -> + { + final int id = parseInteger(rewardNode.getAttributes(), "id"); + final int count = parseInteger(rewardNode.getAttributes(), "count", 1); + final CombinationItemType type = parseEnum(rewardNode.getAttributes(), CombinationItemType.class, "type"); + item.addReward(new CombinationItemReward(id, count, type)); + if (ItemTable.getInstance().getTemplate(id) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find item with id " + id); + } + }); + _items.add(item); + })); + } + + public int getLoadedElementsCount() + { + return _items.size(); + } + + public List getItems() + { + return _items; + } + + public CombinationItem getItemsBySlots(int firstSlot, int secondSlot) + { + return _items.stream().filter(item -> (item.getItemOne() == firstSlot) && (item.getItemTwo() == secondSlot)).findFirst().orElse(null); + } + + public List getItemsByFirstSlot(int id) + { + return _items.stream().filter(item -> item.getItemOne() == id).collect(Collectors.toList()); + } + + public List getItemsBySecondSlot(int id) + { + return _items.stream().filter(item -> item.getItemTwo() == id).collect(Collectors.toList()); + } + + public static final CombinationItemsData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final CombinationItemsData INSTANCE = new CombinationItemsData(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/L2Item.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/L2Item.java index 2f590854f8..c86ec8ca9b 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/L2Item.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/L2Item.java @@ -170,8 +170,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable private int _sharedReuseGroup; private CommissionItemType _commissionItemType; - private int _compoundItem; - private float _compoundChance; private boolean _isAppearanceable; private boolean _isBlessed; @@ -230,8 +228,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable _reuseDelay = set.getInt("reuse_delay", 0); _sharedReuseGroup = set.getInt("shared_reuse_group", 0); _commissionItemType = set.getEnum("commissionItemType", CommissionItemType.class, CommissionItemType.OTHER_ITEM); - _compoundItem = set.getInt("compoundItem", 0); - _compoundChance = set.getFloat("compoundChance", 0); _common = ((_itemId >= 11605) && (_itemId <= 12361)); _heroItem = ((_itemId >= 6611) && (_itemId <= 6621)) || ((_itemId >= 9388) && (_itemId <= 9390)) || (_itemId == 6842); _pvpItem = ((_itemId >= 10667) && (_itemId <= 10835)) || ((_itemId >= 12852) && (_itemId <= 12977)) || ((_itemId >= 14363) && (_itemId <= 14525)) || (_itemId == 14528) || (_itemId == 14529) || (_itemId == 14558) || ((_itemId >= 15913) && (_itemId <= 16024)) || ((_itemId >= 16134) && (_itemId <= 16147)) || (_itemId == 16149) || (_itemId == 16151) || (_itemId == 16153) || (_itemId == 16155) || (_itemId == 16157) || (_itemId == 16159) || ((_itemId >= 16168) && (_itemId <= 16176)) || ((_itemId >= 16179) && (_itemId <= 16220)); @@ -961,16 +957,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable return _commissionItemType; } - public int getCompoundItem() - { - return _compoundItem; - } - - public float getCompoundChance() - { - return _compoundChance; - } - /** * Usable in HTML windows. * @return the icon link in client files diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java new file mode 100644 index 0000000000..d186f635fe --- /dev/null +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java @@ -0,0 +1,65 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.model.items.combination; + +import java.util.EnumMap; +import java.util.Map; + +import com.l2jmobius.gameserver.model.StatsSet; + +/** + * @author UnAfraid + */ +public class CombinationItem +{ + private final int _itemOne; + private final int _itemTwo; + private final int _chance; + private final Map _rewards = new EnumMap<>(CombinationItemType.class); + + public CombinationItem(StatsSet set) + { + _itemOne = set.getInt("one"); + _itemTwo = set.getInt("two"); + _chance = set.getInt("chance"); + } + + public int getItemOne() + { + return _itemOne; + } + + public int getItemTwo() + { + return _itemTwo; + } + + public int getChance() + { + return _chance; + } + + public void addReward(CombinationItemReward item) + { + _rewards.put(item.getType(), item); + } + + public CombinationItemReward getReward(CombinationItemType type) + { + return _rewards.get(type); + } +} diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java new file mode 100644 index 0000000000..c84363b0b2 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java @@ -0,0 +1,38 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.model.items.combination; + +import com.l2jmobius.gameserver.model.holders.ItemHolder; + +/** + * @author UnAfraid + */ +public class CombinationItemReward extends ItemHolder +{ + private final CombinationItemType _type; + + public CombinationItemReward(int id, int count, CombinationItemType type) + { + super(id, count); + _type = type; + } + + public CombinationItemType getType() + { + return _type; + } +} diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java new file mode 100644 index 0000000000..252c81fea6 --- /dev/null +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java @@ -0,0 +1,26 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.model.items.combination; + +/** + * @author UnAfraid + */ +public enum CombinationItemType +{ + ON_SUCCESS, + ON_FAILURE; +} diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java index 198dcb3bc5..4bb19b2b40 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java @@ -16,9 +16,13 @@ */ package com.l2jmobius.gameserver.network.clientpackets.compound; +import java.util.List; + import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -78,8 +82,10 @@ public class RequestNewEnchantPushOne implements IClientIncomingPacket return; } + final List combinationItems = CombinationItemsData.getInstance().getItemsByFirstSlot(itemOne.getId()); + // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) + if (combinationItems.isEmpty()) { client.sendPacket(ExEnchantOneFail.STATIC_PACKET); activeChar.removeRequest(request.getClass()); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java index 9bb1e53e8c..a0317b61be 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java @@ -17,8 +17,10 @@ package com.l2jmobius.gameserver.network.clientpackets.compound; import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -86,15 +88,10 @@ public class RequestNewEnchantPushTwo implements IClientIncomingPacket return; } - // Combining only same items! - if (itemOne.getItem().getId() != itemTwo.getItem().getId()) - { - client.sendPacket(ExEnchantTwoFail.STATIC_PACKET); - return; - } + final CombinationItem combinationItem = CombinationItemsData.getInstance().getItemsBySlots(itemOne.getId(), itemTwo.getId()); // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) + if (combinationItem == null) { client.sendPacket(ExEnchantTwoFail.STATIC_PACKET); return; diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java index 2143d745d5..6858e0b447 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java @@ -18,8 +18,12 @@ package com.l2jmobius.gameserver.network.clientpackets.compound; import com.l2jmobius.commons.network.PacketReader; import com.l2jmobius.commons.util.Rnd; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemReward; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemType; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -82,50 +86,39 @@ public class RequestNewEnchantTry implements IClientIncomingPacket // Lets prevent using same item twice if (itemOne.getObjectId() == itemTwo.getObjectId()) { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); + client.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId())); activeChar.removeRequest(request.getClass()); return; } - // Combining only same items! - if (itemOne.getItem().getId() != itemTwo.getItem().getId()) - { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); - activeChar.removeRequest(request.getClass()); - return; - } + final CombinationItem combinationItem = CombinationItemsData.getInstance().getItemsBySlots(itemOne.getId(), itemTwo.getId()); // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) + if (combinationItem == null) { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); + client.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId())); activeChar.removeRequest(request.getClass()); return; } final InventoryUpdate iu = new InventoryUpdate(); - final double random = Rnd.nextDouble() * 100; + iu.addRemovedItem(itemOne); + iu.addRemovedItem(itemTwo); - // Success - if (random < itemOne.getItem().getCompoundChance()) + if (activeChar.destroyItem("Compound-Item-One", itemOne, 1, null, true) && activeChar.destroyItem("Compound-Item-Two", itemTwo, 1, null, true)) { - iu.addRemovedItem(itemOne); - iu.addRemovedItem(itemTwo); + final double random = (Rnd.nextDouble() * 100); + final boolean success = random <= combinationItem.getChance(); + final CombinationItemReward rewardItem = combinationItem.getReward(success ? CombinationItemType.ON_SUCCESS : CombinationItemType.ON_FAILURE); + final L2ItemInstance item = activeChar.addItem("Compound-Result", rewardItem.getId(), rewardItem.getCount(), null, true); - if (activeChar.destroyItem("Compound-Item-One", itemOne, null, true) && activeChar.destroyItem("Compound-Item-Two", itemTwo, null, true)) + if (success) { - final L2ItemInstance item = activeChar.addItem("Compound-Result", itemOne.getItem().getCompoundItem(), 1, null, true); - client.sendPacket(new ExEnchantSucess(item.getItem().getId())); + client.sendPacket(new ExEnchantSucess(item.getId())); } - } - else - { - iu.addRemovedItem(itemTwo); - - // Upon fail we destroy the second item. - if (activeChar.destroyItem("Compound-Item-Two-Fail", itemTwo, null, true)) + else { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); + client.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId())); } } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/CombinationItems.xml b/L2J_Mobius_3.0_Helios/dist/game/data/CombinationItems.xml new file mode 100644 index 0000000000..f2a95f1515 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/CombinationItems.xml @@ -0,0 +1,3323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/26400-26499.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/26400-26499.xml index 4ae55d1cfd..b7557c7f28 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/26400-26499.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/26400-26499.xml @@ -852,8 +852,6 @@ - - @@ -871,8 +869,6 @@ - - @@ -890,8 +886,6 @@ - - @@ -910,8 +904,6 @@ - - @@ -930,8 +922,6 @@ - - @@ -947,8 +937,6 @@ - - @@ -966,8 +954,6 @@ - - @@ -985,8 +971,6 @@ - - @@ -1004,8 +988,6 @@ - - @@ -1023,8 +1005,6 @@ - - @@ -1038,8 +1018,6 @@ - - @@ -1057,8 +1035,6 @@ - - @@ -1076,8 +1052,6 @@ - - @@ -1095,8 +1069,6 @@ - - @@ -1114,8 +1086,6 @@ - - @@ -1214,8 +1184,6 @@ - - @@ -1233,8 +1201,6 @@ - - @@ -1252,8 +1218,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/26500-26599.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/26500-26599.xml index c0e36776d5..a7476726ec 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/26500-26599.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/26500-26599.xml @@ -3,8 +3,6 @@ - - @@ -23,8 +21,6 @@ - - @@ -39,8 +35,6 @@ - - @@ -59,8 +53,6 @@ - - @@ -79,8 +71,6 @@ - - @@ -99,8 +89,6 @@ - - @@ -119,8 +107,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/27400-27499.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/27400-27499.xml index e5c3e83fae..b5f0e82d69 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/27400-27499.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/27400-27499.xml @@ -992,8 +992,6 @@ - - @@ -1009,8 +1007,6 @@ - - @@ -1021,8 +1017,6 @@ - - @@ -1037,8 +1031,6 @@ - - @@ -1057,8 +1049,6 @@ - - @@ -1077,8 +1067,6 @@ - - @@ -1097,8 +1085,6 @@ - - @@ -1117,8 +1103,6 @@ - - @@ -1154,8 +1138,6 @@ - - @@ -1171,8 +1153,6 @@ - - @@ -1188,8 +1168,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/28300-28399.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/28300-28399.xml index 9a3aeb8fd6..c9fff76c72 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/28300-28399.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/28300-28399.xml @@ -130,8 +130,6 @@ - - @@ -172,8 +170,6 @@ - - @@ -214,8 +210,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/28400-28499.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/28400-28499.xml index 80be62bc04..38d1e6c537 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/28400-28499.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/28400-28499.xml @@ -398,8 +398,6 @@ - - @@ -416,8 +414,6 @@ - - @@ -434,8 +430,6 @@ - - @@ -452,8 +446,6 @@ - - @@ -470,8 +462,6 @@ - - @@ -488,8 +478,6 @@ - - @@ -506,8 +494,6 @@ - - @@ -524,8 +510,6 @@ - - @@ -542,8 +526,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/34900-34999.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/34900-34999.xml index 63ac338369..6ab9614a7c 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/34900-34999.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/34900-34999.xml @@ -1777,8 +1777,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38100-38199.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38100-38199.xml index 883cf954ac..56299159e2 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38100-38199.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38100-38199.xml @@ -515,8 +515,6 @@ - - @@ -545,8 +543,6 @@ - - @@ -575,8 +571,6 @@ - - @@ -604,8 +598,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38400-38499.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38400-38499.xml index 5867a6df9a..4071fdd28c 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38400-38499.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38400-38499.xml @@ -940,8 +940,6 @@ - - @@ -970,8 +968,6 @@ - - @@ -1000,8 +996,6 @@ - - @@ -1029,8 +1023,6 @@ - - @@ -1085,8 +1077,6 @@ - - @@ -1115,8 +1105,6 @@ - - @@ -1145,8 +1133,6 @@ - - @@ -1174,8 +1160,6 @@ - - @@ -1230,8 +1214,6 @@ - - @@ -1260,8 +1242,6 @@ - - @@ -1290,8 +1270,6 @@ - - @@ -1319,8 +1297,6 @@ - - @@ -1375,8 +1351,6 @@ - - @@ -1405,8 +1379,6 @@ - - @@ -1435,8 +1407,6 @@ - - @@ -1464,8 +1434,6 @@ - - @@ -1520,8 +1488,6 @@ - - @@ -1550,8 +1516,6 @@ - - @@ -1580,8 +1544,6 @@ - - @@ -1609,8 +1571,6 @@ - - @@ -1666,8 +1626,6 @@ - - @@ -1696,8 +1654,6 @@ - - @@ -1726,8 +1682,6 @@ - - @@ -1755,8 +1709,6 @@ - - @@ -1811,8 +1763,6 @@ - - @@ -1841,8 +1791,6 @@ - - @@ -1871,8 +1819,6 @@ - - @@ -1900,8 +1846,6 @@ - - @@ -1956,8 +1900,6 @@ - - @@ -1986,8 +1928,6 @@ - - @@ -2016,8 +1956,6 @@ - - @@ -2045,8 +1983,6 @@ - - @@ -2101,8 +2037,6 @@ - - @@ -2131,8 +2065,6 @@ - - @@ -2161,8 +2093,6 @@ - - @@ -2190,8 +2120,6 @@ - - @@ -2246,8 +2174,6 @@ - - @@ -2276,8 +2202,6 @@ - - @@ -2306,8 +2230,6 @@ - - @@ -2336,8 +2258,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38500-38599.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38500-38599.xml index 32bb887b1e..67750a2907 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38500-38599.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38500-38599.xml @@ -3,8 +3,6 @@ - - @@ -33,8 +31,6 @@ - - @@ -63,8 +59,6 @@ - - @@ -92,8 +86,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38800-38899.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38800-38899.xml index f515b1d50c..bc9b2b7bee 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38800-38899.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38800-38899.xml @@ -1503,8 +1503,6 @@ - - @@ -1522,8 +1520,6 @@ - - @@ -1541,8 +1537,6 @@ - - @@ -1560,8 +1554,6 @@ - - @@ -1579,8 +1571,6 @@ - - @@ -1593,8 +1583,6 @@ - - @@ -1612,8 +1600,6 @@ - - @@ -1631,8 +1617,6 @@ - - @@ -1650,8 +1634,6 @@ - - @@ -1669,8 +1651,6 @@ - - @@ -1685,8 +1665,6 @@ - - @@ -1699,8 +1677,6 @@ - - @@ -1713,8 +1689,6 @@ - - @@ -1727,8 +1701,6 @@ - - @@ -1753,8 +1725,6 @@ - - @@ -1767,8 +1737,6 @@ - - @@ -1781,8 +1749,6 @@ - - @@ -1795,8 +1761,6 @@ - - @@ -1821,8 +1785,6 @@ - - @@ -1840,8 +1802,6 @@ - - @@ -1859,8 +1819,6 @@ - - @@ -1878,8 +1836,6 @@ - - @@ -1897,8 +1853,6 @@ - - @@ -1913,8 +1867,6 @@ - - @@ -1932,8 +1884,6 @@ - - @@ -1951,8 +1901,6 @@ - - @@ -1970,8 +1918,6 @@ - - @@ -1989,8 +1935,6 @@ - - @@ -2005,8 +1949,6 @@ - - @@ -2024,8 +1966,6 @@ - - @@ -2044,8 +1984,6 @@ - - @@ -2064,8 +2002,6 @@ - - @@ -2084,8 +2020,6 @@ - - @@ -2100,8 +2034,6 @@ - - @@ -2120,8 +2052,6 @@ - - @@ -2140,8 +2070,6 @@ - - @@ -2160,8 +2088,6 @@ - - @@ -2180,8 +2106,6 @@ - - @@ -2196,8 +2120,6 @@ - - @@ -2216,8 +2138,6 @@ - - @@ -2236,8 +2156,6 @@ - - @@ -2256,8 +2174,6 @@ - - @@ -2276,8 +2192,6 @@ - - @@ -2292,8 +2206,6 @@ - - @@ -2312,8 +2224,6 @@ - - @@ -2332,8 +2242,6 @@ - - @@ -2352,8 +2260,6 @@ - - @@ -2372,8 +2278,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38900-38999.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38900-38999.xml index 27eaf1684d..cf6c49697d 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38900-38999.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/38900-38999.xml @@ -231,8 +231,6 @@ - - @@ -252,8 +250,6 @@ - - @@ -273,8 +269,6 @@ - - @@ -293,8 +287,6 @@ - - @@ -313,8 +305,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/39600-39699.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/39600-39699.xml index 60398b9e5e..cf26a3251c 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/39600-39699.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/39600-39699.xml @@ -921,8 +921,6 @@ - - @@ -941,8 +939,6 @@ - - @@ -960,8 +956,6 @@ - - @@ -979,8 +973,6 @@ - - @@ -998,8 +990,6 @@ - - @@ -1017,8 +1007,6 @@ - - @@ -1036,8 +1024,6 @@ - - @@ -1055,8 +1041,6 @@ - - @@ -1074,8 +1058,6 @@ - - @@ -1093,8 +1075,6 @@ - - @@ -1112,8 +1092,6 @@ - - @@ -1131,8 +1109,6 @@ - - @@ -1150,8 +1126,6 @@ - - @@ -1169,8 +1143,6 @@ - - @@ -1187,8 +1159,6 @@ - - @@ -1205,8 +1175,6 @@ - - @@ -1223,8 +1191,6 @@ - - @@ -1241,8 +1207,6 @@ - - @@ -1259,8 +1223,6 @@ - - @@ -1277,8 +1239,6 @@ - - @@ -1295,8 +1255,6 @@ - - @@ -1313,8 +1271,6 @@ - - @@ -1331,8 +1287,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/46400-46499.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/46400-46499.xml index a1b7e185f8..2e78ba7597 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/46400-46499.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/46400-46499.xml @@ -592,8 +592,6 @@ - - @@ -601,8 +599,6 @@ - - @@ -610,8 +606,6 @@ - - @@ -619,8 +613,6 @@ - - @@ -628,8 +620,6 @@ - - @@ -637,8 +627,6 @@ - - @@ -646,8 +634,6 @@ - - @@ -711,8 +697,6 @@ - - @@ -720,8 +704,6 @@ - - @@ -729,8 +711,6 @@ - - @@ -738,8 +718,6 @@ - - @@ -747,8 +725,6 @@ - - @@ -756,8 +732,6 @@ - - @@ -765,8 +739,6 @@ - - @@ -830,8 +802,6 @@ - - @@ -839,8 +809,6 @@ - - @@ -848,8 +816,6 @@ - - @@ -857,8 +823,6 @@ - - @@ -866,8 +830,6 @@ - - @@ -875,8 +837,6 @@ - - @@ -884,8 +844,6 @@ - - @@ -949,8 +907,6 @@ - - @@ -958,8 +914,6 @@ - - @@ -967,8 +921,6 @@ - - @@ -976,8 +928,6 @@ - - @@ -985,8 +935,6 @@ - - @@ -994,8 +942,6 @@ - - @@ -1003,8 +949,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/46500-46599.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/46500-46599.xml index fa397f02df..4b951da34d 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/46500-46599.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/46500-46599.xml @@ -31,8 +31,6 @@ - - @@ -40,8 +38,6 @@ - - @@ -49,8 +45,6 @@ - - @@ -58,8 +52,6 @@ - - @@ -67,8 +59,6 @@ - - @@ -76,8 +66,6 @@ - - @@ -85,8 +73,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/46600-46699.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/46600-46699.xml index 9ebbe0e10e..bc78ef5192 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/46600-46699.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/46600-46699.xml @@ -1021,8 +1021,6 @@ - - @@ -1037,8 +1035,6 @@ - - @@ -1053,8 +1049,6 @@ - - @@ -1069,8 +1063,6 @@ - - @@ -1094,8 +1086,6 @@ - - @@ -1113,8 +1103,6 @@ - - @@ -1132,8 +1120,6 @@ - - @@ -1151,8 +1137,6 @@ - - @@ -1183,8 +1167,6 @@ - - @@ -1202,8 +1184,6 @@ - - @@ -1221,8 +1201,6 @@ - - @@ -1240,8 +1218,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/47600-47699.xml b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/47600-47699.xml index 19ca6fed40..0f3983406c 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/47600-47699.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/stats/items/47600-47699.xml @@ -376,8 +376,6 @@ - - @@ -395,8 +393,6 @@ - - @@ -414,8 +410,6 @@ - - @@ -433,8 +427,6 @@ - - @@ -452,8 +444,6 @@ - - @@ -467,8 +457,6 @@ - - @@ -486,8 +474,6 @@ - - @@ -505,8 +491,6 @@ - - @@ -524,8 +508,6 @@ - - @@ -543,8 +525,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/xsd/CombinationItems.xsd b/L2J_Mobius_3.0_Helios/dist/game/data/xsd/CombinationItems.xsd new file mode 100644 index 0000000000..eb06810c8c --- /dev/null +++ b/L2J_Mobius_3.0_Helios/dist/game/data/xsd/CombinationItems.xsd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/xsd/items.xsd b/L2J_Mobius_3.0_Helios/dist/game/data/xsd/items.xsd index 96ebd3accb..d8b9c85651 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/xsd/items.xsd +++ b/L2J_Mobius_3.0_Helios/dist/game/data/xsd/items.xsd @@ -134,8 +134,6 @@ - - diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/commons/util/CommonUtil.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/commons/util/CommonUtil.java index bfba2b32b6..16530e4fcf 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/commons/util/CommonUtil.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/commons/util/CommonUtil.java @@ -21,12 +21,15 @@ import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.nio.ByteBuffer; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; import java.time.DayOfWeek; import java.time.LocalDateTime; import java.time.temporal.TemporalAdjusters; import java.util.Arrays; import java.util.Comparator; import java.util.List; +import java.util.Locale; import java.util.StringJoiner; import java.util.StringTokenizer; @@ -573,4 +576,15 @@ public final class CommonUtil } return sj.toString(); } + + /** + * @param val + * @param format + * @return + */ + public static String formatDouble(double val, String format) + { + final DecimalFormat formatter = new DecimalFormat(format, new DecimalFormatSymbols(Locale.ENGLISH)); + return formatter.format(val); + } } diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/GameServer.java index 25a20baaab..b4b36a7542 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/GameServer.java @@ -50,6 +50,7 @@ import com.l2jmobius.gameserver.data.xml.impl.CategoryData; import com.l2jmobius.gameserver.data.xml.impl.ClanHallData; import com.l2jmobius.gameserver.data.xml.impl.ClanRewardData; import com.l2jmobius.gameserver.data.xml.impl.ClassListData; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.data.xml.impl.CubicData; import com.l2jmobius.gameserver.data.xml.impl.DailyMissionData; import com.l2jmobius.gameserver.data.xml.impl.DoorData; @@ -206,6 +207,7 @@ public class GameServer CategoryData.getInstance(); SecondaryAuthData.getInstance(); AbilityPointsData.getInstance(); + CombinationItemsData.getInstance(); SayuneData.getInstance(); ClanRewardData.getInstance(); DailyMissionHandler.getInstance().executeScript(); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java new file mode 100644 index 0000000000..a7e90d5f89 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java @@ -0,0 +1,111 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.data.xml.impl; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Logger; +import java.util.stream.Collectors; + +import org.w3c.dom.Document; + +import com.l2jmobius.commons.util.IGameXmlReader; +import com.l2jmobius.gameserver.datatables.ItemTable; +import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemReward; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemType; + +/** + * @author UnAfraid + */ +public class CombinationItemsData implements IGameXmlReader +{ + private static final Logger LOGGER = Logger.getLogger(CombinationItemsData.class.getName()); + private final List _items = new ArrayList<>(); + + protected CombinationItemsData() + { + load(); + } + + @Override + public synchronized void load() + { + _items.clear(); + parseDatapackFile("data/CombinationItems.xml"); + LOGGER.info(getClass().getSimpleName() + ": Loaded " + _items.size() + " combinations."); + } + + @Override + public void parseDocument(Document doc, File f) + { + forEach(doc, "list", listNode -> forEach(listNode, "item", itemNode -> + { + final CombinationItem item = new CombinationItem(new StatsSet(parseAttributes(itemNode))); + + forEach(itemNode, "reward", rewardNode -> + { + final int id = parseInteger(rewardNode.getAttributes(), "id"); + final int count = parseInteger(rewardNode.getAttributes(), "count", 1); + final CombinationItemType type = parseEnum(rewardNode.getAttributes(), CombinationItemType.class, "type"); + item.addReward(new CombinationItemReward(id, count, type)); + if (ItemTable.getInstance().getTemplate(id) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find item with id " + id); + } + }); + _items.add(item); + })); + } + + public int getLoadedElementsCount() + { + return _items.size(); + } + + public List getItems() + { + return _items; + } + + public CombinationItem getItemsBySlots(int firstSlot, int secondSlot) + { + return _items.stream().filter(item -> (item.getItemOne() == firstSlot) && (item.getItemTwo() == secondSlot)).findFirst().orElse(null); + } + + public List getItemsByFirstSlot(int id) + { + return _items.stream().filter(item -> item.getItemOne() == id).collect(Collectors.toList()); + } + + public List getItemsBySecondSlot(int id) + { + return _items.stream().filter(item -> item.getItemTwo() == id).collect(Collectors.toList()); + } + + public static final CombinationItemsData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final CombinationItemsData INSTANCE = new CombinationItemsData(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/L2Item.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/L2Item.java index 2f590854f8..c86ec8ca9b 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/L2Item.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/L2Item.java @@ -170,8 +170,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable private int _sharedReuseGroup; private CommissionItemType _commissionItemType; - private int _compoundItem; - private float _compoundChance; private boolean _isAppearanceable; private boolean _isBlessed; @@ -230,8 +228,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable _reuseDelay = set.getInt("reuse_delay", 0); _sharedReuseGroup = set.getInt("shared_reuse_group", 0); _commissionItemType = set.getEnum("commissionItemType", CommissionItemType.class, CommissionItemType.OTHER_ITEM); - _compoundItem = set.getInt("compoundItem", 0); - _compoundChance = set.getFloat("compoundChance", 0); _common = ((_itemId >= 11605) && (_itemId <= 12361)); _heroItem = ((_itemId >= 6611) && (_itemId <= 6621)) || ((_itemId >= 9388) && (_itemId <= 9390)) || (_itemId == 6842); _pvpItem = ((_itemId >= 10667) && (_itemId <= 10835)) || ((_itemId >= 12852) && (_itemId <= 12977)) || ((_itemId >= 14363) && (_itemId <= 14525)) || (_itemId == 14528) || (_itemId == 14529) || (_itemId == 14558) || ((_itemId >= 15913) && (_itemId <= 16024)) || ((_itemId >= 16134) && (_itemId <= 16147)) || (_itemId == 16149) || (_itemId == 16151) || (_itemId == 16153) || (_itemId == 16155) || (_itemId == 16157) || (_itemId == 16159) || ((_itemId >= 16168) && (_itemId <= 16176)) || ((_itemId >= 16179) && (_itemId <= 16220)); @@ -961,16 +957,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable return _commissionItemType; } - public int getCompoundItem() - { - return _compoundItem; - } - - public float getCompoundChance() - { - return _compoundChance; - } - /** * Usable in HTML windows. * @return the icon link in client files diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java new file mode 100644 index 0000000000..d186f635fe --- /dev/null +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java @@ -0,0 +1,65 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.model.items.combination; + +import java.util.EnumMap; +import java.util.Map; + +import com.l2jmobius.gameserver.model.StatsSet; + +/** + * @author UnAfraid + */ +public class CombinationItem +{ + private final int _itemOne; + private final int _itemTwo; + private final int _chance; + private final Map _rewards = new EnumMap<>(CombinationItemType.class); + + public CombinationItem(StatsSet set) + { + _itemOne = set.getInt("one"); + _itemTwo = set.getInt("two"); + _chance = set.getInt("chance"); + } + + public int getItemOne() + { + return _itemOne; + } + + public int getItemTwo() + { + return _itemTwo; + } + + public int getChance() + { + return _chance; + } + + public void addReward(CombinationItemReward item) + { + _rewards.put(item.getType(), item); + } + + public CombinationItemReward getReward(CombinationItemType type) + { + return _rewards.get(type); + } +} diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java new file mode 100644 index 0000000000..c84363b0b2 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java @@ -0,0 +1,38 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.model.items.combination; + +import com.l2jmobius.gameserver.model.holders.ItemHolder; + +/** + * @author UnAfraid + */ +public class CombinationItemReward extends ItemHolder +{ + private final CombinationItemType _type; + + public CombinationItemReward(int id, int count, CombinationItemType type) + { + super(id, count); + _type = type; + } + + public CombinationItemType getType() + { + return _type; + } +} diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java new file mode 100644 index 0000000000..252c81fea6 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java @@ -0,0 +1,26 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.model.items.combination; + +/** + * @author UnAfraid + */ +public enum CombinationItemType +{ + ON_SUCCESS, + ON_FAILURE; +} diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java index 198dcb3bc5..4bb19b2b40 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java @@ -16,9 +16,13 @@ */ package com.l2jmobius.gameserver.network.clientpackets.compound; +import java.util.List; + import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -78,8 +82,10 @@ public class RequestNewEnchantPushOne implements IClientIncomingPacket return; } + final List combinationItems = CombinationItemsData.getInstance().getItemsByFirstSlot(itemOne.getId()); + // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) + if (combinationItems.isEmpty()) { client.sendPacket(ExEnchantOneFail.STATIC_PACKET); activeChar.removeRequest(request.getClass()); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java index 9bb1e53e8c..a0317b61be 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java @@ -17,8 +17,10 @@ package com.l2jmobius.gameserver.network.clientpackets.compound; import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -86,15 +88,10 @@ public class RequestNewEnchantPushTwo implements IClientIncomingPacket return; } - // Combining only same items! - if (itemOne.getItem().getId() != itemTwo.getItem().getId()) - { - client.sendPacket(ExEnchantTwoFail.STATIC_PACKET); - return; - } + final CombinationItem combinationItem = CombinationItemsData.getInstance().getItemsBySlots(itemOne.getId(), itemTwo.getId()); // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) + if (combinationItem == null) { client.sendPacket(ExEnchantTwoFail.STATIC_PACKET); return; diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java index 2143d745d5..6858e0b447 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java @@ -18,8 +18,12 @@ package com.l2jmobius.gameserver.network.clientpackets.compound; import com.l2jmobius.commons.network.PacketReader; import com.l2jmobius.commons.util.Rnd; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemReward; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemType; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -82,50 +86,39 @@ public class RequestNewEnchantTry implements IClientIncomingPacket // Lets prevent using same item twice if (itemOne.getObjectId() == itemTwo.getObjectId()) { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); + client.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId())); activeChar.removeRequest(request.getClass()); return; } - // Combining only same items! - if (itemOne.getItem().getId() != itemTwo.getItem().getId()) - { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); - activeChar.removeRequest(request.getClass()); - return; - } + final CombinationItem combinationItem = CombinationItemsData.getInstance().getItemsBySlots(itemOne.getId(), itemTwo.getId()); // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) + if (combinationItem == null) { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); + client.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId())); activeChar.removeRequest(request.getClass()); return; } final InventoryUpdate iu = new InventoryUpdate(); - final double random = Rnd.nextDouble() * 100; + iu.addRemovedItem(itemOne); + iu.addRemovedItem(itemTwo); - // Success - if (random < itemOne.getItem().getCompoundChance()) + if (activeChar.destroyItem("Compound-Item-One", itemOne, 1, null, true) && activeChar.destroyItem("Compound-Item-Two", itemTwo, 1, null, true)) { - iu.addRemovedItem(itemOne); - iu.addRemovedItem(itemTwo); + final double random = (Rnd.nextDouble() * 100); + final boolean success = random <= combinationItem.getChance(); + final CombinationItemReward rewardItem = combinationItem.getReward(success ? CombinationItemType.ON_SUCCESS : CombinationItemType.ON_FAILURE); + final L2ItemInstance item = activeChar.addItem("Compound-Result", rewardItem.getId(), rewardItem.getCount(), null, true); - if (activeChar.destroyItem("Compound-Item-One", itemOne, null, true) && activeChar.destroyItem("Compound-Item-Two", itemTwo, null, true)) + if (success) { - final L2ItemInstance item = activeChar.addItem("Compound-Result", itemOne.getItem().getCompoundItem(), 1, null, true); - client.sendPacket(new ExEnchantSucess(item.getItem().getId())); + client.sendPacket(new ExEnchantSucess(item.getId())); } - } - else - { - iu.addRemovedItem(itemTwo); - - // Upon fail we destroy the second item. - if (activeChar.destroyItem("Compound-Item-Two-Fail", itemTwo, null, true)) + else { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); + client.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId())); } } diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemFail.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemFail.java new file mode 100644 index 0000000000..f471f5717b --- /dev/null +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemFail.java @@ -0,0 +1,40 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.network.serverpackets.compound; + +import com.l2jmobius.commons.network.PacketWriter; +import com.l2jmobius.gameserver.network.OutgoingPackets; +import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Sdw + */ +public class ExEnchantRetryToPutItemFail implements IClientOutgoingPacket +{ + public static final ExEnchantRetryToPutItemFail STATIC_PACKET = new ExEnchantRetryToPutItemFail(); + + private ExEnchantRetryToPutItemFail() + { + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_ENCHANT_RETRY_TO_PUT_ITEM_FAIL.writeId(packet); + return true; + } +} \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemOk.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemOk.java new file mode 100644 index 0000000000..8fb0127cc3 --- /dev/null +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemOk.java @@ -0,0 +1,40 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.network.serverpackets.compound; + +import com.l2jmobius.commons.network.PacketWriter; +import com.l2jmobius.gameserver.network.OutgoingPackets; +import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Sdw + */ +public class ExEnchantRetryToPutItemOk implements IClientOutgoingPacket +{ + public static final ExEnchantRetryToPutItemOk STATIC_PACKET = new ExEnchantRetryToPutItemOk(); + + private ExEnchantRetryToPutItemOk() + { + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_ENCHANT_RETRY_TO_PUT_ITEM_OK.writeId(packet); + return true; + } +} \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/CombinationItems.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/CombinationItems.xml new file mode 100644 index 0000000000..f2a95f1515 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/CombinationItems.xml @@ -0,0 +1,3323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/26400-26499.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/26400-26499.xml index 4ae55d1cfd..b7557c7f28 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/26400-26499.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/26400-26499.xml @@ -852,8 +852,6 @@ - - @@ -871,8 +869,6 @@ - - @@ -890,8 +886,6 @@ - - @@ -910,8 +904,6 @@ - - @@ -930,8 +922,6 @@ - - @@ -947,8 +937,6 @@ - - @@ -966,8 +954,6 @@ - - @@ -985,8 +971,6 @@ - - @@ -1004,8 +988,6 @@ - - @@ -1023,8 +1005,6 @@ - - @@ -1038,8 +1018,6 @@ - - @@ -1057,8 +1035,6 @@ - - @@ -1076,8 +1052,6 @@ - - @@ -1095,8 +1069,6 @@ - - @@ -1114,8 +1086,6 @@ - - @@ -1214,8 +1184,6 @@ - - @@ -1233,8 +1201,6 @@ - - @@ -1252,8 +1218,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/26500-26599.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/26500-26599.xml index 4c92469a7f..98e6d14a0b 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/26500-26599.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/26500-26599.xml @@ -3,8 +3,6 @@ - - @@ -22,8 +20,6 @@ - - @@ -37,8 +33,6 @@ - - @@ -56,8 +50,6 @@ - - @@ -75,8 +67,6 @@ - - @@ -94,8 +84,6 @@ - - @@ -113,8 +101,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/27400-27499.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/27400-27499.xml index 496caaf7a9..b8f5b1fc66 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/27400-27499.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/27400-27499.xml @@ -979,8 +979,6 @@ - - @@ -995,8 +993,6 @@ - - @@ -1006,8 +1002,6 @@ - - @@ -1021,8 +1015,6 @@ - - @@ -1040,8 +1032,6 @@ - - @@ -1059,8 +1049,6 @@ - - @@ -1078,8 +1066,6 @@ - - @@ -1097,8 +1083,6 @@ - - @@ -1129,8 +1113,6 @@ - - @@ -1145,8 +1127,6 @@ - - @@ -1161,8 +1141,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/28300-28399.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/28300-28399.xml index 48340aa98e..d1b73ba15f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/28300-28399.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/28300-28399.xml @@ -127,8 +127,6 @@ - - @@ -169,8 +167,6 @@ - - @@ -211,8 +207,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/28400-28499.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/28400-28499.xml index e253a70d4d..e3d23550f0 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/28400-28499.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/28400-28499.xml @@ -525,8 +525,6 @@ - - @@ -544,8 +542,6 @@ - - @@ -563,8 +559,6 @@ - - @@ -582,8 +576,6 @@ - - @@ -601,8 +593,6 @@ - - @@ -621,8 +611,6 @@ - - @@ -642,8 +630,6 @@ - - @@ -664,8 +650,6 @@ - - @@ -687,8 +671,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/29000-29099.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/29000-29099.xml index 22089cb356..5df135b07c 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/29000-29099.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/29000-29099.xml @@ -3,8 +3,6 @@ - - @@ -21,8 +19,6 @@ - - @@ -39,8 +35,6 @@ - - @@ -57,8 +51,6 @@ - - @@ -75,8 +67,6 @@ - - @@ -94,8 +84,6 @@ - - @@ -114,8 +102,6 @@ - - @@ -135,8 +121,6 @@ - - @@ -157,8 +141,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/34900-34999.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/34900-34999.xml index ed8c4cabb0..6fa356952c 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/34900-34999.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/34900-34999.xml @@ -1688,8 +1688,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38100-38199.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38100-38199.xml index b4e16cfd2e..3f501cc7b5 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38100-38199.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38100-38199.xml @@ -503,8 +503,6 @@ - - @@ -529,8 +527,6 @@ - - @@ -555,8 +551,6 @@ - - @@ -580,8 +574,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38400-38499.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38400-38499.xml index 8886a639c7..a9162d5eb8 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38400-38499.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38400-38499.xml @@ -940,8 +940,6 @@ - - @@ -966,8 +964,6 @@ - - @@ -992,8 +988,6 @@ - - @@ -1017,8 +1011,6 @@ - - @@ -1065,8 +1057,6 @@ - - @@ -1091,8 +1081,6 @@ - - @@ -1117,8 +1105,6 @@ - - @@ -1142,8 +1128,6 @@ - - @@ -1190,8 +1174,6 @@ - - @@ -1216,8 +1198,6 @@ - - @@ -1242,8 +1222,6 @@ - - @@ -1267,8 +1245,6 @@ - - @@ -1315,8 +1291,6 @@ - - @@ -1341,8 +1315,6 @@ - - @@ -1367,8 +1339,6 @@ - - @@ -1392,8 +1362,6 @@ - - @@ -1440,8 +1408,6 @@ - - @@ -1466,8 +1432,6 @@ - - @@ -1492,8 +1456,6 @@ - - @@ -1517,8 +1479,6 @@ - - @@ -1566,8 +1526,6 @@ - - @@ -1592,8 +1550,6 @@ - - @@ -1618,8 +1574,6 @@ - - @@ -1643,8 +1597,6 @@ - - @@ -1691,8 +1643,6 @@ - - @@ -1717,8 +1667,6 @@ - - @@ -1743,8 +1691,6 @@ - - @@ -1768,8 +1714,6 @@ - - @@ -1816,8 +1760,6 @@ - - @@ -1842,8 +1784,6 @@ - - @@ -1868,8 +1808,6 @@ - - @@ -1893,8 +1831,6 @@ - - @@ -1941,8 +1877,6 @@ - - @@ -1967,8 +1901,6 @@ - - @@ -1993,8 +1925,6 @@ - - @@ -2018,8 +1948,6 @@ - - @@ -2066,8 +1994,6 @@ - - @@ -2092,8 +2018,6 @@ - - @@ -2118,8 +2042,6 @@ - - @@ -2144,8 +2066,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38500-38599.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38500-38599.xml index 9e84401d5e..9dc0b51cc0 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38500-38599.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38500-38599.xml @@ -3,8 +3,6 @@ - - @@ -29,8 +27,6 @@ - - @@ -55,8 +51,6 @@ - - @@ -80,8 +74,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38800-38899.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38800-38899.xml index f515b1d50c..bc9b2b7bee 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38800-38899.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38800-38899.xml @@ -1503,8 +1503,6 @@ - - @@ -1522,8 +1520,6 @@ - - @@ -1541,8 +1537,6 @@ - - @@ -1560,8 +1554,6 @@ - - @@ -1579,8 +1571,6 @@ - - @@ -1593,8 +1583,6 @@ - - @@ -1612,8 +1600,6 @@ - - @@ -1631,8 +1617,6 @@ - - @@ -1650,8 +1634,6 @@ - - @@ -1669,8 +1651,6 @@ - - @@ -1685,8 +1665,6 @@ - - @@ -1699,8 +1677,6 @@ - - @@ -1713,8 +1689,6 @@ - - @@ -1727,8 +1701,6 @@ - - @@ -1753,8 +1725,6 @@ - - @@ -1767,8 +1737,6 @@ - - @@ -1781,8 +1749,6 @@ - - @@ -1795,8 +1761,6 @@ - - @@ -1821,8 +1785,6 @@ - - @@ -1840,8 +1802,6 @@ - - @@ -1859,8 +1819,6 @@ - - @@ -1878,8 +1836,6 @@ - - @@ -1897,8 +1853,6 @@ - - @@ -1913,8 +1867,6 @@ - - @@ -1932,8 +1884,6 @@ - - @@ -1951,8 +1901,6 @@ - - @@ -1970,8 +1918,6 @@ - - @@ -1989,8 +1935,6 @@ - - @@ -2005,8 +1949,6 @@ - - @@ -2024,8 +1966,6 @@ - - @@ -2044,8 +1984,6 @@ - - @@ -2064,8 +2002,6 @@ - - @@ -2084,8 +2020,6 @@ - - @@ -2100,8 +2034,6 @@ - - @@ -2120,8 +2052,6 @@ - - @@ -2140,8 +2070,6 @@ - - @@ -2160,8 +2088,6 @@ - - @@ -2180,8 +2106,6 @@ - - @@ -2196,8 +2120,6 @@ - - @@ -2216,8 +2138,6 @@ - - @@ -2236,8 +2156,6 @@ - - @@ -2256,8 +2174,6 @@ - - @@ -2276,8 +2192,6 @@ - - @@ -2292,8 +2206,6 @@ - - @@ -2312,8 +2224,6 @@ - - @@ -2332,8 +2242,6 @@ - - @@ -2352,8 +2260,6 @@ - - @@ -2372,8 +2278,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38900-38999.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38900-38999.xml index f66881e8db..50828b5172 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38900-38999.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/38900-38999.xml @@ -204,8 +204,6 @@ - - @@ -224,8 +222,6 @@ - - @@ -244,8 +240,6 @@ - - @@ -263,8 +257,6 @@ - - @@ -282,8 +274,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/39600-39699.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/39600-39699.xml index 901cedadeb..e718a8371d 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/39600-39699.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/39600-39699.xml @@ -895,8 +895,6 @@ - - @@ -910,8 +908,6 @@ - - @@ -924,8 +920,6 @@ - - @@ -938,8 +932,6 @@ - - @@ -952,8 +944,6 @@ - - @@ -966,8 +956,6 @@ - - @@ -980,8 +968,6 @@ - - @@ -994,8 +980,6 @@ - - @@ -1008,8 +992,6 @@ - - @@ -1022,8 +1004,6 @@ - - @@ -1036,8 +1016,6 @@ - - @@ -1050,8 +1028,6 @@ - - @@ -1064,8 +1040,6 @@ - - @@ -1078,8 +1052,6 @@ - - @@ -1091,8 +1063,6 @@ - - @@ -1104,8 +1074,6 @@ - - @@ -1117,8 +1085,6 @@ - - @@ -1130,8 +1096,6 @@ - - @@ -1143,8 +1107,6 @@ - - @@ -1156,8 +1118,6 @@ - - @@ -1169,8 +1129,6 @@ - - @@ -1182,8 +1140,6 @@ - - @@ -1195,8 +1151,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/46400-46499.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/46400-46499.xml index 73e7f4ffb2..97f2adff79 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/46400-46499.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/46400-46499.xml @@ -558,56 +558,42 @@ - - - - - - - - - - - - - - @@ -662,56 +648,42 @@ - - - - - - - - - - - - - - @@ -766,56 +738,42 @@ - - - - - - - - - - - - - - @@ -870,56 +828,42 @@ - - - - - - - - - - - - - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/46500-46599.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/46500-46599.xml index 8afcfacebe..a03a02cc97 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/46500-46599.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/46500-46599.xml @@ -27,56 +27,42 @@ - - - - - - - - - - - - - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/46600-46699.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/46600-46699.xml index 9ebbe0e10e..bc78ef5192 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/46600-46699.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/46600-46699.xml @@ -1021,8 +1021,6 @@ - - @@ -1037,8 +1035,6 @@ - - @@ -1053,8 +1049,6 @@ - - @@ -1069,8 +1063,6 @@ - - @@ -1094,8 +1086,6 @@ - - @@ -1113,8 +1103,6 @@ - - @@ -1132,8 +1120,6 @@ - - @@ -1151,8 +1137,6 @@ - - @@ -1183,8 +1167,6 @@ - - @@ -1202,8 +1184,6 @@ - - @@ -1221,8 +1201,6 @@ - - @@ -1240,8 +1218,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/47600-47699.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/47600-47699.xml index 6c62a5559a..9e7116402f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/47600-47699.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/stats/items/47600-47699.xml @@ -787,8 +787,6 @@ - - @@ -806,8 +804,6 @@ - - @@ -825,8 +821,6 @@ - - @@ -844,8 +838,6 @@ - - @@ -863,8 +855,6 @@ - - @@ -878,8 +868,6 @@ - - @@ -897,8 +885,6 @@ - - @@ -916,8 +902,6 @@ - - @@ -935,8 +919,6 @@ - - @@ -954,8 +936,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/xsd/CombinationItems.xsd b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/xsd/CombinationItems.xsd new file mode 100644 index 0000000000..41d3436015 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/xsd/CombinationItems.xsd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/xsd/items.xsd b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/xsd/items.xsd index 96ebd3accb..d8b9c85651 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/xsd/items.xsd +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/xsd/items.xsd @@ -134,8 +134,6 @@ - - diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/commons/util/CommonUtil.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/commons/util/CommonUtil.java index bfba2b32b6..16530e4fcf 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/commons/util/CommonUtil.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/commons/util/CommonUtil.java @@ -21,12 +21,15 @@ import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.nio.ByteBuffer; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; import java.time.DayOfWeek; import java.time.LocalDateTime; import java.time.temporal.TemporalAdjusters; import java.util.Arrays; import java.util.Comparator; import java.util.List; +import java.util.Locale; import java.util.StringJoiner; import java.util.StringTokenizer; @@ -573,4 +576,15 @@ public final class CommonUtil } return sj.toString(); } + + /** + * @param val + * @param format + * @return + */ + public static String formatDouble(double val, String format) + { + final DecimalFormat formatter = new DecimalFormat(format, new DecimalFormatSymbols(Locale.ENGLISH)); + return formatter.format(val); + } } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/GameServer.java index c4eff45fb4..42e05b8650 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/GameServer.java @@ -49,6 +49,7 @@ import com.l2jmobius.gameserver.data.xml.impl.CategoryData; import com.l2jmobius.gameserver.data.xml.impl.ClanHallData; import com.l2jmobius.gameserver.data.xml.impl.ClanRewardData; import com.l2jmobius.gameserver.data.xml.impl.ClassListData; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.data.xml.impl.CubicData; import com.l2jmobius.gameserver.data.xml.impl.DailyMissionData; import com.l2jmobius.gameserver.data.xml.impl.DoorData; @@ -205,6 +206,7 @@ public class GameServer ActionData.getInstance(); CategoryData.getInstance(); SecondaryAuthData.getInstance(); + CombinationItemsData.getInstance(); SayuneData.getInstance(); ClanRewardData.getInstance(); DailyMissionHandler.getInstance().executeScript(); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java new file mode 100644 index 0000000000..a7e90d5f89 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java @@ -0,0 +1,111 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.data.xml.impl; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Logger; +import java.util.stream.Collectors; + +import org.w3c.dom.Document; + +import com.l2jmobius.commons.util.IGameXmlReader; +import com.l2jmobius.gameserver.datatables.ItemTable; +import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemReward; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemType; + +/** + * @author UnAfraid + */ +public class CombinationItemsData implements IGameXmlReader +{ + private static final Logger LOGGER = Logger.getLogger(CombinationItemsData.class.getName()); + private final List _items = new ArrayList<>(); + + protected CombinationItemsData() + { + load(); + } + + @Override + public synchronized void load() + { + _items.clear(); + parseDatapackFile("data/CombinationItems.xml"); + LOGGER.info(getClass().getSimpleName() + ": Loaded " + _items.size() + " combinations."); + } + + @Override + public void parseDocument(Document doc, File f) + { + forEach(doc, "list", listNode -> forEach(listNode, "item", itemNode -> + { + final CombinationItem item = new CombinationItem(new StatsSet(parseAttributes(itemNode))); + + forEach(itemNode, "reward", rewardNode -> + { + final int id = parseInteger(rewardNode.getAttributes(), "id"); + final int count = parseInteger(rewardNode.getAttributes(), "count", 1); + final CombinationItemType type = parseEnum(rewardNode.getAttributes(), CombinationItemType.class, "type"); + item.addReward(new CombinationItemReward(id, count, type)); + if (ItemTable.getInstance().getTemplate(id) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find item with id " + id); + } + }); + _items.add(item); + })); + } + + public int getLoadedElementsCount() + { + return _items.size(); + } + + public List getItems() + { + return _items; + } + + public CombinationItem getItemsBySlots(int firstSlot, int secondSlot) + { + return _items.stream().filter(item -> (item.getItemOne() == firstSlot) && (item.getItemTwo() == secondSlot)).findFirst().orElse(null); + } + + public List getItemsByFirstSlot(int id) + { + return _items.stream().filter(item -> item.getItemOne() == id).collect(Collectors.toList()); + } + + public List getItemsBySecondSlot(int id) + { + return _items.stream().filter(item -> item.getItemTwo() == id).collect(Collectors.toList()); + } + + public static final CombinationItemsData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final CombinationItemsData INSTANCE = new CombinationItemsData(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/L2Item.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/L2Item.java index 0f672fa66d..69f76f8772 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/L2Item.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/L2Item.java @@ -170,8 +170,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable private int _sharedReuseGroup; private CommissionItemType _commissionItemType; - private int _compoundItem; - private float _compoundChance; private boolean _isAppearanceable; private boolean _isBlessed; @@ -230,8 +228,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable _reuseDelay = set.getInt("reuse_delay", 0); _sharedReuseGroup = set.getInt("shared_reuse_group", 0); _commissionItemType = set.getEnum("commissionItemType", CommissionItemType.class, CommissionItemType.OTHER_ITEM); - _compoundItem = set.getInt("compoundItem", 0); - _compoundChance = set.getFloat("compoundChance", 0); _common = ((_itemId >= 11605) && (_itemId <= 12361)); _heroItem = ((_itemId >= 6611) && (_itemId <= 6621)) || ((_itemId >= 9388) && (_itemId <= 9390)) || (_itemId == 6842); _pvpItem = ((_itemId >= 10667) && (_itemId <= 10835)) || ((_itemId >= 12852) && (_itemId <= 12977)) || ((_itemId >= 14363) && (_itemId <= 14525)) || (_itemId == 14528) || (_itemId == 14529) || (_itemId == 14558) || ((_itemId >= 15913) && (_itemId <= 16024)) || ((_itemId >= 16134) && (_itemId <= 16147)) || (_itemId == 16149) || (_itemId == 16151) || (_itemId == 16153) || (_itemId == 16155) || (_itemId == 16157) || (_itemId == 16159) || ((_itemId >= 16168) && (_itemId <= 16176)) || ((_itemId >= 16179) && (_itemId <= 16220)); @@ -961,16 +957,6 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable return _commissionItemType; } - public int getCompoundItem() - { - return _compoundItem; - } - - public float getCompoundChance() - { - return _compoundChance; - } - /** * Usable in HTML windows. * @return the icon link in client files diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java new file mode 100644 index 0000000000..d186f635fe --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java @@ -0,0 +1,65 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.model.items.combination; + +import java.util.EnumMap; +import java.util.Map; + +import com.l2jmobius.gameserver.model.StatsSet; + +/** + * @author UnAfraid + */ +public class CombinationItem +{ + private final int _itemOne; + private final int _itemTwo; + private final int _chance; + private final Map _rewards = new EnumMap<>(CombinationItemType.class); + + public CombinationItem(StatsSet set) + { + _itemOne = set.getInt("one"); + _itemTwo = set.getInt("two"); + _chance = set.getInt("chance"); + } + + public int getItemOne() + { + return _itemOne; + } + + public int getItemTwo() + { + return _itemTwo; + } + + public int getChance() + { + return _chance; + } + + public void addReward(CombinationItemReward item) + { + _rewards.put(item.getType(), item); + } + + public CombinationItemReward getReward(CombinationItemType type) + { + return _rewards.get(type); + } +} diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java new file mode 100644 index 0000000000..c84363b0b2 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java @@ -0,0 +1,38 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.model.items.combination; + +import com.l2jmobius.gameserver.model.holders.ItemHolder; + +/** + * @author UnAfraid + */ +public class CombinationItemReward extends ItemHolder +{ + private final CombinationItemType _type; + + public CombinationItemReward(int id, int count, CombinationItemType type) + { + super(id, count); + _type = type; + } + + public CombinationItemType getType() + { + return _type; + } +} diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java new file mode 100644 index 0000000000..252c81fea6 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java @@ -0,0 +1,26 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.model.items.combination; + +/** + * @author UnAfraid + */ +public enum CombinationItemType +{ + ON_SUCCESS, + ON_FAILURE; +} diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java index 58913e355d..56e16b9204 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/ExIncomingPackets.java @@ -61,6 +61,7 @@ import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchant import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantPushTwo; import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantRemoveOne; import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantRemoveTwo; +import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantRetryToPutItems; import com.l2jmobius.gameserver.network.clientpackets.compound.RequestNewEnchantTry; import com.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeEstimate; import com.l2jmobius.gameserver.network.clientpackets.crystalization.RequestCrystallizeItemCancel; diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestNewEnchantRetryToPutItems.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestNewEnchantRetryToPutItems.java deleted file mode 100644 index 4d990dbae3..0000000000 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestNewEnchantRetryToPutItems.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * This file is part of the L2J Mobius project. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.l2jmobius.gameserver.network.clientpackets; - -import com.l2jmobius.commons.network.PacketReader; -import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; -import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; -import com.l2jmobius.gameserver.network.L2GameClient; -import com.l2jmobius.gameserver.network.SystemMessageId; -import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemFail; -import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemOk; - -/** - * @author Sdw - */ -public class RequestNewEnchantRetryToPutItems implements IClientIncomingPacket -{ - private int _firstItemObjectId; - private int _secondItemObjectId; - - @Override - public boolean read(L2GameClient client, PacketReader packet) - { - _firstItemObjectId = packet.readD(); - _secondItemObjectId = packet.readD(); - return true; - } - - @Override - public void run(L2GameClient client) - { - final L2PcInstance activeChar = client.getActiveChar(); - if (activeChar == null) - { - return; - } - else if (activeChar.isInStoreMode()) - { - client.sendPacket(SystemMessageId.YOU_CANNOT_DO_THAT_WHILE_IN_A_PRIVATE_STORE_OR_PRIVATE_WORKSHOP); - client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); - return; - } - else if (activeChar.isProcessingTransaction() || activeChar.isProcessingRequest()) - { - client.sendPacket(SystemMessageId.YOU_CANNOT_USE_THIS_SYSTEM_DURING_TRADING_PRIVATE_STORE_AND_WORKSHOP_SETUP); - client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); - return; - } - - final CompoundRequest request = new CompoundRequest(activeChar); - if (!activeChar.addRequest(request)) - { - client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); - return; - } - - // Make sure player owns first item. - request.setItemOne(_firstItemObjectId); - final L2ItemInstance itemOne = request.getItemOne(); - if (itemOne == null) - { - client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); - activeChar.removeRequest(request.getClass()); - return; - } - - // Make sure player owns second item. - request.setItemTwo(_secondItemObjectId); - final L2ItemInstance itemTwo = request.getItemTwo(); - if (itemTwo == null) - { - client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); - activeChar.removeRequest(request.getClass()); - return; - } - - // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) - { - client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); - activeChar.removeRequest(request.getClass()); - return; - } - - client.sendPacket(ExEnchantRetryToPutItemOk.STATIC_PACKET); - } -} diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java index 198dcb3bc5..4bb19b2b40 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java @@ -16,9 +16,13 @@ */ package com.l2jmobius.gameserver.network.clientpackets.compound; +import java.util.List; + import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -78,8 +82,10 @@ public class RequestNewEnchantPushOne implements IClientIncomingPacket return; } + final List combinationItems = CombinationItemsData.getInstance().getItemsByFirstSlot(itemOne.getId()); + // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) + if (combinationItems.isEmpty()) { client.sendPacket(ExEnchantOneFail.STATIC_PACKET); activeChar.removeRequest(request.getClass()); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java index 9bb1e53e8c..a0317b61be 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java @@ -17,8 +17,10 @@ package com.l2jmobius.gameserver.network.clientpackets.compound; import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -86,15 +88,10 @@ public class RequestNewEnchantPushTwo implements IClientIncomingPacket return; } - // Combining only same items! - if (itemOne.getItem().getId() != itemTwo.getItem().getId()) - { - client.sendPacket(ExEnchantTwoFail.STATIC_PACKET); - return; - } + final CombinationItem combinationItem = CombinationItemsData.getInstance().getItemsBySlots(itemOne.getId(), itemTwo.getId()); // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) + if (combinationItem == null) { client.sendPacket(ExEnchantTwoFail.STATIC_PACKET); return; diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestNewEnchantRetryToPutItems.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantRetryToPutItems.java similarity index 82% rename from L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestNewEnchantRetryToPutItems.java rename to L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantRetryToPutItems.java index a45b5d9e0e..b6d01155ef 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestNewEnchantRetryToPutItems.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantRetryToPutItems.java @@ -1,102 +1,108 @@ -/* - * This file is part of the L2J Mobius project. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.l2jmobius.gameserver.network.clientpackets; - -import com.l2jmobius.commons.network.PacketReader; -import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; -import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; -import com.l2jmobius.gameserver.network.L2GameClient; -import com.l2jmobius.gameserver.network.SystemMessageId; -import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemFail; -import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemOk; - -/** - * @author Sdw - */ -public class RequestNewEnchantRetryToPutItems implements IClientIncomingPacket -{ - private int _firstItemObjectId; - private int _secondItemObjectId; - - @Override - public boolean read(L2GameClient client, PacketReader packet) - { - _firstItemObjectId = packet.readD(); - _secondItemObjectId = packet.readD(); - return true; - } - - @Override - public void run(L2GameClient client) - { - final L2PcInstance activeChar = client.getActiveChar(); - if (activeChar == null) - { - return; - } - else if (activeChar.isInStoreMode()) - { - client.sendPacket(SystemMessageId.YOU_CANNOT_DO_THAT_WHILE_IN_A_PRIVATE_STORE_OR_PRIVATE_WORKSHOP); - client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); - return; - } - else if (activeChar.isProcessingTransaction() || activeChar.isProcessingRequest()) - { - client.sendPacket(SystemMessageId.YOU_CANNOT_USE_THIS_SYSTEM_DURING_TRADING_PRIVATE_STORE_AND_WORKSHOP_SETUP); - client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); - return; - } - - final CompoundRequest request = new CompoundRequest(activeChar); - if (!activeChar.addRequest(request)) - { - client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); - return; - } - - // Make sure player owns first item. - request.setItemOne(_firstItemObjectId); - final L2ItemInstance itemOne = request.getItemOne(); - if (itemOne == null) - { - client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); - activeChar.removeRequest(request.getClass()); - return; - } - - // Make sure player owns second item. - request.setItemTwo(_secondItemObjectId); - final L2ItemInstance itemTwo = request.getItemTwo(); - if (itemTwo == null) - { - client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); - activeChar.removeRequest(request.getClass()); - return; - } - - // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) - { - client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); - activeChar.removeRequest(request.getClass()); - return; - } - - client.sendPacket(ExEnchantRetryToPutItemOk.STATIC_PACKET); - } -} +/* + * Copyright (C) 2004-2016 L2J Unity + * + * This file is part of L2J Unity. + * + * L2J Unity is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * L2J Unity is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.network.clientpackets.compound; + +import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; +import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; +import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; +import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; +import com.l2jmobius.gameserver.network.L2GameClient; +import com.l2jmobius.gameserver.network.SystemMessageId; +import com.l2jmobius.gameserver.network.clientpackets.IClientIncomingPacket; +import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemFail; +import com.l2jmobius.gameserver.network.serverpackets.ExEnchantRetryToPutItemOk; + +/** + * @author Sdw + */ +public class RequestNewEnchantRetryToPutItems implements IClientIncomingPacket +{ + private int _firstItemObjectId; + private int _secondItemObjectId; + + @Override + public boolean read(L2GameClient client, PacketReader packet) + { + _firstItemObjectId = packet.readD(); + _secondItemObjectId = packet.readD(); + return true; + } + + @Override + public void run(L2GameClient client) + { + final L2PcInstance activeChar = client.getActiveChar(); + if (activeChar == null) + { + return; + } + else if (activeChar.isInStoreMode()) + { + client.sendPacket(SystemMessageId.YOU_CANNOT_DO_THAT_WHILE_IN_A_PRIVATE_STORE_OR_PRIVATE_WORKSHOP); + client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); + return; + } + else if (activeChar.isProcessingTransaction() || activeChar.isProcessingRequest()) + { + client.sendPacket(SystemMessageId.YOU_CANNOT_USE_THIS_SYSTEM_DURING_TRADING_PRIVATE_STORE_AND_WORKSHOP_SETUP); + client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); + return; + } + + final CompoundRequest request = new CompoundRequest(activeChar); + if (!activeChar.addRequest(request)) + { + client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); + return; + } + + // Make sure player owns first item. + request.setItemOne(_firstItemObjectId); + final L2ItemInstance itemOne = request.getItemOne(); + if (itemOne == null) + { + client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); + activeChar.removeRequest(request.getClass()); + return; + } + + // Make sure player owns second item. + request.setItemTwo(_secondItemObjectId); + final L2ItemInstance itemTwo = request.getItemTwo(); + if (itemTwo == null) + { + client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); + activeChar.removeRequest(request.getClass()); + return; + } + + final CombinationItem combinationItem = CombinationItemsData.getInstance().getItemsBySlots(itemOne.getId(), itemTwo.getId()); + + // Not implemented or not able to merge! + if (combinationItem == null) + { + client.sendPacket(ExEnchantRetryToPutItemFail.STATIC_PACKET); + activeChar.removeRequest(request.getClass()); + return; + } + client.sendPacket(ExEnchantRetryToPutItemOk.STATIC_PACKET); + } +} diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java index 2143d745d5..6858e0b447 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java @@ -18,8 +18,12 @@ package com.l2jmobius.gameserver.network.clientpackets.compound; import com.l2jmobius.commons.network.PacketReader; import com.l2jmobius.commons.util.Rnd; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemReward; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemType; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -82,50 +86,39 @@ public class RequestNewEnchantTry implements IClientIncomingPacket // Lets prevent using same item twice if (itemOne.getObjectId() == itemTwo.getObjectId()) { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); + client.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId())); activeChar.removeRequest(request.getClass()); return; } - // Combining only same items! - if (itemOne.getItem().getId() != itemTwo.getItem().getId()) - { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); - activeChar.removeRequest(request.getClass()); - return; - } + final CombinationItem combinationItem = CombinationItemsData.getInstance().getItemsBySlots(itemOne.getId(), itemTwo.getId()); // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) + if (combinationItem == null) { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); + client.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId())); activeChar.removeRequest(request.getClass()); return; } final InventoryUpdate iu = new InventoryUpdate(); - final double random = Rnd.nextDouble() * 100; + iu.addRemovedItem(itemOne); + iu.addRemovedItem(itemTwo); - // Success - if (random < itemOne.getItem().getCompoundChance()) + if (activeChar.destroyItem("Compound-Item-One", itemOne, 1, null, true) && activeChar.destroyItem("Compound-Item-Two", itemTwo, 1, null, true)) { - iu.addRemovedItem(itemOne); - iu.addRemovedItem(itemTwo); + final double random = (Rnd.nextDouble() * 100); + final boolean success = random <= combinationItem.getChance(); + final CombinationItemReward rewardItem = combinationItem.getReward(success ? CombinationItemType.ON_SUCCESS : CombinationItemType.ON_FAILURE); + final L2ItemInstance item = activeChar.addItem("Compound-Result", rewardItem.getId(), rewardItem.getCount(), null, true); - if (activeChar.destroyItem("Compound-Item-One", itemOne, null, true) && activeChar.destroyItem("Compound-Item-Two", itemTwo, null, true)) + if (success) { - final L2ItemInstance item = activeChar.addItem("Compound-Result", itemOne.getItem().getCompoundItem(), 1, null, true); - client.sendPacket(new ExEnchantSucess(item.getItem().getId())); + client.sendPacket(new ExEnchantSucess(item.getId())); } - } - else - { - iu.addRemovedItem(itemTwo); - - // Upon fail we destroy the second item. - if (activeChar.destroyItem("Compound-Item-Two-Fail", itemTwo, null, true)) + else { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); + client.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId())); } } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemFail.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemFail.java new file mode 100644 index 0000000000..f471f5717b --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemFail.java @@ -0,0 +1,40 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.network.serverpackets.compound; + +import com.l2jmobius.commons.network.PacketWriter; +import com.l2jmobius.gameserver.network.OutgoingPackets; +import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Sdw + */ +public class ExEnchantRetryToPutItemFail implements IClientOutgoingPacket +{ + public static final ExEnchantRetryToPutItemFail STATIC_PACKET = new ExEnchantRetryToPutItemFail(); + + private ExEnchantRetryToPutItemFail() + { + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_ENCHANT_RETRY_TO_PUT_ITEM_FAIL.writeId(packet); + return true; + } +} \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemOk.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemOk.java new file mode 100644 index 0000000000..8fb0127cc3 --- /dev/null +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemOk.java @@ -0,0 +1,40 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.network.serverpackets.compound; + +import com.l2jmobius.commons.network.PacketWriter; +import com.l2jmobius.gameserver.network.OutgoingPackets; +import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Sdw + */ +public class ExEnchantRetryToPutItemOk implements IClientOutgoingPacket +{ + public static final ExEnchantRetryToPutItemOk STATIC_PACKET = new ExEnchantRetryToPutItemOk(); + + private ExEnchantRetryToPutItemOk() + { + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_ENCHANT_RETRY_TO_PUT_ITEM_OK.writeId(packet); + return true; + } +} \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/CombinationItems.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/CombinationItems.xml new file mode 100644 index 0000000000..9a4a23dd7b --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/CombinationItems.xml @@ -0,0 +1,395 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/xsd/CombinationItems.xsd b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/xsd/CombinationItems.xsd new file mode 100644 index 0000000000..eb06810c8c --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/xsd/CombinationItems.xsd @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/xsd/items.xsd b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/xsd/items.xsd index 0d549aac73..07c094d467 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/xsd/items.xsd +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/xsd/items.xsd @@ -134,8 +134,6 @@ - - diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/commons/util/CommonUtil.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/commons/util/CommonUtil.java index bfba2b32b6..16530e4fcf 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/commons/util/CommonUtil.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/commons/util/CommonUtil.java @@ -21,12 +21,15 @@ import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.nio.ByteBuffer; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; import java.time.DayOfWeek; import java.time.LocalDateTime; import java.time.temporal.TemporalAdjusters; import java.util.Arrays; import java.util.Comparator; import java.util.List; +import java.util.Locale; import java.util.StringJoiner; import java.util.StringTokenizer; @@ -573,4 +576,15 @@ public final class CommonUtil } return sj.toString(); } + + /** + * @param val + * @param format + * @return + */ + public static String formatDouble(double val, String format) + { + final DecimalFormat formatter = new DecimalFormat(format, new DecimalFormatSymbols(Locale.ENGLISH)); + return formatter.format(val); + } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/GameServer.java index a1bf63cf3e..3b0dc7e5d7 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/GameServer.java @@ -50,6 +50,7 @@ import com.l2jmobius.gameserver.data.xml.impl.CategoryData; import com.l2jmobius.gameserver.data.xml.impl.ClanHallData; import com.l2jmobius.gameserver.data.xml.impl.ClanRewardData; import com.l2jmobius.gameserver.data.xml.impl.ClassListData; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.data.xml.impl.CubicData; import com.l2jmobius.gameserver.data.xml.impl.DailyMissionData; import com.l2jmobius.gameserver.data.xml.impl.DoorData; @@ -204,6 +205,7 @@ public class GameServer CategoryData.getInstance(); SecondaryAuthData.getInstance(); AbilityPointsData.getInstance(); + CombinationItemsData.getInstance(); SayuneData.getInstance(); ClanRewardData.getInstance(); DailyMissionHandler.getInstance().executeScript(); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java new file mode 100644 index 0000000000..a7e90d5f89 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/CombinationItemsData.java @@ -0,0 +1,111 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.data.xml.impl; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Logger; +import java.util.stream.Collectors; + +import org.w3c.dom.Document; + +import com.l2jmobius.commons.util.IGameXmlReader; +import com.l2jmobius.gameserver.datatables.ItemTable; +import com.l2jmobius.gameserver.model.StatsSet; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemReward; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemType; + +/** + * @author UnAfraid + */ +public class CombinationItemsData implements IGameXmlReader +{ + private static final Logger LOGGER = Logger.getLogger(CombinationItemsData.class.getName()); + private final List _items = new ArrayList<>(); + + protected CombinationItemsData() + { + load(); + } + + @Override + public synchronized void load() + { + _items.clear(); + parseDatapackFile("data/CombinationItems.xml"); + LOGGER.info(getClass().getSimpleName() + ": Loaded " + _items.size() + " combinations."); + } + + @Override + public void parseDocument(Document doc, File f) + { + forEach(doc, "list", listNode -> forEach(listNode, "item", itemNode -> + { + final CombinationItem item = new CombinationItem(new StatsSet(parseAttributes(itemNode))); + + forEach(itemNode, "reward", rewardNode -> + { + final int id = parseInteger(rewardNode.getAttributes(), "id"); + final int count = parseInteger(rewardNode.getAttributes(), "count", 1); + final CombinationItemType type = parseEnum(rewardNode.getAttributes(), CombinationItemType.class, "type"); + item.addReward(new CombinationItemReward(id, count, type)); + if (ItemTable.getInstance().getTemplate(id) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find item with id " + id); + } + }); + _items.add(item); + })); + } + + public int getLoadedElementsCount() + { + return _items.size(); + } + + public List getItems() + { + return _items; + } + + public CombinationItem getItemsBySlots(int firstSlot, int secondSlot) + { + return _items.stream().filter(item -> (item.getItemOne() == firstSlot) && (item.getItemTwo() == secondSlot)).findFirst().orElse(null); + } + + public List getItemsByFirstSlot(int id) + { + return _items.stream().filter(item -> item.getItemOne() == id).collect(Collectors.toList()); + } + + public List getItemsBySecondSlot(int id) + { + return _items.stream().filter(item -> item.getItemTwo() == id).collect(Collectors.toList()); + } + + public static final CombinationItemsData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final CombinationItemsData INSTANCE = new CombinationItemsData(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java new file mode 100644 index 0000000000..d186f635fe --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/combination/CombinationItem.java @@ -0,0 +1,65 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.model.items.combination; + +import java.util.EnumMap; +import java.util.Map; + +import com.l2jmobius.gameserver.model.StatsSet; + +/** + * @author UnAfraid + */ +public class CombinationItem +{ + private final int _itemOne; + private final int _itemTwo; + private final int _chance; + private final Map _rewards = new EnumMap<>(CombinationItemType.class); + + public CombinationItem(StatsSet set) + { + _itemOne = set.getInt("one"); + _itemTwo = set.getInt("two"); + _chance = set.getInt("chance"); + } + + public int getItemOne() + { + return _itemOne; + } + + public int getItemTwo() + { + return _itemTwo; + } + + public int getChance() + { + return _chance; + } + + public void addReward(CombinationItemReward item) + { + _rewards.put(item.getType(), item); + } + + public CombinationItemReward getReward(CombinationItemType type) + { + return _rewards.get(type); + } +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java new file mode 100644 index 0000000000..c84363b0b2 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemReward.java @@ -0,0 +1,38 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.model.items.combination; + +import com.l2jmobius.gameserver.model.holders.ItemHolder; + +/** + * @author UnAfraid + */ +public class CombinationItemReward extends ItemHolder +{ + private final CombinationItemType _type; + + public CombinationItemReward(int id, int count, CombinationItemType type) + { + super(id, count); + _type = type; + } + + public CombinationItemType getType() + { + return _type; + } +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java new file mode 100644 index 0000000000..252c81fea6 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/items/combination/CombinationItemType.java @@ -0,0 +1,26 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.model.items.combination; + +/** + * @author UnAfraid + */ +public enum CombinationItemType +{ + ON_SUCCESS, + ON_FAILURE; +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java index 198dcb3bc5..4bb19b2b40 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushOne.java @@ -16,9 +16,13 @@ */ package com.l2jmobius.gameserver.network.clientpackets.compound; +import java.util.List; + import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -78,8 +82,10 @@ public class RequestNewEnchantPushOne implements IClientIncomingPacket return; } + final List combinationItems = CombinationItemsData.getInstance().getItemsByFirstSlot(itemOne.getId()); + // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) + if (combinationItems.isEmpty()) { client.sendPacket(ExEnchantOneFail.STATIC_PACKET); activeChar.removeRequest(request.getClass()); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java index 9bb1e53e8c..a0317b61be 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantPushTwo.java @@ -17,8 +17,10 @@ package com.l2jmobius.gameserver.network.clientpackets.compound; import com.l2jmobius.commons.network.PacketReader; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -86,15 +88,10 @@ public class RequestNewEnchantPushTwo implements IClientIncomingPacket return; } - // Combining only same items! - if (itemOne.getItem().getId() != itemTwo.getItem().getId()) - { - client.sendPacket(ExEnchantTwoFail.STATIC_PACKET); - return; - } + final CombinationItem combinationItem = CombinationItemsData.getInstance().getItemsBySlots(itemOne.getId(), itemTwo.getId()); // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) + if (combinationItem == null) { client.sendPacket(ExEnchantTwoFail.STATIC_PACKET); return; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java index 2143d745d5..6858e0b447 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/compound/RequestNewEnchantTry.java @@ -18,8 +18,12 @@ package com.l2jmobius.gameserver.network.clientpackets.compound; import com.l2jmobius.commons.network.PacketReader; import com.l2jmobius.commons.util.Rnd; +import com.l2jmobius.gameserver.data.xml.impl.CombinationItemsData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.request.CompoundRequest; +import com.l2jmobius.gameserver.model.items.combination.CombinationItem; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemReward; +import com.l2jmobius.gameserver.model.items.combination.CombinationItemType; import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -82,50 +86,39 @@ public class RequestNewEnchantTry implements IClientIncomingPacket // Lets prevent using same item twice if (itemOne.getObjectId() == itemTwo.getObjectId()) { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); + client.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId())); activeChar.removeRequest(request.getClass()); return; } - // Combining only same items! - if (itemOne.getItem().getId() != itemTwo.getItem().getId()) - { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); - activeChar.removeRequest(request.getClass()); - return; - } + final CombinationItem combinationItem = CombinationItemsData.getInstance().getItemsBySlots(itemOne.getId(), itemTwo.getId()); // Not implemented or not able to merge! - if ((itemOne.getItem().getCompoundItem() == 0) || (itemOne.getItem().getCompoundChance() == 0)) + if (combinationItem == null) { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); + client.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId())); activeChar.removeRequest(request.getClass()); return; } final InventoryUpdate iu = new InventoryUpdate(); - final double random = Rnd.nextDouble() * 100; + iu.addRemovedItem(itemOne); + iu.addRemovedItem(itemTwo); - // Success - if (random < itemOne.getItem().getCompoundChance()) + if (activeChar.destroyItem("Compound-Item-One", itemOne, 1, null, true) && activeChar.destroyItem("Compound-Item-Two", itemTwo, 1, null, true)) { - iu.addRemovedItem(itemOne); - iu.addRemovedItem(itemTwo); + final double random = (Rnd.nextDouble() * 100); + final boolean success = random <= combinationItem.getChance(); + final CombinationItemReward rewardItem = combinationItem.getReward(success ? CombinationItemType.ON_SUCCESS : CombinationItemType.ON_FAILURE); + final L2ItemInstance item = activeChar.addItem("Compound-Result", rewardItem.getId(), rewardItem.getCount(), null, true); - if (activeChar.destroyItem("Compound-Item-One", itemOne, null, true) && activeChar.destroyItem("Compound-Item-Two", itemTwo, null, true)) + if (success) { - final L2ItemInstance item = activeChar.addItem("Compound-Result", itemOne.getItem().getCompoundItem(), 1, null, true); - client.sendPacket(new ExEnchantSucess(item.getItem().getId())); + client.sendPacket(new ExEnchantSucess(item.getId())); } - } - else - { - iu.addRemovedItem(itemTwo); - - // Upon fail we destroy the second item. - if (activeChar.destroyItem("Compound-Item-Two-Fail", itemTwo, null, true)) + else { - client.sendPacket(new ExEnchantFail(itemOne.getItem().getId(), itemTwo.getItem().getId())); + client.sendPacket(new ExEnchantFail(itemOne.getId(), itemTwo.getId())); } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemFail.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemFail.java new file mode 100644 index 0000000000..f471f5717b --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemFail.java @@ -0,0 +1,40 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.network.serverpackets.compound; + +import com.l2jmobius.commons.network.PacketWriter; +import com.l2jmobius.gameserver.network.OutgoingPackets; +import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Sdw + */ +public class ExEnchantRetryToPutItemFail implements IClientOutgoingPacket +{ + public static final ExEnchantRetryToPutItemFail STATIC_PACKET = new ExEnchantRetryToPutItemFail(); + + private ExEnchantRetryToPutItemFail() + { + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_ENCHANT_RETRY_TO_PUT_ITEM_FAIL.writeId(packet); + return true; + } +} \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemOk.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemOk.java new file mode 100644 index 0000000000..8fb0127cc3 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/serverpackets/compound/ExEnchantRetryToPutItemOk.java @@ -0,0 +1,40 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.l2jmobius.gameserver.network.serverpackets.compound; + +import com.l2jmobius.commons.network.PacketWriter; +import com.l2jmobius.gameserver.network.OutgoingPackets; +import com.l2jmobius.gameserver.network.serverpackets.IClientOutgoingPacket; + +/** + * @author Sdw + */ +public class ExEnchantRetryToPutItemOk implements IClientOutgoingPacket +{ + public static final ExEnchantRetryToPutItemOk STATIC_PACKET = new ExEnchantRetryToPutItemOk(); + + private ExEnchantRetryToPutItemOk() + { + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_ENCHANT_RETRY_TO_PUT_ITEM_OK.writeId(packet); + return true; + } +} \ No newline at end of file