• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

C++ Min Max Damage?

  • Thread starter Thread starter Tinkz
  • Start date Start date
T

Tinkz

Guest
Hello, I'm using TFS 1.2 and something odd occurred while trying out a new formula for spells/runes damage. The effect of using this formula makes my spells do no damage at all.

LUA:
    local min = math.max((base - variation), ((3 * maglevel + 2 * level) * (base - variation) / 100))
    local max = math.max((base + variation), ((3 * maglevel + 2 * level) * (base + variation) / 100))

    return min, max
end

Where can I find the max and min values in the source? Combat.cpp?
 
Solution
min max has to be a negative value.
LUA:
    local min = math.max((base - variation), ((3 * maglevel + 2 * level) * (base - variation) / 100))
    local max = math.max((base + variation), ((3 * maglevel + 2 * level) * (base + variation) / 100))
    return -min, -max
end
min max has to be a negative value.
LUA:
    local min = math.max((base - variation), ((3 * maglevel + 2 * level) * (base - variation) / 100))
    local max = math.max((base + variation), ((3 * maglevel + 2 * level) * (base + variation) / 100))
    return -min, -max
end
 
Solution
min max has to be a negative value.
LUA:
    local min = math.max((base - variation), ((3 * maglevel + 2 * level) * (base - variation) / 100))
    local max = math.max((base + variation), ((3 * maglevel + 2 * level) * (base + variation) / 100))
    return -min, -max
end

Can you explain why?
 

Similar threads

Back
Top