Postado Setembro 26, 2018 6 anos Otx 1.3 8.6 Código SkillsTable = { [0] = { --[[ SKILL_FIST ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [1] = { --[[ SKILL_CLUB ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [2] = { --[[ SKILL_SWORD ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [3] = { --[[ SKILL_AXE ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [4] = { --[[ SKILL_DISTANCE ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [5] = { --[[ SKILL_SHIELD ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [6] = { --[[ SKILL_FISHING ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [7] = { --[[ SKILL_MAGLEVEL ]] stage = { [{0, 50}] = 10, [{51, 70}] = 8, [{71, 80}] = 7, [{81, 90}] = 6, [{91, 110}] = 5, [{111, 300}] = 2 }, rate = configKeys.RATE_MAGIC } } function getSkillsRate(level, skill) local skillRange = SkillsTable[skill] if next(skillRange.stage) then for sLevel, multiplier in pairs(skillRange.stage) do if level >= sLevel[1] and level <= sLevel[2] then return multiplier end end end return 1 end function Player:onGainSkillTries(skill, tries) if APPLY_SKILL_MULTIPLIER == false then return tries end local skills = SkillsTable[skill] if next(skills) and skills.rate then local rate = configManager.getNumber(skills.rate) if rate > 0 then return tries * rate else return tries * getSkillsRate(self:getEffectiveSkillLevel(skill), skill) end end end Erro ocorre somente quando usa magia .
Postado Setembro 27, 2018 6 anos Solução @Celulose Spoiler SkillsTable = { [0] = { --[[ SKILL_FIST ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [1] = { --[[ SKILL_CLUB ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [2] = { --[[ SKILL_SWORD ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [3] = { --[[ SKILL_AXE ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [4] = { --[[ SKILL_DISTANCE ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [5] = { --[[ SKILL_SHIELD ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [6] = { --[[ SKILL_FISHING ]] stage = { [{10, 30}] = 50, [{31, 50}] = 30, [{51, 70}] = 20, [{71, 90}] = 10, [{91, 110}] = 5, [{111, 300}] = 3 }, rate = configKeys.RATE_SKILL }, [7] = { --[[ SKILL_MAGLEVEL ]] stage = { [{0, 50}] = 10, [{51, 70}] = 8, [{71, 80}] = 7, [{81, 90}] = 6, [{91, 110}] = 5, [{111, 300}] = 2 }, rate = configKeys.RATE_MAGIC } } function getSkillsRate(level, skill) local skillRange = SkillsTable[skill] if skillRange then for sLevel, multiplier in pairs(skillRange.stage) do if level >= sLevel[1] and level <= sLevel[2] then return multiplier end end end return 1 end function Player:onGainSkillTries(skill, tries) if APPLY_SKILL_MULTIPLIER == false then return tries end local skills = SkillsTable[skill] if next(skills) and skills.rate then local rate = configManager.getNumber(skills.rate) if rate > 0 then return tries * rate else return tries * getSkillsRate(skill == SKILL_MAGLEVEL and self:getMagicLevel() or self:getEffectiveSkillLevel(skill), skill) end end end
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.