From 6988c207b2919e529243879cf182bf34c81664ba Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Fri, 25 Dec 2020 01:44:36 +0000 Subject: [PATCH] Agathion related rework. --- .../dist/game/data/AgathionData.xml | 3394 +++++++++++++++ .../game/data/stats/items/28700-28799.xml | 62 - .../game/data/stats/items/28800-28899.xml | 200 - .../game/data/stats/items/28900-28999.xml | 200 - .../game/data/stats/items/29000-29099.xml | 148 - .../game/data/stats/items/29100-29199.xml | 14 - .../game/data/stats/items/48100-48199.xml | 13 +- .../game/data/stats/items/48200-48299.xml | 5 +- .../dist/game/data/xsd/AgathionData.xsd | 20 + .../org/l2jmobius/gameserver/GameServer.java | 2 + .../gameserver/data/xml/AgathionData.java | 136 + .../model/holders/AgathionSkillHolder.java | 64 + .../model/itemcontainer/Inventory.java | 71 +- .../gameserver/model/items/Item.java | 7 + .../model/items/instance/ItemInstance.java | 54 + .../network/clientpackets/EnterWorld.java | 8 + .../dist/game/data/AgathionData.xml | 3654 ++++++++++++++++ .../game/data/stats/items/28700-28799.xml | 62 - .../game/data/stats/items/28800-28899.xml | 200 - .../game/data/stats/items/28900-28999.xml | 200 - .../game/data/stats/items/29000-29099.xml | 148 - .../game/data/stats/items/29100-29199.xml | 14 - .../game/data/stats/items/48100-48199.xml | 13 +- .../game/data/stats/items/48200-48299.xml | 5 +- .../game/data/stats/items/48500-48599.xml | 63 +- .../dist/game/data/xsd/AgathionData.xsd | 20 + .../org/l2jmobius/gameserver/GameServer.java | 2 + .../gameserver/data/xml/AgathionData.java | 136 + .../model/holders/AgathionSkillHolder.java | 64 + .../model/itemcontainer/Inventory.java | 71 +- .../gameserver/model/items/Item.java | 7 + .../model/items/instance/ItemInstance.java | 54 + .../network/clientpackets/EnterWorld.java | 8 + .../dist/game/data/AgathionData.xml | 3652 ++++++++++++++++ .../game/data/stats/items/28700-28799.xml | 62 - .../game/data/stats/items/28800-28899.xml | 200 - .../game/data/stats/items/28900-28999.xml | 200 - .../game/data/stats/items/29000-29099.xml | 148 - .../game/data/stats/items/29100-29199.xml | 14 - .../game/data/stats/items/48100-48199.xml | 13 +- .../game/data/stats/items/48200-48299.xml | 5 +- .../game/data/stats/items/48500-48599.xml | 63 +- .../dist/game/data/xsd/AgathionData.xsd | 20 + .../org/l2jmobius/gameserver/GameServer.java | 2 + .../gameserver/data/xml/AgathionData.java | 136 + .../model/holders/AgathionSkillHolder.java | 64 + .../model/itemcontainer/Inventory.java | 71 +- .../gameserver/model/items/Item.java | 7 + .../model/items/instance/ItemInstance.java | 54 + .../network/clientpackets/EnterWorld.java | 8 + .../dist/game/data/AgathionData.xml | 3652 ++++++++++++++++ .../game/data/stats/items/28700-28799.xml | 62 - .../game/data/stats/items/28800-28899.xml | 200 - .../game/data/stats/items/28900-28999.xml | 200 - .../game/data/stats/items/29000-29099.xml | 148 - .../game/data/stats/items/29100-29199.xml | 14 - .../game/data/stats/items/48100-48199.xml | 13 +- .../game/data/stats/items/48200-48299.xml | 5 +- .../game/data/stats/items/48500-48599.xml | 63 +- .../dist/game/data/xsd/AgathionData.xsd | 20 + .../org/l2jmobius/gameserver/GameServer.java | 2 + .../gameserver/data/xml/AgathionData.java | 136 + .../model/holders/AgathionSkillHolder.java | 64 + .../model/itemcontainer/Inventory.java | 71 +- .../gameserver/model/items/Item.java | 7 + .../model/items/instance/ItemInstance.java | 54 + .../network/clientpackets/EnterWorld.java | 8 + .../dist/game/data/AgathionData.xml | 3797 +++++++++++++++++ .../game/data/stats/items/28700-28799.xml | 362 -- .../game/data/stats/items/28800-28899.xml | 1200 ------ .../game/data/stats/items/28900-28999.xml | 1200 ------ .../game/data/stats/items/29000-29099.xml | 718 ---- .../game/data/stats/items/29100-29199.xml | 14 - .../game/data/stats/items/48000-48099.xml | 264 -- .../game/data/stats/items/48100-48199.xml | 10 +- .../game/data/stats/items/48200-48299.xml | 5 +- .../game/data/stats/items/48500-48599.xml | 57 - .../game/data/stats/items/80900-80999.xml | 264 -- .../game/data/stats/items/81400-81499.xml | 18 - .../game/data/stats/items/81600-81699.xml | 1 - .../dist/game/data/xsd/AgathionData.xsd | 20 + .../org/l2jmobius/gameserver/GameServer.java | 2 + .../gameserver/data/xml/AgathionData.java | 136 + .../model/holders/AgathionSkillHolder.java | 64 + .../model/itemcontainer/Inventory.java | 71 +- .../gameserver/model/items/Item.java | 7 + .../model/items/instance/ItemInstance.java | 54 + .../network/clientpackets/EnterWorld.java | 8 + .../dist/game/data/AgathionData.xml | 163 + .../game/data/stats/items/13000-13099.xml | 2 +- .../game/data/stats/items/20600-20699.xml | 2 +- .../game/data/stats/items/49000-49099.xml | 2 +- .../game/data/stats/items/49400-49499.xml | 2 +- .../game/data/stats/items/70300-70399.xml | 2 +- .../game/data/stats/items/70900-70999.xml | 8 +- .../game/data/stats/items/90800-90899.xml | 10 + .../game/data/stats/items/90900-90999.xml | 16 +- .../dist/game/data/xsd/AgathionData.xsd | 20 + .../org/l2jmobius/gameserver/GameServer.java | 2 + .../gameserver/data/xml/AgathionData.java | 136 + .../model/holders/AgathionSkillHolder.java | 64 + .../model/itemcontainer/Inventory.java | 71 +- .../gameserver/model/items/Item.java | 7 + .../model/items/instance/ItemInstance.java | 53 + .../network/clientpackets/EnterWorld.java | 8 + .../dist/game/data/AgathionData.xml | 389 ++ .../game/data/stats/items/13000-13099.xml | 2 +- .../game/data/stats/items/20600-20699.xml | 2 +- .../game/data/stats/items/49000-49099.xml | 2 +- .../game/data/stats/items/49400-49499.xml | 2 +- .../game/data/stats/items/70300-70399.xml | 2 +- .../game/data/stats/items/70900-70999.xml | 8 +- .../game/data/stats/items/71200-71299.xml | 33 +- .../game/data/stats/items/90800-90899.xml | 10 + .../game/data/stats/items/90900-90999.xml | 16 +- .../game/data/stats/items/91100-91199.xml | 24 +- .../dist/game/data/xsd/AgathionData.xsd | 20 + .../org/l2jmobius/gameserver/GameServer.java | 2 + .../gameserver/data/xml/AgathionData.java | 136 + .../model/holders/AgathionSkillHolder.java | 64 + .../model/itemcontainer/Inventory.java | 71 +- .../gameserver/model/items/Item.java | 7 + .../model/items/instance/ItemInstance.java | 53 + .../network/clientpackets/EnterWorld.java | 8 + .../dist/game/data/AgathionData.xml | 488 +++ .../game/data/stats/items/13000-13099.xml | 2 +- .../game/data/stats/items/20600-20699.xml | 2 +- .../game/data/stats/items/49000-49099.xml | 2 +- .../game/data/stats/items/49400-49499.xml | 2 +- .../game/data/stats/items/70300-70399.xml | 2 +- .../game/data/stats/items/70900-70999.xml | 8 +- .../game/data/stats/items/71200-71299.xml | 33 +- .../game/data/stats/items/90800-90899.xml | 10 + .../game/data/stats/items/90900-90999.xml | 16 +- .../game/data/stats/items/91100-91199.xml | 24 +- .../dist/game/data/xsd/AgathionData.xsd | 20 + .../org/l2jmobius/gameserver/GameServer.java | 2 + .../gameserver/data/xml/AgathionData.java | 136 + .../model/holders/AgathionSkillHolder.java | 64 + .../model/itemcontainer/Inventory.java | 71 +- .../gameserver/model/items/Item.java | 7 + .../model/items/instance/ItemInstance.java | 53 + .../network/clientpackets/EnterWorld.java | 8 + .../dist/game/data/AgathionData.xml | 675 +++ .../game/data/stats/items/13000-13099.xml | 2 +- .../game/data/stats/items/20600-20699.xml | 2 +- .../game/data/stats/items/49000-49099.xml | 2 +- .../game/data/stats/items/49400-49499.xml | 2 +- .../game/data/stats/items/70300-70399.xml | 2 +- .../game/data/stats/items/70900-70999.xml | 8 +- .../game/data/stats/items/71200-71299.xml | 33 +- .../game/data/stats/items/90800-90899.xml | 10 + .../game/data/stats/items/90900-90999.xml | 16 +- .../game/data/stats/items/91100-91199.xml | 24 +- .../game/data/stats/items/91900-91999.xml | 3 +- .../dist/game/data/xsd/AgathionData.xsd | 20 + .../org/l2jmobius/gameserver/GameServer.java | 2 + .../gameserver/data/xml/AgathionData.java | 136 + .../model/holders/AgathionSkillHolder.java | 64 + .../model/itemcontainer/Inventory.java | 71 +- .../gameserver/model/items/Item.java | 7 + .../model/items/instance/ItemInstance.java | 53 + .../network/clientpackets/EnterWorld.java | 8 + .../dist/game/data/AgathionData.xml | 358 ++ .../game/data/stats/items/13000-13099.xml | 2 +- .../game/data/stats/items/20600-20699.xml | 2 +- .../game/data/stats/items/49000-49099.xml | 2 +- .../game/data/stats/items/49400-49499.xml | 2 +- .../game/data/stats/items/70300-70399.xml | 2 +- .../game/data/stats/items/70900-70999.xml | 8 +- .../game/data/stats/items/71200-71299.xml | 33 +- .../game/data/stats/items/90800-90899.xml | 10 +- .../game/data/stats/items/90900-90999.xml | 16 +- .../game/data/stats/items/91100-91199.xml | 24 +- .../game/data/stats/items/91900-91999.xml | 3 +- .../dist/game/data/xsd/AgathionData.xsd | 20 + .../org/l2jmobius/gameserver/GameServer.java | 2 + .../gameserver/data/xml/AgathionData.java | 136 + .../model/holders/AgathionSkillHolder.java | 64 + .../model/itemcontainer/Inventory.java | 71 +- .../gameserver/model/items/Item.java | 7 + .../model/items/instance/ItemInstance.java | 53 + .../network/clientpackets/EnterWorld.java | 8 + 183 files changed, 24076 insertions(+), 7085 deletions(-) create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/AgathionData.xml create mode 100644 L2J_Mobius_5.0_Salvation/dist/game/data/xsd/AgathionData.xsd create mode 100644 L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/xml/AgathionData.java create mode 100644 L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/AgathionData.xml create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/xsd/AgathionData.xsd create mode 100644 L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/xml/AgathionData.java create mode 100644 L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/AgathionData.xml create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/xsd/AgathionData.xsd create mode 100644 L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/xml/AgathionData.java create mode 100644 L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/AgathionData.xml create mode 100644 L2J_Mobius_7.0_PreludeOfWar/dist/game/data/xsd/AgathionData.xsd create mode 100644 L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/xml/AgathionData.java create mode 100644 L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java create mode 100644 L2J_Mobius_8.0_Homunculus/dist/game/data/AgathionData.xml create mode 100644 L2J_Mobius_8.0_Homunculus/dist/game/data/xsd/AgathionData.xsd create mode 100644 L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/xml/AgathionData.java create mode 100644 L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java create mode 100644 L2J_Mobius_Classic_2.2_Antharas/dist/game/data/AgathionData.xml create mode 100644 L2J_Mobius_Classic_2.2_Antharas/dist/game/data/xsd/AgathionData.xsd create mode 100644 L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/data/xml/AgathionData.java create mode 100644 L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java create mode 100644 L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/AgathionData.xml create mode 100644 L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/xsd/AgathionData.xsd create mode 100644 L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/data/xml/AgathionData.java create mode 100644 L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java create mode 100644 L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/AgathionData.xml create mode 100644 L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/xsd/AgathionData.xsd create mode 100644 L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/data/xml/AgathionData.java create mode 100644 L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java create mode 100644 L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/AgathionData.xml create mode 100644 L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/xsd/AgathionData.xsd create mode 100644 L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/data/xml/AgathionData.java create mode 100644 L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java create mode 100644 L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/AgathionData.xml create mode 100644 L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/xsd/AgathionData.xsd create mode 100644 L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/AgathionData.java create mode 100644 L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/AgathionData.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/AgathionData.xml new file mode 100644 index 0000000000..8a1a610b09 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/AgathionData.xml @@ -0,0 +1,3394 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/28700-28799.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/28700-28799.xml index d0747f8548..052abe238e 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/28700-28799.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/28700-28799.xml @@ -1160,8 +1160,6 @@ - - @@ -1183,8 +1181,6 @@ - - @@ -1206,8 +1202,6 @@ - - @@ -1229,8 +1223,6 @@ - - @@ -1252,8 +1244,6 @@ - - @@ -1275,8 +1265,6 @@ - - @@ -1298,8 +1286,6 @@ - - @@ -1321,8 +1307,6 @@ - - @@ -1344,8 +1328,6 @@ - - @@ -1367,8 +1349,6 @@ - - @@ -1390,8 +1370,6 @@ - - @@ -1413,8 +1391,6 @@ - - @@ -1436,8 +1412,6 @@ - - @@ -1459,8 +1433,6 @@ - - @@ -1482,8 +1454,6 @@ - - @@ -1505,8 +1475,6 @@ - - @@ -1528,8 +1496,6 @@ - - @@ -1551,8 +1517,6 @@ - - @@ -1574,8 +1538,6 @@ - - @@ -1597,8 +1559,6 @@ - - @@ -1620,8 +1580,6 @@ - - @@ -1643,8 +1601,6 @@ - - @@ -1666,8 +1622,6 @@ - - @@ -1689,8 +1643,6 @@ - - @@ -1712,8 +1664,6 @@ - - @@ -1735,8 +1685,6 @@ - - @@ -1758,8 +1706,6 @@ - - @@ -1781,8 +1727,6 @@ - - @@ -1804,8 +1748,6 @@ - - @@ -1827,8 +1769,6 @@ - - @@ -1850,8 +1790,6 @@ - - diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/28800-28899.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/28800-28899.xml index 73d7c17573..fc2edf5b72 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/28800-28899.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/28800-28899.xml @@ -19,8 +19,6 @@ - - @@ -42,8 +40,6 @@ - - @@ -66,8 +62,6 @@ - - @@ -89,8 +83,6 @@ - - @@ -112,8 +104,6 @@ - - @@ -135,8 +125,6 @@ - - @@ -158,8 +146,6 @@ - - @@ -181,8 +167,6 @@ - - @@ -204,8 +188,6 @@ - - @@ -227,8 +209,6 @@ - - @@ -250,8 +230,6 @@ - - @@ -273,8 +251,6 @@ - - @@ -296,8 +272,6 @@ - - @@ -319,8 +293,6 @@ - - @@ -342,8 +314,6 @@ - - @@ -365,8 +335,6 @@ - - @@ -388,8 +356,6 @@ - - @@ -411,8 +377,6 @@ - - @@ -434,8 +398,6 @@ - - @@ -457,8 +419,6 @@ - - @@ -480,8 +440,6 @@ - - @@ -503,8 +461,6 @@ - - @@ -526,8 +482,6 @@ - - @@ -549,8 +503,6 @@ - - @@ -572,8 +524,6 @@ - - @@ -595,8 +545,6 @@ - - @@ -618,8 +566,6 @@ - - @@ -641,8 +587,6 @@ - - @@ -664,8 +608,6 @@ - - @@ -687,8 +629,6 @@ - - @@ -710,8 +650,6 @@ - - @@ -733,8 +671,6 @@ - - @@ -756,8 +692,6 @@ - - @@ -779,8 +713,6 @@ - - @@ -802,8 +734,6 @@ - - @@ -825,8 +755,6 @@ - - @@ -848,8 +776,6 @@ - - @@ -871,8 +797,6 @@ - - @@ -894,8 +818,6 @@ - - @@ -917,8 +839,6 @@ - - @@ -940,8 +860,6 @@ - - @@ -963,8 +881,6 @@ - - @@ -986,8 +902,6 @@ - - @@ -1009,8 +923,6 @@ - - @@ -1032,8 +944,6 @@ - - @@ -1055,8 +965,6 @@ - - @@ -1078,8 +986,6 @@ - - @@ -1101,8 +1007,6 @@ - - @@ -1124,8 +1028,6 @@ - - @@ -1147,8 +1049,6 @@ - - @@ -1170,8 +1070,6 @@ - - @@ -1193,8 +1091,6 @@ - - @@ -1216,8 +1112,6 @@ - - @@ -1239,8 +1133,6 @@ - - @@ -1262,8 +1154,6 @@ - - @@ -1285,8 +1175,6 @@ - - @@ -1308,8 +1196,6 @@ - - @@ -1331,8 +1217,6 @@ - - @@ -1354,8 +1238,6 @@ - - @@ -1377,8 +1259,6 @@ - - @@ -1400,8 +1280,6 @@ - - @@ -1423,8 +1301,6 @@ - - @@ -1446,8 +1322,6 @@ - - @@ -1469,8 +1343,6 @@ - - @@ -1492,8 +1364,6 @@ - - @@ -1515,8 +1385,6 @@ - - @@ -1538,8 +1406,6 @@ - - @@ -1561,8 +1427,6 @@ - - @@ -1584,8 +1448,6 @@ - - @@ -1607,8 +1469,6 @@ - - @@ -1630,8 +1490,6 @@ - - @@ -1653,8 +1511,6 @@ - - @@ -1676,8 +1532,6 @@ - - @@ -1699,8 +1553,6 @@ - - @@ -1722,8 +1574,6 @@ - - @@ -1745,8 +1595,6 @@ - - @@ -1768,8 +1616,6 @@ - - @@ -1791,8 +1637,6 @@ - - @@ -1814,8 +1658,6 @@ - - @@ -1837,8 +1679,6 @@ - - @@ -1860,8 +1700,6 @@ - - @@ -1883,8 +1721,6 @@ - - @@ -1906,8 +1742,6 @@ - - @@ -1929,8 +1763,6 @@ - - @@ -1952,8 +1784,6 @@ - - @@ -1975,8 +1805,6 @@ - - @@ -1998,8 +1826,6 @@ - - @@ -2021,8 +1847,6 @@ - - @@ -2044,8 +1868,6 @@ - - @@ -2067,8 +1889,6 @@ - - @@ -2090,8 +1910,6 @@ - - @@ -2113,8 +1931,6 @@ - - @@ -2136,8 +1952,6 @@ - - @@ -2159,8 +1973,6 @@ - - @@ -2182,8 +1994,6 @@ - - @@ -2205,8 +2015,6 @@ - - @@ -2228,8 +2036,6 @@ - - @@ -2251,8 +2057,6 @@ - - @@ -2274,8 +2078,6 @@ - - @@ -2297,8 +2099,6 @@ - - diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/28900-28999.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/28900-28999.xml index 60b72440c7..dd30eff0a1 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/28900-28999.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/28900-28999.xml @@ -19,8 +19,6 @@ - - @@ -42,8 +40,6 @@ - - @@ -65,8 +61,6 @@ - - @@ -88,8 +82,6 @@ - - @@ -111,8 +103,6 @@ - - @@ -134,8 +124,6 @@ - - @@ -157,8 +145,6 @@ - - @@ -180,8 +166,6 @@ - - @@ -203,8 +187,6 @@ - - @@ -226,8 +208,6 @@ - - @@ -249,8 +229,6 @@ - - @@ -272,8 +250,6 @@ - - @@ -295,8 +271,6 @@ - - @@ -318,8 +292,6 @@ - - @@ -341,8 +313,6 @@ - - @@ -364,8 +334,6 @@ - - @@ -387,8 +355,6 @@ - - @@ -410,8 +376,6 @@ - - @@ -433,8 +397,6 @@ - - @@ -456,8 +418,6 @@ - - @@ -479,8 +439,6 @@ - - @@ -496,8 +454,6 @@ - - @@ -519,8 +475,6 @@ - - @@ -542,8 +496,6 @@ - - @@ -565,8 +517,6 @@ - - @@ -588,8 +538,6 @@ - - @@ -611,8 +559,6 @@ - - @@ -634,8 +580,6 @@ - - @@ -657,8 +601,6 @@ - - @@ -680,8 +622,6 @@ - - @@ -703,8 +643,6 @@ - - @@ -726,8 +664,6 @@ - - @@ -749,8 +685,6 @@ - - @@ -772,8 +706,6 @@ - - @@ -795,8 +727,6 @@ - - @@ -818,8 +748,6 @@ - - @@ -841,8 +769,6 @@ - - @@ -864,8 +790,6 @@ - - @@ -887,8 +811,6 @@ - - @@ -910,8 +832,6 @@ - - @@ -933,8 +853,6 @@ - - @@ -956,8 +874,6 @@ - - @@ -979,8 +895,6 @@ - - @@ -1002,8 +916,6 @@ - - @@ -1025,8 +937,6 @@ - - @@ -1048,8 +958,6 @@ - - @@ -1071,8 +979,6 @@ - - @@ -1094,8 +1000,6 @@ - - @@ -1117,8 +1021,6 @@ - - @@ -1140,8 +1042,6 @@ - - @@ -1163,8 +1063,6 @@ - - @@ -1186,8 +1084,6 @@ - - @@ -1209,8 +1105,6 @@ - - @@ -1232,8 +1126,6 @@ - - @@ -1255,8 +1147,6 @@ - - @@ -1278,8 +1168,6 @@ - - @@ -1301,8 +1189,6 @@ - - @@ -1324,8 +1210,6 @@ - - @@ -1347,8 +1231,6 @@ - - @@ -1370,8 +1252,6 @@ - - @@ -1393,8 +1273,6 @@ - - @@ -1416,8 +1294,6 @@ - - @@ -1439,8 +1315,6 @@ - - @@ -1462,8 +1336,6 @@ - - @@ -1485,8 +1357,6 @@ - - @@ -1508,8 +1378,6 @@ - - @@ -1531,8 +1399,6 @@ - - @@ -1554,8 +1420,6 @@ - - @@ -1577,8 +1441,6 @@ - - @@ -1600,8 +1462,6 @@ - - @@ -1623,8 +1483,6 @@ - - @@ -1646,8 +1504,6 @@ - - @@ -1669,8 +1525,6 @@ - - @@ -1692,8 +1546,6 @@ - - @@ -1715,8 +1567,6 @@ - - @@ -1738,8 +1588,6 @@ - - @@ -1761,8 +1609,6 @@ - - @@ -1784,8 +1630,6 @@ - - @@ -1807,8 +1651,6 @@ - - @@ -1830,8 +1672,6 @@ - - @@ -1853,8 +1693,6 @@ - - @@ -1876,8 +1714,6 @@ - - @@ -1899,8 +1735,6 @@ - - @@ -1922,8 +1756,6 @@ - - @@ -1945,8 +1777,6 @@ - - @@ -1968,8 +1798,6 @@ - - @@ -1991,8 +1819,6 @@ - - @@ -2014,8 +1840,6 @@ - - @@ -2037,8 +1861,6 @@ - - @@ -2060,8 +1882,6 @@ - - @@ -2083,8 +1903,6 @@ - - @@ -2106,8 +1924,6 @@ - - @@ -2129,8 +1945,6 @@ - - @@ -2152,8 +1966,6 @@ - - @@ -2175,8 +1987,6 @@ - - @@ -2198,8 +2008,6 @@ - - @@ -2221,8 +2029,6 @@ - - @@ -2244,8 +2050,6 @@ - - @@ -2267,8 +2071,6 @@ - - @@ -2290,8 +2092,6 @@ - - diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/29000-29099.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/29000-29099.xml index 92310924ba..d5718e1aa9 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/29000-29099.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/29000-29099.xml @@ -19,8 +19,6 @@ - - @@ -42,8 +40,6 @@ - - @@ -65,8 +61,6 @@ - - @@ -88,8 +82,6 @@ - - @@ -111,8 +103,6 @@ - - @@ -134,8 +124,6 @@ - - @@ -157,8 +145,6 @@ - - @@ -180,8 +166,6 @@ - - @@ -203,8 +187,6 @@ - - @@ -226,8 +208,6 @@ - - @@ -249,8 +229,6 @@ - - @@ -272,8 +250,6 @@ - - @@ -295,8 +271,6 @@ - - @@ -318,8 +292,6 @@ - - @@ -341,8 +313,6 @@ - - @@ -364,8 +334,6 @@ - - @@ -387,8 +355,6 @@ - - @@ -410,8 +376,6 @@ - - @@ -433,8 +397,6 @@ - - @@ -456,8 +418,6 @@ - - @@ -479,8 +439,6 @@ - - @@ -502,8 +460,6 @@ - - @@ -525,8 +481,6 @@ - - @@ -548,8 +502,6 @@ - - @@ -571,8 +523,6 @@ - - @@ -594,8 +544,6 @@ - - @@ -617,8 +565,6 @@ - - @@ -640,8 +586,6 @@ - - @@ -663,8 +607,6 @@ - - @@ -686,8 +628,6 @@ - - @@ -709,8 +649,6 @@ - - @@ -732,8 +670,6 @@ - - @@ -755,8 +691,6 @@ - - @@ -778,8 +712,6 @@ - - @@ -801,8 +733,6 @@ - - @@ -824,8 +754,6 @@ - - @@ -847,8 +775,6 @@ - - @@ -870,8 +796,6 @@ - - @@ -893,8 +817,6 @@ - - @@ -916,8 +838,6 @@ - - @@ -939,8 +859,6 @@ - - @@ -962,8 +880,6 @@ - - @@ -985,8 +901,6 @@ - - @@ -1008,8 +922,6 @@ - - @@ -1031,8 +943,6 @@ - - @@ -1054,8 +964,6 @@ - - @@ -1077,8 +985,6 @@ - - @@ -1100,8 +1006,6 @@ - - @@ -1123,8 +1027,6 @@ - - @@ -1146,8 +1048,6 @@ - - @@ -1169,8 +1069,6 @@ - - @@ -1192,8 +1090,6 @@ - - @@ -1215,8 +1111,6 @@ - - @@ -1238,8 +1132,6 @@ - - @@ -1261,8 +1153,6 @@ - - @@ -1284,8 +1174,6 @@ - - @@ -1307,8 +1195,6 @@ - - @@ -1698,8 +1584,6 @@ - - @@ -1718,8 +1602,6 @@ - - @@ -1738,8 +1620,6 @@ - - @@ -1758,8 +1638,6 @@ - - @@ -1778,8 +1656,6 @@ - - @@ -1798,8 +1674,6 @@ - - @@ -1818,8 +1692,6 @@ - - @@ -1838,8 +1710,6 @@ - - @@ -1858,8 +1728,6 @@ - - @@ -1878,8 +1746,6 @@ - - @@ -1898,8 +1764,6 @@ - - @@ -1918,8 +1782,6 @@ - - @@ -1938,8 +1800,6 @@ - - @@ -1958,8 +1818,6 @@ - - @@ -1978,8 +1836,6 @@ - - @@ -1998,8 +1854,6 @@ - - @@ -2018,8 +1872,6 @@ - - diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/29100-29199.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/29100-29199.xml index a36a1147a5..7e0688a404 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/29100-29199.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/29100-29199.xml @@ -13,8 +13,6 @@ - - @@ -30,8 +28,6 @@ - - @@ -47,8 +43,6 @@ - - @@ -64,8 +58,6 @@ - - @@ -81,8 +73,6 @@ - - @@ -98,8 +88,6 @@ - - @@ -115,8 +103,6 @@ - - diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/48100-48199.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/48100-48199.xml index 7b3c7aa5b4..09d6b6aaa3 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/48100-48199.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/48100-48199.xml @@ -333,10 +333,7 @@ - - - - + @@ -463,15 +460,11 @@ - - - - - - + + diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/48200-48299.xml b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/48200-48299.xml index 7deaf2cc50..aeb223a191 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/48200-48299.xml +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/stats/items/48200-48299.xml @@ -1059,10 +1059,7 @@ - - - - + diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/xsd/AgathionData.xsd b/L2J_Mobius_5.0_Salvation/dist/game/data/xsd/AgathionData.xsd new file mode 100644 index 0000000000..021fb7e22f --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/xsd/AgathionData.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/GameServer.java index 00302ea498..a4c436a915 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/GameServer.java @@ -45,6 +45,7 @@ import org.l2jmobius.gameserver.data.sql.CrestTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.xml.ActionData; import org.l2jmobius.gameserver.data.xml.AdminData; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AlchemyData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; @@ -266,6 +267,7 @@ public class GameServer EnchantItemHPBonusData.getInstance(); BuyListData.getInstance(); MultisellData.getInstance(); + AgathionData.getInstance(); RecipeData.getInstance(); ArmorSetData.getInstance(); FishingData.getInstance(); diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/xml/AgathionData.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/xml/AgathionData.java new file mode 100644 index 0000000000..049e6620ca --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/data/xml/AgathionData.java @@ -0,0 +1,136 @@ +/* + * 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 org.l2jmobius.gameserver.data.xml; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import org.w3c.dom.Document; + +import org.l2jmobius.commons.util.IXmlReader; +import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; + +/** + * @author Mobius + */ +public class AgathionData implements IXmlReader +{ + private static final Logger LOGGER = Logger.getLogger(AgathionData.class.getName()); + + private static final Map AGATHION_SKILLS = new HashMap<>(); + + protected AgathionData() + { + load(); + } + + @Override + public void load() + { + AGATHION_SKILLS.clear(); + parseDatapackFile("data/AgathionData.xml"); + LOGGER.info(getClass().getSimpleName() + ": Loaded " + AGATHION_SKILLS.size() + " agathion data."); + } + + @Override + public void parseDocument(Document doc, File f) + { + forEach(doc, "list", listNode -> forEach(listNode, "agathion", agathionNode -> + { + final StatSet set = new StatSet(parseAttributes(agathionNode)); + + final int id = set.getInt("id"); + if (ItemTable.getInstance().getTemplate(id) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion with id " + id + "."); + return; + } + + final int enchant = set.getInt("enchant", 0); + + final Map> mainSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getMainSkills() : new HashMap<>(); + final List mainSkillList = new ArrayList<>(); + final String main = set.getString("mainSkill", ""); + for (String skill : main.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + mainSkillList.add(new SkillHolder(skillId, level)); + } + mainSkills.put(enchant, mainSkillList); + + final Map> subSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getSubSkills() : new HashMap<>(); + final List subSkillList = new ArrayList<>(); + final String sub = set.getString("subSkill", ""); + for (String skill : sub.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + subSkillList.add(new SkillHolder(skillId, level)); + } + subSkills.put(enchant, subSkillList); + + AGATHION_SKILLS.put(id, new AgathionSkillHolder(mainSkills, subSkills)); + })); + } + + public AgathionSkillHolder getSkills(int agathionId) + { + return AGATHION_SKILLS.get(agathionId); + } + + public static AgathionData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final AgathionData INSTANCE = new AgathionData(); + } +} diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java new file mode 100644 index 0000000000..78fef28978 --- /dev/null +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java @@ -0,0 +1,64 @@ +/* + * 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 org.l2jmobius.gameserver.model.holders; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * @author Mobius + */ +public class AgathionSkillHolder +{ + private final Map> _mainSkill; + private final Map> _subSkill; + + public AgathionSkillHolder(Map> mainSkill, Map> subSkill) + { + _mainSkill = mainSkill; + _subSkill = subSkill; + } + + public Map> getMainSkills() + { + return _mainSkill; + } + + public Map> getSubSkills() + { + return _subSkill; + } + + public List getMainSkills(int enchantLevel) + { + if (!_mainSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _mainSkill.get(enchantLevel); + } + + public List getSubSkills(int enchantLevel) + { + if (!_subSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _subSkill.get(enchantLevel); + } +} diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java index 97e97ae5a5..215f808c41 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java @@ -35,6 +35,7 @@ import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.util.CommonUtil; import org.l2jmobius.gameserver.cache.PaperdollCache; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; import org.l2jmobius.gameserver.enums.ItemLocation; @@ -48,8 +49,10 @@ import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.events.EventDispatcher; import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder; import org.l2jmobius.gameserver.model.holders.ItemSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.appearance.AppearanceStone; @@ -576,8 +579,12 @@ public abstract class Inventory extends ItemContainer } } - // Apply skill, if weapon have "skills on equip" - item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + // Apply skill, if item has "skills on equip" and it is not a secondary agathion. + if ((slot < PAPERDOLL_AGATHION2) || (slot > PAPERDOLL_AGATHION5)) + { + item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + } + if (update) { player.sendSkillList(); @@ -1275,7 +1282,32 @@ public abstract class Inventory extends ItemContainer listener.notifyUnequiped(slot, old, this); } old.updateDatabase(); + + // Remove agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId()); + if (agathionSkills != null) + { + boolean update = false; + for (SkillHolder holder : agathionSkills.getMainSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } + // Add new item in slot of paperdoll if (item != null) { @@ -1295,6 +1327,41 @@ public abstract class Inventory extends ItemContainer listener.notifyEquiped(slot, item, this); } item.updateDatabase(); + + // Add agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId()); + if (agathionSkills != null) + { + boolean update = false; + if (slot == PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } _paperdollCache.clearCachedStats(); diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/Item.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/Item.java index 051ac1eab3..8d7986f570 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/Item.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/Item.java @@ -822,6 +822,13 @@ public abstract class Item extends ListenersContainer implements IIdentifiable public void addSkill(ItemSkillHolder holder) { + // Agathion skills managed by AgathionData. + // if ((getBodyPart() == SLOT_AGATHION) && (holder.getType() != ItemSkillType.ON_EQUIP) && (holder.getType() != ItemSkillType.ON_UNEQUIP)) + // { + // LOGGER.warning("Remove from agathion " + _itemId + " " + holder + "!"); + // return; + // } + if (_skills == null) { _skills = new ArrayList<>(); diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index 3acd046d30..beae6e0db1 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -36,6 +36,7 @@ import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData; import org.l2jmobius.gameserver.data.xml.EnsoulData; @@ -70,7 +71,10 @@ import org.l2jmobius.gameserver.model.events.impl.item.OnItemBypassEvent; import org.l2jmobius.gameserver.model.events.impl.item.OnItemEnchantAdd; import org.l2jmobius.gameserver.model.events.impl.item.OnItemSoulCrystalAdd; import org.l2jmobius.gameserver.model.events.impl.item.OnItemTalk; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.items.Armor; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; @@ -83,6 +87,7 @@ import org.l2jmobius.gameserver.model.options.EnchantOptions; import org.l2jmobius.gameserver.model.options.Options; import org.l2jmobius.gameserver.model.siege.Castle; import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillConditionScope; import org.l2jmobius.gameserver.model.variables.ItemVariables; import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.DropItem; @@ -930,7 +935,56 @@ public class ItemInstance extends WorldObject { return; } + clearEnchantStats(); + + // Agathion skills. + if (isEquipped() && (_item.getBodyPart() == Item.SLOT_AGATHION)) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId()); + if (agathionSkills != null) + { + boolean update = false; + // Remove old skills. + for (SkillHolder holder : agathionSkills.getMainSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + // Add new skills. + if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getActingPlayer().sendSkillList(); + } + } + } + _enchantLevel = enchantLevel; applyEnchantStats(); _storedInDb = false; diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 17eeb98686..ecba025eaf 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -52,6 +52,7 @@ import org.l2jmobius.gameserver.model.clan.Clan; import org.l2jmobius.gameserver.model.holders.AttendanceInfoHolder; import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -645,6 +646,13 @@ public class EnterWorld implements IClientIncomingPacket player.updateAbnormalVisualEffects(); } + // Activate first agathion when available. + final ItemInstance agathion = player.getInventory().unEquipItemInBodySlot(Item.SLOT_AGATHION); + if (agathion != null) + { + player.getInventory().equipItemAndRecord(agathion); + } + if (Config.ENABLE_ATTENDANCE_REWARDS) { ThreadPool.schedule(() -> diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/AgathionData.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/AgathionData.xml new file mode 100644 index 0000000000..a5255ee612 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/AgathionData.xml @@ -0,0 +1,3654 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/28700-28799.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/28700-28799.xml index 9f9b69ee67..94f75a96a8 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/28700-28799.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/28700-28799.xml @@ -1160,8 +1160,6 @@ - - @@ -1183,8 +1181,6 @@ - - @@ -1206,8 +1202,6 @@ - - @@ -1229,8 +1223,6 @@ - - @@ -1252,8 +1244,6 @@ - - @@ -1275,8 +1265,6 @@ - - @@ -1298,8 +1286,6 @@ - - @@ -1321,8 +1307,6 @@ - - @@ -1344,8 +1328,6 @@ - - @@ -1367,8 +1349,6 @@ - - @@ -1390,8 +1370,6 @@ - - @@ -1413,8 +1391,6 @@ - - @@ -1436,8 +1412,6 @@ - - @@ -1459,8 +1433,6 @@ - - @@ -1482,8 +1454,6 @@ - - @@ -1505,8 +1475,6 @@ - - @@ -1528,8 +1496,6 @@ - - @@ -1551,8 +1517,6 @@ - - @@ -1574,8 +1538,6 @@ - - @@ -1597,8 +1559,6 @@ - - @@ -1620,8 +1580,6 @@ - - @@ -1643,8 +1601,6 @@ - - @@ -1666,8 +1622,6 @@ - - @@ -1689,8 +1643,6 @@ - - @@ -1712,8 +1664,6 @@ - - @@ -1735,8 +1685,6 @@ - - @@ -1758,8 +1706,6 @@ - - @@ -1781,8 +1727,6 @@ - - @@ -1804,8 +1748,6 @@ - - @@ -1827,8 +1769,6 @@ - - @@ -1850,8 +1790,6 @@ - - diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/28800-28899.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/28800-28899.xml index 8525e20b41..49618296c6 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/28800-28899.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/28800-28899.xml @@ -19,8 +19,6 @@ - - @@ -42,8 +40,6 @@ - - @@ -66,8 +62,6 @@ - - @@ -89,8 +83,6 @@ - - @@ -112,8 +104,6 @@ - - @@ -135,8 +125,6 @@ - - @@ -158,8 +146,6 @@ - - @@ -181,8 +167,6 @@ - - @@ -204,8 +188,6 @@ - - @@ -227,8 +209,6 @@ - - @@ -250,8 +230,6 @@ - - @@ -273,8 +251,6 @@ - - @@ -296,8 +272,6 @@ - - @@ -319,8 +293,6 @@ - - @@ -342,8 +314,6 @@ - - @@ -365,8 +335,6 @@ - - @@ -388,8 +356,6 @@ - - @@ -411,8 +377,6 @@ - - @@ -434,8 +398,6 @@ - - @@ -457,8 +419,6 @@ - - @@ -480,8 +440,6 @@ - - @@ -503,8 +461,6 @@ - - @@ -526,8 +482,6 @@ - - @@ -549,8 +503,6 @@ - - @@ -572,8 +524,6 @@ - - @@ -595,8 +545,6 @@ - - @@ -618,8 +566,6 @@ - - @@ -641,8 +587,6 @@ - - @@ -664,8 +608,6 @@ - - @@ -687,8 +629,6 @@ - - @@ -710,8 +650,6 @@ - - @@ -733,8 +671,6 @@ - - @@ -756,8 +692,6 @@ - - @@ -779,8 +713,6 @@ - - @@ -802,8 +734,6 @@ - - @@ -825,8 +755,6 @@ - - @@ -848,8 +776,6 @@ - - @@ -871,8 +797,6 @@ - - @@ -894,8 +818,6 @@ - - @@ -917,8 +839,6 @@ - - @@ -940,8 +860,6 @@ - - @@ -963,8 +881,6 @@ - - @@ -986,8 +902,6 @@ - - @@ -1009,8 +923,6 @@ - - @@ -1032,8 +944,6 @@ - - @@ -1055,8 +965,6 @@ - - @@ -1078,8 +986,6 @@ - - @@ -1101,8 +1007,6 @@ - - @@ -1124,8 +1028,6 @@ - - @@ -1147,8 +1049,6 @@ - - @@ -1170,8 +1070,6 @@ - - @@ -1193,8 +1091,6 @@ - - @@ -1216,8 +1112,6 @@ - - @@ -1239,8 +1133,6 @@ - - @@ -1262,8 +1154,6 @@ - - @@ -1285,8 +1175,6 @@ - - @@ -1308,8 +1196,6 @@ - - @@ -1331,8 +1217,6 @@ - - @@ -1354,8 +1238,6 @@ - - @@ -1377,8 +1259,6 @@ - - @@ -1400,8 +1280,6 @@ - - @@ -1423,8 +1301,6 @@ - - @@ -1446,8 +1322,6 @@ - - @@ -1469,8 +1343,6 @@ - - @@ -1492,8 +1364,6 @@ - - @@ -1515,8 +1385,6 @@ - - @@ -1538,8 +1406,6 @@ - - @@ -1561,8 +1427,6 @@ - - @@ -1584,8 +1448,6 @@ - - @@ -1607,8 +1469,6 @@ - - @@ -1630,8 +1490,6 @@ - - @@ -1653,8 +1511,6 @@ - - @@ -1676,8 +1532,6 @@ - - @@ -1699,8 +1553,6 @@ - - @@ -1722,8 +1574,6 @@ - - @@ -1745,8 +1595,6 @@ - - @@ -1768,8 +1616,6 @@ - - @@ -1791,8 +1637,6 @@ - - @@ -1814,8 +1658,6 @@ - - @@ -1837,8 +1679,6 @@ - - @@ -1860,8 +1700,6 @@ - - @@ -1883,8 +1721,6 @@ - - @@ -1906,8 +1742,6 @@ - - @@ -1929,8 +1763,6 @@ - - @@ -1952,8 +1784,6 @@ - - @@ -1975,8 +1805,6 @@ - - @@ -1998,8 +1826,6 @@ - - @@ -2021,8 +1847,6 @@ - - @@ -2044,8 +1868,6 @@ - - @@ -2067,8 +1889,6 @@ - - @@ -2090,8 +1910,6 @@ - - @@ -2113,8 +1931,6 @@ - - @@ -2136,8 +1952,6 @@ - - @@ -2159,8 +1973,6 @@ - - @@ -2182,8 +1994,6 @@ - - @@ -2205,8 +2015,6 @@ - - @@ -2228,8 +2036,6 @@ - - @@ -2251,8 +2057,6 @@ - - @@ -2274,8 +2078,6 @@ - - @@ -2297,8 +2099,6 @@ - - diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/28900-28999.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/28900-28999.xml index ecd5bd8ac0..c0042d9bf4 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/28900-28999.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/28900-28999.xml @@ -19,8 +19,6 @@ - - @@ -42,8 +40,6 @@ - - @@ -65,8 +61,6 @@ - - @@ -88,8 +82,6 @@ - - @@ -111,8 +103,6 @@ - - @@ -134,8 +124,6 @@ - - @@ -157,8 +145,6 @@ - - @@ -180,8 +166,6 @@ - - @@ -203,8 +187,6 @@ - - @@ -226,8 +208,6 @@ - - @@ -249,8 +229,6 @@ - - @@ -272,8 +250,6 @@ - - @@ -295,8 +271,6 @@ - - @@ -318,8 +292,6 @@ - - @@ -341,8 +313,6 @@ - - @@ -364,8 +334,6 @@ - - @@ -387,8 +355,6 @@ - - @@ -410,8 +376,6 @@ - - @@ -433,8 +397,6 @@ - - @@ -456,8 +418,6 @@ - - @@ -479,8 +439,6 @@ - - @@ -496,8 +454,6 @@ - - @@ -519,8 +475,6 @@ - - @@ -542,8 +496,6 @@ - - @@ -565,8 +517,6 @@ - - @@ -588,8 +538,6 @@ - - @@ -611,8 +559,6 @@ - - @@ -634,8 +580,6 @@ - - @@ -657,8 +601,6 @@ - - @@ -680,8 +622,6 @@ - - @@ -703,8 +643,6 @@ - - @@ -726,8 +664,6 @@ - - @@ -749,8 +685,6 @@ - - @@ -772,8 +706,6 @@ - - @@ -795,8 +727,6 @@ - - @@ -818,8 +748,6 @@ - - @@ -841,8 +769,6 @@ - - @@ -864,8 +790,6 @@ - - @@ -887,8 +811,6 @@ - - @@ -910,8 +832,6 @@ - - @@ -933,8 +853,6 @@ - - @@ -956,8 +874,6 @@ - - @@ -979,8 +895,6 @@ - - @@ -1002,8 +916,6 @@ - - @@ -1025,8 +937,6 @@ - - @@ -1048,8 +958,6 @@ - - @@ -1071,8 +979,6 @@ - - @@ -1094,8 +1000,6 @@ - - @@ -1117,8 +1021,6 @@ - - @@ -1140,8 +1042,6 @@ - - @@ -1163,8 +1063,6 @@ - - @@ -1186,8 +1084,6 @@ - - @@ -1209,8 +1105,6 @@ - - @@ -1232,8 +1126,6 @@ - - @@ -1255,8 +1147,6 @@ - - @@ -1278,8 +1168,6 @@ - - @@ -1301,8 +1189,6 @@ - - @@ -1324,8 +1210,6 @@ - - @@ -1347,8 +1231,6 @@ - - @@ -1370,8 +1252,6 @@ - - @@ -1393,8 +1273,6 @@ - - @@ -1416,8 +1294,6 @@ - - @@ -1439,8 +1315,6 @@ - - @@ -1462,8 +1336,6 @@ - - @@ -1485,8 +1357,6 @@ - - @@ -1508,8 +1378,6 @@ - - @@ -1531,8 +1399,6 @@ - - @@ -1554,8 +1420,6 @@ - - @@ -1577,8 +1441,6 @@ - - @@ -1600,8 +1462,6 @@ - - @@ -1623,8 +1483,6 @@ - - @@ -1646,8 +1504,6 @@ - - @@ -1669,8 +1525,6 @@ - - @@ -1692,8 +1546,6 @@ - - @@ -1715,8 +1567,6 @@ - - @@ -1738,8 +1588,6 @@ - - @@ -1761,8 +1609,6 @@ - - @@ -1784,8 +1630,6 @@ - - @@ -1807,8 +1651,6 @@ - - @@ -1830,8 +1672,6 @@ - - @@ -1853,8 +1693,6 @@ - - @@ -1876,8 +1714,6 @@ - - @@ -1899,8 +1735,6 @@ - - @@ -1922,8 +1756,6 @@ - - @@ -1945,8 +1777,6 @@ - - @@ -1968,8 +1798,6 @@ - - @@ -1991,8 +1819,6 @@ - - @@ -2014,8 +1840,6 @@ - - @@ -2037,8 +1861,6 @@ - - @@ -2060,8 +1882,6 @@ - - @@ -2083,8 +1903,6 @@ - - @@ -2106,8 +1924,6 @@ - - @@ -2129,8 +1945,6 @@ - - @@ -2152,8 +1966,6 @@ - - @@ -2175,8 +1987,6 @@ - - @@ -2198,8 +2008,6 @@ - - @@ -2221,8 +2029,6 @@ - - @@ -2244,8 +2050,6 @@ - - @@ -2267,8 +2071,6 @@ - - @@ -2290,8 +2092,6 @@ - - diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/29000-29099.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/29000-29099.xml index 3fdf0ac152..1a94d18954 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/29000-29099.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/29000-29099.xml @@ -19,8 +19,6 @@ - - @@ -42,8 +40,6 @@ - - @@ -65,8 +61,6 @@ - - @@ -88,8 +82,6 @@ - - @@ -111,8 +103,6 @@ - - @@ -134,8 +124,6 @@ - - @@ -157,8 +145,6 @@ - - @@ -180,8 +166,6 @@ - - @@ -203,8 +187,6 @@ - - @@ -226,8 +208,6 @@ - - @@ -249,8 +229,6 @@ - - @@ -272,8 +250,6 @@ - - @@ -295,8 +271,6 @@ - - @@ -318,8 +292,6 @@ - - @@ -341,8 +313,6 @@ - - @@ -364,8 +334,6 @@ - - @@ -387,8 +355,6 @@ - - @@ -410,8 +376,6 @@ - - @@ -433,8 +397,6 @@ - - @@ -456,8 +418,6 @@ - - @@ -479,8 +439,6 @@ - - @@ -502,8 +460,6 @@ - - @@ -525,8 +481,6 @@ - - @@ -548,8 +502,6 @@ - - @@ -571,8 +523,6 @@ - - @@ -594,8 +544,6 @@ - - @@ -617,8 +565,6 @@ - - @@ -640,8 +586,6 @@ - - @@ -663,8 +607,6 @@ - - @@ -686,8 +628,6 @@ - - @@ -709,8 +649,6 @@ - - @@ -732,8 +670,6 @@ - - @@ -755,8 +691,6 @@ - - @@ -778,8 +712,6 @@ - - @@ -801,8 +733,6 @@ - - @@ -824,8 +754,6 @@ - - @@ -847,8 +775,6 @@ - - @@ -870,8 +796,6 @@ - - @@ -893,8 +817,6 @@ - - @@ -916,8 +838,6 @@ - - @@ -939,8 +859,6 @@ - - @@ -962,8 +880,6 @@ - - @@ -985,8 +901,6 @@ - - @@ -1008,8 +922,6 @@ - - @@ -1031,8 +943,6 @@ - - @@ -1054,8 +964,6 @@ - - @@ -1077,8 +985,6 @@ - - @@ -1100,8 +1006,6 @@ - - @@ -1123,8 +1027,6 @@ - - @@ -1146,8 +1048,6 @@ - - @@ -1169,8 +1069,6 @@ - - @@ -1192,8 +1090,6 @@ - - @@ -1215,8 +1111,6 @@ - - @@ -1238,8 +1132,6 @@ - - @@ -1261,8 +1153,6 @@ - - @@ -1284,8 +1174,6 @@ - - @@ -1307,8 +1195,6 @@ - - @@ -1698,8 +1584,6 @@ - - @@ -1718,8 +1602,6 @@ - - @@ -1738,8 +1620,6 @@ - - @@ -1758,8 +1638,6 @@ - - @@ -1778,8 +1656,6 @@ - - @@ -1798,8 +1674,6 @@ - - @@ -1818,8 +1692,6 @@ - - @@ -1838,8 +1710,6 @@ - - @@ -1858,8 +1728,6 @@ - - @@ -1878,8 +1746,6 @@ - - @@ -1898,8 +1764,6 @@ - - @@ -1918,8 +1782,6 @@ - - @@ -1938,8 +1800,6 @@ - - @@ -1958,8 +1818,6 @@ - - @@ -1978,8 +1836,6 @@ - - @@ -1998,8 +1854,6 @@ - - @@ -2018,8 +1872,6 @@ - - diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/29100-29199.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/29100-29199.xml index 7af4a523e9..8ffc40b3af 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/29100-29199.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/29100-29199.xml @@ -13,8 +13,6 @@ - - @@ -30,8 +28,6 @@ - - @@ -47,8 +43,6 @@ - - @@ -64,8 +58,6 @@ - - @@ -81,8 +73,6 @@ - - @@ -98,8 +88,6 @@ - - @@ -115,8 +103,6 @@ - - diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/48100-48199.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/48100-48199.xml index 003da8620c..a8fc501390 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/48100-48199.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/48100-48199.xml @@ -333,10 +333,7 @@ - - - - + @@ -463,15 +460,11 @@ - - - - - - + + diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/48200-48299.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/48200-48299.xml index caaaff501b..a660032a78 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/48200-48299.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/48200-48299.xml @@ -1059,10 +1059,7 @@ - - - - + diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/48500-48599.xml b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/48500-48599.xml index cec6a8f48f..9b6c1a32f7 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/48500-48599.xml +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/stats/items/48500-48599.xml @@ -1253,26 +1253,7 @@ - - - - - - - - - - - - - - - - - - - - + @@ -1287,26 +1268,7 @@ - - - - - - - - - - - - - - - - - - - - + @@ -1321,26 +1283,7 @@ - - - - - - - - - - - - - - - - - - - - + diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/xsd/AgathionData.xsd b/L2J_Mobius_5.5_EtinasFate/dist/game/data/xsd/AgathionData.xsd new file mode 100644 index 0000000000..021fb7e22f --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/xsd/AgathionData.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/GameServer.java index 00302ea498..a4c436a915 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/GameServer.java @@ -45,6 +45,7 @@ import org.l2jmobius.gameserver.data.sql.CrestTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.xml.ActionData; import org.l2jmobius.gameserver.data.xml.AdminData; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AlchemyData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; @@ -266,6 +267,7 @@ public class GameServer EnchantItemHPBonusData.getInstance(); BuyListData.getInstance(); MultisellData.getInstance(); + AgathionData.getInstance(); RecipeData.getInstance(); ArmorSetData.getInstance(); FishingData.getInstance(); diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/xml/AgathionData.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/xml/AgathionData.java new file mode 100644 index 0000000000..049e6620ca --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/data/xml/AgathionData.java @@ -0,0 +1,136 @@ +/* + * 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 org.l2jmobius.gameserver.data.xml; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import org.w3c.dom.Document; + +import org.l2jmobius.commons.util.IXmlReader; +import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; + +/** + * @author Mobius + */ +public class AgathionData implements IXmlReader +{ + private static final Logger LOGGER = Logger.getLogger(AgathionData.class.getName()); + + private static final Map AGATHION_SKILLS = new HashMap<>(); + + protected AgathionData() + { + load(); + } + + @Override + public void load() + { + AGATHION_SKILLS.clear(); + parseDatapackFile("data/AgathionData.xml"); + LOGGER.info(getClass().getSimpleName() + ": Loaded " + AGATHION_SKILLS.size() + " agathion data."); + } + + @Override + public void parseDocument(Document doc, File f) + { + forEach(doc, "list", listNode -> forEach(listNode, "agathion", agathionNode -> + { + final StatSet set = new StatSet(parseAttributes(agathionNode)); + + final int id = set.getInt("id"); + if (ItemTable.getInstance().getTemplate(id) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion with id " + id + "."); + return; + } + + final int enchant = set.getInt("enchant", 0); + + final Map> mainSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getMainSkills() : new HashMap<>(); + final List mainSkillList = new ArrayList<>(); + final String main = set.getString("mainSkill", ""); + for (String skill : main.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + mainSkillList.add(new SkillHolder(skillId, level)); + } + mainSkills.put(enchant, mainSkillList); + + final Map> subSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getSubSkills() : new HashMap<>(); + final List subSkillList = new ArrayList<>(); + final String sub = set.getString("subSkill", ""); + for (String skill : sub.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + subSkillList.add(new SkillHolder(skillId, level)); + } + subSkills.put(enchant, subSkillList); + + AGATHION_SKILLS.put(id, new AgathionSkillHolder(mainSkills, subSkills)); + })); + } + + public AgathionSkillHolder getSkills(int agathionId) + { + return AGATHION_SKILLS.get(agathionId); + } + + public static AgathionData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final AgathionData INSTANCE = new AgathionData(); + } +} diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java new file mode 100644 index 0000000000..78fef28978 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java @@ -0,0 +1,64 @@ +/* + * 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 org.l2jmobius.gameserver.model.holders; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * @author Mobius + */ +public class AgathionSkillHolder +{ + private final Map> _mainSkill; + private final Map> _subSkill; + + public AgathionSkillHolder(Map> mainSkill, Map> subSkill) + { + _mainSkill = mainSkill; + _subSkill = subSkill; + } + + public Map> getMainSkills() + { + return _mainSkill; + } + + public Map> getSubSkills() + { + return _subSkill; + } + + public List getMainSkills(int enchantLevel) + { + if (!_mainSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _mainSkill.get(enchantLevel); + } + + public List getSubSkills(int enchantLevel) + { + if (!_subSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _subSkill.get(enchantLevel); + } +} diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java index e9e329831c..d9fe51d9ae 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java @@ -35,6 +35,7 @@ import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.util.CommonUtil; import org.l2jmobius.gameserver.cache.PaperdollCache; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; import org.l2jmobius.gameserver.enums.ItemLocation; @@ -48,8 +49,10 @@ import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.events.EventDispatcher; import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder; import org.l2jmobius.gameserver.model.holders.ItemSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.appearance.AppearanceStone; @@ -599,8 +602,12 @@ public abstract class Inventory extends ItemContainer } } - // Apply skill, if weapon have "skills on equip" - item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + // Apply skill, if item has "skills on equip" and it is not a secondary agathion. + if ((slot < PAPERDOLL_AGATHION2) || (slot > PAPERDOLL_AGATHION5)) + { + item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + } + if (update) { player.sendSkillList(); @@ -1351,7 +1358,32 @@ public abstract class Inventory extends ItemContainer listener.notifyUnequiped(slot, old, this); } old.updateDatabase(); + + // Remove agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId()); + if (agathionSkills != null) + { + boolean update = false; + for (SkillHolder holder : agathionSkills.getMainSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } + // Add new item in slot of paperdoll if (item != null) { @@ -1371,6 +1403,41 @@ public abstract class Inventory extends ItemContainer listener.notifyEquiped(slot, item, this); } item.updateDatabase(); + + // Add agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId()); + if (agathionSkills != null) + { + boolean update = false; + if (slot == PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } _paperdollCache.clearCachedStats(); diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/Item.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/Item.java index 36ea981ecc..ceb245879d 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/Item.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/Item.java @@ -827,6 +827,13 @@ public abstract class Item extends ListenersContainer implements IIdentifiable public void addSkill(ItemSkillHolder holder) { + // Agathion skills managed by AgathionData. + // if ((getBodyPart() == SLOT_AGATHION) && (holder.getType() != ItemSkillType.ON_EQUIP) && (holder.getType() != ItemSkillType.ON_UNEQUIP)) + // { + // LOGGER.warning("Remove from agathion " + _itemId + " " + holder + "!"); + // return; + // } + if (_skills == null) { _skills = new ArrayList<>(); diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index 3acd046d30..beae6e0db1 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -36,6 +36,7 @@ import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData; import org.l2jmobius.gameserver.data.xml.EnsoulData; @@ -70,7 +71,10 @@ import org.l2jmobius.gameserver.model.events.impl.item.OnItemBypassEvent; import org.l2jmobius.gameserver.model.events.impl.item.OnItemEnchantAdd; import org.l2jmobius.gameserver.model.events.impl.item.OnItemSoulCrystalAdd; import org.l2jmobius.gameserver.model.events.impl.item.OnItemTalk; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.items.Armor; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; @@ -83,6 +87,7 @@ import org.l2jmobius.gameserver.model.options.EnchantOptions; import org.l2jmobius.gameserver.model.options.Options; import org.l2jmobius.gameserver.model.siege.Castle; import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillConditionScope; import org.l2jmobius.gameserver.model.variables.ItemVariables; import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.DropItem; @@ -930,7 +935,56 @@ public class ItemInstance extends WorldObject { return; } + clearEnchantStats(); + + // Agathion skills. + if (isEquipped() && (_item.getBodyPart() == Item.SLOT_AGATHION)) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId()); + if (agathionSkills != null) + { + boolean update = false; + // Remove old skills. + for (SkillHolder holder : agathionSkills.getMainSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + // Add new skills. + if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getActingPlayer().sendSkillList(); + } + } + } + _enchantLevel = enchantLevel; applyEnchantStats(); _storedInDb = false; diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 77b82c329f..584a2744c5 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -52,6 +52,7 @@ import org.l2jmobius.gameserver.model.clan.Clan; import org.l2jmobius.gameserver.model.holders.AttendanceInfoHolder; import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -645,6 +646,13 @@ public class EnterWorld implements IClientIncomingPacket player.updateAbnormalVisualEffects(); } + // Activate first agathion when available. + final ItemInstance agathion = player.getInventory().unEquipItemInBodySlot(Item.SLOT_AGATHION); + if (agathion != null) + { + player.getInventory().equipItemAndRecord(agathion); + } + if (Config.ENABLE_ATTENDANCE_REWARDS) { ThreadPool.schedule(() -> diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/AgathionData.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/AgathionData.xml new file mode 100644 index 0000000000..4cfc73d01a --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/AgathionData.xml @@ -0,0 +1,3652 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/28700-28799.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/28700-28799.xml index 0d4945e60b..50201fcb5e 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/28700-28799.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/28700-28799.xml @@ -1160,8 +1160,6 @@ - - @@ -1183,8 +1181,6 @@ - - @@ -1206,8 +1202,6 @@ - - @@ -1229,8 +1223,6 @@ - - @@ -1252,8 +1244,6 @@ - - @@ -1275,8 +1265,6 @@ - - @@ -1298,8 +1286,6 @@ - - @@ -1321,8 +1307,6 @@ - - @@ -1344,8 +1328,6 @@ - - @@ -1367,8 +1349,6 @@ - - @@ -1390,8 +1370,6 @@ - - @@ -1413,8 +1391,6 @@ - - @@ -1436,8 +1412,6 @@ - - @@ -1459,8 +1433,6 @@ - - @@ -1482,8 +1454,6 @@ - - @@ -1505,8 +1475,6 @@ - - @@ -1528,8 +1496,6 @@ - - @@ -1551,8 +1517,6 @@ - - @@ -1574,8 +1538,6 @@ - - @@ -1597,8 +1559,6 @@ - - @@ -1620,8 +1580,6 @@ - - @@ -1643,8 +1601,6 @@ - - @@ -1666,8 +1622,6 @@ - - @@ -1689,8 +1643,6 @@ - - @@ -1712,8 +1664,6 @@ - - @@ -1735,8 +1685,6 @@ - - @@ -1758,8 +1706,6 @@ - - @@ -1781,8 +1727,6 @@ - - @@ -1804,8 +1748,6 @@ - - @@ -1827,8 +1769,6 @@ - - @@ -1850,8 +1790,6 @@ - - diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/28800-28899.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/28800-28899.xml index 8525e20b41..49618296c6 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/28800-28899.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/28800-28899.xml @@ -19,8 +19,6 @@ - - @@ -42,8 +40,6 @@ - - @@ -66,8 +62,6 @@ - - @@ -89,8 +83,6 @@ - - @@ -112,8 +104,6 @@ - - @@ -135,8 +125,6 @@ - - @@ -158,8 +146,6 @@ - - @@ -181,8 +167,6 @@ - - @@ -204,8 +188,6 @@ - - @@ -227,8 +209,6 @@ - - @@ -250,8 +230,6 @@ - - @@ -273,8 +251,6 @@ - - @@ -296,8 +272,6 @@ - - @@ -319,8 +293,6 @@ - - @@ -342,8 +314,6 @@ - - @@ -365,8 +335,6 @@ - - @@ -388,8 +356,6 @@ - - @@ -411,8 +377,6 @@ - - @@ -434,8 +398,6 @@ - - @@ -457,8 +419,6 @@ - - @@ -480,8 +440,6 @@ - - @@ -503,8 +461,6 @@ - - @@ -526,8 +482,6 @@ - - @@ -549,8 +503,6 @@ - - @@ -572,8 +524,6 @@ - - @@ -595,8 +545,6 @@ - - @@ -618,8 +566,6 @@ - - @@ -641,8 +587,6 @@ - - @@ -664,8 +608,6 @@ - - @@ -687,8 +629,6 @@ - - @@ -710,8 +650,6 @@ - - @@ -733,8 +671,6 @@ - - @@ -756,8 +692,6 @@ - - @@ -779,8 +713,6 @@ - - @@ -802,8 +734,6 @@ - - @@ -825,8 +755,6 @@ - - @@ -848,8 +776,6 @@ - - @@ -871,8 +797,6 @@ - - @@ -894,8 +818,6 @@ - - @@ -917,8 +839,6 @@ - - @@ -940,8 +860,6 @@ - - @@ -963,8 +881,6 @@ - - @@ -986,8 +902,6 @@ - - @@ -1009,8 +923,6 @@ - - @@ -1032,8 +944,6 @@ - - @@ -1055,8 +965,6 @@ - - @@ -1078,8 +986,6 @@ - - @@ -1101,8 +1007,6 @@ - - @@ -1124,8 +1028,6 @@ - - @@ -1147,8 +1049,6 @@ - - @@ -1170,8 +1070,6 @@ - - @@ -1193,8 +1091,6 @@ - - @@ -1216,8 +1112,6 @@ - - @@ -1239,8 +1133,6 @@ - - @@ -1262,8 +1154,6 @@ - - @@ -1285,8 +1175,6 @@ - - @@ -1308,8 +1196,6 @@ - - @@ -1331,8 +1217,6 @@ - - @@ -1354,8 +1238,6 @@ - - @@ -1377,8 +1259,6 @@ - - @@ -1400,8 +1280,6 @@ - - @@ -1423,8 +1301,6 @@ - - @@ -1446,8 +1322,6 @@ - - @@ -1469,8 +1343,6 @@ - - @@ -1492,8 +1364,6 @@ - - @@ -1515,8 +1385,6 @@ - - @@ -1538,8 +1406,6 @@ - - @@ -1561,8 +1427,6 @@ - - @@ -1584,8 +1448,6 @@ - - @@ -1607,8 +1469,6 @@ - - @@ -1630,8 +1490,6 @@ - - @@ -1653,8 +1511,6 @@ - - @@ -1676,8 +1532,6 @@ - - @@ -1699,8 +1553,6 @@ - - @@ -1722,8 +1574,6 @@ - - @@ -1745,8 +1595,6 @@ - - @@ -1768,8 +1616,6 @@ - - @@ -1791,8 +1637,6 @@ - - @@ -1814,8 +1658,6 @@ - - @@ -1837,8 +1679,6 @@ - - @@ -1860,8 +1700,6 @@ - - @@ -1883,8 +1721,6 @@ - - @@ -1906,8 +1742,6 @@ - - @@ -1929,8 +1763,6 @@ - - @@ -1952,8 +1784,6 @@ - - @@ -1975,8 +1805,6 @@ - - @@ -1998,8 +1826,6 @@ - - @@ -2021,8 +1847,6 @@ - - @@ -2044,8 +1868,6 @@ - - @@ -2067,8 +1889,6 @@ - - @@ -2090,8 +1910,6 @@ - - @@ -2113,8 +1931,6 @@ - - @@ -2136,8 +1952,6 @@ - - @@ -2159,8 +1973,6 @@ - - @@ -2182,8 +1994,6 @@ - - @@ -2205,8 +2015,6 @@ - - @@ -2228,8 +2036,6 @@ - - @@ -2251,8 +2057,6 @@ - - @@ -2274,8 +2078,6 @@ - - @@ -2297,8 +2099,6 @@ - - diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/28900-28999.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/28900-28999.xml index ecd5bd8ac0..c0042d9bf4 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/28900-28999.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/28900-28999.xml @@ -19,8 +19,6 @@ - - @@ -42,8 +40,6 @@ - - @@ -65,8 +61,6 @@ - - @@ -88,8 +82,6 @@ - - @@ -111,8 +103,6 @@ - - @@ -134,8 +124,6 @@ - - @@ -157,8 +145,6 @@ - - @@ -180,8 +166,6 @@ - - @@ -203,8 +187,6 @@ - - @@ -226,8 +208,6 @@ - - @@ -249,8 +229,6 @@ - - @@ -272,8 +250,6 @@ - - @@ -295,8 +271,6 @@ - - @@ -318,8 +292,6 @@ - - @@ -341,8 +313,6 @@ - - @@ -364,8 +334,6 @@ - - @@ -387,8 +355,6 @@ - - @@ -410,8 +376,6 @@ - - @@ -433,8 +397,6 @@ - - @@ -456,8 +418,6 @@ - - @@ -479,8 +439,6 @@ - - @@ -496,8 +454,6 @@ - - @@ -519,8 +475,6 @@ - - @@ -542,8 +496,6 @@ - - @@ -565,8 +517,6 @@ - - @@ -588,8 +538,6 @@ - - @@ -611,8 +559,6 @@ - - @@ -634,8 +580,6 @@ - - @@ -657,8 +601,6 @@ - - @@ -680,8 +622,6 @@ - - @@ -703,8 +643,6 @@ - - @@ -726,8 +664,6 @@ - - @@ -749,8 +685,6 @@ - - @@ -772,8 +706,6 @@ - - @@ -795,8 +727,6 @@ - - @@ -818,8 +748,6 @@ - - @@ -841,8 +769,6 @@ - - @@ -864,8 +790,6 @@ - - @@ -887,8 +811,6 @@ - - @@ -910,8 +832,6 @@ - - @@ -933,8 +853,6 @@ - - @@ -956,8 +874,6 @@ - - @@ -979,8 +895,6 @@ - - @@ -1002,8 +916,6 @@ - - @@ -1025,8 +937,6 @@ - - @@ -1048,8 +958,6 @@ - - @@ -1071,8 +979,6 @@ - - @@ -1094,8 +1000,6 @@ - - @@ -1117,8 +1021,6 @@ - - @@ -1140,8 +1042,6 @@ - - @@ -1163,8 +1063,6 @@ - - @@ -1186,8 +1084,6 @@ - - @@ -1209,8 +1105,6 @@ - - @@ -1232,8 +1126,6 @@ - - @@ -1255,8 +1147,6 @@ - - @@ -1278,8 +1168,6 @@ - - @@ -1301,8 +1189,6 @@ - - @@ -1324,8 +1210,6 @@ - - @@ -1347,8 +1231,6 @@ - - @@ -1370,8 +1252,6 @@ - - @@ -1393,8 +1273,6 @@ - - @@ -1416,8 +1294,6 @@ - - @@ -1439,8 +1315,6 @@ - - @@ -1462,8 +1336,6 @@ - - @@ -1485,8 +1357,6 @@ - - @@ -1508,8 +1378,6 @@ - - @@ -1531,8 +1399,6 @@ - - @@ -1554,8 +1420,6 @@ - - @@ -1577,8 +1441,6 @@ - - @@ -1600,8 +1462,6 @@ - - @@ -1623,8 +1483,6 @@ - - @@ -1646,8 +1504,6 @@ - - @@ -1669,8 +1525,6 @@ - - @@ -1692,8 +1546,6 @@ - - @@ -1715,8 +1567,6 @@ - - @@ -1738,8 +1588,6 @@ - - @@ -1761,8 +1609,6 @@ - - @@ -1784,8 +1630,6 @@ - - @@ -1807,8 +1651,6 @@ - - @@ -1830,8 +1672,6 @@ - - @@ -1853,8 +1693,6 @@ - - @@ -1876,8 +1714,6 @@ - - @@ -1899,8 +1735,6 @@ - - @@ -1922,8 +1756,6 @@ - - @@ -1945,8 +1777,6 @@ - - @@ -1968,8 +1798,6 @@ - - @@ -1991,8 +1819,6 @@ - - @@ -2014,8 +1840,6 @@ - - @@ -2037,8 +1861,6 @@ - - @@ -2060,8 +1882,6 @@ - - @@ -2083,8 +1903,6 @@ - - @@ -2106,8 +1924,6 @@ - - @@ -2129,8 +1945,6 @@ - - @@ -2152,8 +1966,6 @@ - - @@ -2175,8 +1987,6 @@ - - @@ -2198,8 +2008,6 @@ - - @@ -2221,8 +2029,6 @@ - - @@ -2244,8 +2050,6 @@ - - @@ -2267,8 +2071,6 @@ - - @@ -2290,8 +2092,6 @@ - - diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/29000-29099.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/29000-29099.xml index 8e0f6da79b..77ce3213f0 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/29000-29099.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/29000-29099.xml @@ -19,8 +19,6 @@ - - @@ -42,8 +40,6 @@ - - @@ -65,8 +61,6 @@ - - @@ -88,8 +82,6 @@ - - @@ -111,8 +103,6 @@ - - @@ -134,8 +124,6 @@ - - @@ -157,8 +145,6 @@ - - @@ -180,8 +166,6 @@ - - @@ -203,8 +187,6 @@ - - @@ -226,8 +208,6 @@ - - @@ -249,8 +229,6 @@ - - @@ -272,8 +250,6 @@ - - @@ -295,8 +271,6 @@ - - @@ -318,8 +292,6 @@ - - @@ -341,8 +313,6 @@ - - @@ -364,8 +334,6 @@ - - @@ -387,8 +355,6 @@ - - @@ -410,8 +376,6 @@ - - @@ -433,8 +397,6 @@ - - @@ -456,8 +418,6 @@ - - @@ -479,8 +439,6 @@ - - @@ -502,8 +460,6 @@ - - @@ -525,8 +481,6 @@ - - @@ -548,8 +502,6 @@ - - @@ -571,8 +523,6 @@ - - @@ -594,8 +544,6 @@ - - @@ -617,8 +565,6 @@ - - @@ -640,8 +586,6 @@ - - @@ -663,8 +607,6 @@ - - @@ -686,8 +628,6 @@ - - @@ -709,8 +649,6 @@ - - @@ -732,8 +670,6 @@ - - @@ -755,8 +691,6 @@ - - @@ -778,8 +712,6 @@ - - @@ -801,8 +733,6 @@ - - @@ -824,8 +754,6 @@ - - @@ -847,8 +775,6 @@ - - @@ -870,8 +796,6 @@ - - @@ -893,8 +817,6 @@ - - @@ -916,8 +838,6 @@ - - @@ -939,8 +859,6 @@ - - @@ -962,8 +880,6 @@ - - @@ -985,8 +901,6 @@ - - @@ -1008,8 +922,6 @@ - - @@ -1031,8 +943,6 @@ - - @@ -1054,8 +964,6 @@ - - @@ -1077,8 +985,6 @@ - - @@ -1100,8 +1006,6 @@ - - @@ -1123,8 +1027,6 @@ - - @@ -1146,8 +1048,6 @@ - - @@ -1169,8 +1069,6 @@ - - @@ -1192,8 +1090,6 @@ - - @@ -1215,8 +1111,6 @@ - - @@ -1238,8 +1132,6 @@ - - @@ -1261,8 +1153,6 @@ - - @@ -1284,8 +1174,6 @@ - - @@ -1307,8 +1195,6 @@ - - @@ -1698,8 +1584,6 @@ - - @@ -1718,8 +1602,6 @@ - - @@ -1738,8 +1620,6 @@ - - @@ -1758,8 +1638,6 @@ - - @@ -1778,8 +1656,6 @@ - - @@ -1798,8 +1674,6 @@ - - @@ -1818,8 +1692,6 @@ - - @@ -1838,8 +1710,6 @@ - - @@ -1858,8 +1728,6 @@ - - @@ -1878,8 +1746,6 @@ - - @@ -1898,8 +1764,6 @@ - - @@ -1918,8 +1782,6 @@ - - @@ -1938,8 +1800,6 @@ - - @@ -1958,8 +1818,6 @@ - - @@ -1978,8 +1836,6 @@ - - @@ -1998,8 +1854,6 @@ - - @@ -2018,8 +1872,6 @@ - - diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/29100-29199.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/29100-29199.xml index c50055ec20..bd50697e79 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/29100-29199.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/29100-29199.xml @@ -13,8 +13,6 @@ - - @@ -30,8 +28,6 @@ - - @@ -47,8 +43,6 @@ - - @@ -64,8 +58,6 @@ - - @@ -81,8 +73,6 @@ - - @@ -98,8 +88,6 @@ - - @@ -115,8 +103,6 @@ - - diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/48100-48199.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/48100-48199.xml index 39acd325c1..eb5d93ddc4 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/48100-48199.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/48100-48199.xml @@ -333,10 +333,7 @@ - - - - + @@ -463,15 +460,11 @@ - - - - - - + + diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/48200-48299.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/48200-48299.xml index 811779a0a5..7bbcdd009a 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/48200-48299.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/48200-48299.xml @@ -1059,10 +1059,7 @@ - - - - + diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/48500-48599.xml b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/48500-48599.xml index bb60197899..59df6a64dc 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/48500-48599.xml +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/stats/items/48500-48599.xml @@ -1253,26 +1253,7 @@ - - - - - - - - - - - - - - - - - - - - + @@ -1287,26 +1268,7 @@ - - - - - - - - - - - - - - - - - - - - + @@ -1321,26 +1283,7 @@ - - - - - - - - - - - - - - - - - - - - + diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/xsd/AgathionData.xsd b/L2J_Mobius_6.0_Fafurion/dist/game/data/xsd/AgathionData.xsd new file mode 100644 index 0000000000..021fb7e22f --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/xsd/AgathionData.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/GameServer.java index adcb7009a0..6d14177052 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/GameServer.java @@ -45,6 +45,7 @@ import org.l2jmobius.gameserver.data.sql.CrestTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.xml.ActionData; import org.l2jmobius.gameserver.data.xml.AdminData; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AlchemyData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; @@ -268,6 +269,7 @@ public class GameServer BuyListData.getInstance(); MultisellData.getInstance(); EquipmentUpgradeData.getInstance(); + AgathionData.getInstance(); RecipeData.getInstance(); ArmorSetData.getInstance(); FishingData.getInstance(); diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/xml/AgathionData.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/xml/AgathionData.java new file mode 100644 index 0000000000..049e6620ca --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/data/xml/AgathionData.java @@ -0,0 +1,136 @@ +/* + * 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 org.l2jmobius.gameserver.data.xml; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import org.w3c.dom.Document; + +import org.l2jmobius.commons.util.IXmlReader; +import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; + +/** + * @author Mobius + */ +public class AgathionData implements IXmlReader +{ + private static final Logger LOGGER = Logger.getLogger(AgathionData.class.getName()); + + private static final Map AGATHION_SKILLS = new HashMap<>(); + + protected AgathionData() + { + load(); + } + + @Override + public void load() + { + AGATHION_SKILLS.clear(); + parseDatapackFile("data/AgathionData.xml"); + LOGGER.info(getClass().getSimpleName() + ": Loaded " + AGATHION_SKILLS.size() + " agathion data."); + } + + @Override + public void parseDocument(Document doc, File f) + { + forEach(doc, "list", listNode -> forEach(listNode, "agathion", agathionNode -> + { + final StatSet set = new StatSet(parseAttributes(agathionNode)); + + final int id = set.getInt("id"); + if (ItemTable.getInstance().getTemplate(id) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion with id " + id + "."); + return; + } + + final int enchant = set.getInt("enchant", 0); + + final Map> mainSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getMainSkills() : new HashMap<>(); + final List mainSkillList = new ArrayList<>(); + final String main = set.getString("mainSkill", ""); + for (String skill : main.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + mainSkillList.add(new SkillHolder(skillId, level)); + } + mainSkills.put(enchant, mainSkillList); + + final Map> subSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getSubSkills() : new HashMap<>(); + final List subSkillList = new ArrayList<>(); + final String sub = set.getString("subSkill", ""); + for (String skill : sub.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + subSkillList.add(new SkillHolder(skillId, level)); + } + subSkills.put(enchant, subSkillList); + + AGATHION_SKILLS.put(id, new AgathionSkillHolder(mainSkills, subSkills)); + })); + } + + public AgathionSkillHolder getSkills(int agathionId) + { + return AGATHION_SKILLS.get(agathionId); + } + + public static AgathionData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final AgathionData INSTANCE = new AgathionData(); + } +} diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java new file mode 100644 index 0000000000..78fef28978 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java @@ -0,0 +1,64 @@ +/* + * 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 org.l2jmobius.gameserver.model.holders; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * @author Mobius + */ +public class AgathionSkillHolder +{ + private final Map> _mainSkill; + private final Map> _subSkill; + + public AgathionSkillHolder(Map> mainSkill, Map> subSkill) + { + _mainSkill = mainSkill; + _subSkill = subSkill; + } + + public Map> getMainSkills() + { + return _mainSkill; + } + + public Map> getSubSkills() + { + return _subSkill; + } + + public List getMainSkills(int enchantLevel) + { + if (!_mainSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _mainSkill.get(enchantLevel); + } + + public List getSubSkills(int enchantLevel) + { + if (!_subSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _subSkill.get(enchantLevel); + } +} diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java index e9e329831c..d9fe51d9ae 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java @@ -35,6 +35,7 @@ import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.util.CommonUtil; import org.l2jmobius.gameserver.cache.PaperdollCache; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; import org.l2jmobius.gameserver.enums.ItemLocation; @@ -48,8 +49,10 @@ import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.events.EventDispatcher; import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder; import org.l2jmobius.gameserver.model.holders.ItemSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.appearance.AppearanceStone; @@ -599,8 +602,12 @@ public abstract class Inventory extends ItemContainer } } - // Apply skill, if weapon have "skills on equip" - item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + // Apply skill, if item has "skills on equip" and it is not a secondary agathion. + if ((slot < PAPERDOLL_AGATHION2) || (slot > PAPERDOLL_AGATHION5)) + { + item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + } + if (update) { player.sendSkillList(); @@ -1351,7 +1358,32 @@ public abstract class Inventory extends ItemContainer listener.notifyUnequiped(slot, old, this); } old.updateDatabase(); + + // Remove agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId()); + if (agathionSkills != null) + { + boolean update = false; + for (SkillHolder holder : agathionSkills.getMainSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } + // Add new item in slot of paperdoll if (item != null) { @@ -1371,6 +1403,41 @@ public abstract class Inventory extends ItemContainer listener.notifyEquiped(slot, item, this); } item.updateDatabase(); + + // Add agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId()); + if (agathionSkills != null) + { + boolean update = false; + if (slot == PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } _paperdollCache.clearCachedStats(); diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/Item.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/Item.java index 243d1cd559..58fd46ecb2 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/Item.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/Item.java @@ -828,6 +828,13 @@ public abstract class Item extends ListenersContainer implements IIdentifiable public void addSkill(ItemSkillHolder holder) { + // Agathion skills managed by AgathionData. + // if ((getBodyPart() == SLOT_AGATHION) && (holder.getType() != ItemSkillType.ON_EQUIP) && (holder.getType() != ItemSkillType.ON_UNEQUIP)) + // { + // LOGGER.warning("Remove from agathion " + _itemId + " " + holder + "!"); + // return; + // } + if (_skills == null) { _skills = new ArrayList<>(); diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index 3acd046d30..beae6e0db1 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -36,6 +36,7 @@ import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData; import org.l2jmobius.gameserver.data.xml.EnsoulData; @@ -70,7 +71,10 @@ import org.l2jmobius.gameserver.model.events.impl.item.OnItemBypassEvent; import org.l2jmobius.gameserver.model.events.impl.item.OnItemEnchantAdd; import org.l2jmobius.gameserver.model.events.impl.item.OnItemSoulCrystalAdd; import org.l2jmobius.gameserver.model.events.impl.item.OnItemTalk; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.items.Armor; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; @@ -83,6 +87,7 @@ import org.l2jmobius.gameserver.model.options.EnchantOptions; import org.l2jmobius.gameserver.model.options.Options; import org.l2jmobius.gameserver.model.siege.Castle; import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillConditionScope; import org.l2jmobius.gameserver.model.variables.ItemVariables; import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.DropItem; @@ -930,7 +935,56 @@ public class ItemInstance extends WorldObject { return; } + clearEnchantStats(); + + // Agathion skills. + if (isEquipped() && (_item.getBodyPart() == Item.SLOT_AGATHION)) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId()); + if (agathionSkills != null) + { + boolean update = false; + // Remove old skills. + for (SkillHolder holder : agathionSkills.getMainSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + // Add new skills. + if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getActingPlayer().sendSkillList(); + } + } + } + _enchantLevel = enchantLevel; applyEnchantStats(); _storedInDb = false; diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 77b82c329f..584a2744c5 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -52,6 +52,7 @@ import org.l2jmobius.gameserver.model.clan.Clan; import org.l2jmobius.gameserver.model.holders.AttendanceInfoHolder; import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -645,6 +646,13 @@ public class EnterWorld implements IClientIncomingPacket player.updateAbnormalVisualEffects(); } + // Activate first agathion when available. + final ItemInstance agathion = player.getInventory().unEquipItemInBodySlot(Item.SLOT_AGATHION); + if (agathion != null) + { + player.getInventory().equipItemAndRecord(agathion); + } + if (Config.ENABLE_ATTENDANCE_REWARDS) { ThreadPool.schedule(() -> diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/AgathionData.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/AgathionData.xml new file mode 100644 index 0000000000..4cfc73d01a --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/AgathionData.xml @@ -0,0 +1,3652 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/28700-28799.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/28700-28799.xml index 0d4945e60b..50201fcb5e 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/28700-28799.xml +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/28700-28799.xml @@ -1160,8 +1160,6 @@ - - @@ -1183,8 +1181,6 @@ - - @@ -1206,8 +1202,6 @@ - - @@ -1229,8 +1223,6 @@ - - @@ -1252,8 +1244,6 @@ - - @@ -1275,8 +1265,6 @@ - - @@ -1298,8 +1286,6 @@ - - @@ -1321,8 +1307,6 @@ - - @@ -1344,8 +1328,6 @@ - - @@ -1367,8 +1349,6 @@ - - @@ -1390,8 +1370,6 @@ - - @@ -1413,8 +1391,6 @@ - - @@ -1436,8 +1412,6 @@ - - @@ -1459,8 +1433,6 @@ - - @@ -1482,8 +1454,6 @@ - - @@ -1505,8 +1475,6 @@ - - @@ -1528,8 +1496,6 @@ - - @@ -1551,8 +1517,6 @@ - - @@ -1574,8 +1538,6 @@ - - @@ -1597,8 +1559,6 @@ - - @@ -1620,8 +1580,6 @@ - - @@ -1643,8 +1601,6 @@ - - @@ -1666,8 +1622,6 @@ - - @@ -1689,8 +1643,6 @@ - - @@ -1712,8 +1664,6 @@ - - @@ -1735,8 +1685,6 @@ - - @@ -1758,8 +1706,6 @@ - - @@ -1781,8 +1727,6 @@ - - @@ -1804,8 +1748,6 @@ - - @@ -1827,8 +1769,6 @@ - - @@ -1850,8 +1790,6 @@ - - diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/28800-28899.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/28800-28899.xml index 8525e20b41..49618296c6 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/28800-28899.xml +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/28800-28899.xml @@ -19,8 +19,6 @@ - - @@ -42,8 +40,6 @@ - - @@ -66,8 +62,6 @@ - - @@ -89,8 +83,6 @@ - - @@ -112,8 +104,6 @@ - - @@ -135,8 +125,6 @@ - - @@ -158,8 +146,6 @@ - - @@ -181,8 +167,6 @@ - - @@ -204,8 +188,6 @@ - - @@ -227,8 +209,6 @@ - - @@ -250,8 +230,6 @@ - - @@ -273,8 +251,6 @@ - - @@ -296,8 +272,6 @@ - - @@ -319,8 +293,6 @@ - - @@ -342,8 +314,6 @@ - - @@ -365,8 +335,6 @@ - - @@ -388,8 +356,6 @@ - - @@ -411,8 +377,6 @@ - - @@ -434,8 +398,6 @@ - - @@ -457,8 +419,6 @@ - - @@ -480,8 +440,6 @@ - - @@ -503,8 +461,6 @@ - - @@ -526,8 +482,6 @@ - - @@ -549,8 +503,6 @@ - - @@ -572,8 +524,6 @@ - - @@ -595,8 +545,6 @@ - - @@ -618,8 +566,6 @@ - - @@ -641,8 +587,6 @@ - - @@ -664,8 +608,6 @@ - - @@ -687,8 +629,6 @@ - - @@ -710,8 +650,6 @@ - - @@ -733,8 +671,6 @@ - - @@ -756,8 +692,6 @@ - - @@ -779,8 +713,6 @@ - - @@ -802,8 +734,6 @@ - - @@ -825,8 +755,6 @@ - - @@ -848,8 +776,6 @@ - - @@ -871,8 +797,6 @@ - - @@ -894,8 +818,6 @@ - - @@ -917,8 +839,6 @@ - - @@ -940,8 +860,6 @@ - - @@ -963,8 +881,6 @@ - - @@ -986,8 +902,6 @@ - - @@ -1009,8 +923,6 @@ - - @@ -1032,8 +944,6 @@ - - @@ -1055,8 +965,6 @@ - - @@ -1078,8 +986,6 @@ - - @@ -1101,8 +1007,6 @@ - - @@ -1124,8 +1028,6 @@ - - @@ -1147,8 +1049,6 @@ - - @@ -1170,8 +1070,6 @@ - - @@ -1193,8 +1091,6 @@ - - @@ -1216,8 +1112,6 @@ - - @@ -1239,8 +1133,6 @@ - - @@ -1262,8 +1154,6 @@ - - @@ -1285,8 +1175,6 @@ - - @@ -1308,8 +1196,6 @@ - - @@ -1331,8 +1217,6 @@ - - @@ -1354,8 +1238,6 @@ - - @@ -1377,8 +1259,6 @@ - - @@ -1400,8 +1280,6 @@ - - @@ -1423,8 +1301,6 @@ - - @@ -1446,8 +1322,6 @@ - - @@ -1469,8 +1343,6 @@ - - @@ -1492,8 +1364,6 @@ - - @@ -1515,8 +1385,6 @@ - - @@ -1538,8 +1406,6 @@ - - @@ -1561,8 +1427,6 @@ - - @@ -1584,8 +1448,6 @@ - - @@ -1607,8 +1469,6 @@ - - @@ -1630,8 +1490,6 @@ - - @@ -1653,8 +1511,6 @@ - - @@ -1676,8 +1532,6 @@ - - @@ -1699,8 +1553,6 @@ - - @@ -1722,8 +1574,6 @@ - - @@ -1745,8 +1595,6 @@ - - @@ -1768,8 +1616,6 @@ - - @@ -1791,8 +1637,6 @@ - - @@ -1814,8 +1658,6 @@ - - @@ -1837,8 +1679,6 @@ - - @@ -1860,8 +1700,6 @@ - - @@ -1883,8 +1721,6 @@ - - @@ -1906,8 +1742,6 @@ - - @@ -1929,8 +1763,6 @@ - - @@ -1952,8 +1784,6 @@ - - @@ -1975,8 +1805,6 @@ - - @@ -1998,8 +1826,6 @@ - - @@ -2021,8 +1847,6 @@ - - @@ -2044,8 +1868,6 @@ - - @@ -2067,8 +1889,6 @@ - - @@ -2090,8 +1910,6 @@ - - @@ -2113,8 +1931,6 @@ - - @@ -2136,8 +1952,6 @@ - - @@ -2159,8 +1973,6 @@ - - @@ -2182,8 +1994,6 @@ - - @@ -2205,8 +2015,6 @@ - - @@ -2228,8 +2036,6 @@ - - @@ -2251,8 +2057,6 @@ - - @@ -2274,8 +2078,6 @@ - - @@ -2297,8 +2099,6 @@ - - diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/28900-28999.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/28900-28999.xml index ecd5bd8ac0..c0042d9bf4 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/28900-28999.xml +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/28900-28999.xml @@ -19,8 +19,6 @@ - - @@ -42,8 +40,6 @@ - - @@ -65,8 +61,6 @@ - - @@ -88,8 +82,6 @@ - - @@ -111,8 +103,6 @@ - - @@ -134,8 +124,6 @@ - - @@ -157,8 +145,6 @@ - - @@ -180,8 +166,6 @@ - - @@ -203,8 +187,6 @@ - - @@ -226,8 +208,6 @@ - - @@ -249,8 +229,6 @@ - - @@ -272,8 +250,6 @@ - - @@ -295,8 +271,6 @@ - - @@ -318,8 +292,6 @@ - - @@ -341,8 +313,6 @@ - - @@ -364,8 +334,6 @@ - - @@ -387,8 +355,6 @@ - - @@ -410,8 +376,6 @@ - - @@ -433,8 +397,6 @@ - - @@ -456,8 +418,6 @@ - - @@ -479,8 +439,6 @@ - - @@ -496,8 +454,6 @@ - - @@ -519,8 +475,6 @@ - - @@ -542,8 +496,6 @@ - - @@ -565,8 +517,6 @@ - - @@ -588,8 +538,6 @@ - - @@ -611,8 +559,6 @@ - - @@ -634,8 +580,6 @@ - - @@ -657,8 +601,6 @@ - - @@ -680,8 +622,6 @@ - - @@ -703,8 +643,6 @@ - - @@ -726,8 +664,6 @@ - - @@ -749,8 +685,6 @@ - - @@ -772,8 +706,6 @@ - - @@ -795,8 +727,6 @@ - - @@ -818,8 +748,6 @@ - - @@ -841,8 +769,6 @@ - - @@ -864,8 +790,6 @@ - - @@ -887,8 +811,6 @@ - - @@ -910,8 +832,6 @@ - - @@ -933,8 +853,6 @@ - - @@ -956,8 +874,6 @@ - - @@ -979,8 +895,6 @@ - - @@ -1002,8 +916,6 @@ - - @@ -1025,8 +937,6 @@ - - @@ -1048,8 +958,6 @@ - - @@ -1071,8 +979,6 @@ - - @@ -1094,8 +1000,6 @@ - - @@ -1117,8 +1021,6 @@ - - @@ -1140,8 +1042,6 @@ - - @@ -1163,8 +1063,6 @@ - - @@ -1186,8 +1084,6 @@ - - @@ -1209,8 +1105,6 @@ - - @@ -1232,8 +1126,6 @@ - - @@ -1255,8 +1147,6 @@ - - @@ -1278,8 +1168,6 @@ - - @@ -1301,8 +1189,6 @@ - - @@ -1324,8 +1210,6 @@ - - @@ -1347,8 +1231,6 @@ - - @@ -1370,8 +1252,6 @@ - - @@ -1393,8 +1273,6 @@ - - @@ -1416,8 +1294,6 @@ - - @@ -1439,8 +1315,6 @@ - - @@ -1462,8 +1336,6 @@ - - @@ -1485,8 +1357,6 @@ - - @@ -1508,8 +1378,6 @@ - - @@ -1531,8 +1399,6 @@ - - @@ -1554,8 +1420,6 @@ - - @@ -1577,8 +1441,6 @@ - - @@ -1600,8 +1462,6 @@ - - @@ -1623,8 +1483,6 @@ - - @@ -1646,8 +1504,6 @@ - - @@ -1669,8 +1525,6 @@ - - @@ -1692,8 +1546,6 @@ - - @@ -1715,8 +1567,6 @@ - - @@ -1738,8 +1588,6 @@ - - @@ -1761,8 +1609,6 @@ - - @@ -1784,8 +1630,6 @@ - - @@ -1807,8 +1651,6 @@ - - @@ -1830,8 +1672,6 @@ - - @@ -1853,8 +1693,6 @@ - - @@ -1876,8 +1714,6 @@ - - @@ -1899,8 +1735,6 @@ - - @@ -1922,8 +1756,6 @@ - - @@ -1945,8 +1777,6 @@ - - @@ -1968,8 +1798,6 @@ - - @@ -1991,8 +1819,6 @@ - - @@ -2014,8 +1840,6 @@ - - @@ -2037,8 +1861,6 @@ - - @@ -2060,8 +1882,6 @@ - - @@ -2083,8 +1903,6 @@ - - @@ -2106,8 +1924,6 @@ - - @@ -2129,8 +1945,6 @@ - - @@ -2152,8 +1966,6 @@ - - @@ -2175,8 +1987,6 @@ - - @@ -2198,8 +2008,6 @@ - - @@ -2221,8 +2029,6 @@ - - @@ -2244,8 +2050,6 @@ - - @@ -2267,8 +2071,6 @@ - - @@ -2290,8 +2092,6 @@ - - diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/29000-29099.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/29000-29099.xml index 8e0f6da79b..77ce3213f0 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/29000-29099.xml +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/29000-29099.xml @@ -19,8 +19,6 @@ - - @@ -42,8 +40,6 @@ - - @@ -65,8 +61,6 @@ - - @@ -88,8 +82,6 @@ - - @@ -111,8 +103,6 @@ - - @@ -134,8 +124,6 @@ - - @@ -157,8 +145,6 @@ - - @@ -180,8 +166,6 @@ - - @@ -203,8 +187,6 @@ - - @@ -226,8 +208,6 @@ - - @@ -249,8 +229,6 @@ - - @@ -272,8 +250,6 @@ - - @@ -295,8 +271,6 @@ - - @@ -318,8 +292,6 @@ - - @@ -341,8 +313,6 @@ - - @@ -364,8 +334,6 @@ - - @@ -387,8 +355,6 @@ - - @@ -410,8 +376,6 @@ - - @@ -433,8 +397,6 @@ - - @@ -456,8 +418,6 @@ - - @@ -479,8 +439,6 @@ - - @@ -502,8 +460,6 @@ - - @@ -525,8 +481,6 @@ - - @@ -548,8 +502,6 @@ - - @@ -571,8 +523,6 @@ - - @@ -594,8 +544,6 @@ - - @@ -617,8 +565,6 @@ - - @@ -640,8 +586,6 @@ - - @@ -663,8 +607,6 @@ - - @@ -686,8 +628,6 @@ - - @@ -709,8 +649,6 @@ - - @@ -732,8 +670,6 @@ - - @@ -755,8 +691,6 @@ - - @@ -778,8 +712,6 @@ - - @@ -801,8 +733,6 @@ - - @@ -824,8 +754,6 @@ - - @@ -847,8 +775,6 @@ - - @@ -870,8 +796,6 @@ - - @@ -893,8 +817,6 @@ - - @@ -916,8 +838,6 @@ - - @@ -939,8 +859,6 @@ - - @@ -962,8 +880,6 @@ - - @@ -985,8 +901,6 @@ - - @@ -1008,8 +922,6 @@ - - @@ -1031,8 +943,6 @@ - - @@ -1054,8 +964,6 @@ - - @@ -1077,8 +985,6 @@ - - @@ -1100,8 +1006,6 @@ - - @@ -1123,8 +1027,6 @@ - - @@ -1146,8 +1048,6 @@ - - @@ -1169,8 +1069,6 @@ - - @@ -1192,8 +1090,6 @@ - - @@ -1215,8 +1111,6 @@ - - @@ -1238,8 +1132,6 @@ - - @@ -1261,8 +1153,6 @@ - - @@ -1284,8 +1174,6 @@ - - @@ -1307,8 +1195,6 @@ - - @@ -1698,8 +1584,6 @@ - - @@ -1718,8 +1602,6 @@ - - @@ -1738,8 +1620,6 @@ - - @@ -1758,8 +1638,6 @@ - - @@ -1778,8 +1656,6 @@ - - @@ -1798,8 +1674,6 @@ - - @@ -1818,8 +1692,6 @@ - - @@ -1838,8 +1710,6 @@ - - @@ -1858,8 +1728,6 @@ - - @@ -1878,8 +1746,6 @@ - - @@ -1898,8 +1764,6 @@ - - @@ -1918,8 +1782,6 @@ - - @@ -1938,8 +1800,6 @@ - - @@ -1958,8 +1818,6 @@ - - @@ -1978,8 +1836,6 @@ - - @@ -1998,8 +1854,6 @@ - - @@ -2018,8 +1872,6 @@ - - diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/29100-29199.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/29100-29199.xml index c50055ec20..bd50697e79 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/29100-29199.xml +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/29100-29199.xml @@ -13,8 +13,6 @@ - - @@ -30,8 +28,6 @@ - - @@ -47,8 +43,6 @@ - - @@ -64,8 +58,6 @@ - - @@ -81,8 +73,6 @@ - - @@ -98,8 +88,6 @@ - - @@ -115,8 +103,6 @@ - - diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/48100-48199.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/48100-48199.xml index 654d27187c..0f54ed959b 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/48100-48199.xml +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/48100-48199.xml @@ -333,10 +333,7 @@ - - - - + @@ -463,15 +460,11 @@ - - - - - - + + diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/48200-48299.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/48200-48299.xml index 5554f8fde1..46a258db42 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/48200-48299.xml +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/48200-48299.xml @@ -1061,10 +1061,7 @@ - - - - + diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/48500-48599.xml b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/48500-48599.xml index bb60197899..59df6a64dc 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/48500-48599.xml +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/stats/items/48500-48599.xml @@ -1253,26 +1253,7 @@ - - - - - - - - - - - - - - - - - - - - + @@ -1287,26 +1268,7 @@ - - - - - - - - - - - - - - - - - - - - + @@ -1321,26 +1283,7 @@ - - - - - - - - - - - - - - - - - - - - + diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/xsd/AgathionData.xsd b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/xsd/AgathionData.xsd new file mode 100644 index 0000000000..021fb7e22f --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/data/xsd/AgathionData.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameServer.java index 7dda47cf28..b5864a1518 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameServer.java @@ -45,6 +45,7 @@ import org.l2jmobius.gameserver.data.sql.CrestTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.xml.ActionData; import org.l2jmobius.gameserver.data.xml.AdminData; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AlchemyData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; @@ -270,6 +271,7 @@ public class GameServer BuyListData.getInstance(); MultisellData.getInstance(); EquipmentUpgradeData.getInstance(); + AgathionData.getInstance(); RecipeData.getInstance(); ArmorSetData.getInstance(); FishingData.getInstance(); diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/xml/AgathionData.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/xml/AgathionData.java new file mode 100644 index 0000000000..049e6620ca --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/data/xml/AgathionData.java @@ -0,0 +1,136 @@ +/* + * 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 org.l2jmobius.gameserver.data.xml; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import org.w3c.dom.Document; + +import org.l2jmobius.commons.util.IXmlReader; +import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; + +/** + * @author Mobius + */ +public class AgathionData implements IXmlReader +{ + private static final Logger LOGGER = Logger.getLogger(AgathionData.class.getName()); + + private static final Map AGATHION_SKILLS = new HashMap<>(); + + protected AgathionData() + { + load(); + } + + @Override + public void load() + { + AGATHION_SKILLS.clear(); + parseDatapackFile("data/AgathionData.xml"); + LOGGER.info(getClass().getSimpleName() + ": Loaded " + AGATHION_SKILLS.size() + " agathion data."); + } + + @Override + public void parseDocument(Document doc, File f) + { + forEach(doc, "list", listNode -> forEach(listNode, "agathion", agathionNode -> + { + final StatSet set = new StatSet(parseAttributes(agathionNode)); + + final int id = set.getInt("id"); + if (ItemTable.getInstance().getTemplate(id) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion with id " + id + "."); + return; + } + + final int enchant = set.getInt("enchant", 0); + + final Map> mainSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getMainSkills() : new HashMap<>(); + final List mainSkillList = new ArrayList<>(); + final String main = set.getString("mainSkill", ""); + for (String skill : main.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + mainSkillList.add(new SkillHolder(skillId, level)); + } + mainSkills.put(enchant, mainSkillList); + + final Map> subSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getSubSkills() : new HashMap<>(); + final List subSkillList = new ArrayList<>(); + final String sub = set.getString("subSkill", ""); + for (String skill : sub.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + subSkillList.add(new SkillHolder(skillId, level)); + } + subSkills.put(enchant, subSkillList); + + AGATHION_SKILLS.put(id, new AgathionSkillHolder(mainSkills, subSkills)); + })); + } + + public AgathionSkillHolder getSkills(int agathionId) + { + return AGATHION_SKILLS.get(agathionId); + } + + public static AgathionData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final AgathionData INSTANCE = new AgathionData(); + } +} diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java new file mode 100644 index 0000000000..78fef28978 --- /dev/null +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java @@ -0,0 +1,64 @@ +/* + * 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 org.l2jmobius.gameserver.model.holders; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * @author Mobius + */ +public class AgathionSkillHolder +{ + private final Map> _mainSkill; + private final Map> _subSkill; + + public AgathionSkillHolder(Map> mainSkill, Map> subSkill) + { + _mainSkill = mainSkill; + _subSkill = subSkill; + } + + public Map> getMainSkills() + { + return _mainSkill; + } + + public Map> getSubSkills() + { + return _subSkill; + } + + public List getMainSkills(int enchantLevel) + { + if (!_mainSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _mainSkill.get(enchantLevel); + } + + public List getSubSkills(int enchantLevel) + { + if (!_subSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _subSkill.get(enchantLevel); + } +} diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java index f321011c13..e94d279cee 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java @@ -35,6 +35,7 @@ import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.util.CommonUtil; import org.l2jmobius.gameserver.cache.PaperdollCache; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; import org.l2jmobius.gameserver.enums.ItemLocation; @@ -48,8 +49,10 @@ import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.events.EventDispatcher; import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder; import org.l2jmobius.gameserver.model.holders.ItemSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.appearance.AppearanceStone; @@ -592,8 +595,12 @@ public abstract class Inventory extends ItemContainer } } - // Apply skill, if weapon have "skills on equip" - item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + // Apply skill, if item has "skills on equip" and it is not a secondary agathion. + if ((slot < PAPERDOLL_AGATHION2) || (slot > PAPERDOLL_AGATHION5)) + { + item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + } + if (update) { player.sendSkillList(); @@ -1344,7 +1351,32 @@ public abstract class Inventory extends ItemContainer listener.notifyUnequiped(slot, old, this); } old.updateDatabase(); + + // Remove agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId()); + if (agathionSkills != null) + { + boolean update = false; + for (SkillHolder holder : agathionSkills.getMainSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } + // Add new item in slot of paperdoll if (item != null) { @@ -1364,6 +1396,41 @@ public abstract class Inventory extends ItemContainer listener.notifyEquiped(slot, item, this); } item.updateDatabase(); + + // Add agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId()); + if (agathionSkills != null) + { + boolean update = false; + if (slot == PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } _paperdollCache.clearCachedStats(); diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/Item.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/Item.java index 243d1cd559..58fd46ecb2 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/Item.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/Item.java @@ -828,6 +828,13 @@ public abstract class Item extends ListenersContainer implements IIdentifiable public void addSkill(ItemSkillHolder holder) { + // Agathion skills managed by AgathionData. + // if ((getBodyPart() == SLOT_AGATHION) && (holder.getType() != ItemSkillType.ON_EQUIP) && (holder.getType() != ItemSkillType.ON_UNEQUIP)) + // { + // LOGGER.warning("Remove from agathion " + _itemId + " " + holder + "!"); + // return; + // } + if (_skills == null) { _skills = new ArrayList<>(); diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index 3acd046d30..beae6e0db1 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -36,6 +36,7 @@ import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData; import org.l2jmobius.gameserver.data.xml.EnsoulData; @@ -70,7 +71,10 @@ import org.l2jmobius.gameserver.model.events.impl.item.OnItemBypassEvent; import org.l2jmobius.gameserver.model.events.impl.item.OnItemEnchantAdd; import org.l2jmobius.gameserver.model.events.impl.item.OnItemSoulCrystalAdd; import org.l2jmobius.gameserver.model.events.impl.item.OnItemTalk; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.items.Armor; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; @@ -83,6 +87,7 @@ import org.l2jmobius.gameserver.model.options.EnchantOptions; import org.l2jmobius.gameserver.model.options.Options; import org.l2jmobius.gameserver.model.siege.Castle; import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillConditionScope; import org.l2jmobius.gameserver.model.variables.ItemVariables; import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.DropItem; @@ -930,7 +935,56 @@ public class ItemInstance extends WorldObject { return; } + clearEnchantStats(); + + // Agathion skills. + if (isEquipped() && (_item.getBodyPart() == Item.SLOT_AGATHION)) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId()); + if (agathionSkills != null) + { + boolean update = false; + // Remove old skills. + for (SkillHolder holder : agathionSkills.getMainSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + // Add new skills. + if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getActingPlayer().sendSkillList(); + } + } + } + _enchantLevel = enchantLevel; applyEnchantStats(); _storedInDb = false; diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 782f03c902..9ab2453009 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -52,6 +52,7 @@ import org.l2jmobius.gameserver.model.clan.Clan; import org.l2jmobius.gameserver.model.holders.AttendanceInfoHolder; import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -651,6 +652,13 @@ public class EnterWorld implements IClientIncomingPacket player.updateAbnormalVisualEffects(); } + // Activate first agathion when available. + final ItemInstance agathion = player.getInventory().unEquipItemInBodySlot(Item.SLOT_AGATHION); + if (agathion != null) + { + player.getInventory().equipItemAndRecord(agathion); + } + if (Config.ENABLE_ATTENDANCE_REWARDS) { ThreadPool.schedule(() -> diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/AgathionData.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/AgathionData.xml new file mode 100644 index 0000000000..05caf14a33 --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/AgathionData.xml @@ -0,0 +1,3797 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/28700-28799.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/28700-28799.xml index 20f0eac7f2..e2d4165be7 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/28700-28799.xml +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/28700-28799.xml @@ -1160,18 +1160,6 @@ - - - - - - - - - - - - @@ -1193,18 +1181,6 @@ - - - - - - - - - - - - @@ -1226,18 +1202,6 @@ - - - - - - - - - - - - @@ -1259,18 +1223,6 @@ - - - - - - - - - - - - @@ -1292,18 +1244,6 @@ - - - - - - - - - - - - @@ -1325,18 +1265,6 @@ - - - - - - - - - - - - @@ -1358,18 +1286,6 @@ - - - - - - - - - - - - @@ -1391,18 +1307,6 @@ - - - - - - - - - - - - @@ -1424,18 +1328,6 @@ - - - - - - - - - - - - @@ -1457,18 +1349,6 @@ - - - - - - - - - - - - @@ -1490,18 +1370,6 @@ - - - - - - - - - - - - @@ -1523,18 +1391,6 @@ - - - - - - - - - - - - @@ -1556,18 +1412,6 @@ - - - - - - - - - - - - @@ -1589,18 +1433,6 @@ - - - - - - - - - - - - @@ -1622,18 +1454,6 @@ - - - - - - - - - - - - @@ -1655,8 +1475,6 @@ - - @@ -1678,18 +1496,6 @@ - - - - - - - - - - - - @@ -1711,18 +1517,6 @@ - - - - - - - - - - - - @@ -1744,18 +1538,6 @@ - - - - - - - - - - - - @@ -1777,18 +1559,6 @@ - - - - - - - - - - - - @@ -1810,18 +1580,6 @@ - - - - - - - - - - - - @@ -1843,18 +1601,6 @@ - - - - - - - - - - - - @@ -1876,18 +1622,6 @@ - - - - - - - - - - - - @@ -1909,18 +1643,6 @@ - - - - - - - - - - - - @@ -1942,18 +1664,6 @@ - - - - - - - - - - - - @@ -1975,18 +1685,6 @@ - - - - - - - - - - - - @@ -2008,18 +1706,6 @@ - - - - - - - - - - - - @@ -2041,18 +1727,6 @@ - - - - - - - - - - - - @@ -2074,18 +1748,6 @@ - - - - - - - - - - - - @@ -2107,18 +1769,6 @@ - - - - - - - - - - - - @@ -2140,18 +1790,6 @@ - - - - - - - - - - - - diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/28800-28899.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/28800-28899.xml index f958108c56..13470dcbd1 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/28800-28899.xml +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/28800-28899.xml @@ -19,18 +19,6 @@ - - - - - - - - - - - - @@ -52,18 +40,6 @@ - - - - - - - - - - - - @@ -86,18 +62,6 @@ - - - - - - - - - - - - @@ -119,18 +83,6 @@ - - - - - - - - - - - - @@ -152,18 +104,6 @@ - - - - - - - - - - - - @@ -185,18 +125,6 @@ - - - - - - - - - - - - @@ -218,18 +146,6 @@ - - - - - - - - - - - - @@ -251,18 +167,6 @@ - - - - - - - - - - - - @@ -284,18 +188,6 @@ - - - - - - - - - - - - @@ -317,18 +209,6 @@ - - - - - - - - - - - - @@ -350,18 +230,6 @@ - - - - - - - - - - - - @@ -383,18 +251,6 @@ - - - - - - - - - - - - @@ -416,18 +272,6 @@ - - - - - - - - - - - - @@ -449,18 +293,6 @@ - - - - - - - - - - - - @@ -482,18 +314,6 @@ - - - - - - - - - - - - @@ -515,18 +335,6 @@ - - - - - - - - - - - - @@ -548,18 +356,6 @@ - - - - - - - - - - - - @@ -581,18 +377,6 @@ - - - - - - - - - - - - @@ -614,18 +398,6 @@ - - - - - - - - - - - - @@ -647,18 +419,6 @@ - - - - - - - - - - - - @@ -680,18 +440,6 @@ - - - - - - - - - - - - @@ -713,18 +461,6 @@ - - - - - - - - - - - - @@ -746,18 +482,6 @@ - - - - - - - - - - - - @@ -779,18 +503,6 @@ - - - - - - - - - - - - @@ -812,18 +524,6 @@ - - - - - - - - - - - - @@ -845,18 +545,6 @@ - - - - - - - - - - - - @@ -878,18 +566,6 @@ - - - - - - - - - - - - @@ -911,18 +587,6 @@ - - - - - - - - - - - - @@ -944,18 +608,6 @@ - - - - - - - - - - - - @@ -977,18 +629,6 @@ - - - - - - - - - - - - @@ -1010,18 +650,6 @@ - - - - - - - - - - - - @@ -1043,18 +671,6 @@ - - - - - - - - - - - - @@ -1076,18 +692,6 @@ - - - - - - - - - - - - @@ -1109,18 +713,6 @@ - - - - - - - - - - - - @@ -1142,18 +734,6 @@ - - - - - - - - - - - - @@ -1175,18 +755,6 @@ - - - - - - - - - - - - @@ -1208,18 +776,6 @@ - - - - - - - - - - - - @@ -1241,18 +797,6 @@ - - - - - - - - - - - - @@ -1274,18 +818,6 @@ - - - - - - - - - - - - @@ -1307,18 +839,6 @@ - - - - - - - - - - - - @@ -1340,18 +860,6 @@ - - - - - - - - - - - - @@ -1373,18 +881,6 @@ - - - - - - - - - - - - @@ -1406,18 +902,6 @@ - - - - - - - - - - - - @@ -1439,18 +923,6 @@ - - - - - - - - - - - - @@ -1472,18 +944,6 @@ - - - - - - - - - - - - @@ -1505,18 +965,6 @@ - - - - - - - - - - - - @@ -1538,18 +986,6 @@ - - - - - - - - - - - - @@ -1571,18 +1007,6 @@ - - - - - - - - - - - - @@ -1604,18 +1028,6 @@ - - - - - - - - - - - - @@ -1637,18 +1049,6 @@ - - - - - - - - - - - - @@ -1670,18 +1070,6 @@ - - - - - - - - - - - - @@ -1703,18 +1091,6 @@ - - - - - - - - - - - - @@ -1736,18 +1112,6 @@ - - - - - - - - - - - - @@ -1769,18 +1133,6 @@ - - - - - - - - - - - - @@ -1802,18 +1154,6 @@ - - - - - - - - - - - - @@ -1835,18 +1175,6 @@ - - - - - - - - - - - - @@ -1868,18 +1196,6 @@ - - - - - - - - - - - - @@ -1901,18 +1217,6 @@ - - - - - - - - - - - - @@ -1934,18 +1238,6 @@ - - - - - - - - - - - - @@ -1967,18 +1259,6 @@ - - - - - - - - - - - - @@ -2000,18 +1280,6 @@ - - - - - - - - - - - - @@ -2033,18 +1301,6 @@ - - - - - - - - - - - - @@ -2066,18 +1322,6 @@ - - - - - - - - - - - - @@ -2099,18 +1343,6 @@ - - - - - - - - - - - - @@ -2132,18 +1364,6 @@ - - - - - - - - - - - - @@ -2165,18 +1385,6 @@ - - - - - - - - - - - - @@ -2198,18 +1406,6 @@ - - - - - - - - - - - - @@ -2231,18 +1427,6 @@ - - - - - - - - - - - - @@ -2264,18 +1448,6 @@ - - - - - - - - - - - - @@ -2297,18 +1469,6 @@ - - - - - - - - - - - - @@ -2330,18 +1490,6 @@ - - - - - - - - - - - - @@ -2363,18 +1511,6 @@ - - - - - - - - - - - - @@ -2396,18 +1532,6 @@ - - - - - - - - - - - - @@ -2429,18 +1553,6 @@ - - - - - - - - - - - - @@ -2462,18 +1574,6 @@ - - - - - - - - - - - - @@ -2495,18 +1595,6 @@ - - - - - - - - - - - - @@ -2528,18 +1616,6 @@ - - - - - - - - - - - - @@ -2561,18 +1637,6 @@ - - - - - - - - - - - - @@ -2594,18 +1658,6 @@ - - - - - - - - - - - - @@ -2627,18 +1679,6 @@ - - - - - - - - - - - - @@ -2660,18 +1700,6 @@ - - - - - - - - - - - - @@ -2693,18 +1721,6 @@ - - - - - - - - - - - - @@ -2726,18 +1742,6 @@ - - - - - - - - - - - - @@ -2759,18 +1763,6 @@ - - - - - - - - - - - - @@ -2792,18 +1784,6 @@ - - - - - - - - - - - - @@ -2825,18 +1805,6 @@ - - - - - - - - - - - - @@ -2858,18 +1826,6 @@ - - - - - - - - - - - - @@ -2891,18 +1847,6 @@ - - - - - - - - - - - - @@ -2924,18 +1868,6 @@ - - - - - - - - - - - - @@ -2957,18 +1889,6 @@ - - - - - - - - - - - - @@ -2990,18 +1910,6 @@ - - - - - - - - - - - - @@ -3023,18 +1931,6 @@ - - - - - - - - - - - - @@ -3056,18 +1952,6 @@ - - - - - - - - - - - - @@ -3089,18 +1973,6 @@ - - - - - - - - - - - - @@ -3122,18 +1994,6 @@ - - - - - - - - - - - - @@ -3155,18 +2015,6 @@ - - - - - - - - - - - - @@ -3188,18 +2036,6 @@ - - - - - - - - - - - - @@ -3221,18 +2057,6 @@ - - - - - - - - - - - - @@ -3254,18 +2078,6 @@ - - - - - - - - - - - - @@ -3287,18 +2099,6 @@ - - - - - - - - - - - - diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/28900-28999.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/28900-28999.xml index 2615c41744..5b3271051a 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/28900-28999.xml +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/28900-28999.xml @@ -19,18 +19,6 @@ - - - - - - - - - - - - @@ -52,18 +40,6 @@ - - - - - - - - - - - - @@ -85,18 +61,6 @@ - - - - - - - - - - - - @@ -118,18 +82,6 @@ - - - - - - - - - - - - @@ -151,18 +103,6 @@ - - - - - - - - - - - - @@ -184,18 +124,6 @@ - - - - - - - - - - - - @@ -217,18 +145,6 @@ - - - - - - - - - - - - @@ -250,18 +166,6 @@ - - - - - - - - - - - - @@ -283,18 +187,6 @@ - - - - - - - - - - - - @@ -316,18 +208,6 @@ - - - - - - - - - - - - @@ -349,18 +229,6 @@ - - - - - - - - - - - - @@ -382,18 +250,6 @@ - - - - - - - - - - - - @@ -415,18 +271,6 @@ - - - - - - - - - - - - @@ -448,18 +292,6 @@ - - - - - - - - - - - - @@ -481,18 +313,6 @@ - - - - - - - - - - - - @@ -514,18 +334,6 @@ - - - - - - - - - - - - @@ -547,18 +355,6 @@ - - - - - - - - - - - - @@ -580,18 +376,6 @@ - - - - - - - - - - - - @@ -613,18 +397,6 @@ - - - - - - - - - - - - @@ -646,18 +418,6 @@ - - - - - - - - - - - - @@ -679,18 +439,6 @@ - - - - - - - - - - - - @@ -706,18 +454,6 @@ - - - - - - - - - - - - @@ -739,18 +475,6 @@ - - - - - - - - - - - - @@ -772,18 +496,6 @@ - - - - - - - - - - - - @@ -805,18 +517,6 @@ - - - - - - - - - - - - @@ -838,18 +538,6 @@ - - - - - - - - - - - - @@ -871,18 +559,6 @@ - - - - - - - - - - - - @@ -904,18 +580,6 @@ - - - - - - - - - - - - @@ -937,18 +601,6 @@ - - - - - - - - - - - - @@ -970,18 +622,6 @@ - - - - - - - - - - - - @@ -1003,18 +643,6 @@ - - - - - - - - - - - - @@ -1036,18 +664,6 @@ - - - - - - - - - - - - @@ -1069,18 +685,6 @@ - - - - - - - - - - - - @@ -1102,18 +706,6 @@ - - - - - - - - - - - - @@ -1135,18 +727,6 @@ - - - - - - - - - - - - @@ -1168,18 +748,6 @@ - - - - - - - - - - - - @@ -1201,18 +769,6 @@ - - - - - - - - - - - - @@ -1234,18 +790,6 @@ - - - - - - - - - - - - @@ -1267,18 +811,6 @@ - - - - - - - - - - - - @@ -1300,18 +832,6 @@ - - - - - - - - - - - - @@ -1333,18 +853,6 @@ - - - - - - - - - - - - @@ -1366,18 +874,6 @@ - - - - - - - - - - - - @@ -1399,18 +895,6 @@ - - - - - - - - - - - - @@ -1432,18 +916,6 @@ - - - - - - - - - - - - @@ -1465,18 +937,6 @@ - - - - - - - - - - - - @@ -1498,18 +958,6 @@ - - - - - - - - - - - - @@ -1531,18 +979,6 @@ - - - - - - - - - - - - @@ -1564,18 +1000,6 @@ - - - - - - - - - - - - @@ -1597,18 +1021,6 @@ - - - - - - - - - - - - @@ -1630,18 +1042,6 @@ - - - - - - - - - - - - @@ -1663,18 +1063,6 @@ - - - - - - - - - - - - @@ -1696,18 +1084,6 @@ - - - - - - - - - - - - @@ -1729,18 +1105,6 @@ - - - - - - - - - - - - @@ -1762,18 +1126,6 @@ - - - - - - - - - - - - @@ -1795,18 +1147,6 @@ - - - - - - - - - - - - @@ -1828,18 +1168,6 @@ - - - - - - - - - - - - @@ -1861,18 +1189,6 @@ - - - - - - - - - - - - @@ -1894,18 +1210,6 @@ - - - - - - - - - - - - @@ -1927,18 +1231,6 @@ - - - - - - - - - - - - @@ -1960,18 +1252,6 @@ - - - - - - - - - - - - @@ -1993,18 +1273,6 @@ - - - - - - - - - - - - @@ -2026,18 +1294,6 @@ - - - - - - - - - - - - @@ -2059,18 +1315,6 @@ - - - - - - - - - - - - @@ -2092,18 +1336,6 @@ - - - - - - - - - - - - @@ -2125,18 +1357,6 @@ - - - - - - - - - - - - @@ -2158,18 +1378,6 @@ - - - - - - - - - - - - @@ -2191,18 +1399,6 @@ - - - - - - - - - - - - @@ -2224,18 +1420,6 @@ - - - - - - - - - - - - @@ -2257,18 +1441,6 @@ - - - - - - - - - - - - @@ -2290,18 +1462,6 @@ - - - - - - - - - - - - @@ -2323,18 +1483,6 @@ - - - - - - - - - - - - @@ -2356,18 +1504,6 @@ - - - - - - - - - - - - @@ -2389,18 +1525,6 @@ - - - - - - - - - - - - @@ -2422,18 +1546,6 @@ - - - - - - - - - - - - @@ -2455,18 +1567,6 @@ - - - - - - - - - - - - @@ -2488,18 +1588,6 @@ - - - - - - - - - - - - @@ -2521,18 +1609,6 @@ - - - - - - - - - - - - @@ -2554,18 +1630,6 @@ - - - - - - - - - - - - @@ -2587,18 +1651,6 @@ - - - - - - - - - - - - @@ -2620,18 +1672,6 @@ - - - - - - - - - - - - @@ -2653,18 +1693,6 @@ - - - - - - - - - - - - @@ -2686,18 +1714,6 @@ - - - - - - - - - - - - @@ -2719,18 +1735,6 @@ - - - - - - - - - - - - @@ -2752,18 +1756,6 @@ - - - - - - - - - - - - @@ -2785,18 +1777,6 @@ - - - - - - - - - - - - @@ -2818,18 +1798,6 @@ - - - - - - - - - - - - @@ -2851,18 +1819,6 @@ - - - - - - - - - - - - @@ -2884,18 +1840,6 @@ - - - - - - - - - - - - @@ -2917,18 +1861,6 @@ - - - - - - - - - - - - @@ -2950,18 +1882,6 @@ - - - - - - - - - - - - @@ -2983,18 +1903,6 @@ - - - - - - - - - - - - @@ -3016,18 +1924,6 @@ - - - - - - - - - - - - @@ -3049,18 +1945,6 @@ - - - - - - - - - - - - @@ -3082,18 +1966,6 @@ - - - - - - - - - - - - @@ -3115,18 +1987,6 @@ - - - - - - - - - - - - @@ -3148,18 +2008,6 @@ - - - - - - - - - - - - @@ -3181,18 +2029,6 @@ - - - - - - - - - - - - @@ -3214,18 +2050,6 @@ - - - - - - - - - - - - @@ -3247,18 +2071,6 @@ - - - - - - - - - - - - @@ -3280,18 +2092,6 @@ - - - - - - - - - - - - diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/29000-29099.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/29000-29099.xml index a88561a7b7..295940675e 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/29000-29099.xml +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/29000-29099.xml @@ -19,18 +19,6 @@ - - - - - - - - - - - - @@ -52,18 +40,6 @@ - - - - - - - - - - - - @@ -85,18 +61,6 @@ - - - - - - - - - - - - @@ -118,18 +82,6 @@ - - - - - - - - - - - - @@ -151,18 +103,6 @@ - - - - - - - - - - - - @@ -184,18 +124,6 @@ - - - - - - - - - - - - @@ -217,18 +145,6 @@ - - - - - - - - - - - - @@ -250,18 +166,6 @@ - - - - - - - - - - - - @@ -283,18 +187,6 @@ - - - - - - - - - - - - @@ -316,18 +208,6 @@ - - - - - - - - - - - - @@ -349,18 +229,6 @@ - - - - - - - - - - - - @@ -382,18 +250,6 @@ - - - - - - - - - - - - @@ -415,18 +271,6 @@ - - - - - - - - - - - - @@ -448,18 +292,6 @@ - - - - - - - - - - - - @@ -481,18 +313,6 @@ - - - - - - - - - - - - @@ -514,18 +334,6 @@ - - - - - - - - - - - - @@ -547,18 +355,6 @@ - - - - - - - - - - - - @@ -580,18 +376,6 @@ - - - - - - - - - - - - @@ -613,18 +397,6 @@ - - - - - - - - - - - - @@ -646,18 +418,6 @@ - - - - - - - - - - - - @@ -679,18 +439,6 @@ - - - - - - - - - - - - @@ -712,18 +460,6 @@ - - - - - - - - - - - - @@ -745,18 +481,6 @@ - - - - - - - - - - - - @@ -778,18 +502,6 @@ - - - - - - - - - - - - @@ -811,18 +523,6 @@ - - - - - - - - - - - - @@ -844,18 +544,6 @@ - - - - - - - - - - - - @@ -877,18 +565,6 @@ - - - - - - - - - - - - @@ -910,18 +586,6 @@ - - - - - - - - - - - - @@ -943,18 +607,6 @@ - - - - - - - - - - - - @@ -976,18 +628,6 @@ - - - - - - - - - - - - @@ -1009,18 +649,6 @@ - - - - - - - - - - - - @@ -1042,18 +670,6 @@ - - - - - - - - - - - - @@ -1075,18 +691,6 @@ - - - - - - - - - - - - @@ -1108,18 +712,6 @@ - - - - - - - - - - - - @@ -1141,18 +733,6 @@ - - - - - - - - - - - - @@ -1174,18 +754,6 @@ - - - - - - - - - - - - @@ -1207,18 +775,6 @@ - - - - - - - - - - - - @@ -1240,18 +796,6 @@ - - - - - - - - - - - - @@ -1273,18 +817,6 @@ - - - - - - - - - - - - @@ -1306,18 +838,6 @@ - - - - - - - - - - - - @@ -1339,18 +859,6 @@ - - - - - - - - - - - - @@ -1372,18 +880,6 @@ - - - - - - - - - - - - @@ -1405,18 +901,6 @@ - - - - - - - - - - - - @@ -1438,18 +922,6 @@ - - - - - - - - - - - - @@ -1471,18 +943,6 @@ - - - - - - - - - - - - @@ -1504,18 +964,6 @@ - - - - - - - - - - - - @@ -1537,18 +985,6 @@ - - - - - - - - - - - - @@ -1570,18 +1006,6 @@ - - - - - - - - - - - - @@ -1603,18 +1027,6 @@ - - - - - - - - - - - - @@ -1636,18 +1048,6 @@ - - - - - - - - - - - - @@ -1669,18 +1069,6 @@ - - - - - - - - - - - - @@ -1702,18 +1090,6 @@ - - - - - - - - - - - - @@ -1735,18 +1111,6 @@ - - - - - - - - - - - - @@ -1768,18 +1132,6 @@ - - - - - - - - - - - - @@ -1801,18 +1153,6 @@ - - - - - - - - - - - - @@ -1834,18 +1174,6 @@ - - - - - - - - - - - - @@ -1867,18 +1195,6 @@ - - - - - - - - - - - - @@ -2268,8 +1584,6 @@ - - @@ -2288,8 +1602,6 @@ - - @@ -2308,8 +1620,6 @@ - - @@ -2328,8 +1638,6 @@ - - @@ -2348,8 +1656,6 @@ - - @@ -2368,8 +1674,6 @@ - - @@ -2388,8 +1692,6 @@ - - @@ -2408,8 +1710,6 @@ - - @@ -2428,8 +1728,6 @@ - - @@ -2448,8 +1746,6 @@ - - @@ -2468,8 +1764,6 @@ - - @@ -2488,8 +1782,6 @@ - - @@ -2508,8 +1800,6 @@ - - @@ -2528,8 +1818,6 @@ - - @@ -2548,8 +1836,6 @@ - - @@ -2568,8 +1854,6 @@ - - @@ -2588,8 +1872,6 @@ - - diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/29100-29199.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/29100-29199.xml index d60a3691f5..a57ed28d53 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/29100-29199.xml +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/29100-29199.xml @@ -13,8 +13,6 @@ - - @@ -30,8 +28,6 @@ - - @@ -47,8 +43,6 @@ - - @@ -64,8 +58,6 @@ - - @@ -81,8 +73,6 @@ - - @@ -98,8 +88,6 @@ - - @@ -115,8 +103,6 @@ - - diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48000-48099.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48000-48099.xml index b361f51254..829a2ad6cc 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48000-48099.xml +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48000-48099.xml @@ -493,28 +493,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -530,28 +508,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -567,28 +523,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -604,28 +538,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -641,28 +553,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -678,28 +568,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -715,28 +583,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -752,28 +598,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -789,28 +613,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -826,28 +628,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -863,28 +643,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -900,28 +658,6 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48100-48199.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48100-48199.xml index 4df976432e..3ef2dd363a 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48100-48199.xml +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48100-48199.xml @@ -334,9 +334,6 @@ - - - @@ -466,11 +463,8 @@ - - - - - + + diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48200-48299.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48200-48299.xml index 666dc44845..86cc020e30 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48200-48299.xml +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48200-48299.xml @@ -1070,10 +1070,7 @@ - - - - + diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48500-48599.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48500-48599.xml index 054f96522b..20d9eb9157 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48500-48599.xml +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/48500-48599.xml @@ -1255,25 +1255,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1289,25 +1270,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1323,25 +1285,6 @@ - - - - - - - - - - - - - - - - - - - diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/80900-80999.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/80900-80999.xml index b093a2937f..3deca8e999 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/80900-80999.xml +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/80900-80999.xml @@ -552,28 +552,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -589,28 +567,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -626,28 +582,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -663,28 +597,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -700,28 +612,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -737,28 +627,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -774,28 +642,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -811,28 +657,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -848,28 +672,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -885,28 +687,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -922,28 +702,6 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -959,28 +717,6 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/81400-81499.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/81400-81499.xml index 1bcc999ff9..6e5da0dbc3 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/81400-81499.xml +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/81400-81499.xml @@ -460,22 +460,6 @@ - - - - - - - - - - - - - - - - @@ -493,8 +477,6 @@ - - diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/81600-81699.xml b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/81600-81699.xml index eca0e2650c..d1dbbb77ef 100644 --- a/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/81600-81699.xml +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/stats/items/81600-81699.xml @@ -573,7 +573,6 @@ - diff --git a/L2J_Mobius_8.0_Homunculus/dist/game/data/xsd/AgathionData.xsd b/L2J_Mobius_8.0_Homunculus/dist/game/data/xsd/AgathionData.xsd new file mode 100644 index 0000000000..021fb7e22f --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/dist/game/data/xsd/AgathionData.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/GameServer.java index 9b6e917b7f..af8c12e698 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/GameServer.java @@ -45,6 +45,7 @@ import org.l2jmobius.gameserver.data.sql.CrestTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.xml.ActionData; import org.l2jmobius.gameserver.data.xml.AdminData; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AlchemyData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; @@ -269,6 +270,7 @@ public class GameServer BuyListData.getInstance(); MultisellData.getInstance(); EquipmentUpgradeData.getInstance(); + AgathionData.getInstance(); RecipeData.getInstance(); ArmorSetData.getInstance(); FishingData.getInstance(); diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/xml/AgathionData.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/xml/AgathionData.java new file mode 100644 index 0000000000..049e6620ca --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/data/xml/AgathionData.java @@ -0,0 +1,136 @@ +/* + * 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 org.l2jmobius.gameserver.data.xml; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import org.w3c.dom.Document; + +import org.l2jmobius.commons.util.IXmlReader; +import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; + +/** + * @author Mobius + */ +public class AgathionData implements IXmlReader +{ + private static final Logger LOGGER = Logger.getLogger(AgathionData.class.getName()); + + private static final Map AGATHION_SKILLS = new HashMap<>(); + + protected AgathionData() + { + load(); + } + + @Override + public void load() + { + AGATHION_SKILLS.clear(); + parseDatapackFile("data/AgathionData.xml"); + LOGGER.info(getClass().getSimpleName() + ": Loaded " + AGATHION_SKILLS.size() + " agathion data."); + } + + @Override + public void parseDocument(Document doc, File f) + { + forEach(doc, "list", listNode -> forEach(listNode, "agathion", agathionNode -> + { + final StatSet set = new StatSet(parseAttributes(agathionNode)); + + final int id = set.getInt("id"); + if (ItemTable.getInstance().getTemplate(id) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion with id " + id + "."); + return; + } + + final int enchant = set.getInt("enchant", 0); + + final Map> mainSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getMainSkills() : new HashMap<>(); + final List mainSkillList = new ArrayList<>(); + final String main = set.getString("mainSkill", ""); + for (String skill : main.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + mainSkillList.add(new SkillHolder(skillId, level)); + } + mainSkills.put(enchant, mainSkillList); + + final Map> subSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getSubSkills() : new HashMap<>(); + final List subSkillList = new ArrayList<>(); + final String sub = set.getString("subSkill", ""); + for (String skill : sub.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + subSkillList.add(new SkillHolder(skillId, level)); + } + subSkills.put(enchant, subSkillList); + + AGATHION_SKILLS.put(id, new AgathionSkillHolder(mainSkills, subSkills)); + })); + } + + public AgathionSkillHolder getSkills(int agathionId) + { + return AGATHION_SKILLS.get(agathionId); + } + + public static AgathionData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final AgathionData INSTANCE = new AgathionData(); + } +} diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java new file mode 100644 index 0000000000..78fef28978 --- /dev/null +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java @@ -0,0 +1,64 @@ +/* + * 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 org.l2jmobius.gameserver.model.holders; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * @author Mobius + */ +public class AgathionSkillHolder +{ + private final Map> _mainSkill; + private final Map> _subSkill; + + public AgathionSkillHolder(Map> mainSkill, Map> subSkill) + { + _mainSkill = mainSkill; + _subSkill = subSkill; + } + + public Map> getMainSkills() + { + return _mainSkill; + } + + public Map> getSubSkills() + { + return _subSkill; + } + + public List getMainSkills(int enchantLevel) + { + if (!_mainSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _mainSkill.get(enchantLevel); + } + + public List getSubSkills(int enchantLevel) + { + if (!_subSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _subSkill.get(enchantLevel); + } +} diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java index a386829897..23954a6eb0 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java @@ -35,6 +35,7 @@ import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.util.CommonUtil; import org.l2jmobius.gameserver.cache.PaperdollCache; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; import org.l2jmobius.gameserver.enums.ItemLocation; @@ -48,8 +49,10 @@ import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.events.EventDispatcher; import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder; import org.l2jmobius.gameserver.model.holders.ItemSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.appearance.AppearanceStone; @@ -593,8 +596,12 @@ public abstract class Inventory extends ItemContainer } } - // Apply skill, if weapon have "skills on equip" - item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + // Apply skill, if item has "skills on equip" and it is not a secondary agathion. + if ((slot < PAPERDOLL_AGATHION2) || (slot > PAPERDOLL_AGATHION5)) + { + item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + } + if (update) { player.sendSkillList(); @@ -1345,7 +1352,32 @@ public abstract class Inventory extends ItemContainer listener.notifyUnequiped(slot, old, this); } old.updateDatabase(); + + // Remove agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId()); + if (agathionSkills != null) + { + boolean update = false; + for (SkillHolder holder : agathionSkills.getMainSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } + // Add new item in slot of paperdoll if (item != null) { @@ -1365,6 +1397,41 @@ public abstract class Inventory extends ItemContainer listener.notifyEquiped(slot, item, this); } item.updateDatabase(); + + // Add agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId()); + if (agathionSkills != null) + { + boolean update = false; + if (slot == PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } _paperdollCache.clearCachedStats(); diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/Item.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/Item.java index 243d1cd559..58fd46ecb2 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/Item.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/Item.java @@ -828,6 +828,13 @@ public abstract class Item extends ListenersContainer implements IIdentifiable public void addSkill(ItemSkillHolder holder) { + // Agathion skills managed by AgathionData. + // if ((getBodyPart() == SLOT_AGATHION) && (holder.getType() != ItemSkillType.ON_EQUIP) && (holder.getType() != ItemSkillType.ON_UNEQUIP)) + // { + // LOGGER.warning("Remove from agathion " + _itemId + " " + holder + "!"); + // return; + // } + if (_skills == null) { _skills = new ArrayList<>(); diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index 3acd046d30..beae6e0db1 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -36,6 +36,7 @@ import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData; import org.l2jmobius.gameserver.data.xml.EnsoulData; @@ -70,7 +71,10 @@ import org.l2jmobius.gameserver.model.events.impl.item.OnItemBypassEvent; import org.l2jmobius.gameserver.model.events.impl.item.OnItemEnchantAdd; import org.l2jmobius.gameserver.model.events.impl.item.OnItemSoulCrystalAdd; import org.l2jmobius.gameserver.model.events.impl.item.OnItemTalk; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.items.Armor; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; @@ -83,6 +87,7 @@ import org.l2jmobius.gameserver.model.options.EnchantOptions; import org.l2jmobius.gameserver.model.options.Options; import org.l2jmobius.gameserver.model.siege.Castle; import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillConditionScope; import org.l2jmobius.gameserver.model.variables.ItemVariables; import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.DropItem; @@ -930,7 +935,56 @@ public class ItemInstance extends WorldObject { return; } + clearEnchantStats(); + + // Agathion skills. + if (isEquipped() && (_item.getBodyPart() == Item.SLOT_AGATHION)) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId()); + if (agathionSkills != null) + { + boolean update = false; + // Remove old skills. + for (SkillHolder holder : agathionSkills.getMainSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + // Add new skills. + if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getActingPlayer().sendSkillList(); + } + } + } + _enchantLevel = enchantLevel; applyEnchantStats(); _storedInDb = false; diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 0daef5157d..6559793c6b 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -52,6 +52,7 @@ import org.l2jmobius.gameserver.model.clan.Clan; import org.l2jmobius.gameserver.model.holders.AttendanceInfoHolder; import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -659,6 +660,13 @@ public class EnterWorld implements IClientIncomingPacket player.updateAbnormalVisualEffects(); } + // Activate first agathion when available. + final ItemInstance agathion = player.getInventory().unEquipItemInBodySlot(Item.SLOT_AGATHION); + if (agathion != null) + { + player.getInventory().equipItemAndRecord(agathion); + } + if (Config.ENABLE_ATTENDANCE_REWARDS) { ThreadPool.schedule(() -> diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/AgathionData.xml b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/AgathionData.xml new file mode 100644 index 0000000000..22ab94f8a5 --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/AgathionData.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/13000-13099.xml b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/13000-13099.xml index e0de192dc6..235a6e0402 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/13000-13099.xml +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/13000-13099.xml @@ -78,7 +78,7 @@ - + diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/20600-20699.xml b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/20600-20699.xml index c73be5460d..81bcfa8cd4 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/20600-20699.xml +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/20600-20699.xml @@ -19,7 +19,7 @@ - + diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/49000-49099.xml b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/49000-49099.xml index b74acd7d7d..df1b9fe066 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/49000-49099.xml +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/49000-49099.xml @@ -14,7 +14,7 @@ - + diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/49400-49499.xml b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/49400-49499.xml index 2deb560c1f..2491c34a99 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/49400-49499.xml +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/49400-49499.xml @@ -934,7 +934,7 @@ - + diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/70300-70399.xml b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/70300-70399.xml index 9eca27d07b..a6ca8660db 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/70300-70399.xml +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/70300-70399.xml @@ -420,7 +420,7 @@ - + diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/70900-70999.xml b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/70900-70999.xml index 1b309b48ca..782857bfbe 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/70900-70999.xml +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/70900-70999.xml @@ -500,7 +500,7 @@ - + @@ -522,7 +522,7 @@ - + @@ -544,7 +544,7 @@ - + @@ -566,7 +566,7 @@ - + diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/90800-90899.xml b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/90800-90899.xml index d5ecbb37fc..2d280ca83f 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/90800-90899.xml +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/90800-90899.xml @@ -1212,6 +1212,7 @@ + @@ -1219,11 +1220,16 @@ + + + + + @@ -1232,6 +1238,10 @@ + + + + diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/90900-90999.xml b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/90900-90999.xml index bd60864dc3..a8148680fe 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/90900-90999.xml +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/items/90900-90999.xml @@ -37,12 +37,8 @@ - - - - - - + + @@ -59,12 +55,8 @@ - - - - - - + + diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/xsd/AgathionData.xsd b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/xsd/AgathionData.xsd new file mode 100644 index 0000000000..021fb7e22f --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/xsd/AgathionData.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/GameServer.java index c6f280cb70..e340814337 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/GameServer.java @@ -46,6 +46,7 @@ import org.l2jmobius.gameserver.data.sql.CrestTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.xml.ActionData; import org.l2jmobius.gameserver.data.xml.AdminData; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; import org.l2jmobius.gameserver.data.xml.AttendanceRewardData; @@ -263,6 +264,7 @@ public class GameServer EnchantItemHPBonusData.getInstance(); BuyListData.getInstance(); MultisellData.getInstance(); + AgathionData.getInstance(); RecipeData.getInstance(); ArmorSetData.getInstance(); FishingData.getInstance(); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/data/xml/AgathionData.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/data/xml/AgathionData.java new file mode 100644 index 0000000000..049e6620ca --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/data/xml/AgathionData.java @@ -0,0 +1,136 @@ +/* + * 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 org.l2jmobius.gameserver.data.xml; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import org.w3c.dom.Document; + +import org.l2jmobius.commons.util.IXmlReader; +import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; + +/** + * @author Mobius + */ +public class AgathionData implements IXmlReader +{ + private static final Logger LOGGER = Logger.getLogger(AgathionData.class.getName()); + + private static final Map AGATHION_SKILLS = new HashMap<>(); + + protected AgathionData() + { + load(); + } + + @Override + public void load() + { + AGATHION_SKILLS.clear(); + parseDatapackFile("data/AgathionData.xml"); + LOGGER.info(getClass().getSimpleName() + ": Loaded " + AGATHION_SKILLS.size() + " agathion data."); + } + + @Override + public void parseDocument(Document doc, File f) + { + forEach(doc, "list", listNode -> forEach(listNode, "agathion", agathionNode -> + { + final StatSet set = new StatSet(parseAttributes(agathionNode)); + + final int id = set.getInt("id"); + if (ItemTable.getInstance().getTemplate(id) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion with id " + id + "."); + return; + } + + final int enchant = set.getInt("enchant", 0); + + final Map> mainSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getMainSkills() : new HashMap<>(); + final List mainSkillList = new ArrayList<>(); + final String main = set.getString("mainSkill", ""); + for (String skill : main.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + mainSkillList.add(new SkillHolder(skillId, level)); + } + mainSkills.put(enchant, mainSkillList); + + final Map> subSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getSubSkills() : new HashMap<>(); + final List subSkillList = new ArrayList<>(); + final String sub = set.getString("subSkill", ""); + for (String skill : sub.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + subSkillList.add(new SkillHolder(skillId, level)); + } + subSkills.put(enchant, subSkillList); + + AGATHION_SKILLS.put(id, new AgathionSkillHolder(mainSkills, subSkills)); + })); + } + + public AgathionSkillHolder getSkills(int agathionId) + { + return AGATHION_SKILLS.get(agathionId); + } + + public static AgathionData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final AgathionData INSTANCE = new AgathionData(); + } +} diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java new file mode 100644 index 0000000000..78fef28978 --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java @@ -0,0 +1,64 @@ +/* + * 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 org.l2jmobius.gameserver.model.holders; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * @author Mobius + */ +public class AgathionSkillHolder +{ + private final Map> _mainSkill; + private final Map> _subSkill; + + public AgathionSkillHolder(Map> mainSkill, Map> subSkill) + { + _mainSkill = mainSkill; + _subSkill = subSkill; + } + + public Map> getMainSkills() + { + return _mainSkill; + } + + public Map> getSubSkills() + { + return _subSkill; + } + + public List getMainSkills(int enchantLevel) + { + if (!_mainSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _mainSkill.get(enchantLevel); + } + + public List getSubSkills(int enchantLevel) + { + if (!_subSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _subSkill.get(enchantLevel); + } +} diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java index 686702747c..088fc3a503 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java @@ -35,6 +35,7 @@ import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.util.CommonUtil; import org.l2jmobius.gameserver.cache.PaperdollCache; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; import org.l2jmobius.gameserver.enums.ItemLocation; @@ -48,8 +49,10 @@ import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.events.EventDispatcher; import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder; import org.l2jmobius.gameserver.model.holders.ItemSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.appearance.AppearanceStone; @@ -576,8 +579,12 @@ public abstract class Inventory extends ItemContainer } } - // Apply skill, if weapon have "skills on equip" - item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + // Apply skill, if item has "skills on equip" and it is not a secondary agathion. + if ((slot < PAPERDOLL_AGATHION2) || (slot > PAPERDOLL_AGATHION5)) + { + item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + } + if (update) { player.sendSkillList(); @@ -1275,7 +1282,32 @@ public abstract class Inventory extends ItemContainer listener.notifyUnequiped(slot, old, this); } old.updateDatabase(); + + // Remove agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId()); + if (agathionSkills != null) + { + boolean update = false; + for (SkillHolder holder : agathionSkills.getMainSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } + // Add new item in slot of paperdoll if (item != null) { @@ -1295,6 +1327,41 @@ public abstract class Inventory extends ItemContainer listener.notifyEquiped(slot, item, this); } item.updateDatabase(); + + // Add agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId()); + if (agathionSkills != null) + { + boolean update = false; + if (slot == PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } _paperdollCache.clearCachedStats(); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/Item.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/Item.java index 07b58b23f5..f259063d4b 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/Item.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/Item.java @@ -822,6 +822,13 @@ public abstract class Item extends ListenersContainer implements IIdentifiable public void addSkill(ItemSkillHolder holder) { + // Agathion skills managed by AgathionData. + // if ((getBodyPart() == SLOT_AGATHION) && (holder.getType() != ItemSkillType.ON_EQUIP) && (holder.getType() != ItemSkillType.ON_UNEQUIP)) + // { + // LOGGER.warning("Remove from agathion " + _itemId + " " + holder + "!"); + // return; + // } + if (_skills == null) { _skills = new ArrayList<>(); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index 7418c5a6e6..3918536939 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -36,6 +36,7 @@ import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData; import org.l2jmobius.gameserver.data.xml.EnsoulData; @@ -67,7 +68,10 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDr import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPickup; import org.l2jmobius.gameserver.model.events.impl.item.OnItemBypassEvent; import org.l2jmobius.gameserver.model.events.impl.item.OnItemTalk; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.items.Armor; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; @@ -80,6 +84,7 @@ import org.l2jmobius.gameserver.model.options.EnchantOptions; import org.l2jmobius.gameserver.model.options.Options; import org.l2jmobius.gameserver.model.siege.Castle; import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillConditionScope; import org.l2jmobius.gameserver.model.variables.ItemVariables; import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.DropItem; @@ -929,6 +934,54 @@ public class ItemInstance extends WorldObject } clearEnchantStats(); + + // Agathion skills. + if (isEquipped() && (_item.getBodyPart() == Item.SLOT_AGATHION)) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId()); + if (agathionSkills != null) + { + boolean update = false; + // Remove old skills. + for (SkillHolder holder : agathionSkills.getMainSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + // Add new skills. + if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getActingPlayer().sendSkillList(); + } + } + } + _enchantLevel = enchantLevel; applyEnchantStats(); _storedInDb = false; diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index e3af565747..a48a70a498 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -51,6 +51,7 @@ import org.l2jmobius.gameserver.model.clan.Clan; import org.l2jmobius.gameserver.model.holders.AttendanceInfoHolder; import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -632,6 +633,13 @@ public class EnterWorld implements IClientIncomingPacket player.updateAbnormalVisualEffects(); } + // Activate first agathion when available. + final ItemInstance agathion = player.getInventory().unEquipItemInBodySlot(Item.SLOT_AGATHION); + if (agathion != null) + { + player.getInventory().equipItemAndRecord(agathion); + } + if (Config.ENABLE_ATTENDANCE_REWARDS) { ThreadPool.schedule(() -> diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/AgathionData.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/AgathionData.xml new file mode 100644 index 0000000000..4bdab0f31e --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/AgathionData.xml @@ -0,0 +1,389 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/13000-13099.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/13000-13099.xml index e0de192dc6..235a6e0402 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/13000-13099.xml +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/13000-13099.xml @@ -78,7 +78,7 @@ - + diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/20600-20699.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/20600-20699.xml index 4996761051..b2ba45060e 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/20600-20699.xml +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/20600-20699.xml @@ -19,7 +19,7 @@ - + diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/49000-49099.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/49000-49099.xml index 609254004b..f83707432c 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/49000-49099.xml +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/49000-49099.xml @@ -14,7 +14,7 @@ - + diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/49400-49499.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/49400-49499.xml index 3cedfa8409..99302c4015 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/49400-49499.xml +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/49400-49499.xml @@ -934,7 +934,7 @@ - + diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/70300-70399.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/70300-70399.xml index df99cc03b6..7c513dfe28 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/70300-70399.xml +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/70300-70399.xml @@ -420,7 +420,7 @@ - + diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/70900-70999.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/70900-70999.xml index 4985172c49..8d75ea514a 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/70900-70999.xml +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/70900-70999.xml @@ -500,7 +500,7 @@ - + @@ -522,7 +522,7 @@ - + @@ -544,7 +544,7 @@ - + @@ -566,7 +566,7 @@ - + diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/71200-71299.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/71200-71299.xml index a7b6e656e7..6b1395b5ab 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/71200-71299.xml +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/71200-71299.xml @@ -13,7 +13,8 @@ - + + @@ -29,7 +30,8 @@ - + + @@ -42,7 +44,8 @@ - + + @@ -55,7 +58,8 @@ - + + @@ -68,7 +72,8 @@ - + + @@ -81,7 +86,8 @@ - + + @@ -94,7 +100,8 @@ - + + @@ -107,7 +114,8 @@ - + + @@ -120,7 +128,8 @@ - + + @@ -133,7 +142,8 @@ - + + @@ -146,7 +156,8 @@ - + + diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/90800-90899.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/90800-90899.xml index a4d9b9724f..e2b53205a0 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/90800-90899.xml +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/90800-90899.xml @@ -1212,6 +1212,7 @@ + @@ -1219,11 +1220,16 @@ + + + + + @@ -1232,6 +1238,10 @@ + + + + diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/90900-90999.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/90900-90999.xml index 7efcea970c..862c1465ec 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/90900-90999.xml +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/90900-90999.xml @@ -37,12 +37,8 @@ - - - - - - + + @@ -59,12 +55,8 @@ - - - - - - + + diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/91100-91199.xml b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/91100-91199.xml index 015057e5b5..d1feb4ca73 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/91100-91199.xml +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/items/91100-91199.xml @@ -371,10 +371,8 @@ - - - - + + @@ -388,10 +386,8 @@ - - - - + + @@ -405,10 +401,8 @@ - - - - + + @@ -422,10 +416,8 @@ - - - - + + diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/xsd/AgathionData.xsd b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/xsd/AgathionData.xsd new file mode 100644 index 0000000000..021fb7e22f --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/xsd/AgathionData.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/GameServer.java index 3c4bda433b..3dd32f0206 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/GameServer.java @@ -46,6 +46,7 @@ import org.l2jmobius.gameserver.data.sql.CrestTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.xml.ActionData; import org.l2jmobius.gameserver.data.xml.AdminData; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; import org.l2jmobius.gameserver.data.xml.AttendanceRewardData; @@ -265,6 +266,7 @@ public class GameServer EnchantItemHPBonusData.getInstance(); BuyListData.getInstance(); MultisellData.getInstance(); + AgathionData.getInstance(); RecipeData.getInstance(); ArmorSetData.getInstance(); FishingData.getInstance(); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/data/xml/AgathionData.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/data/xml/AgathionData.java new file mode 100644 index 0000000000..049e6620ca --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/data/xml/AgathionData.java @@ -0,0 +1,136 @@ +/* + * 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 org.l2jmobius.gameserver.data.xml; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import org.w3c.dom.Document; + +import org.l2jmobius.commons.util.IXmlReader; +import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; + +/** + * @author Mobius + */ +public class AgathionData implements IXmlReader +{ + private static final Logger LOGGER = Logger.getLogger(AgathionData.class.getName()); + + private static final Map AGATHION_SKILLS = new HashMap<>(); + + protected AgathionData() + { + load(); + } + + @Override + public void load() + { + AGATHION_SKILLS.clear(); + parseDatapackFile("data/AgathionData.xml"); + LOGGER.info(getClass().getSimpleName() + ": Loaded " + AGATHION_SKILLS.size() + " agathion data."); + } + + @Override + public void parseDocument(Document doc, File f) + { + forEach(doc, "list", listNode -> forEach(listNode, "agathion", agathionNode -> + { + final StatSet set = new StatSet(parseAttributes(agathionNode)); + + final int id = set.getInt("id"); + if (ItemTable.getInstance().getTemplate(id) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion with id " + id + "."); + return; + } + + final int enchant = set.getInt("enchant", 0); + + final Map> mainSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getMainSkills() : new HashMap<>(); + final List mainSkillList = new ArrayList<>(); + final String main = set.getString("mainSkill", ""); + for (String skill : main.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + mainSkillList.add(new SkillHolder(skillId, level)); + } + mainSkills.put(enchant, mainSkillList); + + final Map> subSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getSubSkills() : new HashMap<>(); + final List subSkillList = new ArrayList<>(); + final String sub = set.getString("subSkill", ""); + for (String skill : sub.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + subSkillList.add(new SkillHolder(skillId, level)); + } + subSkills.put(enchant, subSkillList); + + AGATHION_SKILLS.put(id, new AgathionSkillHolder(mainSkills, subSkills)); + })); + } + + public AgathionSkillHolder getSkills(int agathionId) + { + return AGATHION_SKILLS.get(agathionId); + } + + public static AgathionData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final AgathionData INSTANCE = new AgathionData(); + } +} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java new file mode 100644 index 0000000000..78fef28978 --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java @@ -0,0 +1,64 @@ +/* + * 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 org.l2jmobius.gameserver.model.holders; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * @author Mobius + */ +public class AgathionSkillHolder +{ + private final Map> _mainSkill; + private final Map> _subSkill; + + public AgathionSkillHolder(Map> mainSkill, Map> subSkill) + { + _mainSkill = mainSkill; + _subSkill = subSkill; + } + + public Map> getMainSkills() + { + return _mainSkill; + } + + public Map> getSubSkills() + { + return _subSkill; + } + + public List getMainSkills(int enchantLevel) + { + if (!_mainSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _mainSkill.get(enchantLevel); + } + + public List getSubSkills(int enchantLevel) + { + if (!_subSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _subSkill.get(enchantLevel); + } +} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java index b2ba8a6850..c87b9657a8 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java @@ -35,6 +35,7 @@ import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.util.CommonUtil; import org.l2jmobius.gameserver.cache.PaperdollCache; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; import org.l2jmobius.gameserver.enums.ItemLocation; @@ -48,8 +49,10 @@ import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.events.EventDispatcher; import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder; import org.l2jmobius.gameserver.model.holders.ItemSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.appearance.AppearanceStone; @@ -599,8 +602,12 @@ public abstract class Inventory extends ItemContainer } } - // Apply skill, if weapon have "skills on equip" - item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + // Apply skill, if item has "skills on equip" and it is not a secondary agathion. + if ((slot < PAPERDOLL_AGATHION2) || (slot > PAPERDOLL_AGATHION5)) + { + item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + } + if (update) { player.sendSkillList(); @@ -1351,7 +1358,32 @@ public abstract class Inventory extends ItemContainer listener.notifyUnequiped(slot, old, this); } old.updateDatabase(); + + // Remove agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId()); + if (agathionSkills != null) + { + boolean update = false; + for (SkillHolder holder : agathionSkills.getMainSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } + // Add new item in slot of paperdoll if (item != null) { @@ -1371,6 +1403,41 @@ public abstract class Inventory extends ItemContainer listener.notifyEquiped(slot, item, this); } item.updateDatabase(); + + // Add agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId()); + if (agathionSkills != null) + { + boolean update = false; + if (slot == PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } _paperdollCache.clearCachedStats(); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/Item.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/Item.java index c485a1efc5..a7493cf689 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/Item.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/Item.java @@ -827,6 +827,13 @@ public abstract class Item extends ListenersContainer implements IIdentifiable public void addSkill(ItemSkillHolder holder) { + // Agathion skills managed by AgathionData. + // if ((getBodyPart() == SLOT_AGATHION) && (holder.getType() != ItemSkillType.ON_EQUIP) && (holder.getType() != ItemSkillType.ON_UNEQUIP)) + // { + // LOGGER.warning("Remove from agathion " + _itemId + " " + holder + "!"); + // return; + // } + if (_skills == null) { _skills = new ArrayList<>(); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index 7418c5a6e6..3918536939 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -36,6 +36,7 @@ import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData; import org.l2jmobius.gameserver.data.xml.EnsoulData; @@ -67,7 +68,10 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDr import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPickup; import org.l2jmobius.gameserver.model.events.impl.item.OnItemBypassEvent; import org.l2jmobius.gameserver.model.events.impl.item.OnItemTalk; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.items.Armor; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; @@ -80,6 +84,7 @@ import org.l2jmobius.gameserver.model.options.EnchantOptions; import org.l2jmobius.gameserver.model.options.Options; import org.l2jmobius.gameserver.model.siege.Castle; import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillConditionScope; import org.l2jmobius.gameserver.model.variables.ItemVariables; import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.DropItem; @@ -929,6 +934,54 @@ public class ItemInstance extends WorldObject } clearEnchantStats(); + + // Agathion skills. + if (isEquipped() && (_item.getBodyPart() == Item.SLOT_AGATHION)) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId()); + if (agathionSkills != null) + { + boolean update = false; + // Remove old skills. + for (SkillHolder holder : agathionSkills.getMainSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + // Add new skills. + if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getActingPlayer().sendSkillList(); + } + } + } + _enchantLevel = enchantLevel; applyEnchantStats(); _storedInDb = false; diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index e3af565747..a48a70a498 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -51,6 +51,7 @@ import org.l2jmobius.gameserver.model.clan.Clan; import org.l2jmobius.gameserver.model.holders.AttendanceInfoHolder; import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -632,6 +633,13 @@ public class EnterWorld implements IClientIncomingPacket player.updateAbnormalVisualEffects(); } + // Activate first agathion when available. + final ItemInstance agathion = player.getInventory().unEquipItemInBodySlot(Item.SLOT_AGATHION); + if (agathion != null) + { + player.getInventory().equipItemAndRecord(agathion); + } + if (Config.ENABLE_ATTENDANCE_REWARDS) { ThreadPool.schedule(() -> diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/AgathionData.xml b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/AgathionData.xml new file mode 100644 index 0000000000..c3eab77631 --- /dev/null +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/AgathionData.xml @@ -0,0 +1,488 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/13000-13099.xml b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/13000-13099.xml index e0de192dc6..235a6e0402 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/13000-13099.xml +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/13000-13099.xml @@ -78,7 +78,7 @@ - + diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/20600-20699.xml b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/20600-20699.xml index 4996761051..b2ba45060e 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/20600-20699.xml +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/20600-20699.xml @@ -19,7 +19,7 @@ - + diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/49000-49099.xml b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/49000-49099.xml index 609254004b..f83707432c 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/49000-49099.xml +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/49000-49099.xml @@ -14,7 +14,7 @@ - + diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/49400-49499.xml b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/49400-49499.xml index 3cedfa8409..99302c4015 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/49400-49499.xml +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/49400-49499.xml @@ -934,7 +934,7 @@ - + diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/70300-70399.xml b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/70300-70399.xml index df99cc03b6..7c513dfe28 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/70300-70399.xml +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/70300-70399.xml @@ -420,7 +420,7 @@ - + diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/70900-70999.xml b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/70900-70999.xml index 4985172c49..8d75ea514a 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/70900-70999.xml +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/70900-70999.xml @@ -500,7 +500,7 @@ - + @@ -522,7 +522,7 @@ - + @@ -544,7 +544,7 @@ - + @@ -566,7 +566,7 @@ - + diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/71200-71299.xml b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/71200-71299.xml index a7b6e656e7..6b1395b5ab 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/71200-71299.xml +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/71200-71299.xml @@ -13,7 +13,8 @@ - + + @@ -29,7 +30,8 @@ - + + @@ -42,7 +44,8 @@ - + + @@ -55,7 +58,8 @@ - + + @@ -68,7 +72,8 @@ - + + @@ -81,7 +86,8 @@ - + + @@ -94,7 +100,8 @@ - + + @@ -107,7 +114,8 @@ - + + @@ -120,7 +128,8 @@ - + + @@ -133,7 +142,8 @@ - + + @@ -146,7 +156,8 @@ - + + diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/90800-90899.xml b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/90800-90899.xml index 65e2196d02..5d9200a23d 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/90800-90899.xml +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/90800-90899.xml @@ -1212,6 +1212,7 @@ + @@ -1219,11 +1220,16 @@ + + + + + @@ -1232,6 +1238,10 @@ + + + + diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/90900-90999.xml b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/90900-90999.xml index 7efcea970c..862c1465ec 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/90900-90999.xml +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/90900-90999.xml @@ -37,12 +37,8 @@ - - - - - - + + @@ -59,12 +55,8 @@ - - - - - - + + diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/91100-91199.xml b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/91100-91199.xml index 015057e5b5..d1feb4ca73 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/91100-91199.xml +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/items/91100-91199.xml @@ -371,10 +371,8 @@ - - - - + + @@ -388,10 +386,8 @@ - - - - + + @@ -405,10 +401,8 @@ - - - - + + @@ -422,10 +416,8 @@ - - - - + + diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/xsd/AgathionData.xsd b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/xsd/AgathionData.xsd new file mode 100644 index 0000000000..021fb7e22f --- /dev/null +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/xsd/AgathionData.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/GameServer.java index 0089164311..c7766efa39 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/GameServer.java @@ -46,6 +46,7 @@ import org.l2jmobius.gameserver.data.sql.CrestTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.xml.ActionData; import org.l2jmobius.gameserver.data.xml.AdminData; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; import org.l2jmobius.gameserver.data.xml.AttendanceRewardData; @@ -267,6 +268,7 @@ public class GameServer BuyListData.getInstance(); MultisellData.getInstance(); EquipmentUpgradeData.getInstance(); + AgathionData.getInstance(); RecipeData.getInstance(); ArmorSetData.getInstance(); FishingData.getInstance(); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/data/xml/AgathionData.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/data/xml/AgathionData.java new file mode 100644 index 0000000000..049e6620ca --- /dev/null +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/data/xml/AgathionData.java @@ -0,0 +1,136 @@ +/* + * 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 org.l2jmobius.gameserver.data.xml; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import org.w3c.dom.Document; + +import org.l2jmobius.commons.util.IXmlReader; +import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; + +/** + * @author Mobius + */ +public class AgathionData implements IXmlReader +{ + private static final Logger LOGGER = Logger.getLogger(AgathionData.class.getName()); + + private static final Map AGATHION_SKILLS = new HashMap<>(); + + protected AgathionData() + { + load(); + } + + @Override + public void load() + { + AGATHION_SKILLS.clear(); + parseDatapackFile("data/AgathionData.xml"); + LOGGER.info(getClass().getSimpleName() + ": Loaded " + AGATHION_SKILLS.size() + " agathion data."); + } + + @Override + public void parseDocument(Document doc, File f) + { + forEach(doc, "list", listNode -> forEach(listNode, "agathion", agathionNode -> + { + final StatSet set = new StatSet(parseAttributes(agathionNode)); + + final int id = set.getInt("id"); + if (ItemTable.getInstance().getTemplate(id) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion with id " + id + "."); + return; + } + + final int enchant = set.getInt("enchant", 0); + + final Map> mainSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getMainSkills() : new HashMap<>(); + final List mainSkillList = new ArrayList<>(); + final String main = set.getString("mainSkill", ""); + for (String skill : main.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + mainSkillList.add(new SkillHolder(skillId, level)); + } + mainSkills.put(enchant, mainSkillList); + + final Map> subSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getSubSkills() : new HashMap<>(); + final List subSkillList = new ArrayList<>(); + final String sub = set.getString("subSkill", ""); + for (String skill : sub.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + subSkillList.add(new SkillHolder(skillId, level)); + } + subSkills.put(enchant, subSkillList); + + AGATHION_SKILLS.put(id, new AgathionSkillHolder(mainSkills, subSkills)); + })); + } + + public AgathionSkillHolder getSkills(int agathionId) + { + return AGATHION_SKILLS.get(agathionId); + } + + public static AgathionData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final AgathionData INSTANCE = new AgathionData(); + } +} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java new file mode 100644 index 0000000000..78fef28978 --- /dev/null +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java @@ -0,0 +1,64 @@ +/* + * 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 org.l2jmobius.gameserver.model.holders; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * @author Mobius + */ +public class AgathionSkillHolder +{ + private final Map> _mainSkill; + private final Map> _subSkill; + + public AgathionSkillHolder(Map> mainSkill, Map> subSkill) + { + _mainSkill = mainSkill; + _subSkill = subSkill; + } + + public Map> getMainSkills() + { + return _mainSkill; + } + + public Map> getSubSkills() + { + return _subSkill; + } + + public List getMainSkills(int enchantLevel) + { + if (!_mainSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _mainSkill.get(enchantLevel); + } + + public List getSubSkills(int enchantLevel) + { + if (!_subSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _subSkill.get(enchantLevel); + } +} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java index b2ba8a6850..c87b9657a8 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java @@ -35,6 +35,7 @@ import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.util.CommonUtil; import org.l2jmobius.gameserver.cache.PaperdollCache; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; import org.l2jmobius.gameserver.enums.ItemLocation; @@ -48,8 +49,10 @@ import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.events.EventDispatcher; import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder; import org.l2jmobius.gameserver.model.holders.ItemSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.appearance.AppearanceStone; @@ -599,8 +602,12 @@ public abstract class Inventory extends ItemContainer } } - // Apply skill, if weapon have "skills on equip" - item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + // Apply skill, if item has "skills on equip" and it is not a secondary agathion. + if ((slot < PAPERDOLL_AGATHION2) || (slot > PAPERDOLL_AGATHION5)) + { + item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + } + if (update) { player.sendSkillList(); @@ -1351,7 +1358,32 @@ public abstract class Inventory extends ItemContainer listener.notifyUnequiped(slot, old, this); } old.updateDatabase(); + + // Remove agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId()); + if (agathionSkills != null) + { + boolean update = false; + for (SkillHolder holder : agathionSkills.getMainSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } + // Add new item in slot of paperdoll if (item != null) { @@ -1371,6 +1403,41 @@ public abstract class Inventory extends ItemContainer listener.notifyEquiped(slot, item, this); } item.updateDatabase(); + + // Add agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId()); + if (agathionSkills != null) + { + boolean update = false; + if (slot == PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } _paperdollCache.clearCachedStats(); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/Item.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/Item.java index c485a1efc5..a7493cf689 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/Item.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/Item.java @@ -827,6 +827,13 @@ public abstract class Item extends ListenersContainer implements IIdentifiable public void addSkill(ItemSkillHolder holder) { + // Agathion skills managed by AgathionData. + // if ((getBodyPart() == SLOT_AGATHION) && (holder.getType() != ItemSkillType.ON_EQUIP) && (holder.getType() != ItemSkillType.ON_UNEQUIP)) + // { + // LOGGER.warning("Remove from agathion " + _itemId + " " + holder + "!"); + // return; + // } + if (_skills == null) { _skills = new ArrayList<>(); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index 7418c5a6e6..3918536939 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -36,6 +36,7 @@ import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData; import org.l2jmobius.gameserver.data.xml.EnsoulData; @@ -67,7 +68,10 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDr import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPickup; import org.l2jmobius.gameserver.model.events.impl.item.OnItemBypassEvent; import org.l2jmobius.gameserver.model.events.impl.item.OnItemTalk; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.items.Armor; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; @@ -80,6 +84,7 @@ import org.l2jmobius.gameserver.model.options.EnchantOptions; import org.l2jmobius.gameserver.model.options.Options; import org.l2jmobius.gameserver.model.siege.Castle; import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillConditionScope; import org.l2jmobius.gameserver.model.variables.ItemVariables; import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.DropItem; @@ -929,6 +934,54 @@ public class ItemInstance extends WorldObject } clearEnchantStats(); + + // Agathion skills. + if (isEquipped() && (_item.getBodyPart() == Item.SLOT_AGATHION)) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId()); + if (agathionSkills != null) + { + boolean update = false; + // Remove old skills. + for (SkillHolder holder : agathionSkills.getMainSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + // Add new skills. + if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getActingPlayer().sendSkillList(); + } + } + } + _enchantLevel = enchantLevel; applyEnchantStats(); _storedInDb = false; diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index e3af565747..a48a70a498 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -51,6 +51,7 @@ import org.l2jmobius.gameserver.model.clan.Clan; import org.l2jmobius.gameserver.model.holders.AttendanceInfoHolder; import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -632,6 +633,13 @@ public class EnterWorld implements IClientIncomingPacket player.updateAbnormalVisualEffects(); } + // Activate first agathion when available. + final ItemInstance agathion = player.getInventory().unEquipItemInBodySlot(Item.SLOT_AGATHION); + if (agathion != null) + { + player.getInventory().equipItemAndRecord(agathion); + } + if (Config.ENABLE_ATTENDANCE_REWARDS) { ThreadPool.schedule(() -> diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/AgathionData.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/AgathionData.xml new file mode 100644 index 0000000000..7f9ce02d93 --- /dev/null +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/AgathionData.xml @@ -0,0 +1,675 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/13000-13099.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/13000-13099.xml index e0de192dc6..235a6e0402 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/13000-13099.xml +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/13000-13099.xml @@ -78,7 +78,7 @@ - + diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/20600-20699.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/20600-20699.xml index 4996761051..b2ba45060e 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/20600-20699.xml +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/20600-20699.xml @@ -19,7 +19,7 @@ - + diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/49000-49099.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/49000-49099.xml index 609254004b..f83707432c 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/49000-49099.xml +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/49000-49099.xml @@ -14,7 +14,7 @@ - + diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/49400-49499.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/49400-49499.xml index 3cedfa8409..99302c4015 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/49400-49499.xml +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/49400-49499.xml @@ -934,7 +934,7 @@ - + diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/70300-70399.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/70300-70399.xml index df99cc03b6..7c513dfe28 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/70300-70399.xml +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/70300-70399.xml @@ -420,7 +420,7 @@ - + diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/70900-70999.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/70900-70999.xml index 4985172c49..8d75ea514a 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/70900-70999.xml +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/70900-70999.xml @@ -500,7 +500,7 @@ - + @@ -522,7 +522,7 @@ - + @@ -544,7 +544,7 @@ - + @@ -566,7 +566,7 @@ - + diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/71200-71299.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/71200-71299.xml index a7b6e656e7..6b1395b5ab 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/71200-71299.xml +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/71200-71299.xml @@ -13,7 +13,8 @@ - + + @@ -29,7 +30,8 @@ - + + @@ -42,7 +44,8 @@ - + + @@ -55,7 +58,8 @@ - + + @@ -68,7 +72,8 @@ - + + @@ -81,7 +86,8 @@ - + + @@ -94,7 +100,8 @@ - + + @@ -107,7 +114,8 @@ - + + @@ -120,7 +128,8 @@ - + + @@ -133,7 +142,8 @@ - + + @@ -146,7 +156,8 @@ - + + diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/90800-90899.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/90800-90899.xml index 65e2196d02..5d9200a23d 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/90800-90899.xml +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/90800-90899.xml @@ -1212,6 +1212,7 @@ + @@ -1219,11 +1220,16 @@ + + + + + @@ -1232,6 +1238,10 @@ + + + + diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/90900-90999.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/90900-90999.xml index 7efcea970c..862c1465ec 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/90900-90999.xml +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/90900-90999.xml @@ -37,12 +37,8 @@ - - - - - - + + @@ -59,12 +55,8 @@ - - - - - - + + diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91100-91199.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91100-91199.xml index 22ace22901..cf60a19b25 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91100-91199.xml +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91100-91199.xml @@ -371,10 +371,8 @@ - - - - + + @@ -388,10 +386,8 @@ - - - - + + @@ -405,10 +401,8 @@ - - - - + + @@ -422,10 +416,8 @@ - - - - + + diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91900-91999.xml b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91900-91999.xml index e29558ab41..55f48040f5 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91900-91999.xml +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/items/91900-91999.xml @@ -551,7 +551,8 @@ - + + diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/xsd/AgathionData.xsd b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/xsd/AgathionData.xsd new file mode 100644 index 0000000000..021fb7e22f --- /dev/null +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/xsd/AgathionData.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/GameServer.java index d2b8678aca..0ae6d4f5fa 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/GameServer.java @@ -46,6 +46,7 @@ import org.l2jmobius.gameserver.data.sql.CrestTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.xml.ActionData; import org.l2jmobius.gameserver.data.xml.AdminData; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; import org.l2jmobius.gameserver.data.xml.AttendanceRewardData; @@ -269,6 +270,7 @@ public class GameServer BuyListData.getInstance(); MultisellData.getInstance(); EquipmentUpgradeData.getInstance(); + AgathionData.getInstance(); RecipeData.getInstance(); ArmorSetData.getInstance(); FishingData.getInstance(); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/data/xml/AgathionData.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/data/xml/AgathionData.java new file mode 100644 index 0000000000..049e6620ca --- /dev/null +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/data/xml/AgathionData.java @@ -0,0 +1,136 @@ +/* + * 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 org.l2jmobius.gameserver.data.xml; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import org.w3c.dom.Document; + +import org.l2jmobius.commons.util.IXmlReader; +import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; + +/** + * @author Mobius + */ +public class AgathionData implements IXmlReader +{ + private static final Logger LOGGER = Logger.getLogger(AgathionData.class.getName()); + + private static final Map AGATHION_SKILLS = new HashMap<>(); + + protected AgathionData() + { + load(); + } + + @Override + public void load() + { + AGATHION_SKILLS.clear(); + parseDatapackFile("data/AgathionData.xml"); + LOGGER.info(getClass().getSimpleName() + ": Loaded " + AGATHION_SKILLS.size() + " agathion data."); + } + + @Override + public void parseDocument(Document doc, File f) + { + forEach(doc, "list", listNode -> forEach(listNode, "agathion", agathionNode -> + { + final StatSet set = new StatSet(parseAttributes(agathionNode)); + + final int id = set.getInt("id"); + if (ItemTable.getInstance().getTemplate(id) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion with id " + id + "."); + return; + } + + final int enchant = set.getInt("enchant", 0); + + final Map> mainSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getMainSkills() : new HashMap<>(); + final List mainSkillList = new ArrayList<>(); + final String main = set.getString("mainSkill", ""); + for (String skill : main.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + mainSkillList.add(new SkillHolder(skillId, level)); + } + mainSkills.put(enchant, mainSkillList); + + final Map> subSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getSubSkills() : new HashMap<>(); + final List subSkillList = new ArrayList<>(); + final String sub = set.getString("subSkill", ""); + for (String skill : sub.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + subSkillList.add(new SkillHolder(skillId, level)); + } + subSkills.put(enchant, subSkillList); + + AGATHION_SKILLS.put(id, new AgathionSkillHolder(mainSkills, subSkills)); + })); + } + + public AgathionSkillHolder getSkills(int agathionId) + { + return AGATHION_SKILLS.get(agathionId); + } + + public static AgathionData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final AgathionData INSTANCE = new AgathionData(); + } +} diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java new file mode 100644 index 0000000000..78fef28978 --- /dev/null +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java @@ -0,0 +1,64 @@ +/* + * 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 org.l2jmobius.gameserver.model.holders; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * @author Mobius + */ +public class AgathionSkillHolder +{ + private final Map> _mainSkill; + private final Map> _subSkill; + + public AgathionSkillHolder(Map> mainSkill, Map> subSkill) + { + _mainSkill = mainSkill; + _subSkill = subSkill; + } + + public Map> getMainSkills() + { + return _mainSkill; + } + + public Map> getSubSkills() + { + return _subSkill; + } + + public List getMainSkills(int enchantLevel) + { + if (!_mainSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _mainSkill.get(enchantLevel); + } + + public List getSubSkills(int enchantLevel) + { + if (!_subSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _subSkill.get(enchantLevel); + } +} diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java index f321011c13..e94d279cee 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java @@ -35,6 +35,7 @@ import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.util.CommonUtil; import org.l2jmobius.gameserver.cache.PaperdollCache; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; import org.l2jmobius.gameserver.enums.ItemLocation; @@ -48,8 +49,10 @@ import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.events.EventDispatcher; import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder; import org.l2jmobius.gameserver.model.holders.ItemSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.appearance.AppearanceStone; @@ -592,8 +595,12 @@ public abstract class Inventory extends ItemContainer } } - // Apply skill, if weapon have "skills on equip" - item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + // Apply skill, if item has "skills on equip" and it is not a secondary agathion. + if ((slot < PAPERDOLL_AGATHION2) || (slot > PAPERDOLL_AGATHION5)) + { + item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + } + if (update) { player.sendSkillList(); @@ -1344,7 +1351,32 @@ public abstract class Inventory extends ItemContainer listener.notifyUnequiped(slot, old, this); } old.updateDatabase(); + + // Remove agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId()); + if (agathionSkills != null) + { + boolean update = false; + for (SkillHolder holder : agathionSkills.getMainSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } + // Add new item in slot of paperdoll if (item != null) { @@ -1364,6 +1396,41 @@ public abstract class Inventory extends ItemContainer listener.notifyEquiped(slot, item, this); } item.updateDatabase(); + + // Add agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId()); + if (agathionSkills != null) + { + boolean update = false; + if (slot == PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } _paperdollCache.clearCachedStats(); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/Item.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/Item.java index c485a1efc5..a7493cf689 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/Item.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/Item.java @@ -827,6 +827,13 @@ public abstract class Item extends ListenersContainer implements IIdentifiable public void addSkill(ItemSkillHolder holder) { + // Agathion skills managed by AgathionData. + // if ((getBodyPart() == SLOT_AGATHION) && (holder.getType() != ItemSkillType.ON_EQUIP) && (holder.getType() != ItemSkillType.ON_UNEQUIP)) + // { + // LOGGER.warning("Remove from agathion " + _itemId + " " + holder + "!"); + // return; + // } + if (_skills == null) { _skills = new ArrayList<>(); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index 7418c5a6e6..3918536939 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -36,6 +36,7 @@ import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData; import org.l2jmobius.gameserver.data.xml.EnsoulData; @@ -67,7 +68,10 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDr import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPickup; import org.l2jmobius.gameserver.model.events.impl.item.OnItemBypassEvent; import org.l2jmobius.gameserver.model.events.impl.item.OnItemTalk; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.items.Armor; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; @@ -80,6 +84,7 @@ import org.l2jmobius.gameserver.model.options.EnchantOptions; import org.l2jmobius.gameserver.model.options.Options; import org.l2jmobius.gameserver.model.siege.Castle; import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillConditionScope; import org.l2jmobius.gameserver.model.variables.ItemVariables; import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.DropItem; @@ -929,6 +934,54 @@ public class ItemInstance extends WorldObject } clearEnchantStats(); + + // Agathion skills. + if (isEquipped() && (_item.getBodyPart() == Item.SLOT_AGATHION)) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId()); + if (agathionSkills != null) + { + boolean update = false; + // Remove old skills. + for (SkillHolder holder : agathionSkills.getMainSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + // Add new skills. + if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getActingPlayer().sendSkillList(); + } + } + } + _enchantLevel = enchantLevel; applyEnchantStats(); _storedInDb = false; diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 1ca5e57b2b..2360a47a36 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -51,6 +51,7 @@ import org.l2jmobius.gameserver.model.clan.Clan; import org.l2jmobius.gameserver.model.holders.AttendanceInfoHolder; import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -636,6 +637,13 @@ public class EnterWorld implements IClientIncomingPacket player.updateAbnormalVisualEffects(); } + // Activate first agathion when available. + final ItemInstance agathion = player.getInventory().unEquipItemInBodySlot(Item.SLOT_AGATHION); + if (agathion != null) + { + player.getInventory().equipItemAndRecord(agathion); + } + if (Config.ENABLE_ATTENDANCE_REWARDS) { ThreadPool.schedule(() -> diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/AgathionData.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/AgathionData.xml new file mode 100644 index 0000000000..cac0834631 --- /dev/null +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/AgathionData.xml @@ -0,0 +1,358 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/13000-13099.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/13000-13099.xml index e0de192dc6..235a6e0402 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/13000-13099.xml +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/13000-13099.xml @@ -78,7 +78,7 @@ - + diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/20600-20699.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/20600-20699.xml index 4996761051..b2ba45060e 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/20600-20699.xml +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/20600-20699.xml @@ -19,7 +19,7 @@ - + diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/49000-49099.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/49000-49099.xml index 609254004b..f83707432c 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/49000-49099.xml +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/49000-49099.xml @@ -14,7 +14,7 @@ - + diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/49400-49499.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/49400-49499.xml index 3cedfa8409..99302c4015 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/49400-49499.xml +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/49400-49499.xml @@ -934,7 +934,7 @@ - + diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/70300-70399.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/70300-70399.xml index df99cc03b6..7c513dfe28 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/70300-70399.xml +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/70300-70399.xml @@ -420,7 +420,7 @@ - + diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/70900-70999.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/70900-70999.xml index 4985172c49..8d75ea514a 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/70900-70999.xml +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/70900-70999.xml @@ -500,7 +500,7 @@ - + @@ -522,7 +522,7 @@ - + @@ -544,7 +544,7 @@ - + @@ -566,7 +566,7 @@ - + diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/71200-71299.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/71200-71299.xml index a7a7a997af..c31d9ca69e 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/71200-71299.xml +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/71200-71299.xml @@ -13,7 +13,8 @@ - + + @@ -29,7 +30,8 @@ - + + @@ -42,7 +44,8 @@ - + + @@ -55,7 +58,8 @@ - + + @@ -68,7 +72,8 @@ - + + @@ -81,7 +86,8 @@ - + + @@ -94,7 +100,8 @@ - + + @@ -107,7 +114,8 @@ - + + @@ -120,7 +128,8 @@ - + + @@ -133,7 +142,8 @@ - + + @@ -146,7 +156,8 @@ - + + diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/90800-90899.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/90800-90899.xml index 6f873c24db..5d9200a23d 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/90800-90899.xml +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/90800-90899.xml @@ -1221,11 +1221,8 @@ - - + - - @@ -1242,11 +1239,8 @@ - - + - - diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/90900-90999.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/90900-90999.xml index 7efcea970c..862c1465ec 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/90900-90999.xml +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/90900-90999.xml @@ -37,12 +37,8 @@ - - - - - - + + @@ -59,12 +55,8 @@ - - - - - - + + diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/91100-91199.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/91100-91199.xml index 22ace22901..cf60a19b25 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/91100-91199.xml +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/91100-91199.xml @@ -371,10 +371,8 @@ - - - - + + @@ -388,10 +386,8 @@ - - - - + + @@ -405,10 +401,8 @@ - - - - + + @@ -422,10 +416,8 @@ - - - - + + diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/91900-91999.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/91900-91999.xml index aab4b07256..ade0dda7c6 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/91900-91999.xml +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/stats/items/91900-91999.xml @@ -559,7 +559,8 @@ - + + diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/xsd/AgathionData.xsd b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/xsd/AgathionData.xsd new file mode 100644 index 0000000000..021fb7e22f --- /dev/null +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/xsd/AgathionData.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/GameServer.java index 88783cec91..b63743b697 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/GameServer.java @@ -46,6 +46,7 @@ import org.l2jmobius.gameserver.data.sql.CrestTable; import org.l2jmobius.gameserver.data.sql.OfflineTraderTable; import org.l2jmobius.gameserver.data.xml.ActionData; import org.l2jmobius.gameserver.data.xml.AdminData; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; import org.l2jmobius.gameserver.data.xml.AttendanceRewardData; @@ -270,6 +271,7 @@ public class GameServer BuyListData.getInstance(); MultisellData.getInstance(); EquipmentUpgradeData.getInstance(); + AgathionData.getInstance(); RecipeData.getInstance(); ArmorSetData.getInstance(); FishingData.getInstance(); diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/AgathionData.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/AgathionData.java new file mode 100644 index 0000000000..049e6620ca --- /dev/null +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/data/xml/AgathionData.java @@ -0,0 +1,136 @@ +/* + * 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 org.l2jmobius.gameserver.data.xml; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import org.w3c.dom.Document; + +import org.l2jmobius.commons.util.IXmlReader; +import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; + +/** + * @author Mobius + */ +public class AgathionData implements IXmlReader +{ + private static final Logger LOGGER = Logger.getLogger(AgathionData.class.getName()); + + private static final Map AGATHION_SKILLS = new HashMap<>(); + + protected AgathionData() + { + load(); + } + + @Override + public void load() + { + AGATHION_SKILLS.clear(); + parseDatapackFile("data/AgathionData.xml"); + LOGGER.info(getClass().getSimpleName() + ": Loaded " + AGATHION_SKILLS.size() + " agathion data."); + } + + @Override + public void parseDocument(Document doc, File f) + { + forEach(doc, "list", listNode -> forEach(listNode, "agathion", agathionNode -> + { + final StatSet set = new StatSet(parseAttributes(agathionNode)); + + final int id = set.getInt("id"); + if (ItemTable.getInstance().getTemplate(id) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion with id " + id + "."); + return; + } + + final int enchant = set.getInt("enchant", 0); + + final Map> mainSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getMainSkills() : new HashMap<>(); + final List mainSkillList = new ArrayList<>(); + final String main = set.getString("mainSkill", ""); + for (String skill : main.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + mainSkillList.add(new SkillHolder(skillId, level)); + } + mainSkills.put(enchant, mainSkillList); + + final Map> subSkills = AGATHION_SKILLS.containsKey(id) ? AGATHION_SKILLS.get(id).getSubSkills() : new HashMap<>(); + final List subSkillList = new ArrayList<>(); + final String sub = set.getString("subSkill", ""); + for (String skill : sub.split(";")) + { + if (skill.isEmpty()) + { + continue; + } + + final String[] split = skill.split(","); + final int skillId = Integer.parseInt(split[0]); + final int level = Integer.parseInt(split[1]); + if (SkillData.getInstance().getSkill(skillId, level) == null) + { + LOGGER.info(getClass().getSimpleName() + ": Could not find agathion skill id " + skillId + "."); + return; + } + + subSkillList.add(new SkillHolder(skillId, level)); + } + subSkills.put(enchant, subSkillList); + + AGATHION_SKILLS.put(id, new AgathionSkillHolder(mainSkills, subSkills)); + })); + } + + public AgathionSkillHolder getSkills(int agathionId) + { + return AGATHION_SKILLS.get(agathionId); + } + + public static AgathionData getInstance() + { + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder + { + protected static final AgathionData INSTANCE = new AgathionData(); + } +} diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java new file mode 100644 index 0000000000..78fef28978 --- /dev/null +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/holders/AgathionSkillHolder.java @@ -0,0 +1,64 @@ +/* + * 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 org.l2jmobius.gameserver.model.holders; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * @author Mobius + */ +public class AgathionSkillHolder +{ + private final Map> _mainSkill; + private final Map> _subSkill; + + public AgathionSkillHolder(Map> mainSkill, Map> subSkill) + { + _mainSkill = mainSkill; + _subSkill = subSkill; + } + + public Map> getMainSkills() + { + return _mainSkill; + } + + public Map> getSubSkills() + { + return _subSkill; + } + + public List getMainSkills(int enchantLevel) + { + if (!_mainSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _mainSkill.get(enchantLevel); + } + + public List getSubSkills(int enchantLevel) + { + if (!_subSkill.containsKey(enchantLevel)) + { + return Collections.emptyList(); + } + return _subSkill.get(enchantLevel); + } +} diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java index f321011c13..e94d279cee 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/itemcontainer/Inventory.java @@ -35,6 +35,7 @@ import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.commons.util.CommonUtil; import org.l2jmobius.gameserver.cache.PaperdollCache; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.ArmorSetData; import org.l2jmobius.gameserver.enums.ItemLocation; @@ -48,8 +49,10 @@ import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance; import org.l2jmobius.gameserver.model.events.EventDispatcher; import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; import org.l2jmobius.gameserver.model.holders.ArmorsetSkillHolder; import org.l2jmobius.gameserver.model.holders.ItemSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.appearance.AppearanceStone; @@ -592,8 +595,12 @@ public abstract class Inventory extends ItemContainer } } - // Apply skill, if weapon have "skills on equip" - item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + // Apply skill, if item has "skills on equip" and it is not a secondary agathion. + if ((slot < PAPERDOLL_AGATHION2) || (slot > PAPERDOLL_AGATHION5)) + { + item.getItem().forEachSkill(ItemSkillType.ON_EQUIP, holder -> holder.getSkill().activateSkill(player, player)); + } + if (update) { player.sendSkillList(); @@ -1344,7 +1351,32 @@ public abstract class Inventory extends ItemContainer listener.notifyUnequiped(slot, old, this); } old.updateDatabase(); + + // Remove agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(old.getId()); + if (agathionSkills != null) + { + boolean update = false; + for (SkillHolder holder : agathionSkills.getMainSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(old.getEnchantLevel())) + { + getOwner().getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } + // Add new item in slot of paperdoll if (item != null) { @@ -1364,6 +1396,41 @@ public abstract class Inventory extends ItemContainer listener.notifyEquiped(slot, item, this); } item.updateDatabase(); + + // Add agathion skills. + if ((slot >= PAPERDOLL_AGATHION1) && (slot <= PAPERDOLL_AGATHION5) && getOwner().isPlayer()) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(item.getId()); + if (agathionSkills != null) + { + boolean update = false; + if (slot == PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(item.getEnchantLevel())) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getOwner().getActingPlayer(), getOwner().getActingPlayer())) + { + continue; + } + getOwner().getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getOwner().getActingPlayer().sendSkillList(); + } + } + } } _paperdollCache.clearCachedStats(); diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/Item.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/Item.java index 4402f33e3c..c86d0a5a41 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/Item.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/Item.java @@ -827,6 +827,13 @@ public abstract class Item extends ListenersContainer implements IIdentifiable public void addSkill(ItemSkillHolder holder) { + // Agathion skills managed by AgathionData. + // if ((getBodyPart() == SLOT_AGATHION) && (holder.getType() != ItemSkillType.ON_EQUIP) && (holder.getType() != ItemSkillType.ON_UNEQUIP)) + // { + // LOGGER.warning("Remove from agathion " + _itemId + " " + holder + "!"); + // return; + // } + if (_skills == null) { _skills = new ArrayList<>(); diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java index 7418c5a6e6..3918536939 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/items/instance/ItemInstance.java @@ -36,6 +36,7 @@ import java.util.logging.Logger; import org.l2jmobius.Config; import org.l2jmobius.commons.database.DatabaseFactory; import org.l2jmobius.gameserver.data.ItemTable; +import org.l2jmobius.gameserver.data.xml.AgathionData; import org.l2jmobius.gameserver.data.xml.AppearanceItemData; import org.l2jmobius.gameserver.data.xml.EnchantItemOptionsData; import org.l2jmobius.gameserver.data.xml.EnsoulData; @@ -67,7 +68,10 @@ import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemDr import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemPickup; import org.l2jmobius.gameserver.model.events.impl.item.OnItemBypassEvent; import org.l2jmobius.gameserver.model.events.impl.item.OnItemTalk; +import org.l2jmobius.gameserver.model.holders.AgathionSkillHolder; +import org.l2jmobius.gameserver.model.holders.SkillHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.items.Armor; import org.l2jmobius.gameserver.model.items.EtcItem; import org.l2jmobius.gameserver.model.items.Item; @@ -80,6 +84,7 @@ import org.l2jmobius.gameserver.model.options.EnchantOptions; import org.l2jmobius.gameserver.model.options.Options; import org.l2jmobius.gameserver.model.siege.Castle; import org.l2jmobius.gameserver.model.skills.Skill; +import org.l2jmobius.gameserver.model.skills.SkillConditionScope; import org.l2jmobius.gameserver.model.variables.ItemVariables; import org.l2jmobius.gameserver.network.SystemMessageId; import org.l2jmobius.gameserver.network.serverpackets.DropItem; @@ -929,6 +934,54 @@ public class ItemInstance extends WorldObject } clearEnchantStats(); + + // Agathion skills. + if (isEquipped() && (_item.getBodyPart() == Item.SLOT_AGATHION)) + { + final AgathionSkillHolder agathionSkills = AgathionData.getInstance().getSkills(getId()); + if (agathionSkills != null) + { + boolean update = false; + // Remove old skills. + for (SkillHolder holder : agathionSkills.getMainSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + for (SkillHolder holder : agathionSkills.getSubSkills(_enchantLevel)) + { + getActingPlayer().removeSkill(holder.getSkill(), false, holder.getSkill().isPassive()); + update = true; + } + // Add new skills. + if (getLocationSlot() == Inventory.PAPERDOLL_AGATHION1) + { + for (SkillHolder holder : agathionSkills.getMainSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + } + for (SkillHolder holder : agathionSkills.getSubSkills(enchantLevel)) + { + if (holder.getSkill().isPassive() && !holder.getSkill().checkConditions(SkillConditionScope.PASSIVE, getActingPlayer(), getActingPlayer())) + { + continue; + } + getActingPlayer().addSkill(holder.getSkill(), false); + update = true; + } + if (update) + { + getActingPlayer().sendSkillList(); + } + } + } + _enchantLevel = enchantLevel; applyEnchantStats(); _storedInDb = false; diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index ee96f20af5..82d6897304 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -51,6 +51,7 @@ import org.l2jmobius.gameserver.model.clan.Clan; import org.l2jmobius.gameserver.model.holders.AttendanceInfoHolder; import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder; import org.l2jmobius.gameserver.model.instancezone.Instance; +import org.l2jmobius.gameserver.model.items.Item; import org.l2jmobius.gameserver.model.items.instance.ItemInstance; import org.l2jmobius.gameserver.model.quest.Quest; import org.l2jmobius.gameserver.model.residences.ClanHall; @@ -657,6 +658,13 @@ public class EnterWorld implements IClientIncomingPacket player.sendPacket(new ExVitalityEffectInfo(player)); } + // Activate first agathion when available. + final ItemInstance agathion = player.getInventory().unEquipItemInBodySlot(Item.SLOT_AGATHION); + if (agathion != null) + { + player.getInventory().equipItemAndRecord(agathion); + } + if (Config.ENABLE_ATTENDANCE_REWARDS) { ThreadPool.schedule(() ->