Fixed skill learn after class change.
Thanks Sdw for the pointers.
This commit is contained in:
@@ -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.<br>
|
||||
* If the alternative skill learn system is enabled and the player is learning a skill from a different class apply a fee.<br>
|
||||
* 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()
|
||||
{
|
||||
|
@@ -134,8 +134,6 @@ public class L2NpcInstance extends L2Npc
|
||||
|
||||
// Normal skills, No LearnedByFS, no AutoGet skills.
|
||||
final List<L2SkillLearn> skills = SkillTreesData.getInstance().getAvailableSkills(player, classId, false, false);
|
||||
player.setLearningClass(classId);
|
||||
|
||||
if (skills.isEmpty())
|
||||
{
|
||||
final Map<Long, L2SkillLearn> skillTree = SkillTreesData.getInstance().getCompleteClassSkillTree(classId);
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user