In MapleCharacter.java search for a function called loadCharFromDB.
Find:
PHP:
for (MapleData skill_ : MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/" + "String.wz")).getData("Skill.img").getChildren()) {
try {
ISkill skill = SkillFactory.getSkill(Integer.parseInt(skill_.getName()));
ret.skills.put(skill, new SkillEntry(skill.getMaxLevel(), skill.getMaxLevel(), (long) -1));
} catch (NumberFormatException nfe) {
break;
} catch (NullPointerException npe) {
continue;
}
}
and remove all of it.
Then, in its place, put this there:
PHP:
ps = con.prepareStatement("SELECT skillid,skilllevel,masterlevel,expiration FROM skills WHERE characterid = ?");
ps.setInt(1, charid);
rs = ps.executeQuery();
while (rs.next()) {
ret.skills.put(SkillFactory.getSkill(rs.getInt("skillid")), new SkillEntry(rs.getByte("skilllevel"), rs.getInt("masterlevel"), rs.getLong("expiration")));
}
rs.close();
ps.close();
Next, find function saveToDB(boolean update). In the function, look for this:
PHP:
deleteWhereCharacterId(con, "DELETE FROM skills WHERE characterid = ?");
Right below it, place this:
PHP:
ps = con.prepareStatement("INSERT INTO skills (characterid, skillid, skilllevel, masterlevel, expiration) VALUES (?, ?, ?, ?, ?)");
ps.setInt(1, id);
for (Entry<Skill, SkillEntry> skill : skills.entrySet()) {
ps.setInt(2, skill.getKey().getId());
ps.setInt(3, skill.getValue().skillevel);
ps.setInt(4, skill.getValue().masterlevel);
ps.setLong(5, skill.getValue().expiration);
ps.addBatch();
}
ps.executeBatch();
After you're done, compile again like you did before, and replace JAR in dist. It should no longer max your skills.