Class Trait script. Easier solution?
Posted: Sun Apr 05, 2015 7:52 pm
Hello Everyone
I want to make a class script that gives attribute points at different level. In this example +1 Str every 3 levels and +1 vitality every 4 levels
It works with this script, but it makes it very long in my opinion. Is there an easier Solution?
I also did something like champion:addStatModifier("strength",(level/3)) Problem here is that the game will show something like Strenght 12,333333333 at level 1 which is very bad
I want to make a class script that gives attribute points at different level. In this example +1 Str every 3 levels and +1 vitality every 4 levels
Code: Select all
onRecomputeStats = function(champion, level)
if level > 0 then
level = champion:getLevel()
champion:addStatModifier("max_health", 22 + (level-1) * 12)
champion:addStatModifier("max_energy", 10 + (level-1) * 5)
if level > 2 then
level = champion:getLevel()
champion:addStatModifier("strength",1)
if level > 3 then
level = champion:getLevel()
champion:addStatModifier("vitality",1)
if level > 5 then
level = champion:getLevel()
champion:addStatModifier("strength",1)
if level > 7 then
level = champion:getLevel()
champion:addStatModifier("vitality",1)
if level > 8 then
level = champion:getLevel()
champion:addStatModifier("strength",1)
if level > 11 then
level = champion:getLevel()
champion:addStatModifier("strength",1)
champion:addStatModifier("vitality",1)
if level > 14 then
level = champion:getLevel()
champion:addStatModifier("strength",1)
if level > 15 then
level = champion:getLevel()
champion:addStatModifier("vitality",1)
if level > 17 then
level = champion:getLevel()
champion:addStatModifier("strength",1)
end
end
end
end
end
end
end
end
end
end,I also did something like champion:addStatModifier("strength",(level/3)) Problem here is that the game will show something like Strenght 12,333333333 at level 1 which is very bad