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

Solved SOLVED Help on error function.setcondition error console

wafuboe

Member
Joined
Dec 24, 2010
Messages
881
Solutions
2
Reaction score
22
Hello Im recently updating my server to the newer TFS 1.4.2
On some spells im having this error console,
i try to replace set to add but it always giving me errors when i do that, so i dont know what exactly i need to edit so the error doesnt show up.

Thank you in advance

condition error.PNG

Heres the sample of my script daggers script

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_THROWINGKNIFE)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)

local condition = Condition(CONDITION_ENERGY)
condition:setParameter(CONDITION_PARAM_DELAYED, true)
condition:addDamage(10, 10000, -25)
combat:setCondition(condition)

function onGetFormulaValues(player, skill, attack, factor)
    local distSkill = player:getEffectiveSkillLevel(SKILL_DISTANCE)
    local min = (player:getLevel() / 5) + distSkill * 2
    local max = (player:getLevel() / 5) + distSkill + 3
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end
 
Solution
this should work:
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_THROWINGKNIFE)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)

local condition = Condition(CONDITION_ENERGY)
condition:setParameter(CONDITION_PARAM_DELAYED, true)
condition:addDamage(10, 10000, -25)
combat:addCondition(condition)

function onGetFormulaValues(player, skill, attack, factor)
    local distSkill = player:getEffectiveSkillLevel(SKILL_DISTANCE)
    local min = (player:getLevel() / 5) + distSkill * 2
    local max = (player:getLevel() / 5) + distSkill + 3
    return -min, -max
end...
this should work:
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_THROWINGKNIFE)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)

local condition = Condition(CONDITION_ENERGY)
condition:setParameter(CONDITION_PARAM_DELAYED, true)
condition:addDamage(10, 10000, -25)
combat:addCondition(condition)

function onGetFormulaValues(player, skill, attack, factor)
    local distSkill = player:getEffectiveSkillLevel(SKILL_DISTANCE)
    local min = (player:getLevel() / 5) + distSkill * 2
    local max = (player:getLevel() / 5) + distSkill + 3
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

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

line 10,
Code:
combat:setCondition(condition)
this func is renamed in newer tfs
its not even an error, just a warning that you are using old function name, not a big deal but who wanna 400 warnings in console.
 
Solution
Back
Top