• 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!

TFS 1.X+ formulas

  • Thread starter Thread starter Tibia Demon
  • Start date Start date
T

Tibia Demon

Guest
on formulas like this
LUA:
function onGetFormulaValues(player, skill, attack, factor)
i should define this?
LUA:
local distanceSkill = player:getEffectiveSkillLevel(SKILL_DISTANCE)
or only like this and it work with out define and it get the value?
LUA:
(skill * attack * 0.05)
Code:
function onGetFormulaValues(player, level, magicLevel)
and here i need define this?
LUA:
local level = player:getLevel()
local magicLevel = player:getMagicLevel()
or only like this and it know the value without define?
LUA:
(level / 5) + (magicLevel * 7.3)
 
Solution
X
Do yourself a favour, and throw some prints into the script, and figure it out firsthand.
Maybe it works as you want, maybe it doesn't.
But you won't know until you actually test it. xP

LUA:
function onGetFormulaValues(player, skill, attack, factor)
    local distanceSkill = player:getEffectiveSkillLevel(SKILL_DISTANCE)
    print("skill: " .. skill)
    print("distanceSkill: " .. distanceSkill)
LUA:
function onGetFormulaValues(player, level, magicLevel)
    local playerLevel = player:getLevel()
    local playerMagicLevel = player:getMagicLevel()
    print("level: " .. level)
    print("playerLevel: " .. playerLevel)
    print("magicLevel: " .. magicLevel)
    print("playerMagicLevel: " .. playerMagicLevel)
Do yourself a favour, and throw some prints into the script, and figure it out firsthand.
Maybe it works as you want, maybe it doesn't.
But you won't know until you actually test it. xP

LUA:
function onGetFormulaValues(player, skill, attack, factor)
    local distanceSkill = player:getEffectiveSkillLevel(SKILL_DISTANCE)
    print("skill: " .. skill)
    print("distanceSkill: " .. distanceSkill)
LUA:
function onGetFormulaValues(player, level, magicLevel)
    local playerLevel = player:getLevel()
    local playerMagicLevel = player:getMagicLevel()
    print("level: " .. level)
    print("playerLevel: " .. playerLevel)
    print("magicLevel: " .. magicLevel)
    print("playerMagicLevel: " .. playerMagicLevel)
 
Solution

Similar threads

Back
Top