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

TFS 1.X+ potion increase skills/ml doesnt change spell attack

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
922
Location
Chile
Hello guys, i have two potions, one for skill and one for magic lvl
and i edited my spell formulas so skills and ml are very important, so when the player uses these potions, the attack increases importantle...

it worked perfectly for knights and paladins, but for mages there was no change, does anyone might know why?
maybe due the magic lvl limit? this player had like 230 with the potion..

here are two examples of the knights/paladins formulas and mages formulas
if anyone could enlight me would be awesome!!

knight
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 206)
combat:setFormula(COMBAT_FORMULA_SKILL, 9, 9, 8, 8)

arr = {
    {0, 0, 1, 0, 0},
    {0, 1, 1, 1, 0},
    {1, 1, 3, 1, 1},
    {0, 1, 1, 1, 0},
    {0, 0, 1, 0, 0}
}

function onGetFormulaValues(player, skill)
    local level = player:getLevel()
    local min = 15+skill*85.8 + level*7.0
    local max = 25+skill*95.1 + level*7.2
    return -min, -max
end


combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

local area = createCombatArea(arr)
combat:setArea(area)


function onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end


sorcerer

LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, 202)
combat:setFormula(COMBAT_FORMULA_LEVELMAGIC, -13, -13, -22, -22)
combat:setArea(createCombatArea(AREA_CROSS6X6))

function onGetFormulaValues(player, maglevel)
    local level = player:getLevel()
    local min = 400+maglevel*240.8 + level*8.8
    local max = 700+maglevel*280.1 + level*9.6
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end

tfs 1.3!
 
Solution
change the callback to CALLBACK_PARAM_LEVELMAGICVALUE
change onGetFormulaValues to this
function onGetFormulaValues(player, level, maglevel)
change the callback to CALLBACK_PARAM_LEVELMAGICVALUE
change onGetFormulaValues to this
function onGetFormulaValues(player, level, maglevel)
 
Solution
Back
Top