lastid = id;
lastmaxlearn = learn;
}
lastmaxlearn = Math.max(lastmaxlearn, learn);
int baseLevel = _baseLevels[id];
L2Skill base = getInfo(id, 1);
if(base == null)
{
_incorrectSkills.add(id);
Log.add("Incorrect skill base for id: " + id, "sql_skill_levels", "");
continue;
}
int level = SkillTreeTable.convertEnchantLevel(baseLevel, display_level, base.getEnchantLevelCount());
L2Skill skill = getInfo(id, level);
if(skill == null)
{
if(!_incorrectSkills.contains(id))
{
_incorrectSkills.add(id);
if(display_level < 100)
{
Log.add("Incorrect skill levels for id: " + id + ", level = " + level + ", display_level = " + display_level, "sql_skill_levels", "");
}
else
{
Log.add("Not found enchant for skill id: " + id + ", level = " + level + ", display_level = " + display_level, "sql_skill_enchant_levels", "");
}
}
continue;
}
//mysql.set("update skills set reuse_final=" + skill.getReuseDelay() + " where id=" + id + " and level=" + display_level);
skill._isStandart = true;
int maxSQL = _maxSQLLevels[id];
for(int i = level; i < MAX_SKILL_LEVELS && (i > maxSQL || i == level); i++)
{
skill = getInfo(id, i);
if(skill == null)
{
continue;
}
// Загружаем реюз
if(reuse > -1)
{
skill.setReuseDelay(reuse);
}
// Корректируем уровни скиллов, в основном для энчантов
if(skill.getDisplayLevel() != display_level)
{
Log.add("Incorrect display level: id = " + id + ", level = " + level, "sql_skill_display_levels", "");
}
if(skill.getPower() == 0 && power > 0)
{
skill.setPower(power);
Log.add("Not found power for skill id: " + id + ", level = " + level, "sql_skill_without_power", "");
}
else if(skill.getBaseValues() != null && skill.getBaseValues().contains("power"))
{
if(power <= 0)
{
Log.add("Incorrect power for skill id: " + id + ", level = " + level, "sql_skill_base_power", "");
}
else
{
skill.setPower(power);
}
}
else if(power > 0 && skill.getPower() != power)
{
Log.add("Incorrect power for skill id: " + id + ", level = " + level, "sql_skill_power", "");
}
skill.setBaseLevel((short) baseLevel);
if(skill.getMagicLevel() == 0)
{
skill.setMagicLevel(lastmaxlearn);
}
if(is_enchant)
{
if(skill.getEnchantLevelCount() == 15)
{
skill.setMagicLevel(skill.getMagicLevel() + DocumentSkill.elevels15[skill.getDisplayLevel() % 100]);
}
else
{
skill.setMagicLevel(DocumentSkill.elevels30[skill.getDisplayLevel() % 100]);
}
}
skill.setCastRange(cast_range);
if(skill.getFlyType() != FlyType.NONE && skill.getFlyRadius() > 0 && skill.getCastRange() > 0 && skill.getCastRange() < skill.getFlyRadius())
{
skill.setCastRange(skill.getFlyRadius());
}
skill.setName(name);
skill.setHitTime(hit_time);
if(skill.getSkillInterruptTime() == 0)
{
skill.setSkillInterruptTime(skill.getHitTime() * 3 / 4);
}
skill.setIsMagic(is_magic);
skill.setOverhit(skill.isOverhit() || !is_magic && Config.ALT_ALL_PHYS_SKILLS_OVERHIT);
//skill.setDisplayLevel((short) display_level);
skill.setHpConsume(hp_consume);
if(mp_consume > 0)
{
if(mp_consume / 4 >= 1 && is_magic)
{
skill.setMpConsume1(mp_consume * 1. / 4);
skill.setMpConsume2(mp_consume * 3. / 4);
}
else
{
skill.setMpConsume2(mp_consume);
}
}
}
}
for(L2Skill[] sl : skills)