Store exalted skills in both main and dual class.
This commit is contained in:
parent
af6bc6cf25
commit
b0936e3095
@ -46,6 +46,7 @@ import java.util.stream.Collectors;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.concurrent.ThreadPool;
|
import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.GameTimeController;
|
import org.l2jmobius.gameserver.GameTimeController;
|
||||||
import org.l2jmobius.gameserver.ItemsAutoDestroy;
|
import org.l2jmobius.gameserver.ItemsAutoDestroy;
|
||||||
@ -840,6 +841,18 @@ public class PlayerInstance extends Playable
|
|||||||
private static final String TRAINING_CAMP_VAR = "TRAINING_CAMP";
|
private static final String TRAINING_CAMP_VAR = "TRAINING_CAMP";
|
||||||
private static final String TRAINING_CAMP_DURATION = "TRAINING_CAMP_DURATION";
|
private static final String TRAINING_CAMP_DURATION = "TRAINING_CAMP_DURATION";
|
||||||
|
|
||||||
|
// Shared dualclass skills.
|
||||||
|
private static final String KNOWN_DUAL_SKILLS_VAR = "KNOWN_DUAL_SKILLS";
|
||||||
|
private static final int[] DUAL_CLASS_SKILLS = new int[]
|
||||||
|
{
|
||||||
|
19222, // Dignity of the Exalted
|
||||||
|
19223, // Belief of the Exalted
|
||||||
|
19224, // Blessing of the Exalted
|
||||||
|
19225, // Summon Battle Potion
|
||||||
|
19226, // Favor of the Exalted
|
||||||
|
19229, // Fate of the Exalted
|
||||||
|
};
|
||||||
|
|
||||||
// Save responder name for log it
|
// Save responder name for log it
|
||||||
private String _lastPetitionGmName = null;
|
private String _lastPetitionGmName = null;
|
||||||
|
|
||||||
@ -7356,6 +7369,24 @@ public class PlayerInstance extends Playable
|
|||||||
if (store)
|
if (store)
|
||||||
{
|
{
|
||||||
storeSkill(newSkill, oldSkill, -1);
|
storeSkill(newSkill, oldSkill, -1);
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, newSkill.getId()))
|
||||||
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
if (!dualClassSkills.contains(newSkill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == newSkill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(newSkill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return oldSkill;
|
return oldSkill;
|
||||||
}
|
}
|
||||||
@ -7507,6 +7538,8 @@ public class PlayerInstance extends Playable
|
|||||||
*/
|
*/
|
||||||
private void restoreSkills()
|
private void restoreSkills()
|
||||||
{
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
|
||||||
try (Connection con = DatabaseFactory.getConnection();
|
try (Connection con = DatabaseFactory.getConnection();
|
||||||
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
||||||
{
|
{
|
||||||
@ -7529,6 +7562,20 @@ public class PlayerInstance extends Playable
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, id) && !dualClassSkills.contains(skill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == skill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(skill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
|
||||||
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
||||||
addSkill(skill);
|
addSkill(skill);
|
||||||
|
|
||||||
@ -7547,6 +7594,15 @@ public class PlayerInstance extends Playable
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Learn known dualclass skills.
|
||||||
|
if (isDualClassActive() || !isSubClassActive())
|
||||||
|
{
|
||||||
|
for (Skill skill : dualClassSkills)
|
||||||
|
{
|
||||||
|
addSkill(skill, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,6 +46,7 @@ import java.util.stream.Collectors;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.concurrent.ThreadPool;
|
import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.GameTimeController;
|
import org.l2jmobius.gameserver.GameTimeController;
|
||||||
import org.l2jmobius.gameserver.ItemsAutoDestroy;
|
import org.l2jmobius.gameserver.ItemsAutoDestroy;
|
||||||
@ -846,6 +847,18 @@ public class PlayerInstance extends Playable
|
|||||||
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
||||||
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
||||||
|
|
||||||
|
// Shared dualclass skills.
|
||||||
|
private static final String KNOWN_DUAL_SKILLS_VAR = "KNOWN_DUAL_SKILLS";
|
||||||
|
private static final int[] DUAL_CLASS_SKILLS = new int[]
|
||||||
|
{
|
||||||
|
19222, // Dignity of the Exalted
|
||||||
|
19223, // Belief of the Exalted
|
||||||
|
19224, // Blessing of the Exalted
|
||||||
|
19225, // Summon Battle Potion
|
||||||
|
19226, // Favor of the Exalted
|
||||||
|
19229, // Fate of the Exalted
|
||||||
|
};
|
||||||
|
|
||||||
// Save responder name for log it
|
// Save responder name for log it
|
||||||
private String _lastPetitionGmName = null;
|
private String _lastPetitionGmName = null;
|
||||||
|
|
||||||
@ -7363,6 +7376,24 @@ public class PlayerInstance extends Playable
|
|||||||
if (store)
|
if (store)
|
||||||
{
|
{
|
||||||
storeSkill(newSkill, oldSkill, -1);
|
storeSkill(newSkill, oldSkill, -1);
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, newSkill.getId()))
|
||||||
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
if (!dualClassSkills.contains(newSkill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == newSkill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(newSkill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return oldSkill;
|
return oldSkill;
|
||||||
}
|
}
|
||||||
@ -7514,6 +7545,8 @@ public class PlayerInstance extends Playable
|
|||||||
*/
|
*/
|
||||||
private void restoreSkills()
|
private void restoreSkills()
|
||||||
{
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
|
||||||
try (Connection con = DatabaseFactory.getConnection();
|
try (Connection con = DatabaseFactory.getConnection();
|
||||||
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
||||||
{
|
{
|
||||||
@ -7536,6 +7569,20 @@ public class PlayerInstance extends Playable
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, id) && !dualClassSkills.contains(skill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == skill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(skill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
|
||||||
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
||||||
addSkill(skill);
|
addSkill(skill);
|
||||||
|
|
||||||
@ -7554,6 +7601,15 @@ public class PlayerInstance extends Playable
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Learn known dualclass skills.
|
||||||
|
if (isDualClassActive() || !isSubClassActive())
|
||||||
|
{
|
||||||
|
for (Skill skill : dualClassSkills)
|
||||||
|
{
|
||||||
|
addSkill(skill, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,6 +46,7 @@ import java.util.stream.Collectors;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.concurrent.ThreadPool;
|
import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.GameTimeController;
|
import org.l2jmobius.gameserver.GameTimeController;
|
||||||
import org.l2jmobius.gameserver.ItemsAutoDestroy;
|
import org.l2jmobius.gameserver.ItemsAutoDestroy;
|
||||||
@ -848,6 +849,18 @@ public class PlayerInstance extends Playable
|
|||||||
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
||||||
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
||||||
|
|
||||||
|
// Shared dualclass skills.
|
||||||
|
private static final String KNOWN_DUAL_SKILLS_VAR = "KNOWN_DUAL_SKILLS";
|
||||||
|
private static final int[] DUAL_CLASS_SKILLS = new int[]
|
||||||
|
{
|
||||||
|
19222, // Dignity of the Exalted
|
||||||
|
19223, // Belief of the Exalted
|
||||||
|
19224, // Blessing of the Exalted
|
||||||
|
19225, // Summon Battle Potion
|
||||||
|
19226, // Favor of the Exalted
|
||||||
|
19229, // Fate of the Exalted
|
||||||
|
};
|
||||||
|
|
||||||
// Save responder name for log it
|
// Save responder name for log it
|
||||||
private String _lastPetitionGmName = null;
|
private String _lastPetitionGmName = null;
|
||||||
|
|
||||||
@ -7365,6 +7378,24 @@ public class PlayerInstance extends Playable
|
|||||||
if (store)
|
if (store)
|
||||||
{
|
{
|
||||||
storeSkill(newSkill, oldSkill, -1);
|
storeSkill(newSkill, oldSkill, -1);
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, newSkill.getId()))
|
||||||
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
if (!dualClassSkills.contains(newSkill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == newSkill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(newSkill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return oldSkill;
|
return oldSkill;
|
||||||
}
|
}
|
||||||
@ -7516,6 +7547,8 @@ public class PlayerInstance extends Playable
|
|||||||
*/
|
*/
|
||||||
private void restoreSkills()
|
private void restoreSkills()
|
||||||
{
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
|
||||||
try (Connection con = DatabaseFactory.getConnection();
|
try (Connection con = DatabaseFactory.getConnection();
|
||||||
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
||||||
{
|
{
|
||||||
@ -7538,6 +7571,20 @@ public class PlayerInstance extends Playable
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, id) && !dualClassSkills.contains(skill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == skill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(skill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
|
||||||
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
||||||
addSkill(skill);
|
addSkill(skill);
|
||||||
|
|
||||||
@ -7556,6 +7603,15 @@ public class PlayerInstance extends Playable
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Learn known dualclass skills.
|
||||||
|
if (isDualClassActive() || !isSubClassActive())
|
||||||
|
{
|
||||||
|
for (Skill skill : dualClassSkills)
|
||||||
|
{
|
||||||
|
addSkill(skill, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -858,6 +858,19 @@ public class PlayerInstance extends Playable
|
|||||||
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
||||||
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
||||||
|
|
||||||
|
// Shared dualclass skills.
|
||||||
|
private static final String KNOWN_DUAL_SKILLS_VAR = "KNOWN_DUAL_SKILLS";
|
||||||
|
private static final int[] DUAL_CLASS_SKILLS = new int[]
|
||||||
|
{
|
||||||
|
19222, // Dignity of the Exalted
|
||||||
|
19223, // Belief of the Exalted
|
||||||
|
19224, // Blessing of the Exalted
|
||||||
|
19225, // Summon Battle Potion
|
||||||
|
19226, // Favor of the Exalted
|
||||||
|
19229, // Fate of the Exalted
|
||||||
|
19290, // Vitality of the Exalted
|
||||||
|
};
|
||||||
|
|
||||||
// Save responder name for log it
|
// Save responder name for log it
|
||||||
private String _lastPetitionGmName = null;
|
private String _lastPetitionGmName = null;
|
||||||
|
|
||||||
@ -7360,6 +7373,24 @@ public class PlayerInstance extends Playable
|
|||||||
if (store)
|
if (store)
|
||||||
{
|
{
|
||||||
storeSkill(newSkill, oldSkill, -1);
|
storeSkill(newSkill, oldSkill, -1);
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, newSkill.getId()))
|
||||||
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
if (!dualClassSkills.contains(newSkill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == newSkill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(newSkill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return oldSkill;
|
return oldSkill;
|
||||||
}
|
}
|
||||||
@ -7511,6 +7542,8 @@ public class PlayerInstance extends Playable
|
|||||||
*/
|
*/
|
||||||
private void restoreSkills()
|
private void restoreSkills()
|
||||||
{
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
|
||||||
try (Connection con = DatabaseFactory.getConnection();
|
try (Connection con = DatabaseFactory.getConnection();
|
||||||
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
||||||
{
|
{
|
||||||
@ -7533,6 +7566,20 @@ public class PlayerInstance extends Playable
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, id) && !dualClassSkills.contains(skill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == skill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(skill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
|
||||||
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
||||||
addSkill(skill);
|
addSkill(skill);
|
||||||
|
|
||||||
@ -7551,6 +7598,15 @@ public class PlayerInstance extends Playable
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Learn known dualclass skills.
|
||||||
|
if (isDualClassActive() || !isSubClassActive())
|
||||||
|
{
|
||||||
|
for (Skill skill : dualClassSkills)
|
||||||
|
{
|
||||||
|
addSkill(skill, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -854,6 +854,19 @@ public class PlayerInstance extends Playable
|
|||||||
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
||||||
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
||||||
|
|
||||||
|
// Shared dualclass skills.
|
||||||
|
private static final String KNOWN_DUAL_SKILLS_VAR = "KNOWN_DUAL_SKILLS";
|
||||||
|
private static final int[] DUAL_CLASS_SKILLS = new int[]
|
||||||
|
{
|
||||||
|
19222, // Dignity of the Exalted
|
||||||
|
19223, // Belief of the Exalted
|
||||||
|
19224, // Blessing of the Exalted
|
||||||
|
19225, // Summon Battle Potion
|
||||||
|
19226, // Favor of the Exalted
|
||||||
|
19229, // Fate of the Exalted
|
||||||
|
19290, // Vitality of the Exalted
|
||||||
|
};
|
||||||
|
|
||||||
// Save responder name for log it
|
// Save responder name for log it
|
||||||
private String _lastPetitionGmName = null;
|
private String _lastPetitionGmName = null;
|
||||||
|
|
||||||
@ -7339,6 +7352,24 @@ public class PlayerInstance extends Playable
|
|||||||
if (store)
|
if (store)
|
||||||
{
|
{
|
||||||
storeSkill(newSkill, oldSkill, -1);
|
storeSkill(newSkill, oldSkill, -1);
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, newSkill.getId()))
|
||||||
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
if (!dualClassSkills.contains(newSkill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == newSkill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(newSkill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return oldSkill;
|
return oldSkill;
|
||||||
}
|
}
|
||||||
@ -7490,6 +7521,8 @@ public class PlayerInstance extends Playable
|
|||||||
*/
|
*/
|
||||||
private void restoreSkills()
|
private void restoreSkills()
|
||||||
{
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
|
||||||
try (Connection con = DatabaseFactory.getConnection();
|
try (Connection con = DatabaseFactory.getConnection();
|
||||||
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
||||||
{
|
{
|
||||||
@ -7512,6 +7545,20 @@ public class PlayerInstance extends Playable
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, id) && !dualClassSkills.contains(skill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == skill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(skill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
|
||||||
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
||||||
addSkill(skill);
|
addSkill(skill);
|
||||||
|
|
||||||
@ -7530,6 +7577,15 @@ public class PlayerInstance extends Playable
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Learn known dualclass skills.
|
||||||
|
if (isDualClassActive() || !isSubClassActive())
|
||||||
|
{
|
||||||
|
for (Skill skill : dualClassSkills)
|
||||||
|
{
|
||||||
|
addSkill(skill, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -854,6 +854,19 @@ public class PlayerInstance extends Playable
|
|||||||
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
||||||
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
||||||
|
|
||||||
|
// Shared dualclass skills.
|
||||||
|
private static final String KNOWN_DUAL_SKILLS_VAR = "KNOWN_DUAL_SKILLS";
|
||||||
|
private static final int[] DUAL_CLASS_SKILLS = new int[]
|
||||||
|
{
|
||||||
|
19222, // Dignity of the Exalted
|
||||||
|
19223, // Belief of the Exalted
|
||||||
|
19224, // Blessing of the Exalted
|
||||||
|
19225, // Summon Battle Potion
|
||||||
|
19226, // Favor of the Exalted
|
||||||
|
19229, // Fate of the Exalted
|
||||||
|
19290, // Vitality of the Exalted
|
||||||
|
};
|
||||||
|
|
||||||
// Save responder name for log it
|
// Save responder name for log it
|
||||||
private String _lastPetitionGmName = null;
|
private String _lastPetitionGmName = null;
|
||||||
|
|
||||||
@ -7339,6 +7352,24 @@ public class PlayerInstance extends Playable
|
|||||||
if (store)
|
if (store)
|
||||||
{
|
{
|
||||||
storeSkill(newSkill, oldSkill, -1);
|
storeSkill(newSkill, oldSkill, -1);
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, newSkill.getId()))
|
||||||
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
if (!dualClassSkills.contains(newSkill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == newSkill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(newSkill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return oldSkill;
|
return oldSkill;
|
||||||
}
|
}
|
||||||
@ -7490,6 +7521,8 @@ public class PlayerInstance extends Playable
|
|||||||
*/
|
*/
|
||||||
private void restoreSkills()
|
private void restoreSkills()
|
||||||
{
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
|
||||||
try (Connection con = DatabaseFactory.getConnection();
|
try (Connection con = DatabaseFactory.getConnection();
|
||||||
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
||||||
{
|
{
|
||||||
@ -7512,6 +7545,20 @@ public class PlayerInstance extends Playable
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, id) && !dualClassSkills.contains(skill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == skill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(skill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
|
||||||
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
||||||
addSkill(skill);
|
addSkill(skill);
|
||||||
|
|
||||||
@ -7530,6 +7577,15 @@ public class PlayerInstance extends Playable
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Learn known dualclass skills.
|
||||||
|
if (isDualClassActive() || !isSubClassActive())
|
||||||
|
{
|
||||||
|
for (Skill skill : dualClassSkills)
|
||||||
|
{
|
||||||
|
addSkill(skill, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -854,6 +854,19 @@ public class PlayerInstance extends Playable
|
|||||||
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
||||||
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
||||||
|
|
||||||
|
// Shared dualclass skills.
|
||||||
|
private static final String KNOWN_DUAL_SKILLS_VAR = "KNOWN_DUAL_SKILLS";
|
||||||
|
private static final int[] DUAL_CLASS_SKILLS = new int[]
|
||||||
|
{
|
||||||
|
19222, // Dignity of the Exalted
|
||||||
|
19223, // Belief of the Exalted
|
||||||
|
19224, // Blessing of the Exalted
|
||||||
|
19225, // Summon Battle Potion
|
||||||
|
19226, // Favor of the Exalted
|
||||||
|
19229, // Fate of the Exalted
|
||||||
|
19290, // Vitality of the Exalted
|
||||||
|
};
|
||||||
|
|
||||||
// Save responder name for log it
|
// Save responder name for log it
|
||||||
private String _lastPetitionGmName = null;
|
private String _lastPetitionGmName = null;
|
||||||
|
|
||||||
@ -7340,6 +7353,24 @@ public class PlayerInstance extends Playable
|
|||||||
if (store)
|
if (store)
|
||||||
{
|
{
|
||||||
storeSkill(newSkill, oldSkill, -1);
|
storeSkill(newSkill, oldSkill, -1);
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, newSkill.getId()))
|
||||||
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
if (!dualClassSkills.contains(newSkill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == newSkill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(newSkill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return oldSkill;
|
return oldSkill;
|
||||||
}
|
}
|
||||||
@ -7491,6 +7522,8 @@ public class PlayerInstance extends Playable
|
|||||||
*/
|
*/
|
||||||
private void restoreSkills()
|
private void restoreSkills()
|
||||||
{
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
|
||||||
try (Connection con = DatabaseFactory.getConnection();
|
try (Connection con = DatabaseFactory.getConnection();
|
||||||
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
||||||
{
|
{
|
||||||
@ -7513,6 +7546,20 @@ public class PlayerInstance extends Playable
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, id) && !dualClassSkills.contains(skill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == skill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(skill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
|
||||||
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
||||||
addSkill(skill);
|
addSkill(skill);
|
||||||
|
|
||||||
@ -7531,6 +7578,15 @@ public class PlayerInstance extends Playable
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Learn known dualclass skills.
|
||||||
|
if (isDualClassActive() || !isSubClassActive())
|
||||||
|
{
|
||||||
|
for (Skill skill : dualClassSkills)
|
||||||
|
{
|
||||||
|
addSkill(skill, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,6 +46,7 @@ import java.util.stream.Collectors;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.concurrent.ThreadPool;
|
import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.GameTimeController;
|
import org.l2jmobius.gameserver.GameTimeController;
|
||||||
import org.l2jmobius.gameserver.ItemsAutoDestroy;
|
import org.l2jmobius.gameserver.ItemsAutoDestroy;
|
||||||
@ -860,6 +861,19 @@ public class PlayerInstance extends Playable
|
|||||||
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
||||||
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
||||||
|
|
||||||
|
// Shared dualclass skills.
|
||||||
|
private static final String KNOWN_DUAL_SKILLS_VAR = "KNOWN_DUAL_SKILLS";
|
||||||
|
private static final int[] DUAL_CLASS_SKILLS = new int[]
|
||||||
|
{
|
||||||
|
19222, // Dignity of the Exalted
|
||||||
|
19223, // Belief of the Exalted
|
||||||
|
19224, // Blessing of the Exalted
|
||||||
|
19225, // Summon Battle Potion
|
||||||
|
19226, // Favor of the Exalted
|
||||||
|
19229, // Fate of the Exalted
|
||||||
|
19290, // Vitality of the Exalted
|
||||||
|
};
|
||||||
|
|
||||||
// Save responder name for log it
|
// Save responder name for log it
|
||||||
private String _lastPetitionGmName = null;
|
private String _lastPetitionGmName = null;
|
||||||
|
|
||||||
@ -7347,6 +7361,24 @@ public class PlayerInstance extends Playable
|
|||||||
if (store)
|
if (store)
|
||||||
{
|
{
|
||||||
storeSkill(newSkill, oldSkill, -1);
|
storeSkill(newSkill, oldSkill, -1);
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, newSkill.getId()))
|
||||||
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
if (!dualClassSkills.contains(newSkill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == newSkill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(newSkill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return oldSkill;
|
return oldSkill;
|
||||||
}
|
}
|
||||||
@ -7498,6 +7530,8 @@ public class PlayerInstance extends Playable
|
|||||||
*/
|
*/
|
||||||
private void restoreSkills()
|
private void restoreSkills()
|
||||||
{
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
|
||||||
try (Connection con = DatabaseFactory.getConnection();
|
try (Connection con = DatabaseFactory.getConnection();
|
||||||
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
||||||
{
|
{
|
||||||
@ -7520,6 +7554,20 @@ public class PlayerInstance extends Playable
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, id) && !dualClassSkills.contains(skill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == skill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(skill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
|
||||||
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
||||||
addSkill(skill);
|
addSkill(skill);
|
||||||
|
|
||||||
@ -7538,6 +7586,15 @@ public class PlayerInstance extends Playable
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Learn known dualclass skills.
|
||||||
|
if (isDualClassActive() || !isSubClassActive())
|
||||||
|
{
|
||||||
|
for (Skill skill : dualClassSkills)
|
||||||
|
{
|
||||||
|
addSkill(skill, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,6 +46,7 @@ import java.util.stream.Collectors;
|
|||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
import org.l2jmobius.commons.concurrent.ThreadPool;
|
import org.l2jmobius.commons.concurrent.ThreadPool;
|
||||||
import org.l2jmobius.commons.database.DatabaseFactory;
|
import org.l2jmobius.commons.database.DatabaseFactory;
|
||||||
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.GameTimeController;
|
import org.l2jmobius.gameserver.GameTimeController;
|
||||||
import org.l2jmobius.gameserver.ItemsAutoDestroy;
|
import org.l2jmobius.gameserver.ItemsAutoDestroy;
|
||||||
@ -850,6 +851,19 @@ public class PlayerInstance extends Playable
|
|||||||
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
private static final String ATTENDANCE_DATE_VAR = "ATTENDANCE_DATE";
|
||||||
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
private static final String ATTENDANCE_INDEX_VAR = "ATTENDANCE_INDEX";
|
||||||
|
|
||||||
|
// Shared dualclass skills.
|
||||||
|
private static final String KNOWN_DUAL_SKILLS_VAR = "KNOWN_DUAL_SKILLS";
|
||||||
|
private static final int[] DUAL_CLASS_SKILLS = new int[]
|
||||||
|
{
|
||||||
|
19222, // Dignity of the Exalted
|
||||||
|
19223, // Belief of the Exalted
|
||||||
|
19224, // Blessing of the Exalted
|
||||||
|
19225, // Summon Battle Potion
|
||||||
|
19226, // Favor of the Exalted
|
||||||
|
19229, // Fate of the Exalted
|
||||||
|
19290, // Vitality of the Exalted
|
||||||
|
};
|
||||||
|
|
||||||
// Save responder name for log it
|
// Save responder name for log it
|
||||||
private String _lastPetitionGmName = null;
|
private String _lastPetitionGmName = null;
|
||||||
|
|
||||||
@ -7347,6 +7361,24 @@ public class PlayerInstance extends Playable
|
|||||||
if (store)
|
if (store)
|
||||||
{
|
{
|
||||||
storeSkill(newSkill, oldSkill, -1);
|
storeSkill(newSkill, oldSkill, -1);
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, newSkill.getId()))
|
||||||
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
if (!dualClassSkills.contains(newSkill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == newSkill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(newSkill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return oldSkill;
|
return oldSkill;
|
||||||
}
|
}
|
||||||
@ -7498,6 +7530,8 @@ public class PlayerInstance extends Playable
|
|||||||
*/
|
*/
|
||||||
private void restoreSkills()
|
private void restoreSkills()
|
||||||
{
|
{
|
||||||
|
final List<Skill> dualClassSkills = getVariables().getList(KNOWN_DUAL_SKILLS_VAR, Skill.class, new ArrayList<>());
|
||||||
|
|
||||||
try (Connection con = DatabaseFactory.getConnection();
|
try (Connection con = DatabaseFactory.getConnection();
|
||||||
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR))
|
||||||
{
|
{
|
||||||
@ -7520,6 +7554,20 @@ public class PlayerInstance extends Playable
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CommonUtil.contains(DUAL_CLASS_SKILLS, id) && !dualClassSkills.contains(skill))
|
||||||
|
{
|
||||||
|
for (Skill dualSkill : dualClassSkills)
|
||||||
|
{
|
||||||
|
if (dualSkill.getId() == skill.getId())
|
||||||
|
{
|
||||||
|
dualClassSkills.remove(dualSkill);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dualClassSkills.add(skill);
|
||||||
|
getVariables().set(KNOWN_DUAL_SKILLS_VAR, dualClassSkills);
|
||||||
|
}
|
||||||
|
|
||||||
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
// Add the Skill object to the Creature _skills and its Func objects to the calculator set of the Creature
|
||||||
addSkill(skill);
|
addSkill(skill);
|
||||||
|
|
||||||
@ -7538,6 +7586,15 @@ public class PlayerInstance extends Playable
|
|||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not restore character " + this + " skills: " + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Learn known dualclass skills.
|
||||||
|
if (isDualClassActive() || !isSubClassActive())
|
||||||
|
{
|
||||||
|
for (Skill skill : dualClassSkills)
|
||||||
|
{
|
||||||
|
addSkill(skill, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user