Lineage 2 Tower Forum

Full Version: Get skill enchant level
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
Something I am struggling with - I cannot obtain properly a skill enchant level.

Here is a simple skill-list script I was using to debug:

Code:
skills = GetSkills();
for skill in skills.list do
    ShowToClient("Skills:", skill.name .. " - " .. tostring(skill.skillId) .. "(Lvl." .. tostring(skill.skillLvl) .. ")");
end;

, but it seems "skillLvl" value is *a strangle mix* between the actual skill level + the enchant level. Example, I have a skill default level 41, the same one is enchanted to +15, and the final value I receive from "skillLvl" is 115 lol (the leading "4" is missing, and the enchant level is joined at the end)

Could you please let me know (if anyone knows) how to extract the skill enchant level.

+Suggestion - The Skill class should have another property maybe - not only skillLvl, but also skillEnchantLvl.
Well, I haven't tested it, but I believe the answer is:

    LUA Programming
skills = GetSkills();
for skill in skills.list do
 local skillEnchantLvl = skill.skillLvl > 100 and skill.skillLvl % 100 or 0;
 ShowToClient("Skills:", skill.name .. "(+ " .. tostring(skillEnchantLvl) .. ")");
end;

Reference URL's