PK ›;“ÄÄinit.lua-- ToME - Tales of Maj'Eyal:
-- Copyright (C) 2009-2016 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see .
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
long_name = "Old CombatTalentLimit"
short_name = "oldctl"
for_module = "tome"
version = {1,7,4}
addon_version = {1, 0, 0}
requires_addons = {}
weight = 50
author = { 'mannendake'}
homepage = "http://tome.te4.org/"
description = [[Superloads CombatTalentLimit to how it was before. I cannot guarantee what this will do.
]]
tags = {'talent', 'level'}
hooks = false
overload = false
superload = true
data = false
PK 9¨"ÍÍ(superload/mod/class/interface/Combat.lualocal _M = loadPrevious(...)
--hmmmmmmm
function _M:combatTalentLimit(t, limit, low, high, raw, mastery)
mastery=mastery or 1.0
local x_low, x_high = (1*mastery),(5*mastery) -- Implied talent levels for low and high values respectively
local tl = type(t) == "table" and (raw and self:getTalentLevelRaw(t) or self:getTalentLevel(t)) or t
if tl <= 0 then tl = 0.1 end
if low then
local p = limit*(x_high-x_low)
local m = x_high*high - x_low*low
-- local halfpoint = (p-m)/(high - low) -- point at which half progress towards the limit is reached
-- local add = (limit*(x_high*low-x_low*high) + high*low*(x_low-x_high))/(p-m)
local ah = (limit*(x_high*low-x_low*high)+ high*low*(x_low-x_high))/(high - low) -- add*halfpoint product calculated at once to avoid possible divide by zero
return (limit*tl + ah)/(tl + (p-m)/(high - low)) --factored version of above formula
-- return (limit-add)*tl/(tl + halfpoint) + add, halfpoint, add
else -- assume low and x_low are both 0
local halfpoint = limit*x_high/high-x_high
return limit*tl/(tl + halfpoint)
-- return (limit-add)*tl/(tl + halfpoint) + add, halfpoint, add
end
end
return _M
PK ›;“ÄÄinit.luaPK 9¨"ÍÍ(êsuperload/mod/class/interface/Combat.luaPKŒý