tfs 1.2 @mdwilliams any idea?
local vocation = player:getVocation()
local level = player:getSkillLevel(SKILL_SWORD)
local reqtries = vocation:getRequiredSkillTries(SKILL_SWORD, level+1)
local curtries = player:getSkillTries(SKILL_SWORD)
if reqtries-curtries > 0 then
player:addSkillTries(SKILL_SWORD, reqtries-curtries)
end
Thanks, but that's not what I mean exactly.Code:local vocation = player:getVocation() local level = player:getSkillLevel(SKILL_SWORD) local reqtries = vocation:getRequiredSkillTries(SKILL_SWORD, level+1) local curtries = player:getSkillTries(SKILL_SWORD) if reqtries-curtries > 0 then player:addSkillTries(SKILL_SWORD, reqtries-curtries) end
Thanks, but that's not what I mean exactly.
I mean if I am 50 % of sword skill at lvl 40, I should be 50% of lvl 41% not just completing the level!
function Player:addLevel(skillId)
local curSkill = self:getSkillLevel(skillId)
local curTries = self:getSkillTries(skillId)
local voc = self:getVocation()
local nextTries = voc:getRequiredSkillTries(skillId, curSkill + 1)
self:addSkillTries(skillId, nextTries - curTries + curTries / nextTries * voc:getRequiredSkillTries(skillId, curSkill + 2))
end