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

Lua [TFS 1.4.2] spell/rune problem.

OTcreator

Well-Known Member
Joined
Feb 14, 2022
Messages
482
Solutions
1
Reaction score
53
Hello!
I try create rune for vocations (others min, max) but not working.
I can use rune, but still hit to low (not found proffession?)

LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
combat:setParameter(COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)

function onGetFormulaValues(player, level, magicLevel)
    local levelTotal = level / 5
    local isKnight = (player:getVocation() == 4) or (player:getVocation() == 8)
    local isPaladin = (player:getVocation() == 3) or (player:getVocation() == 7)
    
    if isKnight then
        local min = (level * 1 + magicLevel * 4) * 1.85 * 1.5
        local max = (level * 1 + magicLevel * 4) * 2.2 * 1.5
        return min, max
    elseif isPaladin then
        local min = (level * 1 + magicLevel * 4) * 1.80
        local max = (level * 1 + magicLevel * 4) * 2.2
        return min, max
    else
        local min = levelTotal + (magicLevel * 10) + 9
        local max = levelTotal + (magicLevel * 12) + 19
        return min, max
    end

    return min, max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant, isHotkey)
    return combat:execute(creature, variant)
end
 
Change player:getVocation() to player:getVocation:getId()
Not working...

You know where I can add this in my script to working good?

LUA:
    local uh = math.random(190,250)
    if min < 190 then
        min = uh
    end
 
Last edited:
Back
Top