From 42d3a8cf68b163d69d7c5bbfb9957ac8e7d73941 Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Thu, 22 Dec 2016 14:43:54 +0000 Subject: [PATCH] Fixed skill learn after class change. Thanks Sdw for the pointers. --- .../dist/game/config/Character.ini | 8 -- .../ai/others/ClassMaster/ClassMaster.java | 20 +++- .../admincommandhandlers/AdminEditChar.java | 15 ++- .../handlers/bypasshandlers/SkillList.java | 91 +------------------ .../Q10331_StartOfFate.java | 2 + .../Q10360_CertificationOfFate.java | 1 + .../Q10751_WindsOfFateEncounters.java | 2 + .../Q10752_WindsOfFateAPromise.java | 2 + .../Q10753_WindsOfFateChoices.java | 2 + .../quests/ThirdClassTransferQuest.java | 1 + .../java/com/l2jmobius/Config.java | 2 - .../data/xml/impl/SkillTreesData.java | 2 +- .../gameserver/model/L2SkillLearn.java | 34 ------- .../model/actor/instance/L2NpcInstance.java | 2 - .../model/actor/instance/L2PcInstance.java | 23 ----- .../clientpackets/RequestAcquireSkill.java | 2 +- .../RequestAcquireSkillInfo.java | 3 +- .../serverpackets/ExAcquireSkillInfo.java | 5 +- 18 files changed, 41 insertions(+), 176 deletions(-) diff --git a/L2J_Mobius_Underground/dist/game/config/Character.ini b/L2J_Mobius_Underground/dist/game/config/Character.ini index 262b128f4b..35bb294910 100644 --- a/L2J_Mobius_Underground/dist/game/config/Character.ini +++ b/L2J_Mobius_Underground/dist/game/config/Character.ini @@ -155,14 +155,6 @@ EnchantSkillSpBookNeeded = True # Default: True DivineInspirationSpBookNeeded = True -# When enabled, the following will be true: -# All classes can learn all skills. -# Skills of another class costs x2 SP to learn. -# Skills of another race costs x2 SP to learn. -# Skills of fighters/mages costs x3 SP to learn. -# Default: False -AltGameSkillLearn = False - # Allow player to sub-class without checking for unique quest items. # Default: False AltSubClassWithoutQuests = False diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/ClassMaster/ClassMaster.java b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/ClassMaster/ClassMaster.java index 1a51003757..71aa72a43e 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/ClassMaster/ClassMaster.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/ai/others/ClassMaster/ClassMaster.java @@ -32,9 +32,12 @@ import com.l2jmobius.commons.util.IGameXmlReader; import com.l2jmobius.commons.util.Rnd; import com.l2jmobius.gameserver.data.xml.impl.CategoryData; import com.l2jmobius.gameserver.data.xml.impl.ClassListData; +import com.l2jmobius.gameserver.data.xml.impl.SkillData; +import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.datatables.ItemTable; import com.l2jmobius.gameserver.enums.CategoryType; import com.l2jmobius.gameserver.enums.Race; +import com.l2jmobius.gameserver.model.L2SkillLearn; import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.base.ClassId; @@ -49,7 +52,6 @@ import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerPress import com.l2jmobius.gameserver.model.events.impl.character.player.OnPlayerProfessionChange; import com.l2jmobius.gameserver.model.holders.ItemChanceHolder; import com.l2jmobius.gameserver.model.spawns.SpawnTemplate; -import com.l2jmobius.gameserver.network.serverpackets.AcquireSkillList; import com.l2jmobius.gameserver.network.serverpackets.PlaySound; import com.l2jmobius.gameserver.network.serverpackets.TutorialCloseHtml; import com.l2jmobius.gameserver.network.serverpackets.TutorialShowQuestionMark; @@ -409,10 +411,18 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader { player.setBaseClass(player.getActiveClass()); } - player.sendPacket(new PlaySound("ItemSound.quest_fanfare_2")); - player.broadcastUserInfo(); - player.sendPacket(new AcquireSkillList(player)); + if (player.isInCategory(CategoryType.AWAKEN_GROUP)) + { + SkillTreesData.getInstance().cleanSkillUponAwakening(player); + for (L2SkillLearn skill : SkillTreesData.getInstance().getRaceSkillTree(player.getRace())) + { + player.addSkill(SkillData.getInstance().getSkill(skill.getSkillId(), skill.getSkillLevel()), true); + } + } player.store(false); // Save player cause if server crashes before this char is saved, he will lose class and the money payed for class change. + player.broadcastUserInfo(); + player.sendSkillList(); + player.sendPacket(new PlaySound("ItemSound.quest_fanfare_2")); return "test_server_helper021.html"; } break; @@ -779,7 +789,7 @@ public final class ClassMaster extends AbstractNpcAI implements IGameXmlReader { player.setBaseClass(player.getActiveClass()); } - player.sendPacket(new AcquireSkillList(player)); + player.sendSkillList(); return true; } } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java index 7778c56402..b833c8c07f 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/admincommandhandlers/AdminEditChar.java @@ -32,12 +32,14 @@ import com.l2jmobius.Config; import com.l2jmobius.commons.database.DatabaseFactory; import com.l2jmobius.gameserver.data.sql.impl.CharNameTable; import com.l2jmobius.gameserver.data.xml.impl.ClassListData; +import com.l2jmobius.gameserver.data.xml.impl.SkillData; import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.enums.CategoryType; import com.l2jmobius.gameserver.enums.Race; import com.l2jmobius.gameserver.enums.SubclassInfoType; import com.l2jmobius.gameserver.handler.IAdminCommandHandler; import com.l2jmobius.gameserver.model.L2Object; +import com.l2jmobius.gameserver.model.L2SkillLearn; import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Playable; @@ -50,7 +52,6 @@ import com.l2jmobius.gameserver.model.html.PageResult; import com.l2jmobius.gameserver.model.stats.Stats; import com.l2jmobius.gameserver.network.SystemMessageId; import com.l2jmobius.gameserver.network.client.L2GameClient; -import com.l2jmobius.gameserver.network.serverpackets.AcquireSkillList; import com.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo; import com.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight; import com.l2jmobius.gameserver.network.serverpackets.ExVoteSystemInfo; @@ -411,16 +412,20 @@ public class AdminEditChar implements IAdminCommandHandler } final String newclass = ClassListData.getInstance().getClass(player.getClassId()).getClassName(); - player.storeMe(); - player.sendMessage("A GM changed your class to " + newclass + "."); - player.broadcastUserInfo(); if (player.isInCategory(CategoryType.AWAKEN_GROUP)) { SkillTreesData.getInstance().cleanSkillUponAwakening(player); + for (L2SkillLearn skill : SkillTreesData.getInstance().getRaceSkillTree(player.getRace())) + { + player.addSkill(SkillData.getInstance().getSkill(skill.getSkillId(), skill.getSkillLevel()), true); + } } + player.store(false); + player.broadcastUserInfo(); + player.sendSkillList(); player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED)); player.sendPacket(new ExUserInfoInvenWeight(player)); - player.sendPacket(new AcquireSkillList(player)); + player.sendMessage("A GM changed your class to " + newclass + "."); activeChar.sendMessage(player.getName() + " is a " + newclass + "."); } else diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/SkillList.java b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/SkillList.java index c875c99f91..296416aea1 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/SkillList.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/handlers/bypasshandlers/SkillList.java @@ -16,19 +16,11 @@ */ package handlers.bypasshandlers; -import java.util.List; -import java.util.logging.Level; - -import com.l2jmobius.Config; -import com.l2jmobius.gameserver.data.xml.impl.SkillTreesData; import com.l2jmobius.gameserver.handler.IBypassHandler; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.instance.L2NpcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; -import com.l2jmobius.gameserver.model.base.ClassId; -import com.l2jmobius.gameserver.network.serverpackets.ActionFailed; -import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage; public class SkillList implements IBypassHandler { @@ -44,88 +36,7 @@ public class SkillList implements IBypassHandler { return false; } - - if (Config.ALT_GAME_SKILL_LEARN) - { - try - { - final String id = command.substring(9).trim(); - if (id.length() != 0) - { - L2NpcInstance.showSkillList(activeChar, (L2Npc) target, ClassId.getClassId(Integer.parseInt(id))); - } - else - { - boolean own_class = false; - - final List classesToTeach = ((L2NpcInstance) target).getClassesToTeach(); - for (ClassId cid : classesToTeach) - { - if (cid.equalsOrChildOf(activeChar.getClassId())) - { - own_class = true; - break; - } - } - - String text = "
Skill learning:

"; - - if (!own_class) - { - final String charType = activeChar.getClassId().isMage() ? "fighter" : "mage"; - text += "Skills of your class are the easiest to learn.
Skills of another class of your race are a little harder.
Skills for classes of another race are extremely difficult.
But the hardest of all to learn are the " + charType + "skills!
"; - } - - // make a list of classes - if (!classesToTeach.isEmpty()) - { - int count = 0; - ClassId classCheck = activeChar.getClassId(); - - while ((count == 0) && (classCheck != null)) - { - for (ClassId cid : classesToTeach) - { - if (cid.level() > classCheck.level()) - { - continue; - } - - if (SkillTreesData.getInstance().getAvailableSkills(activeChar, cid, false, false).isEmpty()) - { - continue; - } - - text += "Learn " + cid + "'s class Skills
\n"; - count++; - } - classCheck = classCheck.getParent(); - } - classCheck = null; - } - else - { - text += "No Skills.
"; - } - text += ""; - - final NpcHtmlMessage html = new NpcHtmlMessage(target.getObjectId()); - html.setHtml(text); - html.replace("%objectId%", String.valueOf(target.getObjectId())); - activeChar.sendPacket(html); - - activeChar.sendPacket(ActionFailed.STATIC_PACKET); - } - } - catch (Exception e) - { - _log.log(Level.WARNING, "Exception in " + getClass().getSimpleName(), e); - } - } - else - { - L2NpcInstance.showSkillList(activeChar, (L2Npc) target, activeChar.getClassId()); - } + L2NpcInstance.showSkillList(activeChar, (L2Npc) target, activeChar.getClassId()); return true; } diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10331_StartOfFate/Q10331_StartOfFate.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10331_StartOfFate/Q10331_StartOfFate.java index 689f430c29..2ace154d20 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10331_StartOfFate/Q10331_StartOfFate.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10331_StartOfFate/Q10331_StartOfFate.java @@ -303,7 +303,9 @@ public final class Q10331_StartOfFate extends Quest } player.setBaseClass(newClassId); player.setClassId(newClassId.getId()); + player.store(false); player.broadcastUserInfo(); + player.sendSkillList(); giveAdena(player, 80000, true); giveItems(player, PROOF_OF_COURAGE, 40); addExpAndSp(player, 200000, 48); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10360_CertificationOfFate/Q10360_CertificationOfFate.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10360_CertificationOfFate/Q10360_CertificationOfFate.java index a836e09b7f..b8e56ae8db 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10360_CertificationOfFate/Q10360_CertificationOfFate.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10360_CertificationOfFate/Q10360_CertificationOfFate.java @@ -212,6 +212,7 @@ public final class Q10360_CertificationOfFate extends Quest player.setBaseClass(newClassId); player.setClassId(newClassId.getId()); player.broadcastUserInfo(); + player.sendSkillList(); giveAdena(player, 110000, true); giveItems(player, PROOF_OF_JUSTICE, 40); addExpAndSp(player, 2700000, 648); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10751_WindsOfFateEncounters/Q10751_WindsOfFateEncounters.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10751_WindsOfFateEncounters/Q10751_WindsOfFateEncounters.java index 1324b71c78..255e4cdc27 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10751_WindsOfFateEncounters/Q10751_WindsOfFateEncounters.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10751_WindsOfFateEncounters/Q10751_WindsOfFateEncounters.java @@ -209,6 +209,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest player.setBaseClass(newClass); player.setClassId(newClass.getId()); player.broadcastUserInfo(); + player.sendSkillList(); player.sendPacket(new SocialAction(player.getObjectId(), 23)); giveAdena(player, 11000, false); giveItems(player, NAVARI_SUPPORT_BOX_MAGE, 1); @@ -225,6 +226,7 @@ public final class Q10751_WindsOfFateEncounters extends Quest player.setBaseClass(newClass); player.setClassId(newClass.getId()); player.broadcastUserInfo(); + player.sendSkillList(); player.sendPacket(new SocialAction(player.getObjectId(), 23)); giveAdena(player, 11000, false); giveItems(player, NAVARI_SUPPORT_BOX_FIGHTER, 1); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10752_WindsOfFateAPromise/Q10752_WindsOfFateAPromise.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10752_WindsOfFateAPromise/Q10752_WindsOfFateAPromise.java index b3f8dfeccb..2cf1d78daa 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10752_WindsOfFateAPromise/Q10752_WindsOfFateAPromise.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10752_WindsOfFateAPromise/Q10752_WindsOfFateAPromise.java @@ -215,6 +215,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest player.setBaseClass(newClass); player.setClassId(newClass.getId()); player.broadcastUserInfo(); + player.sendSkillList(); player.sendPacket(new SocialAction(player.getObjectId(), 24)); giveAdena(player, 5_000_000, false); giveItems(player, SOUL_SHOT_PACK, 1); @@ -233,6 +234,7 @@ public final class Q10752_WindsOfFateAPromise extends Quest player.setBaseClass(newClass); player.setClassId(newClass.getId()); player.broadcastUserInfo(); + player.sendSkillList(); player.sendPacket(new SocialAction(player.getObjectId(), 24)); giveAdena(player, 5_000_000, false); giveItems(player, SOUL_SHOT_PACK, 1); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10753_WindsOfFateChoices/Q10753_WindsOfFateChoices.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10753_WindsOfFateChoices/Q10753_WindsOfFateChoices.java index d34be4a13c..5b7c0f0844 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10753_WindsOfFateChoices/Q10753_WindsOfFateChoices.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/Q10753_WindsOfFateChoices/Q10753_WindsOfFateChoices.java @@ -321,6 +321,7 @@ public final class Q10753_WindsOfFateChoices extends Quest player.setBaseClass(newClass); player.setClassId(newClass.getId()); player.broadcastUserInfo(); + player.sendSkillList(); player.sendPacket(new SocialAction(player.getObjectId(), 24)); showOnScreenMsg(player, NpcStringId.CONGRATULATIONS_YOU_WILL_NOW_GRADUATE_FROM_THE_CLAN_ACADEMY_AND_LEAVE_YOUR_CURRENT_CLAN_YOU_CAN_NOW_JOIN_A_CLAN_AS_A_REGULAR_MEMBER_WITHOUT_BEING_SUBJECT_TO_ANY_PENALTIES, ExShowScreenMessage.TOP_CENTER, 10000); giveStoryQuestReward(player, 400); @@ -339,6 +340,7 @@ public final class Q10753_WindsOfFateChoices extends Quest player.setBaseClass(newClass); player.setClassId(newClass.getId()); player.broadcastUserInfo(); + player.sendSkillList(); player.sendPacket(new SocialAction(player.getObjectId(), 24)); showOnScreenMsg(player, NpcStringId.CONGRATULATIONS_YOU_WILL_NOW_GRADUATE_FROM_THE_CLAN_ACADEMY_AND_LEAVE_YOUR_CURRENT_CLAN_YOU_CAN_NOW_JOIN_A_CLAN_AS_A_REGULAR_MEMBER_WITHOUT_BEING_SUBJECT_TO_ANY_PENALTIES, ExShowScreenMessage.TOP_CENTER, 10000); giveStoryQuestReward(player, 400); diff --git a/L2J_Mobius_Underground/dist/game/data/scripts/quests/ThirdClassTransferQuest.java b/L2J_Mobius_Underground/dist/game/data/scripts/quests/ThirdClassTransferQuest.java index 0e77b62690..68130f41e7 100644 --- a/L2J_Mobius_Underground/dist/game/data/scripts/quests/ThirdClassTransferQuest.java +++ b/L2J_Mobius_Underground/dist/game/data/scripts/quests/ThirdClassTransferQuest.java @@ -238,6 +238,7 @@ public abstract class ThirdClassTransferQuest extends Quest player.setBaseClass(newClassId); player.setClassId(newClassId.getId()); player.broadcastUserInfo(); + player.sendSkillList(); giveItems(player, SOUL_SHOT_PACK, 1); giveItems(player, SPIRIT_SHOT_PACK, 1); giveItems(player, STEEL_DOOR_COIN, 87); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/Config.java b/L2J_Mobius_Underground/java/com/l2jmobius/Config.java index fb1316bca6..a3ec200ca5 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/Config.java @@ -144,7 +144,6 @@ public final class Config public static boolean LIFE_CRYSTAL_NEEDED; public static boolean ES_SP_BOOK_NEEDED; public static boolean DIVINE_SP_BOOK_NEEDED; - public static boolean ALT_GAME_SKILL_LEARN; public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS; public static boolean ALLOW_TRANSFORM_WITHOUT_QUEST; public static int FEE_DELETE_TRANSFER_SKILLS; @@ -1330,7 +1329,6 @@ public final class Config LIFE_CRYSTAL_NEEDED = Character.getBoolean("LifeCrystalNeeded", true); ES_SP_BOOK_NEEDED = Character.getBoolean("EnchantSkillSpBookNeeded", true); DIVINE_SP_BOOK_NEEDED = Character.getBoolean("DivineInspirationSpBookNeeded", true); - ALT_GAME_SKILL_LEARN = Character.getBoolean("AltGameSkillLearn", false); ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Character.getBoolean("AltSubClassWithoutQuests", false); RESTORE_SERVITOR_ON_RECONNECT = Character.getBoolean("RestoreServitorOnReconnect", true); RESTORE_PET_ON_RECONNECT = Character.getBoolean("RestorePetOnReconnect", true); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java index a2d70a0a11..b6c85032c8 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/data/xml/impl/SkillTreesData.java @@ -1171,7 +1171,7 @@ public final class SkillTreesData implements IGameXmlReader switch (skillType) { case CLASS: - sl = getClassSkill(id, lvl, player.getLearningClass()); + sl = getClassSkill(id, lvl, player.getClassId()); break; case TRANSFORM: sl = getTransformSkill(id, lvl); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/L2SkillLearn.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/L2SkillLearn.java index c9d32dae35..405766d64d 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/L2SkillLearn.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/L2SkillLearn.java @@ -21,10 +21,8 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import com.l2jmobius.Config; import com.l2jmobius.gameserver.data.xml.impl.SkillData; import com.l2jmobius.gameserver.enums.Race; -import com.l2jmobius.gameserver.model.base.ClassId; import com.l2jmobius.gameserver.model.base.SocialClass; import com.l2jmobius.gameserver.model.holders.ItemHolder; import com.l2jmobius.gameserver.model.holders.SkillHolder; @@ -276,38 +274,6 @@ public final class L2SkillLearn return _pointsRequired; } - /** - * Used for AltGameSkillLearn mod.
- * If the alternative skill learn system is enabled and the player is learning a skill from a different class apply a fee.
- * If the player is learning a skill from other class type (mage learning warrior skills or vice versa) the fee is higher. - * @param playerClass the player class Id. - * @param learningClass the skill learning player class Id. - * @return the amount of SP required to acquire this skill, by calculating the cost for the alternative skill learn system. - */ - public int getCalculatedLevelUpSp(ClassId playerClass, ClassId learningClass) - { - if ((playerClass == null) || (learningClass == null)) - { - return _levelUpSp; - } - - int levelUpSp = _levelUpSp; - // If the alternative skill learn system is enabled and the player is learning a skill from a different class apply a fee. - if (Config.ALT_GAME_SKILL_LEARN && (playerClass != learningClass)) - { - // If the player is learning a skill from other class type (mage learning warrior skills or vice versa) the fee is higher. - if (playerClass.isMage() != learningClass.isMage()) - { - levelUpSp *= 3; - } - else - { - levelUpSp *= 2; - } - } - return levelUpSp; - } - @Override public String toString() { diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java index b1c6992b77..94bd7ebfb2 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcInstance.java @@ -134,8 +134,6 @@ public class L2NpcInstance extends L2Npc // Normal skills, No LearnedByFS, no AutoGet skills. final List skills = SkillTreesData.getInstance().getAvailableSkills(player, classId, false, false); - player.setLearningClass(classId); - if (skills.isEmpty()) { final Map skillTree = SkillTreesData.getInstance().getCompleteClassSkillTree(classId); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index be71862ae3..547a60a9cb 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -2384,27 +2384,6 @@ public final class L2PcInstance extends L2Playable } } - /** - * Used for AltGameSkillLearn to set a custom skill learning class Id. - */ - private ClassId _learningClass = getClassId(); - - /** - * @return the custom skill learning class Id. - */ - public ClassId getLearningClass() - { - return _learningClass; - } - - /** - * @param learningClass the custom skill learning class Id to set. - */ - public void setLearningClass(ClassId learningClass) - { - _learningClass = learningClass; - } - /** * @return the Experience of the L2PcInstance. */ @@ -9636,8 +9615,6 @@ public final class L2PcInstance extends L2Playable } _classIndex = classIndex; - setLearningClass(getClassId()); - if (isInParty()) { getParty().recalculatePartyLevel(); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java index 9fce0be749..485590c89d 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkill.java @@ -575,7 +575,7 @@ public final class RequestAcquireSkill implements IClientIncomingPacket } // First it checks that the skill require SP and the player has enough SP to learn it. - final int levelUpSp = skillLearn.getCalculatedLevelUpSp(player.getClassId(), player.getLearningClass()); + final int levelUpSp = skillLearn.getLevelUpSp(); if ((levelUpSp > 0) && (levelUpSp > player.getSp())) { player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_ENOUGH_SP_TO_LEARN_THIS_SKILL); diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java index 48835d1303..bc31ef3aea 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/clientpackets/RequestAcquireSkillInfo.java @@ -118,8 +118,7 @@ public final class RequestAcquireSkillInfo implements IClientIncomingPacket } case CLASS: { - final int customSp = s.getCalculatedLevelUpSp(activeChar.getClassId(), activeChar.getLearningClass()); - client.sendPacket(new ExAcquireSkillInfo(activeChar, s, customSp)); + client.sendPacket(new ExAcquireSkillInfo(activeChar, s)); break; } case PLEDGE: diff --git a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExAcquireSkillInfo.java b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExAcquireSkillInfo.java index bed669a474..bc76861fe7 100644 --- a/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExAcquireSkillInfo.java +++ b/L2J_Mobius_Underground/java/com/l2jmobius/gameserver/network/serverpackets/ExAcquireSkillInfo.java @@ -45,14 +45,13 @@ public class ExAcquireSkillInfo implements IClientOutgoingPacket * Sets a custom amount of SP. * @param player * @param skillLearn the skill learn. - * @param sp the custom SP amount. */ - public ExAcquireSkillInfo(L2PcInstance player, L2SkillLearn skillLearn, int sp) + public ExAcquireSkillInfo(L2PcInstance player, L2SkillLearn skillLearn) { _id = skillLearn.getSkillId(); _level = skillLearn.getSkillLevel(); _dualClassLevel = skillLearn.getDualClassLevel(); - _spCost = sp; + _spCost = skillLearn.getLevelUpSp(); _minLevel = skillLearn.getGetLevel(); _itemReq = skillLearn.getRequiredItems(); _skillRem = skillLearn.getRemoveSkills().stream().map(player::getKnownSkill).filter(Objects::nonNull).collect(Collectors.toList());