_currentSkill.currentLevel = i;
for (n=first; n != null; n = n.getNextSibling())
{
if ("cond".equalsIgnoreCase(n.getNodeName()))
{
Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
Node msg = n.getAttributes().getNamedItem("msg");
if (condition != null && msg != null)
condition.setMessage(msg.getNodeValue());
_currentSkill.currentSkills.get(i).attach(condition, false);
}
if ("for".equalsIgnoreCase(n.getNodeName()))
{
parseTemplate(n, _currentSkill.currentSkills.get(i));
}
}
}
for (int i=lastLvl; i < lastLvl+enchantLevels1; i++)
{
_currentSkill.currentLevel = i-lastLvl;
boolean found = false;
for (n=first; n != null; n = n.getNextSibling())
{
if ("enchant1cond".equalsIgnoreCase(n.getNodeName()))
{
found = true;
Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
Node msg = n.getAttributes().getNamedItem("msg");
if (condition != null && msg != null)
condition.setMessage(msg.getNodeValue());
_currentSkill.currentSkills.get(i).attach(condition,false);
}
if ("enchant1for".equalsIgnoreCase(n.getNodeName()))
{
found = true;
parseTemplate(n, _currentSkill.currentSkills.get(i));
}
}
// If none found, the enchanted skill will take effects from maxLvL of norm skill
if (!found)
{
_currentSkill.currentLevel = lastLvl-1;
for (n=first; n != null; n = n.getNextSibling())
{
if ("cond".equalsIgnoreCase(n.getNodeName()))
{
Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
Node msg = n.getAttributes().getNamedItem("msg");
if (condition != null && msg != null)
condition.setMessage(msg.getNodeValue());
_currentSkill.currentSkills.get(i).attach(condition,false);
}
if ("for".equalsIgnoreCase(n.getNodeName()))
{
parseTemplate(n, _currentSkill.currentSkills.get(i));
}
}
}
}
for (int i=lastLvl+enchantLevels1; i < lastLvl+enchantLevels1+enchantLevels2; i++)
{
boolean found = false;
_currentSkill.currentLevel = i-lastLvl-enchantLevels1;
for (n=first; n != null; n = n.getNextSibling())
{
if ("enchant2cond".equalsIgnoreCase(n.getNodeName()))
{
found = true;
Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
Node msg = n.getAttributes().getNamedItem("msg");
if (condition != null && msg != null)
condition.setMessage(msg.getNodeValue());
_currentSkill.currentSkills.get(i).attach(condition,false);
}
if ("enchant2for".equalsIgnoreCase(n.getNodeName()))
{
found = true;
parseTemplate(n, _currentSkill.currentSkills.get(i));
}
}
// If none found, the enchanted skill will take effects from maxLvL of norm skill
if(!found)
{
_currentSkill.currentLevel = lastLvl-1;
for (n=first; n != null; n = n.getNextSibling())
{
if ("cond".equalsIgnoreCase(n.getNodeName()))
{
Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
Node msg = n.getAttributes().getNamedItem("msg");
if (condition != null && msg != null)
condition.setMessage(msg.getNodeValue());
_currentSkill.currentSkills.get(i).attach(condition,false);
}
if ("for".equalsIgnoreCase(n.getNodeName()))
{
parseTemplate(n, _currentSkill.currentSkills.get(i));