Champion:trainSkill Component Bug on Party Creation
Posted: Sun Mar 15, 2015 8:40 am
Hi guys. I'm trying to figure out how NOT to make the Champion:trainSkill(name, times) component fill up a skill with all 5 skill points, even if "times" is only set to 1, on the party creation screen.
This is the code I have right now for a class that should start with 1 on "armors" skill, and 1 on "shields" skill:
For some reason, as soon as I choose the "knight" class, it shoots those two skills up to 5 points. Not sure why, or how to fix it. Any help would be much appreciated, thank you.
This is the code I have right now for a class that should start with 1 on "armors" skill, and 1 on "shields" skill:
Code: Select all
defineTrait{
name = "knight",
uiName = "Knight",
icon = 97,
description = "As a knight you believe that good preparation is the key to triumph in combat. You are specialized in wielding armor and using the shield.",
gameEffect = [[
- Health 60 (+10 per level), Energy 30 (+3 per level)
- Weight of equipped armor is reduced by 50%.
- Add +1 to both your Armor and Shields skills at start.]],
onRecomputeStats = function(champion, level)
if level > 0 then
level = champion:getLevel()
champion:addStatModifier("max_health", 60 + (level-1) * 10)
champion:addStatModifier("max_energy", 30 + (level-1) * 3)
champion:trainSkill("armors",1)
champion:trainSkill("shields",1)
end
end,
}