• 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+ How do you add simple aggresive condition to a action script

This is specifically for the battle sign. This will not pz lock the player.

I'm unsure which way it works.. so I'm posting two methods that seem reasonable.
LUA:
local fight = Condition(CONDITION_INFIGHT, CONDITIONID_DEFAULT)
fight:setParameter(CONDITION_PARAM_TICKS, 60000) -- 60 seconds

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    print("test 1")
    player:addCondition(fight)
    return true
end
LUA:
local fight = Condition(CONDITION_INFIGHT)
fight:setParameter(CONDITION_PARAM_SUBID, CONDITIONID_DEFAULT)
fight:setParameter(CONDITION_PARAM_TICKS, 60000)

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    print("test 2")
    player:addCondition(fight)
end
 
This is specifically for the battle sign. This will not pz lock the player.

I'm unsure which way it works.. so I'm posting two methods that seem reasonable.
LUA:
local fight = Condition(CONDITION_INFIGHT, CONDITIONID_DEFAULT)
fight:setParameter(CONDITION_PARAM_TICKS, 60000) -- 60 seconds

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    print("test 1")
    player:addCondition(fight)
    return true
end
LUA:
local fight = Condition(CONDITION_INFIGHT)
fight:setParameter(CONDITION_PARAM_SUBID, CONDITIONID_DEFAULT)
fight:setParameter(CONDITION_PARAM_TICKS, 60000)

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    print("test 2")
    player:addCondition(fight)
end
You mean about subid method and without?

LUA:
local fight = Condition(CONDITION_PARAM_SUBID, CONDITIONID_DEFAULT)

thats mean this specific condition will have subid with specific id that use int
CONDITIONID_DEFAULT, it can be any number to not "rewrite"

better explaination:

with script like this:

LUA:
local condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_DEFAULT)
condition:setParameter(CONDITION_PARAM_SKILL_CLUB, 10)

we are RE-WRTING every condition for CONDITION_ATTRIBUTES that use default subid
so if we make in another script

LUA:
local condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_DEFAULT)
condition:setParameter(CONDITION_PARAM_SKILL_CLUB, 15)

the previous code will be re-written to this one, so total of club skill will be increase to 15 or 10, it cant work together

but if we use different subid for each condition

LUA:
local condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_DEFAULT)
condition:setParameter(CONDITION_PARAM_SKILL_CLUB, 10)
condition:setParameter(CONDITION_PARAM_SUBID, 200)

LUA:
local condition = Condition(CONDITION_ATTRIBUTES, CONDITIONID_DEFAULT)
condition:setParameter(CONDITION_PARAM_SKILL_CLUB, 15)
condition:setParameter(CONDITION_PARAM_SUBID, 201)

when both condition's player will active he will receive +25 buff to skill club in this case
 
Last edited:
This is specifically for the battle sign. This will not pz lock the player.

I'm unsure which way it works.. so I'm posting two methods that seem reasonable.
LUA:
local fight = Condition(CONDITION_INFIGHT, CONDITIONID_DEFAULT)
fight:setParameter(CONDITION_PARAM_TICKS, 60000) -- 60 seconds

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    print("test 1")
    player:addCondition(fight)
    return true
end
LUA:
local fight = Condition(CONDITION_INFIGHT)
fight:setParameter(CONDITION_PARAM_SUBID, CONDITIONID_DEFAULT)
fight:setParameter(CONDITION_PARAM_TICKS, 60000)

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    print("test 2")
    player:addCondition(fight)
end
Worked perfectly
 
Back
Top