player.properties
#=============================================================#
# Stuck Sub Class #
#=============================================================#
#When you add subclass your skills from main class and subclass will stuck
#Attention - this will unbalance the server
#Default: False
StuckSubclass = True
#=============================================================#
# Custom Start Level Sub Class #
#=============================================================#
#Custom lvl when player add new subclass
#default = 40
CustomSubclassLvl = 79
-------------------------------------------------------------------------------------------
PcInstance.java
// Character Skill Save SQL String Definitions:
private static final String ADD_SKILL_SAVE = "INSERT INTO character_skills_save (char_obj_id,skill_id,skill_level,effect_count,effect_cur_time,reuse_delay,systime,restore_type,class_index,buff_index) VALUES (?,?,?,?,?,?,?,?,?,?)";
+ private static final String RESTORE_SKILLS_FOR_CHAR_ALT_SUBCLASS = "SELECT skill_id,skill_level FROM character_skills WHERE char_obj_id=? ORDER BY (skill_level+0)";
private static final String RESTORE_SKILL_SAVE = "SELECT skill_id,skill_level,effect_count,effect_cur_time, reuse_delay, systime, restore_type FROM character_skills_save WHERE char_obj_id=? AND class_index=? ORDER BY buff_index ASC";
private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE char_obj_id=? AND class_index=?";
line 6417
/**
* Retrieve from the database all skills of this L2PcInstance and add them to _skills.
*/
private void restoreSkills()
{
try (Connection con = L2DatabaseFactory.getInstance().getConnection())
{
+ if(!Config.KEEP_SUBCLASS_SKILLS)
+ {
PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR);
statement.setInt(1, getObjectId());
statement.setInt(2, getClassIndex());
ResultSet rset = statement.executeQuery();
// Go though the recordset of this SQL query
while (rset.next())
{
int id = rset.getInt("skill_id");
int level = rset.getInt("skill_level");
if (id > 9000)
continue; // fake skills for base stats
// Create a L2Skill object for each record
L2Skill skill = SkillTable.getInstance().getInfo(id, level);
// Add the L2Skill object to the L2Character _skills and its Func objects to the calculator set of the L2Character
super.addSkill(skill);
}
rset.close();
statement.close();
+ }
+ else
+ {
+ // Retrieve all skills of this L2PcInstance from the database
+ PreparedStatement statement = con.prepareStatement(RESTORE_SKILLS_FOR_CHAR_ALT_SUBCLASS);
+ statement.setInt(1, getObjectId());
+ ResultSet rset = statement.executeQuery();
+
+ // Go though the recordset of this SQL query
+ while (rset.next())
+ {
+ int id = rset.getInt("skill_id");
+ int level = rset.getInt("skill_level");
+
+ if (id > 9000)
+ continue; // fake skills for base stats
+
+ // Create a L2Skill object for each record
+ L2Skill skill = SkillTable.getInstance().getInfo(id, level);
+
+ // Add the L2Skill object to the L2Character _skills and its Func objects to the calculator set of the L2Character
+ super.addSkill(skill);
+ }
+
+ rset.close();
+ statement.close();
+ }
+ }
catch (Exception e)
{
_log.warning("Could not restore character skills: " + e);
}
}
---------------------------------------------------------------------------------------------------------------------------
SubClass.java
package net.sf.l2j.gameserver.model.base;
+import net.sf.l2j.Config;
/**
* Character Sub-Class Definition <BR>
* Used to store key information about a character's sub-class.
* @author Tempy
*/
public final class SubClass
{
private PlayerClass _class;
- private long _exp = Experience.LEVEL[40];
+ private long _exp = Experience.LEVEL[Config.CUSTOM_SUBCLASS_LVL];
private int _sp = 0;
- private byte _level = 40;
+ private byte _level = (byte)Config.CUSTOM_SUBCLASS_LVL;
private int _classIndex = 1;
public SubClass(int classId, long exp, int sp, byte level, int classIndex)
{
_class = PlayerClass.values()[classId];
_exp = exp;
_sp = sp;
_level = level;
_classIndex = classIndex;
}
---------------------------------------------------------------------------------------------------------------------------
Config.java
/** Buffs */
public static boolean STORE_SKILL_COOLTIME;
public static int BUFFS_MAX_AMOUNT;
+ /**Stuck Subclass **/
+ public static boolean KEEP_SUBCLASS_SKILLS;
+ public static int CUSTOM_SUBCLASS_LVL;
// --------------------------------------------------
// Server
// --------------------------------------------------
Line 1038
KARMA_AWARD_PK_KILL = players.getProperty("AwardPKKillPVPPoint", true);
KARMA_PK_LIMIT = players.getProperty("MinimumPKRequiredToDrop", 5);
KARMA_NONDROPPABLE_PET_ITEMS = players.getProperty("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650");
KARMA_NONDROPPABLE_ITEMS = players.getProperty("ListOfNonDroppableItemsForPK", "1147,425,1146,461,10,2368,7,6,2370,2369");
+ KEEP_SUBCLASS_SKILLS = Boolean.parseBoolean(players.getProperty("StuckSubclass", "False"));
+ CUSTOM_SUBCLASS_LVL = Integer.parseInt(players.getProperty("CustomSubclassLvl", "40"));
String[] array = KARMA_NONDROPPABLE_PET_ITEMS.split(",");
KARMA_LIST_NONDROPPABLE_PET_ITEMS = new int[array.length];
for (int i = 0; i < array.length; i++)
KARMA_LIST_NONDROPPABLE_PET_ITEMS[i] = Integer.parseInt(array[i]);