From 1692f55e22b408f7826e6994d742c636e306d520 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 6 Dec 2017 13:23:08 +0000 Subject: [PATCH] Removed subclass change skilltree and skilllearn data. --- .../dist/game/data/SkillLearn.xml | 2145 ----------------- .../others/HealerTrainer/HealerTrainer.java | 16 +- .../admincommandhandlers/AdminBuffs.java | 2 +- .../game/data/skillTrees/nobleSkillTree.xml | 18 +- .../skillTrees/subclassChangeSkillTree.xml | 10 - .../com/l2jmobius/gameserver/GameServer.java | 2 - .../gameserver/data/xml/impl/NpcData.java | 15 - .../data/xml/impl/SkillLearnData.java | 103 - .../data/xml/impl/SkillTreesData.java | 93 +- .../gameserver/model/actor/L2Character.java | 13 + .../model/actor/instance/L2NpcInstance.java | 40 - .../model/actor/instance/L2PcInstance.java | 17 +- .../model/actor/templates/L2NpcTemplate.java | 23 - .../clientpackets/RequestMagicSkillUse.java | 21 +- .../dist/game/data/SkillLearn.xml | 2145 ----------------- .../others/HealerTrainer/HealerTrainer.java | 16 +- .../admincommandhandlers/AdminBuffs.java | 2 +- .../game/data/skillTrees/nobleSkillTree.xml | 21 +- .../skillTrees/subclassChangeSkillTree.xml | 10 - .../com/l2jmobius/gameserver/GameServer.java | 2 - .../gameserver/data/xml/impl/NpcData.java | 15 - .../data/xml/impl/SkillLearnData.java | 103 - .../data/xml/impl/SkillTreesData.java | 93 +- .../gameserver/model/actor/L2Character.java | 13 + .../model/actor/instance/L2NpcInstance.java | 40 - .../model/actor/instance/L2PcInstance.java | 17 +- .../model/actor/templates/L2NpcTemplate.java | 23 - .../clientpackets/RequestMagicSkillUse.java | 21 +- .../dist/game/data/SkillLearn.xml | 2145 ----------------- .../others/HealerTrainer/HealerTrainer.java | 16 +- .../admincommandhandlers/AdminBuffs.java | 2 +- .../game/data/skillTrees/nobleSkillTree.xml | 21 +- .../skillTrees/subclassChangeSkillTree.xml | 10 - .../com/l2jmobius/gameserver/GameServer.java | 2 - .../gameserver/data/xml/impl/NpcData.java | 15 - .../data/xml/impl/SkillLearnData.java | 103 - .../data/xml/impl/SkillTreesData.java | 93 +- .../gameserver/model/actor/L2Character.java | 13 + .../model/actor/instance/L2NpcInstance.java | 40 - .../model/actor/instance/L2PcInstance.java | 17 +- .../model/actor/templates/L2NpcTemplate.java | 23 - .../clientpackets/RequestMagicSkillUse.java | 21 +- .../dist/game/data/SkillLearn.xml | 2145 ----------------- .../others/HealerTrainer/HealerTrainer.java | 16 +- .../admincommandhandlers/AdminBuffs.java | 2 +- .../game/data/skillTrees/nobleSkillTree.xml | 16 +- .../skillTrees/subclassChangeSkillTree.xml | 10 - .../com/l2jmobius/gameserver/GameServer.java | 2 - .../gameserver/data/xml/impl/NpcData.java | 15 - .../data/xml/impl/SkillLearnData.java | 103 - .../data/xml/impl/SkillTreesData.java | 93 +- .../gameserver/model/actor/L2Character.java | 13 + .../model/actor/instance/L2NpcInstance.java | 40 - .../model/actor/instance/L2PcInstance.java | 22 +- .../model/actor/templates/L2NpcTemplate.java | 23 - .../clientpackets/RequestMagicSkillUse.java | 21 +- .../dist/game/data/SkillLearn.xml | 2145 ----------------- .../admincommandhandlers/AdminBuffs.java | 2 +- .../game/data/skillTrees/nobleSkillTree.xml | 13 +- .../com/l2jmobius/gameserver/GameServer.java | 2 - .../gameserver/data/xml/impl/NpcData.java | 15 - .../data/xml/impl/SkillLearnData.java | 103 - .../data/xml/impl/SkillTreesData.java | 93 +- .../gameserver/model/actor/L2Character.java | 13 + .../model/actor/instance/L2NpcInstance.java | 40 - .../model/actor/instance/L2PcInstance.java | 17 +- .../model/actor/templates/L2NpcTemplate.java | 23 - .../clientpackets/RequestMagicSkillUse.java | 21 +- 68 files changed, 348 insertions(+), 12220 deletions(-) delete mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/SkillLearn.xml delete mode 100644 L2J_Mobius_1.0_Ertheia/dist/game/data/skillTrees/subclassChangeSkillTree.xml delete mode 100644 L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java delete mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/SkillLearn.xml delete mode 100644 L2J_Mobius_2.5_Underground/dist/game/data/skillTrees/subclassChangeSkillTree.xml delete mode 100644 L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java delete mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/SkillLearn.xml delete mode 100644 L2J_Mobius_3.0_Helios/dist/game/data/skillTrees/subclassChangeSkillTree.xml delete mode 100644 L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java delete mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/SkillLearn.xml delete mode 100644 L2J_Mobius_4.0_GrandCrusade/dist/game/data/skillTrees/subclassChangeSkillTree.xml delete mode 100644 L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java delete mode 100644 L2J_Mobius_Classic_2.0_Saviors/dist/game/data/SkillLearn.xml delete mode 100644 L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/SkillLearn.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/SkillLearn.xml deleted file mode 100644 index fd9f157cdb..0000000000 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/SkillLearn.xml +++ /dev/null @@ -1,2145 +0,0 @@ - - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 15 - 16 - 17 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 15 - 16 - 17 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 15 - 16 - 17 - - - 25 - 29 - 30 - - - 10 - 11 - 12 - 13 - 14 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 25 - 26 - 27 - 28 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 26 - 27 - 28 - - - 25 - 29 - 30 - - - 54 - 55 - 117 - - - 54 - 55 - 117 - - - 10 - 11 - 12 - 13 - 14 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 15 - 16 - 17 - - - 25 - 26 - 27 - 28 - - - 10 - 11 - 12 - 13 - 14 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 25 - 29 - 30 - - - 53 - 56 - 57 - - - 53 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 29 - 30 - - - 25 - 26 - 27 - 28 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 53 - 56 - 57 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 26 - 27 - 28 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 53 - 56 - 57 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 53 - 54 - 55 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 53 - 56 - 57 - - - 44 - 45 - 46 - 47 - 48 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 49 - 50 - 51 - 52 - - - 53 - 56 - 57 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 29 - 30 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 25 - 26 - 27 - 28 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 25 - 29 - 30 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 15 - 16 - 17 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 29 - 30 - - - 25 - 26 - 27 - 28 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 49 - 50 - 51 - 52 - 115 - 116 - - - 44 - 45 - 46 - 47 - 48 - 113 - 114 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 99 - 100 - 101 - 102 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 88 - 89 - 90 - 91 - 92 - 93 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 49 - 50 - 51 - 52 - 115 - 116 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 44 - 45 - 46 - 47 - 48 - 113 - 114 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 99 - 100 - 101 - 102 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 88 - 89 - 90 - 91 - 92 - 93 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 117 - - - 53 - 54 - 55 - 117 - - - 53 - 54 - 55 - 117 - - - 53 - 56 - 57 - 118 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 89 - 90 - 91 - 92 - 93 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 99 - 100 - 101 - 102 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - - - 25 - 26 - 27 - 28 - 29 - 103 - 104 - 105 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 44 - 45 - 46 - 47 - 48 - 113 - 114 - - - 49 - 50 - 51 - 52 - 115 - 116 - - - 53 - 56 - 118 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 26 - 27 - 28 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 53 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java index ff7e85b98a..21878c40eb 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java @@ -21,6 +21,7 @@ import java.util.List; import com.l2jmobius.Config; import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; +import com.l2jmobius.gameserver.enums.CategoryType; import com.l2jmobius.gameserver.model.L2SkillLearn; import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; @@ -51,7 +52,12 @@ public final class HealerTrainer extends AbstractNpcAI // @formatter:on // Misc private static final int MIN_LEVEL = 76; - private static final int MIN_CLASS_LEVEL = 3; + private static final CategoryType[] ALLOWED_CATEGORIES = + { + CategoryType.FOURTH_CLASS_GROUP, + CategoryType.FIFTH_CLASS_GROUP, + CategoryType.SIXTH_CLASS_GROUP + }; private HealerTrainer() { @@ -79,13 +85,13 @@ public final class HealerTrainer extends AbstractNpcAI } case "SkillTransferLearn": { - if (!npc.getTemplate().canTeach(player.getClassId())) + if (!player.isInCategory(CategoryType.HEAL_MASTER)) { htmltext = npc.getId() + "-noteach.html"; break; } - if ((player.getLevel() < MIN_LEVEL) || (player.getClassId().level() < MIN_CLASS_LEVEL)) + if ((player.getLevel() < MIN_LEVEL) || !player.isInOneOfCategory(ALLOWED_CATEGORIES)) { htmltext = "learn-lowlevel.html"; break; @@ -104,13 +110,13 @@ public final class HealerTrainer extends AbstractNpcAI } case "SkillTransferCleanse": { - if (!npc.getTemplate().canTeach(player.getClassId())) + if (!player.isInCategory(CategoryType.HEAL_MASTER)) { htmltext = "cleanse-no.html"; break; } - if ((player.getLevel() < MIN_LEVEL) || (player.getClassId().level() < MIN_CLASS_LEVEL)) + if ((player.getLevel() < MIN_LEVEL) || !player.isInOneOfCategory(ALLOWED_CATEGORIES)) { htmltext = "cleanse-no.html"; break; diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java index 35eb076401..80cd183b64 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java @@ -277,7 +277,7 @@ public class AdminBuffs implements IAdminCommandHandler */ public static void switchSkills(L2PcInstance gmchar, boolean toAuraSkills) { - final Collection skills = toAuraSkills ? SkillTreesData.getInstance().getGMSkillTree().values() : SkillTreesData.getInstance().getGMAuraSkillTree().values(); + final Collection skills = toAuraSkills ? SkillTreesData.getInstance().getGMSkillTree() : SkillTreesData.getInstance().getGMAuraSkillTree(); for (Skill skill : skills) { gmchar.removeSkill(skill, false); // Don't Save GM skills to database diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/skillTrees/nobleSkillTree.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/skillTrees/nobleSkillTree.xml index 4eece9cf34..2103988dd1 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/skillTrees/nobleSkillTree.xml +++ b/L2J_Mobius_1.0_Ertheia/dist/game/data/skillTrees/nobleSkillTree.xml @@ -1,14 +1,14 @@ - - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/data/skillTrees/subclassChangeSkillTree.xml b/L2J_Mobius_1.0_Ertheia/dist/game/data/skillTrees/subclassChangeSkillTree.xml deleted file mode 100644 index e65e5bf356..0000000000 --- a/L2J_Mobius_1.0_Ertheia/dist/game/data/skillTrees/subclassChangeSkillTree.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/GameServer.java index e2d108f174..b35f955da8 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/GameServer.java @@ -84,7 +84,6 @@ import com.l2jmobius.gameserver.data.xml.impl.SecondaryAuthData; import com.l2jmobius.gameserver.data.xml.impl.ShuttleData; import com.l2jmobius.gameserver.data.xml.impl.SiegeScheduleData; import com.l2jmobius.gameserver.data.xml.impl.SkillData; -import com.l2jmobius.gameserver.data.xml.impl.SkillLearnData; import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.data.xml.impl.SpawnsData; import com.l2jmobius.gameserver.data.xml.impl.StaticObjectData; @@ -282,7 +281,6 @@ public class GameServer } printSection("NPCs"); - SkillLearnData.getInstance(); NpcData.getInstance(); FakePlayerData.getInstance(); FakePlayerChatManager.getInstance(); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java index f03a2395f1..95393db740 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java @@ -44,7 +44,6 @@ import com.l2jmobius.gameserver.enums.MpRewardAffectType; import com.l2jmobius.gameserver.enums.MpRewardType; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; -import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.model.effects.L2EffectType; import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.skills.Skill; @@ -80,8 +79,6 @@ public class NpcData implements IGameXmlReader parseDatapackDirectory("data/stats/npcs/custom", true); LOGGER.info(getClass().getSimpleName() + ": Loaded " + (_npcs.size() - npcCount) + " Custom NPCs."); } - - loadNpcsSkillLearn(); } @Override @@ -787,18 +784,6 @@ public class NpcData implements IGameXmlReader return getTemplates(template -> CommonUtil.contains(classTypes, template.getType(), true)); } - public void loadNpcsSkillLearn() - { - _npcs.values().forEach(template -> - { - final List teachInfo = SkillLearnData.getInstance().getSkillLearnData(template.getId()); - if (teachInfo != null) - { - template.addTeachInfo(teachInfo); - } - }); - } - /** * @return the IDs of monsters that have minions. */ diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java deleted file mode 100644 index d7929de1c3..0000000000 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * This file is part of the L2J Mobius project. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.l2jmobius.gameserver.data.xml.impl; - -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.w3c.dom.Node; - -import com.l2jmobius.commons.util.IGameXmlReader; -import com.l2jmobius.gameserver.model.base.ClassId; - -/** - * Holds all skill learn data for all npcs. - * @author xban1x - */ -public final class SkillLearnData implements IGameXmlReader -{ - private static final Logger LOGGER = Logger.getLogger(SkillLearnData.class.getName()); - - private final Map> _skillLearn = new HashMap<>(); - - protected SkillLearnData() - { - load(); - } - - @Override - public synchronized void load() - { - _skillLearn.clear(); - parseDatapackFile("data/SkillLearn.xml"); - LOGGER.info(getClass().getSimpleName() + ": Loaded " + _skillLearn.size() + " Skill Learn data."); - } - - @Override - public void parseDocument(Document doc, File f) - { - for (Node node = doc.getFirstChild(); node != null; node = node.getNextSibling()) - { - if ("list".equalsIgnoreCase(node.getNodeName())) - { - for (Node list_node = node.getFirstChild(); list_node != null; list_node = list_node.getNextSibling()) - { - if ("npc".equalsIgnoreCase(list_node.getNodeName())) - { - final List classIds = new ArrayList<>(); - for (Node c = list_node.getFirstChild(); c != null; c = c.getNextSibling()) - { - if ("classId".equalsIgnoreCase(c.getNodeName())) - { - classIds.add(ClassId.getClassId(Integer.parseInt(c.getTextContent()))); - } - } - _skillLearn.put(parseInteger(list_node.getAttributes(), "id"), classIds); - } - } - } - } - } - - /** - * @param npcId - * @return {@link List} of {@link ClassId}'s that this npcId can teach. - */ - public List getSkillLearnData(int npcId) - { - return _skillLearn.get(npcId); - } - - /** - * Gets the single instance of SkillLearnData. - * @return single instance of SkillLearnData - */ - public static SkillLearnData getInstance() - { - return SingletonHolder._instance; - } - - private static class SingletonHolder - { - protected static final SkillLearnData _instance = new SkillLearnData(); - } -} diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java index 4b35d8bca8..e0ce62ab0f 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java @@ -29,7 +29,9 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Logger; +import java.util.stream.Collectors; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; @@ -93,7 +95,6 @@ public final class SkillTreesData implements IGameXmlReader private static final Map _subPledgeSkillTree = new HashMap<>(); private static final Map _transformSkillTree = new HashMap<>(); private static final Map _commonSkillTree = new HashMap<>(); - private static final Map _subClassChangeSkillTree = new HashMap<>(); private static final Map _abilitySkillTree = new HashMap<>(); private static final Map _alchemySkillTree = new HashMap<>(); private static final Map _dualClassSkillTree = new HashMap<>(); @@ -110,11 +111,11 @@ public final class SkillTreesData implements IGameXmlReader private Map _skillsByRaceHashCodes; // Race-specific Transformations private long[] _allSkillsHashCodes; // Fishing, Collection, Transformations, Common Skills. - private boolean _loading = true; - /** Parent class Ids are read from XML and stored in this map, to allow easy customization. */ private static final Map _parentClassMap = new HashMap<>(); + private final AtomicBoolean _isLoading = new AtomicBoolean(); + /** * Instantiates a new skill trees data. */ @@ -126,7 +127,8 @@ public final class SkillTreesData implements IGameXmlReader @Override public void load() { - _loading = true; + _isLoading.set(true); + _classSkillTrees.clear(); _collectSkillTree.clear(); _fishingSkillTree.clear(); @@ -136,7 +138,6 @@ public final class SkillTreesData implements IGameXmlReader _transferSkillTrees.clear(); _transformSkillTree.clear(); _nobleSkillTree.clear(); - _subClassChangeSkillTree.clear(); _abilitySkillTree.clear(); _alchemySkillTree.clear(); _heroSkillTree.clear(); @@ -154,10 +155,10 @@ public final class SkillTreesData implements IGameXmlReader // Generate check arrays. generateCheckArrays(); - _loading = false; - // Logs a report with skill trees info. report(); + + _isLoading.set(false); } /** @@ -368,11 +369,6 @@ public final class SkillTreesData implements IGameXmlReader _gameMasterAuraSkillTree.put(skillHashCode, skillLearn); break; } - case "subClassChangeSkillTree": - { - _subClassChangeSkillTree.put(skillHashCode, skillLearn); - break; - } case "dualClassSkillTree": { _dualClassSkillTree.put(skillHashCode, skillLearn); @@ -523,15 +519,6 @@ public final class SkillTreesData implements IGameXmlReader return _subClassSkillTree; } - /** - * Gets the sub class change skill tree. - * @return the complete Common Skill Tree - */ - public Map getSubClassChangeSkillTree() - { - return _subClassChangeSkillTree; - } - /** * Gets the sub pledge skill tree. * @return the complete Sub-Pledge Skill Tree @@ -572,60 +559,45 @@ public final class SkillTreesData implements IGameXmlReader * Gets the noble skill tree. * @return the complete Noble Skill Tree */ - public Map getNobleSkillTree() + public List getNobleSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _nobleSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _nobleSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); + } + + /** + * Gets the noble skill tree. + * @return the complete Noble Skill Tree + */ + public List getNobleSkillAutoGetTree() + { + return _nobleSkillTree.values().stream().filter(entry -> entry.isAutoGet()).map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** * Gets the hero skill tree. * @return the complete Hero Skill Tree */ - public Map getHeroSkillTree() + public List getHeroSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _heroSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _heroSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** * Gets the Game Master skill tree. * @return the complete Game Master Skill Tree */ - public Map getGMSkillTree() + public List getGMSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _gameMasterSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _gameMasterSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** * Gets the Game Master Aura skill tree. * @return the complete Game Master Aura Skill Tree */ - public Map getGMAuraSkillTree() + public List getGMAuraSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _gameMasterAuraSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _gameMasterAuraSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** @@ -753,7 +725,6 @@ public final class SkillTreesData implements IGameXmlReader for (L2SkillLearn skillLearn : learnable) { final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel()); - // Cleanup skills that has to be removed for (int skillId : skillLearn.getRemoveSkills()) { @@ -1536,17 +1507,6 @@ public final class SkillTreesData implements IGameXmlReader return _pledgeSkillTree.containsKey(hashCode) || _subPledgeSkillTree.containsKey(hashCode); } - /** - * Checks if a skill is a Subclass change skill. - * @param skillId the Id of the skill to check - * @param skillLevel the level of the skill to check - * @return {@code true} if the skill is present in the Subclass change Skill Trees, {@code false} otherwise - */ - public boolean isSubClassChangeSkill(int skillId, int skillLevel) - { - return _subClassChangeSkillTree.containsKey(SkillData.getSkillHashCode(skillId, skillLevel)); - } - public boolean isRemoveSkill(ClassId classId, int skillId) { return _removeSkillCache.getOrDefault(classId, Collections.emptySet()).contains(skillId); @@ -1704,7 +1664,7 @@ public final class SkillTreesData implements IGameXmlReader } // Prevent accidental skill remove during reload - if (_loading) + if (_isLoading.get()) { return true; } @@ -1819,7 +1779,6 @@ public final class SkillTreesData implements IGameXmlReader { LOGGER.info(className + ": Loaded " + commonSkills + " Common Skills to all classes."); } - LOGGER.info(className + ": Loaded " + _subClassChangeSkillTree.size() + " Subclass change Skills."); } /** diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java index 65b3a13650..acf3306085 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -5104,6 +5104,19 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe return CategoryData.getInstance().isInCategory(type, getId()); } + public final boolean isInOneOfCategory(CategoryType... types) + { + for (CategoryType type : types) + { + if (CategoryData.getInstance().isInCategory(type, getId())) + { + return true; + } + } + + return false; + } + /** * @return the character that summoned this NPC. */ diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java index 94bd7ebfb2..11f2e21933 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java @@ -20,7 +20,6 @@ import java.util.List; import java.util.Map; import com.l2jmobius.Config; -import com.l2jmobius.gameserver.cache.HtmCache; import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.enums.InstanceType; import com.l2jmobius.gameserver.model.L2SkillLearn; @@ -31,7 +30,6 @@ import com.l2jmobius.gameserver.model.base.AcquireSkillType; import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass; -import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class L2NpcInstance extends L2Npc @@ -55,11 +53,6 @@ public class L2NpcInstance extends L2Npc setStatus(new FolkStatus(this)); } - public List getClassesToTeach() - { - return getTemplate().getTeachInfo(); - } - /** * Displays Skill Tree for a given player, npc and class Id. * @param player the active character. @@ -99,39 +92,6 @@ public class L2NpcInstance extends L2Npc return; } - if (!npc.getTemplate().canTeach(classId)) - { - String html = ""; - - if (npc instanceof L2WarehouseInstance) - { - html = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), "data/html/warehouse/" + npcId + "-noteach.htm"); - } - - final NpcHtmlMessage noTeachMsg = new NpcHtmlMessage(npc.getObjectId()); - if (html == null) - { - _log.warning("Npc " + npcId + " missing noTeach html!"); - noTeachMsg.setHtml("I cannot teach you any skills.
You must find your current class teachers."); - } - else - { - noTeachMsg.setHtml(html); - noTeachMsg.replace("%objectId%", String.valueOf(npc.getObjectId())); - } - player.sendPacket(noTeachMsg); - return; - } - - if (((L2NpcInstance) npc).getClassesToTeach().isEmpty()) - { - final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId()); - final String sb = "I cannot teach you. My class list is empty.
Ask admin to fix it. Need add my npcid and classes to skill_learn.sql.
NpcId:" + npcId + ", Your classId:" + player.getClassId().getId() + ""; - html.setHtml(sb); - player.sendPacket(html); - return; - } - // Normal skills, No LearnedByFS, no AutoGet skills. final List skills = SkillTreesData.getInstance().getAvailableSkills(player, classId, false, false); if (skills.isEmpty()) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index ebb1b815de..a15bcb605c 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -9236,14 +9236,14 @@ public final class L2PcInstance extends L2Playable { if (hero && (_baseClass == _activeClass)) { - for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree().values()) + for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree()) { addSkill(skill, false); // Don't persist hero skills into database } } else { - for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree().values()) + for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree()) { removeSkill(skill, false, true); // Just remove skills from non-hero players } @@ -9402,24 +9402,15 @@ public final class L2PcInstance extends L2Playable public void setNoble(boolean val) { - final Collection nobleSkillTree = SkillTreesData.getInstance().getNobleSkillTree().values(); if (val) { - for (Skill skill : nobleSkillTree) - { - addSkill(skill, false); - } + SkillTreesData.getInstance().getNobleSkillAutoGetTree().forEach(skill -> addSkill(skill, false)); } else { - for (Skill skill : nobleSkillTree) - { - removeSkill(skill, false, true); - } + SkillTreesData.getInstance().getNobleSkillTree().forEach(skill -> removeSkill(skill, false, true)); } - _noble = val; - sendSkillList(); if (val && (getLevel() >= 99)) { diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java index f5bee5dab6..125639ae1f 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java @@ -36,7 +36,6 @@ import com.l2jmobius.gameserver.enums.Race; import com.l2jmobius.gameserver.enums.Sex; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.holders.ItemHolder; import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; @@ -113,8 +112,6 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable private int _mpRewardTicks; private MpRewardAffectType _mpRewardAffectType; - private final List _teachInfo = new ArrayList<>(); - private List _extendDrop; /** @@ -938,26 +935,6 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable return L2NpcTemplate.isAssignableTo(obj.getClass(), clazz); } - public boolean canTeach(ClassId classId) - { - // If the player is on a third class, fetch the class teacher information for its parent class. - if (classId.level() == 3) - { - return _teachInfo.contains(classId.getParent()); - } - return _teachInfo.contains(classId); - } - - public List getTeachInfo() - { - return _teachInfo; - } - - public void addTeachInfo(List teachInfo) - { - _teachInfo.addAll(teachInfo); - } - public List getExtendDrop() { return _extendDrop == null ? Collections.emptyList() : _extendDrop; diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java index 2d6ce2da28..07c07080b9 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java @@ -17,10 +17,7 @@ package com.l2jmobius.gameserver.network.clientpackets; import com.l2jmobius.commons.network.PacketReader; -import com.l2jmobius.gameserver.data.xml.impl.SkillData; -import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.model.skills.CommonSkill; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -51,6 +48,11 @@ public final class RequestMagicSkillUse implements IClientIncomingPacket return; } + if (activeChar.isSpawnProtected()) + { + activeChar.onActionRequest(); + } + // Get the level of the used skill Skill skill = activeChar.getKnownSkill(_magicId); if (skill == null) @@ -59,16 +61,9 @@ public final class RequestMagicSkillUse implements IClientIncomingPacket skill = activeChar.getCustomSkill(_magicId); if (skill == null) { - if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) || SkillTreesData.getInstance().isSubClassChangeSkill(_magicId, 1)) - { - skill = SkillData.getInstance().getSkill(_magicId, 1); - } - else - { - activeChar.sendPacket(ActionFailed.STATIC_PACKET); - _log.warning("Skill Id " + _magicId + " not found in player!"); - return; - } + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + _log.warning("Player " + activeChar + " tried to use a skill [" + _magicId + "] which hasn't been learned or it belongs to a macro of a currently inactive class."); + return; } } diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/SkillLearn.xml b/L2J_Mobius_2.5_Underground/dist/game/data/SkillLearn.xml deleted file mode 100644 index fd9f157cdb..0000000000 --- a/L2J_Mobius_2.5_Underground/dist/game/data/SkillLearn.xml +++ /dev/null @@ -1,2145 +0,0 @@ - - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 15 - 16 - 17 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 15 - 16 - 17 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 15 - 16 - 17 - - - 25 - 29 - 30 - - - 10 - 11 - 12 - 13 - 14 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 25 - 26 - 27 - 28 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 26 - 27 - 28 - - - 25 - 29 - 30 - - - 54 - 55 - 117 - - - 54 - 55 - 117 - - - 10 - 11 - 12 - 13 - 14 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 15 - 16 - 17 - - - 25 - 26 - 27 - 28 - - - 10 - 11 - 12 - 13 - 14 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 25 - 29 - 30 - - - 53 - 56 - 57 - - - 53 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 29 - 30 - - - 25 - 26 - 27 - 28 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 53 - 56 - 57 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 26 - 27 - 28 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 53 - 56 - 57 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 53 - 54 - 55 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 53 - 56 - 57 - - - 44 - 45 - 46 - 47 - 48 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 49 - 50 - 51 - 52 - - - 53 - 56 - 57 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 29 - 30 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 25 - 26 - 27 - 28 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 25 - 29 - 30 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 15 - 16 - 17 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 29 - 30 - - - 25 - 26 - 27 - 28 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 49 - 50 - 51 - 52 - 115 - 116 - - - 44 - 45 - 46 - 47 - 48 - 113 - 114 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 99 - 100 - 101 - 102 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 88 - 89 - 90 - 91 - 92 - 93 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 49 - 50 - 51 - 52 - 115 - 116 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 44 - 45 - 46 - 47 - 48 - 113 - 114 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 99 - 100 - 101 - 102 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 88 - 89 - 90 - 91 - 92 - 93 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 117 - - - 53 - 54 - 55 - 117 - - - 53 - 54 - 55 - 117 - - - 53 - 56 - 57 - 118 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 89 - 90 - 91 - 92 - 93 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 99 - 100 - 101 - 102 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - - - 25 - 26 - 27 - 28 - 29 - 103 - 104 - 105 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 44 - 45 - 46 - 47 - 48 - 113 - 114 - - - 49 - 50 - 51 - 52 - 115 - 116 - - - 53 - 56 - 118 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 26 - 27 - 28 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 53 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java index ff7e85b98a..21878c40eb 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java @@ -21,6 +21,7 @@ import java.util.List; import com.l2jmobius.Config; import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; +import com.l2jmobius.gameserver.enums.CategoryType; import com.l2jmobius.gameserver.model.L2SkillLearn; import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; @@ -51,7 +52,12 @@ public final class HealerTrainer extends AbstractNpcAI // @formatter:on // Misc private static final int MIN_LEVEL = 76; - private static final int MIN_CLASS_LEVEL = 3; + private static final CategoryType[] ALLOWED_CATEGORIES = + { + CategoryType.FOURTH_CLASS_GROUP, + CategoryType.FIFTH_CLASS_GROUP, + CategoryType.SIXTH_CLASS_GROUP + }; private HealerTrainer() { @@ -79,13 +85,13 @@ public final class HealerTrainer extends AbstractNpcAI } case "SkillTransferLearn": { - if (!npc.getTemplate().canTeach(player.getClassId())) + if (!player.isInCategory(CategoryType.HEAL_MASTER)) { htmltext = npc.getId() + "-noteach.html"; break; } - if ((player.getLevel() < MIN_LEVEL) || (player.getClassId().level() < MIN_CLASS_LEVEL)) + if ((player.getLevel() < MIN_LEVEL) || !player.isInOneOfCategory(ALLOWED_CATEGORIES)) { htmltext = "learn-lowlevel.html"; break; @@ -104,13 +110,13 @@ public final class HealerTrainer extends AbstractNpcAI } case "SkillTransferCleanse": { - if (!npc.getTemplate().canTeach(player.getClassId())) + if (!player.isInCategory(CategoryType.HEAL_MASTER)) { htmltext = "cleanse-no.html"; break; } - if ((player.getLevel() < MIN_LEVEL) || (player.getClassId().level() < MIN_CLASS_LEVEL)) + if ((player.getLevel() < MIN_LEVEL) || !player.isInOneOfCategory(ALLOWED_CATEGORIES)) { htmltext = "cleanse-no.html"; break; diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java index 35eb076401..80cd183b64 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java @@ -277,7 +277,7 @@ public class AdminBuffs implements IAdminCommandHandler */ public static void switchSkills(L2PcInstance gmchar, boolean toAuraSkills) { - final Collection skills = toAuraSkills ? SkillTreesData.getInstance().getGMSkillTree().values() : SkillTreesData.getInstance().getGMAuraSkillTree().values(); + final Collection skills = toAuraSkills ? SkillTreesData.getInstance().getGMSkillTree() : SkillTreesData.getInstance().getGMAuraSkillTree(); for (Skill skill : skills) { gmchar.removeSkill(skill, false); // Don't Save GM skills to database diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/skillTrees/nobleSkillTree.xml b/L2J_Mobius_2.5_Underground/dist/game/data/skillTrees/nobleSkillTree.xml index b93e64cb2d..09046f0d64 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/skillTrees/nobleSkillTree.xml +++ b/L2J_Mobius_2.5_Underground/dist/game/data/skillTrees/nobleSkillTree.xml @@ -1,17 +1,16 @@ - - - - - - - - - - - + + + + + + + + + + diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/skillTrees/subclassChangeSkillTree.xml b/L2J_Mobius_2.5_Underground/dist/game/data/skillTrees/subclassChangeSkillTree.xml deleted file mode 100644 index e65e5bf356..0000000000 --- a/L2J_Mobius_2.5_Underground/dist/game/data/skillTrees/subclassChangeSkillTree.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/GameServer.java index 09ca886b87..37c43f7491 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/GameServer.java @@ -86,7 +86,6 @@ import com.l2jmobius.gameserver.data.xml.impl.SecondaryAuthData; import com.l2jmobius.gameserver.data.xml.impl.ShuttleData; import com.l2jmobius.gameserver.data.xml.impl.SiegeScheduleData; import com.l2jmobius.gameserver.data.xml.impl.SkillData; -import com.l2jmobius.gameserver.data.xml.impl.SkillLearnData; import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.data.xml.impl.SpawnsData; import com.l2jmobius.gameserver.data.xml.impl.StaticObjectData; @@ -288,7 +287,6 @@ public class GameServer } printSection("NPCs"); - SkillLearnData.getInstance(); NpcData.getInstance(); FakePlayerData.getInstance(); FakePlayerChatManager.getInstance(); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java index f03a2395f1..95393db740 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java @@ -44,7 +44,6 @@ import com.l2jmobius.gameserver.enums.MpRewardAffectType; import com.l2jmobius.gameserver.enums.MpRewardType; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; -import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.model.effects.L2EffectType; import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.skills.Skill; @@ -80,8 +79,6 @@ public class NpcData implements IGameXmlReader parseDatapackDirectory("data/stats/npcs/custom", true); LOGGER.info(getClass().getSimpleName() + ": Loaded " + (_npcs.size() - npcCount) + " Custom NPCs."); } - - loadNpcsSkillLearn(); } @Override @@ -787,18 +784,6 @@ public class NpcData implements IGameXmlReader return getTemplates(template -> CommonUtil.contains(classTypes, template.getType(), true)); } - public void loadNpcsSkillLearn() - { - _npcs.values().forEach(template -> - { - final List teachInfo = SkillLearnData.getInstance().getSkillLearnData(template.getId()); - if (teachInfo != null) - { - template.addTeachInfo(teachInfo); - } - }); - } - /** * @return the IDs of monsters that have minions. */ diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java deleted file mode 100644 index d7929de1c3..0000000000 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * This file is part of the L2J Mobius project. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.l2jmobius.gameserver.data.xml.impl; - -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.w3c.dom.Node; - -import com.l2jmobius.commons.util.IGameXmlReader; -import com.l2jmobius.gameserver.model.base.ClassId; - -/** - * Holds all skill learn data for all npcs. - * @author xban1x - */ -public final class SkillLearnData implements IGameXmlReader -{ - private static final Logger LOGGER = Logger.getLogger(SkillLearnData.class.getName()); - - private final Map> _skillLearn = new HashMap<>(); - - protected SkillLearnData() - { - load(); - } - - @Override - public synchronized void load() - { - _skillLearn.clear(); - parseDatapackFile("data/SkillLearn.xml"); - LOGGER.info(getClass().getSimpleName() + ": Loaded " + _skillLearn.size() + " Skill Learn data."); - } - - @Override - public void parseDocument(Document doc, File f) - { - for (Node node = doc.getFirstChild(); node != null; node = node.getNextSibling()) - { - if ("list".equalsIgnoreCase(node.getNodeName())) - { - for (Node list_node = node.getFirstChild(); list_node != null; list_node = list_node.getNextSibling()) - { - if ("npc".equalsIgnoreCase(list_node.getNodeName())) - { - final List classIds = new ArrayList<>(); - for (Node c = list_node.getFirstChild(); c != null; c = c.getNextSibling()) - { - if ("classId".equalsIgnoreCase(c.getNodeName())) - { - classIds.add(ClassId.getClassId(Integer.parseInt(c.getTextContent()))); - } - } - _skillLearn.put(parseInteger(list_node.getAttributes(), "id"), classIds); - } - } - } - } - } - - /** - * @param npcId - * @return {@link List} of {@link ClassId}'s that this npcId can teach. - */ - public List getSkillLearnData(int npcId) - { - return _skillLearn.get(npcId); - } - - /** - * Gets the single instance of SkillLearnData. - * @return single instance of SkillLearnData - */ - public static SkillLearnData getInstance() - { - return SingletonHolder._instance; - } - - private static class SingletonHolder - { - protected static final SkillLearnData _instance = new SkillLearnData(); - } -} diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java index 4b35d8bca8..e0ce62ab0f 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java @@ -29,7 +29,9 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Logger; +import java.util.stream.Collectors; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; @@ -93,7 +95,6 @@ public final class SkillTreesData implements IGameXmlReader private static final Map _subPledgeSkillTree = new HashMap<>(); private static final Map _transformSkillTree = new HashMap<>(); private static final Map _commonSkillTree = new HashMap<>(); - private static final Map _subClassChangeSkillTree = new HashMap<>(); private static final Map _abilitySkillTree = new HashMap<>(); private static final Map _alchemySkillTree = new HashMap<>(); private static final Map _dualClassSkillTree = new HashMap<>(); @@ -110,11 +111,11 @@ public final class SkillTreesData implements IGameXmlReader private Map _skillsByRaceHashCodes; // Race-specific Transformations private long[] _allSkillsHashCodes; // Fishing, Collection, Transformations, Common Skills. - private boolean _loading = true; - /** Parent class Ids are read from XML and stored in this map, to allow easy customization. */ private static final Map _parentClassMap = new HashMap<>(); + private final AtomicBoolean _isLoading = new AtomicBoolean(); + /** * Instantiates a new skill trees data. */ @@ -126,7 +127,8 @@ public final class SkillTreesData implements IGameXmlReader @Override public void load() { - _loading = true; + _isLoading.set(true); + _classSkillTrees.clear(); _collectSkillTree.clear(); _fishingSkillTree.clear(); @@ -136,7 +138,6 @@ public final class SkillTreesData implements IGameXmlReader _transferSkillTrees.clear(); _transformSkillTree.clear(); _nobleSkillTree.clear(); - _subClassChangeSkillTree.clear(); _abilitySkillTree.clear(); _alchemySkillTree.clear(); _heroSkillTree.clear(); @@ -154,10 +155,10 @@ public final class SkillTreesData implements IGameXmlReader // Generate check arrays. generateCheckArrays(); - _loading = false; - // Logs a report with skill trees info. report(); + + _isLoading.set(false); } /** @@ -368,11 +369,6 @@ public final class SkillTreesData implements IGameXmlReader _gameMasterAuraSkillTree.put(skillHashCode, skillLearn); break; } - case "subClassChangeSkillTree": - { - _subClassChangeSkillTree.put(skillHashCode, skillLearn); - break; - } case "dualClassSkillTree": { _dualClassSkillTree.put(skillHashCode, skillLearn); @@ -523,15 +519,6 @@ public final class SkillTreesData implements IGameXmlReader return _subClassSkillTree; } - /** - * Gets the sub class change skill tree. - * @return the complete Common Skill Tree - */ - public Map getSubClassChangeSkillTree() - { - return _subClassChangeSkillTree; - } - /** * Gets the sub pledge skill tree. * @return the complete Sub-Pledge Skill Tree @@ -572,60 +559,45 @@ public final class SkillTreesData implements IGameXmlReader * Gets the noble skill tree. * @return the complete Noble Skill Tree */ - public Map getNobleSkillTree() + public List getNobleSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _nobleSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _nobleSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); + } + + /** + * Gets the noble skill tree. + * @return the complete Noble Skill Tree + */ + public List getNobleSkillAutoGetTree() + { + return _nobleSkillTree.values().stream().filter(entry -> entry.isAutoGet()).map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** * Gets the hero skill tree. * @return the complete Hero Skill Tree */ - public Map getHeroSkillTree() + public List getHeroSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _heroSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _heroSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** * Gets the Game Master skill tree. * @return the complete Game Master Skill Tree */ - public Map getGMSkillTree() + public List getGMSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _gameMasterSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _gameMasterSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** * Gets the Game Master Aura skill tree. * @return the complete Game Master Aura Skill Tree */ - public Map getGMAuraSkillTree() + public List getGMAuraSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _gameMasterAuraSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _gameMasterAuraSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** @@ -753,7 +725,6 @@ public final class SkillTreesData implements IGameXmlReader for (L2SkillLearn skillLearn : learnable) { final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel()); - // Cleanup skills that has to be removed for (int skillId : skillLearn.getRemoveSkills()) { @@ -1536,17 +1507,6 @@ public final class SkillTreesData implements IGameXmlReader return _pledgeSkillTree.containsKey(hashCode) || _subPledgeSkillTree.containsKey(hashCode); } - /** - * Checks if a skill is a Subclass change skill. - * @param skillId the Id of the skill to check - * @param skillLevel the level of the skill to check - * @return {@code true} if the skill is present in the Subclass change Skill Trees, {@code false} otherwise - */ - public boolean isSubClassChangeSkill(int skillId, int skillLevel) - { - return _subClassChangeSkillTree.containsKey(SkillData.getSkillHashCode(skillId, skillLevel)); - } - public boolean isRemoveSkill(ClassId classId, int skillId) { return _removeSkillCache.getOrDefault(classId, Collections.emptySet()).contains(skillId); @@ -1704,7 +1664,7 @@ public final class SkillTreesData implements IGameXmlReader } // Prevent accidental skill remove during reload - if (_loading) + if (_isLoading.get()) { return true; } @@ -1819,7 +1779,6 @@ public final class SkillTreesData implements IGameXmlReader { LOGGER.info(className + ": Loaded " + commonSkills + " Common Skills to all classes."); } - LOGGER.info(className + ": Loaded " + _subClassChangeSkillTree.size() + " Subclass change Skills."); } /** diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java index 88d2616d3b..ccb8fe9c4d 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -5108,6 +5108,19 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe return CategoryData.getInstance().isInCategory(type, getId()); } + public final boolean isInOneOfCategory(CategoryType... types) + { + for (CategoryType type : types) + { + if (CategoryData.getInstance().isInCategory(type, getId())) + { + return true; + } + } + + return false; + } + /** * @return the character that summoned this NPC. */ diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java index 94bd7ebfb2..11f2e21933 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java @@ -20,7 +20,6 @@ import java.util.List; import java.util.Map; import com.l2jmobius.Config; -import com.l2jmobius.gameserver.cache.HtmCache; import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.enums.InstanceType; import com.l2jmobius.gameserver.model.L2SkillLearn; @@ -31,7 +30,6 @@ import com.l2jmobius.gameserver.model.base.AcquireSkillType; import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass; -import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class L2NpcInstance extends L2Npc @@ -55,11 +53,6 @@ public class L2NpcInstance extends L2Npc setStatus(new FolkStatus(this)); } - public List getClassesToTeach() - { - return getTemplate().getTeachInfo(); - } - /** * Displays Skill Tree for a given player, npc and class Id. * @param player the active character. @@ -99,39 +92,6 @@ public class L2NpcInstance extends L2Npc return; } - if (!npc.getTemplate().canTeach(classId)) - { - String html = ""; - - if (npc instanceof L2WarehouseInstance) - { - html = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), "data/html/warehouse/" + npcId + "-noteach.htm"); - } - - final NpcHtmlMessage noTeachMsg = new NpcHtmlMessage(npc.getObjectId()); - if (html == null) - { - _log.warning("Npc " + npcId + " missing noTeach html!"); - noTeachMsg.setHtml("I cannot teach you any skills.
You must find your current class teachers."); - } - else - { - noTeachMsg.setHtml(html); - noTeachMsg.replace("%objectId%", String.valueOf(npc.getObjectId())); - } - player.sendPacket(noTeachMsg); - return; - } - - if (((L2NpcInstance) npc).getClassesToTeach().isEmpty()) - { - final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId()); - final String sb = "I cannot teach you. My class list is empty.
Ask admin to fix it. Need add my npcid and classes to skill_learn.sql.
NpcId:" + npcId + ", Your classId:" + player.getClassId().getId() + ""; - html.setHtml(sb); - player.sendPacket(html); - return; - } - // Normal skills, No LearnedByFS, no AutoGet skills. final List skills = SkillTreesData.getInstance().getAvailableSkills(player, classId, false, false); if (skills.isEmpty()) diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index ef36cf45c1..08fe0b4bea 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -9237,14 +9237,14 @@ public final class L2PcInstance extends L2Playable { if (hero && (_baseClass == _activeClass)) { - for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree().values()) + for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree()) { addSkill(skill, false); // Don't persist hero skills into database } } else { - for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree().values()) + for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree()) { removeSkill(skill, false, true); // Just remove skills from non-hero players } @@ -9403,24 +9403,15 @@ public final class L2PcInstance extends L2Playable public void setNobleLevel(int level) { - final Collection nobleSkillTree = SkillTreesData.getInstance().getNobleSkillTree().values(); if (level != 0) { - for (Skill skill : nobleSkillTree) - { - addSkill(skill, false); - } + SkillTreesData.getInstance().getNobleSkillAutoGetTree().forEach(skill -> addSkill(skill, false)); } else { - for (Skill skill : nobleSkillTree) - { - removeSkill(skill, false, true); - } + SkillTreesData.getInstance().getNobleSkillTree().forEach(skill -> removeSkill(skill, false, true)); } - _nobleLevel = level; - sendSkillList(); if ((level != 0) && (getLevel() >= 99)) { diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java index f5bee5dab6..125639ae1f 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java @@ -36,7 +36,6 @@ import com.l2jmobius.gameserver.enums.Race; import com.l2jmobius.gameserver.enums.Sex; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.holders.ItemHolder; import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; @@ -113,8 +112,6 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable private int _mpRewardTicks; private MpRewardAffectType _mpRewardAffectType; - private final List _teachInfo = new ArrayList<>(); - private List _extendDrop; /** @@ -938,26 +935,6 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable return L2NpcTemplate.isAssignableTo(obj.getClass(), clazz); } - public boolean canTeach(ClassId classId) - { - // If the player is on a third class, fetch the class teacher information for its parent class. - if (classId.level() == 3) - { - return _teachInfo.contains(classId.getParent()); - } - return _teachInfo.contains(classId); - } - - public List getTeachInfo() - { - return _teachInfo; - } - - public void addTeachInfo(List teachInfo) - { - _teachInfo.addAll(teachInfo); - } - public List getExtendDrop() { return _extendDrop == null ? Collections.emptyList() : _extendDrop; diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java index 2d6ce2da28..07c07080b9 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java @@ -17,10 +17,7 @@ package com.l2jmobius.gameserver.network.clientpackets; import com.l2jmobius.commons.network.PacketReader; -import com.l2jmobius.gameserver.data.xml.impl.SkillData; -import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.model.skills.CommonSkill; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -51,6 +48,11 @@ public final class RequestMagicSkillUse implements IClientIncomingPacket return; } + if (activeChar.isSpawnProtected()) + { + activeChar.onActionRequest(); + } + // Get the level of the used skill Skill skill = activeChar.getKnownSkill(_magicId); if (skill == null) @@ -59,16 +61,9 @@ public final class RequestMagicSkillUse implements IClientIncomingPacket skill = activeChar.getCustomSkill(_magicId); if (skill == null) { - if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) || SkillTreesData.getInstance().isSubClassChangeSkill(_magicId, 1)) - { - skill = SkillData.getInstance().getSkill(_magicId, 1); - } - else - { - activeChar.sendPacket(ActionFailed.STATIC_PACKET); - _log.warning("Skill Id " + _magicId + " not found in player!"); - return; - } + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + _log.warning("Player " + activeChar + " tried to use a skill [" + _magicId + "] which hasn't been learned or it belongs to a macro of a currently inactive class."); + return; } } diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/SkillLearn.xml b/L2J_Mobius_3.0_Helios/dist/game/data/SkillLearn.xml deleted file mode 100644 index fd9f157cdb..0000000000 --- a/L2J_Mobius_3.0_Helios/dist/game/data/SkillLearn.xml +++ /dev/null @@ -1,2145 +0,0 @@ - - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 15 - 16 - 17 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 15 - 16 - 17 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 15 - 16 - 17 - - - 25 - 29 - 30 - - - 10 - 11 - 12 - 13 - 14 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 25 - 26 - 27 - 28 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 26 - 27 - 28 - - - 25 - 29 - 30 - - - 54 - 55 - 117 - - - 54 - 55 - 117 - - - 10 - 11 - 12 - 13 - 14 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 15 - 16 - 17 - - - 25 - 26 - 27 - 28 - - - 10 - 11 - 12 - 13 - 14 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 25 - 29 - 30 - - - 53 - 56 - 57 - - - 53 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 29 - 30 - - - 25 - 26 - 27 - 28 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 53 - 56 - 57 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 26 - 27 - 28 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 53 - 56 - 57 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 53 - 54 - 55 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 53 - 56 - 57 - - - 44 - 45 - 46 - 47 - 48 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 49 - 50 - 51 - 52 - - - 53 - 56 - 57 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 29 - 30 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 25 - 26 - 27 - 28 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 25 - 29 - 30 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 15 - 16 - 17 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 29 - 30 - - - 25 - 26 - 27 - 28 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 49 - 50 - 51 - 52 - 115 - 116 - - - 44 - 45 - 46 - 47 - 48 - 113 - 114 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 99 - 100 - 101 - 102 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 88 - 89 - 90 - 91 - 92 - 93 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 49 - 50 - 51 - 52 - 115 - 116 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 44 - 45 - 46 - 47 - 48 - 113 - 114 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 99 - 100 - 101 - 102 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 88 - 89 - 90 - 91 - 92 - 93 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 117 - - - 53 - 54 - 55 - 117 - - - 53 - 54 - 55 - 117 - - - 53 - 56 - 57 - 118 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 89 - 90 - 91 - 92 - 93 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 99 - 100 - 101 - 102 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - - - 25 - 26 - 27 - 28 - 29 - 103 - 104 - 105 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 44 - 45 - 46 - 47 - 48 - 113 - 114 - - - 49 - 50 - 51 - 52 - 115 - 116 - - - 53 - 56 - 118 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 26 - 27 - 28 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 53 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java index ff7e85b98a..21878c40eb 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java @@ -21,6 +21,7 @@ import java.util.List; import com.l2jmobius.Config; import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; +import com.l2jmobius.gameserver.enums.CategoryType; import com.l2jmobius.gameserver.model.L2SkillLearn; import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; @@ -51,7 +52,12 @@ public final class HealerTrainer extends AbstractNpcAI // @formatter:on // Misc private static final int MIN_LEVEL = 76; - private static final int MIN_CLASS_LEVEL = 3; + private static final CategoryType[] ALLOWED_CATEGORIES = + { + CategoryType.FOURTH_CLASS_GROUP, + CategoryType.FIFTH_CLASS_GROUP, + CategoryType.SIXTH_CLASS_GROUP + }; private HealerTrainer() { @@ -79,13 +85,13 @@ public final class HealerTrainer extends AbstractNpcAI } case "SkillTransferLearn": { - if (!npc.getTemplate().canTeach(player.getClassId())) + if (!player.isInCategory(CategoryType.HEAL_MASTER)) { htmltext = npc.getId() + "-noteach.html"; break; } - if ((player.getLevel() < MIN_LEVEL) || (player.getClassId().level() < MIN_CLASS_LEVEL)) + if ((player.getLevel() < MIN_LEVEL) || !player.isInOneOfCategory(ALLOWED_CATEGORIES)) { htmltext = "learn-lowlevel.html"; break; @@ -104,13 +110,13 @@ public final class HealerTrainer extends AbstractNpcAI } case "SkillTransferCleanse": { - if (!npc.getTemplate().canTeach(player.getClassId())) + if (!player.isInCategory(CategoryType.HEAL_MASTER)) { htmltext = "cleanse-no.html"; break; } - if ((player.getLevel() < MIN_LEVEL) || (player.getClassId().level() < MIN_CLASS_LEVEL)) + if ((player.getLevel() < MIN_LEVEL) || !player.isInOneOfCategory(ALLOWED_CATEGORIES)) { htmltext = "cleanse-no.html"; break; diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java index 35eb076401..80cd183b64 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java @@ -277,7 +277,7 @@ public class AdminBuffs implements IAdminCommandHandler */ public static void switchSkills(L2PcInstance gmchar, boolean toAuraSkills) { - final Collection skills = toAuraSkills ? SkillTreesData.getInstance().getGMSkillTree().values() : SkillTreesData.getInstance().getGMAuraSkillTree().values(); + final Collection skills = toAuraSkills ? SkillTreesData.getInstance().getGMSkillTree() : SkillTreesData.getInstance().getGMAuraSkillTree(); for (Skill skill : skills) { gmchar.removeSkill(skill, false); // Don't Save GM skills to database diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/skillTrees/nobleSkillTree.xml b/L2J_Mobius_3.0_Helios/dist/game/data/skillTrees/nobleSkillTree.xml index b93e64cb2d..09046f0d64 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/skillTrees/nobleSkillTree.xml +++ b/L2J_Mobius_3.0_Helios/dist/game/data/skillTrees/nobleSkillTree.xml @@ -1,17 +1,16 @@ - - - - - - - - - - - + + + + + + + + + + diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/skillTrees/subclassChangeSkillTree.xml b/L2J_Mobius_3.0_Helios/dist/game/data/skillTrees/subclassChangeSkillTree.xml deleted file mode 100644 index e65e5bf356..0000000000 --- a/L2J_Mobius_3.0_Helios/dist/game/data/skillTrees/subclassChangeSkillTree.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/GameServer.java index 810ed1ae09..d248ed472a 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/GameServer.java @@ -86,7 +86,6 @@ import com.l2jmobius.gameserver.data.xml.impl.SecondaryAuthData; import com.l2jmobius.gameserver.data.xml.impl.ShuttleData; import com.l2jmobius.gameserver.data.xml.impl.SiegeScheduleData; import com.l2jmobius.gameserver.data.xml.impl.SkillData; -import com.l2jmobius.gameserver.data.xml.impl.SkillLearnData; import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.data.xml.impl.SpawnsData; import com.l2jmobius.gameserver.data.xml.impl.StaticObjectData; @@ -288,7 +287,6 @@ public class GameServer } printSection("NPCs"); - SkillLearnData.getInstance(); NpcData.getInstance(); FakePlayerData.getInstance(); FakePlayerChatManager.getInstance(); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java index f03a2395f1..95393db740 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java @@ -44,7 +44,6 @@ import com.l2jmobius.gameserver.enums.MpRewardAffectType; import com.l2jmobius.gameserver.enums.MpRewardType; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; -import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.model.effects.L2EffectType; import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.skills.Skill; @@ -80,8 +79,6 @@ public class NpcData implements IGameXmlReader parseDatapackDirectory("data/stats/npcs/custom", true); LOGGER.info(getClass().getSimpleName() + ": Loaded " + (_npcs.size() - npcCount) + " Custom NPCs."); } - - loadNpcsSkillLearn(); } @Override @@ -787,18 +784,6 @@ public class NpcData implements IGameXmlReader return getTemplates(template -> CommonUtil.contains(classTypes, template.getType(), true)); } - public void loadNpcsSkillLearn() - { - _npcs.values().forEach(template -> - { - final List teachInfo = SkillLearnData.getInstance().getSkillLearnData(template.getId()); - if (teachInfo != null) - { - template.addTeachInfo(teachInfo); - } - }); - } - /** * @return the IDs of monsters that have minions. */ diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java deleted file mode 100644 index d7929de1c3..0000000000 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * This file is part of the L2J Mobius project. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.l2jmobius.gameserver.data.xml.impl; - -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.w3c.dom.Node; - -import com.l2jmobius.commons.util.IGameXmlReader; -import com.l2jmobius.gameserver.model.base.ClassId; - -/** - * Holds all skill learn data for all npcs. - * @author xban1x - */ -public final class SkillLearnData implements IGameXmlReader -{ - private static final Logger LOGGER = Logger.getLogger(SkillLearnData.class.getName()); - - private final Map> _skillLearn = new HashMap<>(); - - protected SkillLearnData() - { - load(); - } - - @Override - public synchronized void load() - { - _skillLearn.clear(); - parseDatapackFile("data/SkillLearn.xml"); - LOGGER.info(getClass().getSimpleName() + ": Loaded " + _skillLearn.size() + " Skill Learn data."); - } - - @Override - public void parseDocument(Document doc, File f) - { - for (Node node = doc.getFirstChild(); node != null; node = node.getNextSibling()) - { - if ("list".equalsIgnoreCase(node.getNodeName())) - { - for (Node list_node = node.getFirstChild(); list_node != null; list_node = list_node.getNextSibling()) - { - if ("npc".equalsIgnoreCase(list_node.getNodeName())) - { - final List classIds = new ArrayList<>(); - for (Node c = list_node.getFirstChild(); c != null; c = c.getNextSibling()) - { - if ("classId".equalsIgnoreCase(c.getNodeName())) - { - classIds.add(ClassId.getClassId(Integer.parseInt(c.getTextContent()))); - } - } - _skillLearn.put(parseInteger(list_node.getAttributes(), "id"), classIds); - } - } - } - } - } - - /** - * @param npcId - * @return {@link List} of {@link ClassId}'s that this npcId can teach. - */ - public List getSkillLearnData(int npcId) - { - return _skillLearn.get(npcId); - } - - /** - * Gets the single instance of SkillLearnData. - * @return single instance of SkillLearnData - */ - public static SkillLearnData getInstance() - { - return SingletonHolder._instance; - } - - private static class SingletonHolder - { - protected static final SkillLearnData _instance = new SkillLearnData(); - } -} diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java index 4b35d8bca8..e0ce62ab0f 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java @@ -29,7 +29,9 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Logger; +import java.util.stream.Collectors; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; @@ -93,7 +95,6 @@ public final class SkillTreesData implements IGameXmlReader private static final Map _subPledgeSkillTree = new HashMap<>(); private static final Map _transformSkillTree = new HashMap<>(); private static final Map _commonSkillTree = new HashMap<>(); - private static final Map _subClassChangeSkillTree = new HashMap<>(); private static final Map _abilitySkillTree = new HashMap<>(); private static final Map _alchemySkillTree = new HashMap<>(); private static final Map _dualClassSkillTree = new HashMap<>(); @@ -110,11 +111,11 @@ public final class SkillTreesData implements IGameXmlReader private Map _skillsByRaceHashCodes; // Race-specific Transformations private long[] _allSkillsHashCodes; // Fishing, Collection, Transformations, Common Skills. - private boolean _loading = true; - /** Parent class Ids are read from XML and stored in this map, to allow easy customization. */ private static final Map _parentClassMap = new HashMap<>(); + private final AtomicBoolean _isLoading = new AtomicBoolean(); + /** * Instantiates a new skill trees data. */ @@ -126,7 +127,8 @@ public final class SkillTreesData implements IGameXmlReader @Override public void load() { - _loading = true; + _isLoading.set(true); + _classSkillTrees.clear(); _collectSkillTree.clear(); _fishingSkillTree.clear(); @@ -136,7 +138,6 @@ public final class SkillTreesData implements IGameXmlReader _transferSkillTrees.clear(); _transformSkillTree.clear(); _nobleSkillTree.clear(); - _subClassChangeSkillTree.clear(); _abilitySkillTree.clear(); _alchemySkillTree.clear(); _heroSkillTree.clear(); @@ -154,10 +155,10 @@ public final class SkillTreesData implements IGameXmlReader // Generate check arrays. generateCheckArrays(); - _loading = false; - // Logs a report with skill trees info. report(); + + _isLoading.set(false); } /** @@ -368,11 +369,6 @@ public final class SkillTreesData implements IGameXmlReader _gameMasterAuraSkillTree.put(skillHashCode, skillLearn); break; } - case "subClassChangeSkillTree": - { - _subClassChangeSkillTree.put(skillHashCode, skillLearn); - break; - } case "dualClassSkillTree": { _dualClassSkillTree.put(skillHashCode, skillLearn); @@ -523,15 +519,6 @@ public final class SkillTreesData implements IGameXmlReader return _subClassSkillTree; } - /** - * Gets the sub class change skill tree. - * @return the complete Common Skill Tree - */ - public Map getSubClassChangeSkillTree() - { - return _subClassChangeSkillTree; - } - /** * Gets the sub pledge skill tree. * @return the complete Sub-Pledge Skill Tree @@ -572,60 +559,45 @@ public final class SkillTreesData implements IGameXmlReader * Gets the noble skill tree. * @return the complete Noble Skill Tree */ - public Map getNobleSkillTree() + public List getNobleSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _nobleSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _nobleSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); + } + + /** + * Gets the noble skill tree. + * @return the complete Noble Skill Tree + */ + public List getNobleSkillAutoGetTree() + { + return _nobleSkillTree.values().stream().filter(entry -> entry.isAutoGet()).map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** * Gets the hero skill tree. * @return the complete Hero Skill Tree */ - public Map getHeroSkillTree() + public List getHeroSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _heroSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _heroSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** * Gets the Game Master skill tree. * @return the complete Game Master Skill Tree */ - public Map getGMSkillTree() + public List getGMSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _gameMasterSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _gameMasterSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** * Gets the Game Master Aura skill tree. * @return the complete Game Master Aura Skill Tree */ - public Map getGMAuraSkillTree() + public List getGMAuraSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _gameMasterAuraSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _gameMasterAuraSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** @@ -753,7 +725,6 @@ public final class SkillTreesData implements IGameXmlReader for (L2SkillLearn skillLearn : learnable) { final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel()); - // Cleanup skills that has to be removed for (int skillId : skillLearn.getRemoveSkills()) { @@ -1536,17 +1507,6 @@ public final class SkillTreesData implements IGameXmlReader return _pledgeSkillTree.containsKey(hashCode) || _subPledgeSkillTree.containsKey(hashCode); } - /** - * Checks if a skill is a Subclass change skill. - * @param skillId the Id of the skill to check - * @param skillLevel the level of the skill to check - * @return {@code true} if the skill is present in the Subclass change Skill Trees, {@code false} otherwise - */ - public boolean isSubClassChangeSkill(int skillId, int skillLevel) - { - return _subClassChangeSkillTree.containsKey(SkillData.getSkillHashCode(skillId, skillLevel)); - } - public boolean isRemoveSkill(ClassId classId, int skillId) { return _removeSkillCache.getOrDefault(classId, Collections.emptySet()).contains(skillId); @@ -1704,7 +1664,7 @@ public final class SkillTreesData implements IGameXmlReader } // Prevent accidental skill remove during reload - if (_loading) + if (_isLoading.get()) { return true; } @@ -1819,7 +1779,6 @@ public final class SkillTreesData implements IGameXmlReader { LOGGER.info(className + ": Loaded " + commonSkills + " Common Skills to all classes."); } - LOGGER.info(className + ": Loaded " + _subClassChangeSkillTree.size() + " Subclass change Skills."); } /** diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java index 88d2616d3b..ccb8fe9c4d 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -5108,6 +5108,19 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe return CategoryData.getInstance().isInCategory(type, getId()); } + public final boolean isInOneOfCategory(CategoryType... types) + { + for (CategoryType type : types) + { + if (CategoryData.getInstance().isInCategory(type, getId())) + { + return true; + } + } + + return false; + } + /** * @return the character that summoned this NPC. */ diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java index 94bd7ebfb2..11f2e21933 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java @@ -20,7 +20,6 @@ import java.util.List; import java.util.Map; import com.l2jmobius.Config; -import com.l2jmobius.gameserver.cache.HtmCache; import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.enums.InstanceType; import com.l2jmobius.gameserver.model.L2SkillLearn; @@ -31,7 +30,6 @@ import com.l2jmobius.gameserver.model.base.AcquireSkillType; import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass; -import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class L2NpcInstance extends L2Npc @@ -55,11 +53,6 @@ public class L2NpcInstance extends L2Npc setStatus(new FolkStatus(this)); } - public List getClassesToTeach() - { - return getTemplate().getTeachInfo(); - } - /** * Displays Skill Tree for a given player, npc and class Id. * @param player the active character. @@ -99,39 +92,6 @@ public class L2NpcInstance extends L2Npc return; } - if (!npc.getTemplate().canTeach(classId)) - { - String html = ""; - - if (npc instanceof L2WarehouseInstance) - { - html = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), "data/html/warehouse/" + npcId + "-noteach.htm"); - } - - final NpcHtmlMessage noTeachMsg = new NpcHtmlMessage(npc.getObjectId()); - if (html == null) - { - _log.warning("Npc " + npcId + " missing noTeach html!"); - noTeachMsg.setHtml("I cannot teach you any skills.
You must find your current class teachers."); - } - else - { - noTeachMsg.setHtml(html); - noTeachMsg.replace("%objectId%", String.valueOf(npc.getObjectId())); - } - player.sendPacket(noTeachMsg); - return; - } - - if (((L2NpcInstance) npc).getClassesToTeach().isEmpty()) - { - final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId()); - final String sb = "I cannot teach you. My class list is empty.
Ask admin to fix it. Need add my npcid and classes to skill_learn.sql.
NpcId:" + npcId + ", Your classId:" + player.getClassId().getId() + ""; - html.setHtml(sb); - player.sendPacket(html); - return; - } - // Normal skills, No LearnedByFS, no AutoGet skills. final List skills = SkillTreesData.getInstance().getAvailableSkills(player, classId, false, false); if (skills.isEmpty()) diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index f4576eb25d..246d91802a 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -9247,14 +9247,14 @@ public final class L2PcInstance extends L2Playable { if (hero && (_baseClass == _activeClass)) { - for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree().values()) + for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree()) { addSkill(skill, false); // Don't persist hero skills into database } } else { - for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree().values()) + for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree()) { removeSkill(skill, false, true); // Just remove skills from non-hero players } @@ -9413,24 +9413,15 @@ public final class L2PcInstance extends L2Playable public void setNobleLevel(int level) { - final Collection nobleSkillTree = SkillTreesData.getInstance().getNobleSkillTree().values(); if (level != 0) { - for (Skill skill : nobleSkillTree) - { - addSkill(skill, false); - } + SkillTreesData.getInstance().getNobleSkillAutoGetTree().forEach(skill -> addSkill(skill, false)); } else { - for (Skill skill : nobleSkillTree) - { - removeSkill(skill, false, true); - } + SkillTreesData.getInstance().getNobleSkillTree().forEach(skill -> removeSkill(skill, false, true)); } - _nobleLevel = level; - sendSkillList(); if ((level != 0) && (getLevel() >= 99)) { diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java index f5bee5dab6..125639ae1f 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java @@ -36,7 +36,6 @@ import com.l2jmobius.gameserver.enums.Race; import com.l2jmobius.gameserver.enums.Sex; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.holders.ItemHolder; import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; @@ -113,8 +112,6 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable private int _mpRewardTicks; private MpRewardAffectType _mpRewardAffectType; - private final List _teachInfo = new ArrayList<>(); - private List _extendDrop; /** @@ -938,26 +935,6 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable return L2NpcTemplate.isAssignableTo(obj.getClass(), clazz); } - public boolean canTeach(ClassId classId) - { - // If the player is on a third class, fetch the class teacher information for its parent class. - if (classId.level() == 3) - { - return _teachInfo.contains(classId.getParent()); - } - return _teachInfo.contains(classId); - } - - public List getTeachInfo() - { - return _teachInfo; - } - - public void addTeachInfo(List teachInfo) - { - _teachInfo.addAll(teachInfo); - } - public List getExtendDrop() { return _extendDrop == null ? Collections.emptyList() : _extendDrop; diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java index 2d6ce2da28..07c07080b9 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java @@ -17,10 +17,7 @@ package com.l2jmobius.gameserver.network.clientpackets; import com.l2jmobius.commons.network.PacketReader; -import com.l2jmobius.gameserver.data.xml.impl.SkillData; -import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.model.skills.CommonSkill; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -51,6 +48,11 @@ public final class RequestMagicSkillUse implements IClientIncomingPacket return; } + if (activeChar.isSpawnProtected()) + { + activeChar.onActionRequest(); + } + // Get the level of the used skill Skill skill = activeChar.getKnownSkill(_magicId); if (skill == null) @@ -59,16 +61,9 @@ public final class RequestMagicSkillUse implements IClientIncomingPacket skill = activeChar.getCustomSkill(_magicId); if (skill == null) { - if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) || SkillTreesData.getInstance().isSubClassChangeSkill(_magicId, 1)) - { - skill = SkillData.getInstance().getSkill(_magicId, 1); - } - else - { - activeChar.sendPacket(ActionFailed.STATIC_PACKET); - _log.warning("Skill Id " + _magicId + " not found in player!"); - return; - } + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + _log.warning("Player " + activeChar + " tried to use a skill [" + _magicId + "] which hasn't been learned or it belongs to a macro of a currently inactive class."); + return; } } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/SkillLearn.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/SkillLearn.xml deleted file mode 100644 index fd9f157cdb..0000000000 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/SkillLearn.xml +++ /dev/null @@ -1,2145 +0,0 @@ - - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 15 - 16 - 17 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 15 - 16 - 17 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 15 - 16 - 17 - - - 25 - 29 - 30 - - - 10 - 11 - 12 - 13 - 14 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 25 - 26 - 27 - 28 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 26 - 27 - 28 - - - 25 - 29 - 30 - - - 54 - 55 - 117 - - - 54 - 55 - 117 - - - 10 - 11 - 12 - 13 - 14 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 15 - 16 - 17 - - - 25 - 26 - 27 - 28 - - - 10 - 11 - 12 - 13 - 14 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 25 - 29 - 30 - - - 53 - 56 - 57 - - - 53 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 29 - 30 - - - 25 - 26 - 27 - 28 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 53 - 56 - 57 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 26 - 27 - 28 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 53 - 56 - 57 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 53 - 54 - 55 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 53 - 56 - 57 - - - 44 - 45 - 46 - 47 - 48 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 49 - 50 - 51 - 52 - - - 53 - 56 - 57 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 29 - 30 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 25 - 26 - 27 - 28 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 25 - 29 - 30 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 15 - 16 - 17 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 29 - 30 - - - 25 - 26 - 27 - 28 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 49 - 50 - 51 - 52 - 115 - 116 - - - 44 - 45 - 46 - 47 - 48 - 113 - 114 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 99 - 100 - 101 - 102 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 88 - 89 - 90 - 91 - 92 - 93 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 49 - 50 - 51 - 52 - 115 - 116 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 44 - 45 - 46 - 47 - 48 - 113 - 114 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 99 - 100 - 101 - 102 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 88 - 89 - 90 - 91 - 92 - 93 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 117 - - - 53 - 54 - 55 - 117 - - - 53 - 54 - 55 - 117 - - - 53 - 56 - 57 - 118 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 89 - 90 - 91 - 92 - 93 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 99 - 100 - 101 - 102 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - - - 25 - 26 - 27 - 28 - 29 - 103 - 104 - 105 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 44 - 45 - 46 - 47 - 48 - 113 - 114 - - - 49 - 50 - 51 - 52 - 115 - 116 - - - 53 - 56 - 118 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 26 - 27 - 28 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 53 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java index ff7e85b98a..21878c40eb 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/others/HealerTrainer/HealerTrainer.java @@ -21,6 +21,7 @@ import java.util.List; import com.l2jmobius.Config; import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; +import com.l2jmobius.gameserver.enums.CategoryType; import com.l2jmobius.gameserver.model.L2SkillLearn; import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; @@ -51,7 +52,12 @@ public final class HealerTrainer extends AbstractNpcAI // @formatter:on // Misc private static final int MIN_LEVEL = 76; - private static final int MIN_CLASS_LEVEL = 3; + private static final CategoryType[] ALLOWED_CATEGORIES = + { + CategoryType.FOURTH_CLASS_GROUP, + CategoryType.FIFTH_CLASS_GROUP, + CategoryType.SIXTH_CLASS_GROUP + }; private HealerTrainer() { @@ -79,13 +85,13 @@ public final class HealerTrainer extends AbstractNpcAI } case "SkillTransferLearn": { - if (!npc.getTemplate().canTeach(player.getClassId())) + if (!player.isInCategory(CategoryType.HEAL_MASTER)) { htmltext = npc.getId() + "-noteach.html"; break; } - if ((player.getLevel() < MIN_LEVEL) || (player.getClassId().level() < MIN_CLASS_LEVEL)) + if ((player.getLevel() < MIN_LEVEL) || !player.isInOneOfCategory(ALLOWED_CATEGORIES)) { htmltext = "learn-lowlevel.html"; break; @@ -104,13 +110,13 @@ public final class HealerTrainer extends AbstractNpcAI } case "SkillTransferCleanse": { - if (!npc.getTemplate().canTeach(player.getClassId())) + if (!player.isInCategory(CategoryType.HEAL_MASTER)) { htmltext = "cleanse-no.html"; break; } - if ((player.getLevel() < MIN_LEVEL) || (player.getClassId().level() < MIN_CLASS_LEVEL)) + if ((player.getLevel() < MIN_LEVEL) || !player.isInOneOfCategory(ALLOWED_CATEGORIES)) { htmltext = "cleanse-no.html"; break; diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java index 35eb076401..80cd183b64 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java @@ -277,7 +277,7 @@ public class AdminBuffs implements IAdminCommandHandler */ public static void switchSkills(L2PcInstance gmchar, boolean toAuraSkills) { - final Collection skills = toAuraSkills ? SkillTreesData.getInstance().getGMSkillTree().values() : SkillTreesData.getInstance().getGMAuraSkillTree().values(); + final Collection skills = toAuraSkills ? SkillTreesData.getInstance().getGMSkillTree() : SkillTreesData.getInstance().getGMAuraSkillTree(); for (Skill skill : skills) { gmchar.removeSkill(skill, false); // Don't Save GM skills to database diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/skillTrees/nobleSkillTree.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/skillTrees/nobleSkillTree.xml index 88e804e3a7..a3db3ee1c9 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/skillTrees/nobleSkillTree.xml +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/skillTrees/nobleSkillTree.xml @@ -2,14 +2,14 @@ - - - - - - - - + + + + + + + + diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/skillTrees/subclassChangeSkillTree.xml b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/skillTrees/subclassChangeSkillTree.xml deleted file mode 100644 index e65e5bf356..0000000000 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/skillTrees/subclassChangeSkillTree.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/GameServer.java index f90fd5cedc..86abeff892 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/GameServer.java @@ -86,7 +86,6 @@ import com.l2jmobius.gameserver.data.xml.impl.SecondaryAuthData; import com.l2jmobius.gameserver.data.xml.impl.ShuttleData; import com.l2jmobius.gameserver.data.xml.impl.SiegeScheduleData; import com.l2jmobius.gameserver.data.xml.impl.SkillData; -import com.l2jmobius.gameserver.data.xml.impl.SkillLearnData; import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.data.xml.impl.SpawnsData; import com.l2jmobius.gameserver.data.xml.impl.StaticObjectData; @@ -287,7 +286,6 @@ public class GameServer } printSection("NPCs"); - SkillLearnData.getInstance(); NpcData.getInstance(); FakePlayerData.getInstance(); FakePlayerChatManager.getInstance(); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java index f03a2395f1..95393db740 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java @@ -44,7 +44,6 @@ import com.l2jmobius.gameserver.enums.MpRewardAffectType; import com.l2jmobius.gameserver.enums.MpRewardType; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; -import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.model.effects.L2EffectType; import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.skills.Skill; @@ -80,8 +79,6 @@ public class NpcData implements IGameXmlReader parseDatapackDirectory("data/stats/npcs/custom", true); LOGGER.info(getClass().getSimpleName() + ": Loaded " + (_npcs.size() - npcCount) + " Custom NPCs."); } - - loadNpcsSkillLearn(); } @Override @@ -787,18 +784,6 @@ public class NpcData implements IGameXmlReader return getTemplates(template -> CommonUtil.contains(classTypes, template.getType(), true)); } - public void loadNpcsSkillLearn() - { - _npcs.values().forEach(template -> - { - final List teachInfo = SkillLearnData.getInstance().getSkillLearnData(template.getId()); - if (teachInfo != null) - { - template.addTeachInfo(teachInfo); - } - }); - } - /** * @return the IDs of monsters that have minions. */ diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java deleted file mode 100644 index d7929de1c3..0000000000 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * This file is part of the L2J Mobius project. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.l2jmobius.gameserver.data.xml.impl; - -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.w3c.dom.Node; - -import com.l2jmobius.commons.util.IGameXmlReader; -import com.l2jmobius.gameserver.model.base.ClassId; - -/** - * Holds all skill learn data for all npcs. - * @author xban1x - */ -public final class SkillLearnData implements IGameXmlReader -{ - private static final Logger LOGGER = Logger.getLogger(SkillLearnData.class.getName()); - - private final Map> _skillLearn = new HashMap<>(); - - protected SkillLearnData() - { - load(); - } - - @Override - public synchronized void load() - { - _skillLearn.clear(); - parseDatapackFile("data/SkillLearn.xml"); - LOGGER.info(getClass().getSimpleName() + ": Loaded " + _skillLearn.size() + " Skill Learn data."); - } - - @Override - public void parseDocument(Document doc, File f) - { - for (Node node = doc.getFirstChild(); node != null; node = node.getNextSibling()) - { - if ("list".equalsIgnoreCase(node.getNodeName())) - { - for (Node list_node = node.getFirstChild(); list_node != null; list_node = list_node.getNextSibling()) - { - if ("npc".equalsIgnoreCase(list_node.getNodeName())) - { - final List classIds = new ArrayList<>(); - for (Node c = list_node.getFirstChild(); c != null; c = c.getNextSibling()) - { - if ("classId".equalsIgnoreCase(c.getNodeName())) - { - classIds.add(ClassId.getClassId(Integer.parseInt(c.getTextContent()))); - } - } - _skillLearn.put(parseInteger(list_node.getAttributes(), "id"), classIds); - } - } - } - } - } - - /** - * @param npcId - * @return {@link List} of {@link ClassId}'s that this npcId can teach. - */ - public List getSkillLearnData(int npcId) - { - return _skillLearn.get(npcId); - } - - /** - * Gets the single instance of SkillLearnData. - * @return single instance of SkillLearnData - */ - public static SkillLearnData getInstance() - { - return SingletonHolder._instance; - } - - private static class SingletonHolder - { - protected static final SkillLearnData _instance = new SkillLearnData(); - } -} diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java index 4b35d8bca8..e0ce62ab0f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java @@ -29,7 +29,9 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Logger; +import java.util.stream.Collectors; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; @@ -93,7 +95,6 @@ public final class SkillTreesData implements IGameXmlReader private static final Map _subPledgeSkillTree = new HashMap<>(); private static final Map _transformSkillTree = new HashMap<>(); private static final Map _commonSkillTree = new HashMap<>(); - private static final Map _subClassChangeSkillTree = new HashMap<>(); private static final Map _abilitySkillTree = new HashMap<>(); private static final Map _alchemySkillTree = new HashMap<>(); private static final Map _dualClassSkillTree = new HashMap<>(); @@ -110,11 +111,11 @@ public final class SkillTreesData implements IGameXmlReader private Map _skillsByRaceHashCodes; // Race-specific Transformations private long[] _allSkillsHashCodes; // Fishing, Collection, Transformations, Common Skills. - private boolean _loading = true; - /** Parent class Ids are read from XML and stored in this map, to allow easy customization. */ private static final Map _parentClassMap = new HashMap<>(); + private final AtomicBoolean _isLoading = new AtomicBoolean(); + /** * Instantiates a new skill trees data. */ @@ -126,7 +127,8 @@ public final class SkillTreesData implements IGameXmlReader @Override public void load() { - _loading = true; + _isLoading.set(true); + _classSkillTrees.clear(); _collectSkillTree.clear(); _fishingSkillTree.clear(); @@ -136,7 +138,6 @@ public final class SkillTreesData implements IGameXmlReader _transferSkillTrees.clear(); _transformSkillTree.clear(); _nobleSkillTree.clear(); - _subClassChangeSkillTree.clear(); _abilitySkillTree.clear(); _alchemySkillTree.clear(); _heroSkillTree.clear(); @@ -154,10 +155,10 @@ public final class SkillTreesData implements IGameXmlReader // Generate check arrays. generateCheckArrays(); - _loading = false; - // Logs a report with skill trees info. report(); + + _isLoading.set(false); } /** @@ -368,11 +369,6 @@ public final class SkillTreesData implements IGameXmlReader _gameMasterAuraSkillTree.put(skillHashCode, skillLearn); break; } - case "subClassChangeSkillTree": - { - _subClassChangeSkillTree.put(skillHashCode, skillLearn); - break; - } case "dualClassSkillTree": { _dualClassSkillTree.put(skillHashCode, skillLearn); @@ -523,15 +519,6 @@ public final class SkillTreesData implements IGameXmlReader return _subClassSkillTree; } - /** - * Gets the sub class change skill tree. - * @return the complete Common Skill Tree - */ - public Map getSubClassChangeSkillTree() - { - return _subClassChangeSkillTree; - } - /** * Gets the sub pledge skill tree. * @return the complete Sub-Pledge Skill Tree @@ -572,60 +559,45 @@ public final class SkillTreesData implements IGameXmlReader * Gets the noble skill tree. * @return the complete Noble Skill Tree */ - public Map getNobleSkillTree() + public List getNobleSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _nobleSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _nobleSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); + } + + /** + * Gets the noble skill tree. + * @return the complete Noble Skill Tree + */ + public List getNobleSkillAutoGetTree() + { + return _nobleSkillTree.values().stream().filter(entry -> entry.isAutoGet()).map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** * Gets the hero skill tree. * @return the complete Hero Skill Tree */ - public Map getHeroSkillTree() + public List getHeroSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _heroSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _heroSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** * Gets the Game Master skill tree. * @return the complete Game Master Skill Tree */ - public Map getGMSkillTree() + public List getGMSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _gameMasterSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _gameMasterSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** * Gets the Game Master Aura skill tree. * @return the complete Game Master Aura Skill Tree */ - public Map getGMAuraSkillTree() + public List getGMAuraSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _gameMasterAuraSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _gameMasterAuraSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** @@ -753,7 +725,6 @@ public final class SkillTreesData implements IGameXmlReader for (L2SkillLearn skillLearn : learnable) { final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel()); - // Cleanup skills that has to be removed for (int skillId : skillLearn.getRemoveSkills()) { @@ -1536,17 +1507,6 @@ public final class SkillTreesData implements IGameXmlReader return _pledgeSkillTree.containsKey(hashCode) || _subPledgeSkillTree.containsKey(hashCode); } - /** - * Checks if a skill is a Subclass change skill. - * @param skillId the Id of the skill to check - * @param skillLevel the level of the skill to check - * @return {@code true} if the skill is present in the Subclass change Skill Trees, {@code false} otherwise - */ - public boolean isSubClassChangeSkill(int skillId, int skillLevel) - { - return _subClassChangeSkillTree.containsKey(SkillData.getSkillHashCode(skillId, skillLevel)); - } - public boolean isRemoveSkill(ClassId classId, int skillId) { return _removeSkillCache.getOrDefault(classId, Collections.emptySet()).contains(skillId); @@ -1704,7 +1664,7 @@ public final class SkillTreesData implements IGameXmlReader } // Prevent accidental skill remove during reload - if (_loading) + if (_isLoading.get()) { return true; } @@ -1819,7 +1779,6 @@ public final class SkillTreesData implements IGameXmlReader { LOGGER.info(className + ": Loaded " + commonSkills + " Common Skills to all classes."); } - LOGGER.info(className + ": Loaded " + _subClassChangeSkillTree.size() + " Subclass change Skills."); } /** diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Character.java index 88d2616d3b..ccb8fe9c4d 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -5108,6 +5108,19 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe return CategoryData.getInstance().isInCategory(type, getId()); } + public final boolean isInOneOfCategory(CategoryType... types) + { + for (CategoryType type : types) + { + if (CategoryData.getInstance().isInCategory(type, getId())) + { + return true; + } + } + + return false; + } + /** * @return the character that summoned this NPC. */ diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java index 94bd7ebfb2..11f2e21933 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java @@ -20,7 +20,6 @@ import java.util.List; import java.util.Map; import com.l2jmobius.Config; -import com.l2jmobius.gameserver.cache.HtmCache; import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.enums.InstanceType; import com.l2jmobius.gameserver.model.L2SkillLearn; @@ -31,7 +30,6 @@ import com.l2jmobius.gameserver.model.base.AcquireSkillType; import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass; -import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class L2NpcInstance extends L2Npc @@ -55,11 +53,6 @@ public class L2NpcInstance extends L2Npc setStatus(new FolkStatus(this)); } - public List getClassesToTeach() - { - return getTemplate().getTeachInfo(); - } - /** * Displays Skill Tree for a given player, npc and class Id. * @param player the active character. @@ -99,39 +92,6 @@ public class L2NpcInstance extends L2Npc return; } - if (!npc.getTemplate().canTeach(classId)) - { - String html = ""; - - if (npc instanceof L2WarehouseInstance) - { - html = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), "data/html/warehouse/" + npcId + "-noteach.htm"); - } - - final NpcHtmlMessage noTeachMsg = new NpcHtmlMessage(npc.getObjectId()); - if (html == null) - { - _log.warning("Npc " + npcId + " missing noTeach html!"); - noTeachMsg.setHtml("I cannot teach you any skills.
You must find your current class teachers."); - } - else - { - noTeachMsg.setHtml(html); - noTeachMsg.replace("%objectId%", String.valueOf(npc.getObjectId())); - } - player.sendPacket(noTeachMsg); - return; - } - - if (((L2NpcInstance) npc).getClassesToTeach().isEmpty()) - { - final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId()); - final String sb = "I cannot teach you. My class list is empty.
Ask admin to fix it. Need add my npcid and classes to skill_learn.sql.
NpcId:" + npcId + ", Your classId:" + player.getClassId().getId() + ""; - html.setHtml(sb); - player.sendPacket(html); - return; - } - // Normal skills, No LearnedByFS, no AutoGet skills. final List skills = SkillTreesData.getInstance().getAvailableSkills(player, classId, false, false); if (skills.isEmpty()) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 9a8d1fd646..255ed33be8 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -333,7 +333,6 @@ import com.l2jmobius.gameserver.network.serverpackets.TradeOtherDone; import com.l2jmobius.gameserver.network.serverpackets.TradeStart; import com.l2jmobius.gameserver.network.serverpackets.UserInfo; import com.l2jmobius.gameserver.network.serverpackets.ValidateLocation; -import com.l2jmobius.gameserver.network.serverpackets.ability.ExAcquireAPSkillList; import com.l2jmobius.gameserver.network.serverpackets.commission.ExResponseCommissionInfo; import com.l2jmobius.gameserver.network.serverpackets.friend.L2FriendStatus; import com.l2jmobius.gameserver.network.serverpackets.monsterbook.ExMonsterBook; @@ -9245,14 +9244,14 @@ public final class L2PcInstance extends L2Playable { if (hero && (_baseClass == _activeClass)) { - for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree().values()) + for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree()) { addSkill(skill, false); // Don't persist hero skills into database } } else { - for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree().values()) + for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree()) { removeSkill(skill, false, true); // Just remove skills from non-hero players } @@ -9411,29 +9410,16 @@ public final class L2PcInstance extends L2Playable public void setNobleLevel(int level) { - final Collection nobleSkillTree = SkillTreesData.getInstance().getNobleSkillTree().values(); if (level != 0) { - for (Skill skill : nobleSkillTree) - { - addSkill(skill, false); - } + SkillTreesData.getInstance().getNobleSkillAutoGetTree().forEach(skill -> addSkill(skill, false)); } else { - for (Skill skill : nobleSkillTree) - { - removeSkill(skill, false, true); - } + SkillTreesData.getInstance().getNobleSkillTree().forEach(skill -> removeSkill(skill, false, true)); } - _nobleLevel = level; - sendSkillList(); - if ((level != 0) && (getLevel() >= 99)) - { - sendPacket(new ExAcquireAPSkillList(this)); - } } public void setLvlJoinedAcademy(int lvl) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java index f5bee5dab6..125639ae1f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java @@ -36,7 +36,6 @@ import com.l2jmobius.gameserver.enums.Race; import com.l2jmobius.gameserver.enums.Sex; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.holders.ItemHolder; import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; @@ -113,8 +112,6 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable private int _mpRewardTicks; private MpRewardAffectType _mpRewardAffectType; - private final List _teachInfo = new ArrayList<>(); - private List _extendDrop; /** @@ -938,26 +935,6 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable return L2NpcTemplate.isAssignableTo(obj.getClass(), clazz); } - public boolean canTeach(ClassId classId) - { - // If the player is on a third class, fetch the class teacher information for its parent class. - if (classId.level() == 3) - { - return _teachInfo.contains(classId.getParent()); - } - return _teachInfo.contains(classId); - } - - public List getTeachInfo() - { - return _teachInfo; - } - - public void addTeachInfo(List teachInfo) - { - _teachInfo.addAll(teachInfo); - } - public List getExtendDrop() { return _extendDrop == null ? Collections.emptyList() : _extendDrop; diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java index 2d6ce2da28..07c07080b9 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java @@ -17,10 +17,7 @@ package com.l2jmobius.gameserver.network.clientpackets; import com.l2jmobius.commons.network.PacketReader; -import com.l2jmobius.gameserver.data.xml.impl.SkillData; -import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.model.skills.CommonSkill; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -51,6 +48,11 @@ public final class RequestMagicSkillUse implements IClientIncomingPacket return; } + if (activeChar.isSpawnProtected()) + { + activeChar.onActionRequest(); + } + // Get the level of the used skill Skill skill = activeChar.getKnownSkill(_magicId); if (skill == null) @@ -59,16 +61,9 @@ public final class RequestMagicSkillUse implements IClientIncomingPacket skill = activeChar.getCustomSkill(_magicId); if (skill == null) { - if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) || SkillTreesData.getInstance().isSubClassChangeSkill(_magicId, 1)) - { - skill = SkillData.getInstance().getSkill(_magicId, 1); - } - else - { - activeChar.sendPacket(ActionFailed.STATIC_PACKET); - _log.warning("Skill Id " + _magicId + " not found in player!"); - return; - } + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + _log.warning("Player " + activeChar + " tried to use a skill [" + _magicId + "] which hasn't been learned or it belongs to a macro of a currently inactive class."); + return; } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/SkillLearn.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/SkillLearn.xml deleted file mode 100644 index fd9f157cdb..0000000000 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/SkillLearn.xml +++ /dev/null @@ -1,2145 +0,0 @@ - - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 15 - 16 - 17 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 15 - 16 - 17 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 15 - 16 - 17 - - - 25 - 29 - 30 - - - 10 - 11 - 12 - 13 - 14 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 25 - 26 - 27 - 28 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 26 - 27 - 28 - - - 25 - 29 - 30 - - - 54 - 55 - 117 - - - 54 - 55 - 117 - - - 10 - 11 - 12 - 13 - 14 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 15 - 16 - 17 - - - 25 - 26 - 27 - 28 - - - 10 - 11 - 12 - 13 - 14 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 25 - 29 - 30 - - - 53 - 56 - 57 - - - 53 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 29 - 30 - - - 25 - 26 - 27 - 28 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 53 - 56 - 57 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 26 - 27 - 28 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 53 - 56 - 57 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 53 - 54 - 55 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 53 - 56 - 57 - - - 44 - 45 - 46 - 47 - 48 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 49 - 50 - 51 - 52 - - - 53 - 56 - 57 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 29 - 30 - - - 49 - 50 - 51 - 52 - - - 44 - 45 - 46 - 47 - 48 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 11 - 12 - 13 - 14 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 25 - 26 - 27 - 28 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 26 - 27 - 28 - - - 10 - 15 - 16 - 17 - - - 10 - 15 - 16 - 17 - - - 25 - 29 - 30 - - - 25 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - - 53 - 56 - 57 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 10 - 15 - 16 - 17 - - - 10 - 11 - 12 - 13 - 14 - - - 25 - 29 - 30 - - - 25 - 26 - 27 - 28 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 49 - 50 - 51 - 52 - 115 - 116 - - - 44 - 45 - 46 - 47 - 48 - 113 - 114 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 99 - 100 - 101 - 102 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 88 - 89 - 90 - 91 - 92 - 93 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 49 - 50 - 51 - 52 - 115 - 116 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 44 - 45 - 46 - 47 - 48 - 113 - 114 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 99 - 100 - 101 - 102 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 88 - 89 - 90 - 91 - 92 - 93 - - - 53 - 54 - 55 - 56 - 57 - 117 - 118 - - - 53 - 54 - 55 - 117 - - - 53 - 54 - 55 - 117 - - - 53 - 54 - 55 - 117 - - - 53 - 56 - 57 - 118 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 89 - 90 - 91 - 92 - 93 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 99 - 100 - 101 - 102 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - 98 - - - 25 - 26 - 27 - 28 - 29 - 30 - - - 25 - 26 - 27 - 28 - 29 - 103 - 104 - 105 - - - 25 - 26 - 27 - 28 - 29 - 30 - 103 - 104 - 105 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 106 - 107 - 108 - 109 - - - 38 - 39 - 40 - 41 - 42 - 43 - 110 - 111 - 112 - - - 44 - 45 - 46 - 47 - 48 - 113 - 114 - - - 49 - 50 - 51 - 52 - 115 - 116 - - - 53 - 56 - 118 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 94 - 95 - 96 - 97 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 128 - 131 - 132 - - - 124 - 126 - 129 - 130 - 133 - 134 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 123 - 125 - 127 - 131 - 128 - 132 - 135 - 136 - - - 124 - 126 - 129 - 133 - 130 - 134 - 135 - 136 - - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - - - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - - - 44 - 45 - 46 - 47 - 48 - - - 49 - 50 - 51 - 52 - - - 18 - 19 - 20 - 21 - 22 - 23 - 24 - - - 25 - 26 - 27 - 28 - 29 - 30 - - - 31 - 32 - 33 - 34 - 35 - 36 - 37 - - - 38 - 39 - 40 - 41 - 42 - 43 - - - 53 - 56 - 57 - - - 53 - 54 - 55 - - - 53 - 54 - 55 - - \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java index 35eb076401..80cd183b64 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java @@ -277,7 +277,7 @@ public class AdminBuffs implements IAdminCommandHandler */ public static void switchSkills(L2PcInstance gmchar, boolean toAuraSkills) { - final Collection skills = toAuraSkills ? SkillTreesData.getInstance().getGMSkillTree().values() : SkillTreesData.getInstance().getGMAuraSkillTree().values(); + final Collection skills = toAuraSkills ? SkillTreesData.getInstance().getGMSkillTree() : SkillTreesData.getInstance().getGMAuraSkillTree(); for (Skill skill : skills) { gmchar.removeSkill(skill, false); // Don't Save GM skills to database diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/skillTrees/nobleSkillTree.xml b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/skillTrees/nobleSkillTree.xml index c9738ea4df..5fe564aa6a 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/skillTrees/nobleSkillTree.xml +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/skillTrees/nobleSkillTree.xml @@ -1,11 +1,12 @@ - - - - - - + + + + + + + \ No newline at end of file diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/GameServer.java index d439bda0f7..7e30cae537 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/GameServer.java @@ -86,7 +86,6 @@ import com.l2jmobius.gameserver.data.xml.impl.SecondaryAuthData; import com.l2jmobius.gameserver.data.xml.impl.ShuttleData; import com.l2jmobius.gameserver.data.xml.impl.SiegeScheduleData; import com.l2jmobius.gameserver.data.xml.impl.SkillData; -import com.l2jmobius.gameserver.data.xml.impl.SkillLearnData; import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.data.xml.impl.SpawnsData; import com.l2jmobius.gameserver.data.xml.impl.StaticObjectData; @@ -286,7 +285,6 @@ public class GameServer } printSection("NPCs"); - SkillLearnData.getInstance(); NpcData.getInstance(); FakePlayerData.getInstance(); FakePlayerChatManager.getInstance(); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java index 2caef85892..f5e5b92500 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/NpcData.java @@ -44,7 +44,6 @@ import com.l2jmobius.gameserver.enums.MpRewardAffectType; import com.l2jmobius.gameserver.enums.MpRewardType; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate; -import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.model.effects.L2EffectType; import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.skills.Skill; @@ -80,8 +79,6 @@ public class NpcData implements IGameXmlReader parseDatapackDirectory("data/stats/npcs/custom", true); LOGGER.info(getClass().getSimpleName() + ": Loaded " + (_npcs.size() - npcCount) + " Custom NPCs."); } - - loadNpcsSkillLearn(); } @Override @@ -788,18 +785,6 @@ public class NpcData implements IGameXmlReader return getTemplates(template -> CommonUtil.contains(classTypes, template.getType(), true)); } - public void loadNpcsSkillLearn() - { - _npcs.values().forEach(template -> - { - final List teachInfo = SkillLearnData.getInstance().getSkillLearnData(template.getId()); - if (teachInfo != null) - { - template.addTeachInfo(teachInfo); - } - }); - } - /** * @return the IDs of monsters that have minions. */ diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java deleted file mode 100644 index d7929de1c3..0000000000 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/SkillLearnData.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * This file is part of the L2J Mobius project. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.l2jmobius.gameserver.data.xml.impl; - -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.w3c.dom.Node; - -import com.l2jmobius.commons.util.IGameXmlReader; -import com.l2jmobius.gameserver.model.base.ClassId; - -/** - * Holds all skill learn data for all npcs. - * @author xban1x - */ -public final class SkillLearnData implements IGameXmlReader -{ - private static final Logger LOGGER = Logger.getLogger(SkillLearnData.class.getName()); - - private final Map> _skillLearn = new HashMap<>(); - - protected SkillLearnData() - { - load(); - } - - @Override - public synchronized void load() - { - _skillLearn.clear(); - parseDatapackFile("data/SkillLearn.xml"); - LOGGER.info(getClass().getSimpleName() + ": Loaded " + _skillLearn.size() + " Skill Learn data."); - } - - @Override - public void parseDocument(Document doc, File f) - { - for (Node node = doc.getFirstChild(); node != null; node = node.getNextSibling()) - { - if ("list".equalsIgnoreCase(node.getNodeName())) - { - for (Node list_node = node.getFirstChild(); list_node != null; list_node = list_node.getNextSibling()) - { - if ("npc".equalsIgnoreCase(list_node.getNodeName())) - { - final List classIds = new ArrayList<>(); - for (Node c = list_node.getFirstChild(); c != null; c = c.getNextSibling()) - { - if ("classId".equalsIgnoreCase(c.getNodeName())) - { - classIds.add(ClassId.getClassId(Integer.parseInt(c.getTextContent()))); - } - } - _skillLearn.put(parseInteger(list_node.getAttributes(), "id"), classIds); - } - } - } - } - } - - /** - * @param npcId - * @return {@link List} of {@link ClassId}'s that this npcId can teach. - */ - public List getSkillLearnData(int npcId) - { - return _skillLearn.get(npcId); - } - - /** - * Gets the single instance of SkillLearnData. - * @return single instance of SkillLearnData - */ - public static SkillLearnData getInstance() - { - return SingletonHolder._instance; - } - - private static class SingletonHolder - { - protected static final SkillLearnData _instance = new SkillLearnData(); - } -} diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java index 4b35d8bca8..e0ce62ab0f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java @@ -29,7 +29,9 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.logging.Logger; +import java.util.stream.Collectors; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; @@ -93,7 +95,6 @@ public final class SkillTreesData implements IGameXmlReader private static final Map _subPledgeSkillTree = new HashMap<>(); private static final Map _transformSkillTree = new HashMap<>(); private static final Map _commonSkillTree = new HashMap<>(); - private static final Map _subClassChangeSkillTree = new HashMap<>(); private static final Map _abilitySkillTree = new HashMap<>(); private static final Map _alchemySkillTree = new HashMap<>(); private static final Map _dualClassSkillTree = new HashMap<>(); @@ -110,11 +111,11 @@ public final class SkillTreesData implements IGameXmlReader private Map _skillsByRaceHashCodes; // Race-specific Transformations private long[] _allSkillsHashCodes; // Fishing, Collection, Transformations, Common Skills. - private boolean _loading = true; - /** Parent class Ids are read from XML and stored in this map, to allow easy customization. */ private static final Map _parentClassMap = new HashMap<>(); + private final AtomicBoolean _isLoading = new AtomicBoolean(); + /** * Instantiates a new skill trees data. */ @@ -126,7 +127,8 @@ public final class SkillTreesData implements IGameXmlReader @Override public void load() { - _loading = true; + _isLoading.set(true); + _classSkillTrees.clear(); _collectSkillTree.clear(); _fishingSkillTree.clear(); @@ -136,7 +138,6 @@ public final class SkillTreesData implements IGameXmlReader _transferSkillTrees.clear(); _transformSkillTree.clear(); _nobleSkillTree.clear(); - _subClassChangeSkillTree.clear(); _abilitySkillTree.clear(); _alchemySkillTree.clear(); _heroSkillTree.clear(); @@ -154,10 +155,10 @@ public final class SkillTreesData implements IGameXmlReader // Generate check arrays. generateCheckArrays(); - _loading = false; - // Logs a report with skill trees info. report(); + + _isLoading.set(false); } /** @@ -368,11 +369,6 @@ public final class SkillTreesData implements IGameXmlReader _gameMasterAuraSkillTree.put(skillHashCode, skillLearn); break; } - case "subClassChangeSkillTree": - { - _subClassChangeSkillTree.put(skillHashCode, skillLearn); - break; - } case "dualClassSkillTree": { _dualClassSkillTree.put(skillHashCode, skillLearn); @@ -523,15 +519,6 @@ public final class SkillTreesData implements IGameXmlReader return _subClassSkillTree; } - /** - * Gets the sub class change skill tree. - * @return the complete Common Skill Tree - */ - public Map getSubClassChangeSkillTree() - { - return _subClassChangeSkillTree; - } - /** * Gets the sub pledge skill tree. * @return the complete Sub-Pledge Skill Tree @@ -572,60 +559,45 @@ public final class SkillTreesData implements IGameXmlReader * Gets the noble skill tree. * @return the complete Noble Skill Tree */ - public Map getNobleSkillTree() + public List getNobleSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _nobleSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _nobleSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); + } + + /** + * Gets the noble skill tree. + * @return the complete Noble Skill Tree + */ + public List getNobleSkillAutoGetTree() + { + return _nobleSkillTree.values().stream().filter(entry -> entry.isAutoGet()).map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** * Gets the hero skill tree. * @return the complete Hero Skill Tree */ - public Map getHeroSkillTree() + public List getHeroSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _heroSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _heroSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** * Gets the Game Master skill tree. * @return the complete Game Master Skill Tree */ - public Map getGMSkillTree() + public List getGMSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _gameMasterSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _gameMasterSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** * Gets the Game Master Aura skill tree. * @return the complete Game Master Aura Skill Tree */ - public Map getGMAuraSkillTree() + public List getGMAuraSkillTree() { - final Map tree = new HashMap<>(); - final SkillData st = SkillData.getInstance(); - for (Entry e : _gameMasterAuraSkillTree.entrySet()) - { - tree.put(e.getKey(), st.getSkill(e.getValue().getSkillId(), e.getValue().getSkillLevel())); - } - return tree; + return _gameMasterAuraSkillTree.values().stream().map(entry -> SkillData.getInstance().getSkill(entry.getSkillId(), entry.getSkillLevel())).collect(Collectors.toList()); } /** @@ -753,7 +725,6 @@ public final class SkillTreesData implements IGameXmlReader for (L2SkillLearn skillLearn : learnable) { final Skill skill = SkillData.getInstance().getSkill(skillLearn.getSkillId(), skillLearn.getSkillLevel()); - // Cleanup skills that has to be removed for (int skillId : skillLearn.getRemoveSkills()) { @@ -1536,17 +1507,6 @@ public final class SkillTreesData implements IGameXmlReader return _pledgeSkillTree.containsKey(hashCode) || _subPledgeSkillTree.containsKey(hashCode); } - /** - * Checks if a skill is a Subclass change skill. - * @param skillId the Id of the skill to check - * @param skillLevel the level of the skill to check - * @return {@code true} if the skill is present in the Subclass change Skill Trees, {@code false} otherwise - */ - public boolean isSubClassChangeSkill(int skillId, int skillLevel) - { - return _subClassChangeSkillTree.containsKey(SkillData.getSkillHashCode(skillId, skillLevel)); - } - public boolean isRemoveSkill(ClassId classId, int skillId) { return _removeSkillCache.getOrDefault(classId, Collections.emptySet()).contains(skillId); @@ -1704,7 +1664,7 @@ public final class SkillTreesData implements IGameXmlReader } // Prevent accidental skill remove during reload - if (_loading) + if (_isLoading.get()) { return true; } @@ -1819,7 +1779,6 @@ public final class SkillTreesData implements IGameXmlReader { LOGGER.info(className + ": Loaded " + commonSkills + " Common Skills to all classes."); } - LOGGER.info(className + ": Loaded " + _subClassChangeSkillTree.size() + " Subclass change Skills."); } /** diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java index 88d2616d3b..ccb8fe9c4d 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -5108,6 +5108,19 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe return CategoryData.getInstance().isInCategory(type, getId()); } + public final boolean isInOneOfCategory(CategoryType... types) + { + for (CategoryType type : types) + { + if (CategoryData.getInstance().isInCategory(type, getId())) + { + return true; + } + } + + return false; + } + /** * @return the character that summoned this NPC. */ diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java index 94bd7ebfb2..11f2e21933 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java @@ -20,7 +20,6 @@ import java.util.List; import java.util.Map; import com.l2jmobius.Config; -import com.l2jmobius.gameserver.cache.HtmCache; import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.enums.InstanceType; import com.l2jmobius.gameserver.model.L2SkillLearn; @@ -31,7 +30,6 @@ import com.l2jmobius.gameserver.model.base.AcquireSkillType; import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass; -import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jmobius.gameserver.network.serverpackets.SystemMessage; public class L2NpcInstance extends L2Npc @@ -55,11 +53,6 @@ public class L2NpcInstance extends L2Npc setStatus(new FolkStatus(this)); } - public List getClassesToTeach() - { - return getTemplate().getTeachInfo(); - } - /** * Displays Skill Tree for a given player, npc and class Id. * @param player the active character. @@ -99,39 +92,6 @@ public class L2NpcInstance extends L2Npc return; } - if (!npc.getTemplate().canTeach(classId)) - { - String html = ""; - - if (npc instanceof L2WarehouseInstance) - { - html = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), "data/html/warehouse/" + npcId + "-noteach.htm"); - } - - final NpcHtmlMessage noTeachMsg = new NpcHtmlMessage(npc.getObjectId()); - if (html == null) - { - _log.warning("Npc " + npcId + " missing noTeach html!"); - noTeachMsg.setHtml("I cannot teach you any skills.
You must find your current class teachers."); - } - else - { - noTeachMsg.setHtml(html); - noTeachMsg.replace("%objectId%", String.valueOf(npc.getObjectId())); - } - player.sendPacket(noTeachMsg); - return; - } - - if (((L2NpcInstance) npc).getClassesToTeach().isEmpty()) - { - final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId()); - final String sb = "I cannot teach you. My class list is empty.
Ask admin to fix it. Need add my npcid and classes to skill_learn.sql.
NpcId:" + npcId + ", Your classId:" + player.getClassId().getId() + ""; - html.setHtml(sb); - player.sendPacket(html); - return; - } - // Normal skills, No LearnedByFS, no AutoGet skills. final List skills = SkillTreesData.getInstance().getAvailableSkills(player, classId, false, false); if (skills.isEmpty()) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index da7b19a932..f0f96e90f5 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -9180,14 +9180,14 @@ public final class L2PcInstance extends L2Playable { if (hero && (_baseClass == _activeClass)) { - for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree().values()) + for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree()) { addSkill(skill, false); // Don't persist hero skills into database } } else { - for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree().values()) + for (Skill skill : SkillTreesData.getInstance().getHeroSkillTree()) { removeSkill(skill, false, true); // Just remove skills from non-hero players } @@ -9346,24 +9346,15 @@ public final class L2PcInstance extends L2Playable public void setNoble(boolean val) { - final Collection nobleSkillTree = SkillTreesData.getInstance().getNobleSkillTree().values(); if (val) { - for (Skill skill : nobleSkillTree) - { - addSkill(skill, false); - } + SkillTreesData.getInstance().getNobleSkillAutoGetTree().forEach(skill -> addSkill(skill, false)); } else { - for (Skill skill : nobleSkillTree) - { - removeSkill(skill, false, true); - } + SkillTreesData.getInstance().getNobleSkillTree().forEach(skill -> removeSkill(skill, false, true)); } - _noble = val; - sendSkillList(); if (val && (getLevel() >= 99)) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java index 0d276af74d..36f99bb6db 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/templates/L2NpcTemplate.java @@ -36,7 +36,6 @@ import com.l2jmobius.gameserver.enums.Race; import com.l2jmobius.gameserver.enums.Sex; import com.l2jmobius.gameserver.model.StatsSet; import com.l2jmobius.gameserver.model.actor.L2Character; -import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.model.holders.DropHolder; import com.l2jmobius.gameserver.model.holders.ItemHolder; import com.l2jmobius.gameserver.model.interfaces.IIdentifiable; @@ -113,8 +112,6 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable private int _mpRewardTicks; private MpRewardAffectType _mpRewardAffectType; - private final List _teachInfo = new ArrayList<>(); - private List _extendDrop; /** @@ -930,26 +927,6 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable return L2NpcTemplate.isAssignableTo(obj.getClass(), clazz); } - public boolean canTeach(ClassId classId) - { - // If the player is on a third class, fetch the class teacher information for its parent class. - if (classId.level() == 3) - { - return _teachInfo.contains(classId.getParent()); - } - return _teachInfo.contains(classId); - } - - public List getTeachInfo() - { - return _teachInfo; - } - - public void addTeachInfo(List teachInfo) - { - _teachInfo.addAll(teachInfo); - } - public List getExtendDrop() { return _extendDrop == null ? Collections.emptyList() : _extendDrop; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java index 2d6ce2da28..07c07080b9 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/network/clientpackets/RequestMagicSkillUse.java @@ -17,10 +17,7 @@ package com.l2jmobius.gameserver.network.clientpackets; import com.l2jmobius.commons.network.PacketReader; -import com.l2jmobius.gameserver.data.xml.impl.SkillData; -import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.model.skills.CommonSkill; import com.l2jmobius.gameserver.model.skills.Skill; import com.l2jmobius.gameserver.network.L2GameClient; import com.l2jmobius.gameserver.network.SystemMessageId; @@ -51,6 +48,11 @@ public final class RequestMagicSkillUse implements IClientIncomingPacket return; } + if (activeChar.isSpawnProtected()) + { + activeChar.onActionRequest(); + } + // Get the level of the used skill Skill skill = activeChar.getKnownSkill(_magicId); if (skill == null) @@ -59,16 +61,9 @@ public final class RequestMagicSkillUse implements IClientIncomingPacket skill = activeChar.getCustomSkill(_magicId); if (skill == null) { - if ((_magicId == CommonSkill.HAIR_ACCESSORY_SET.getId()) || SkillTreesData.getInstance().isSubClassChangeSkill(_magicId, 1)) - { - skill = SkillData.getInstance().getSkill(_magicId, 1); - } - else - { - activeChar.sendPacket(ActionFailed.STATIC_PACKET); - _log.warning("Skill Id " + _magicId + " not found in player!"); - return; - } + activeChar.sendPacket(ActionFailed.STATIC_PACKET); + _log.warning("Player " + activeChar + " tried to use a skill [" + _magicId + "] which hasn't been learned or it belongs to a macro of a currently inactive class."); + return; } }