• 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 Condition parameters

Aridez

New Member
Joined
May 9, 2015
Messages
3
Reaction score
0
Hi! I've been searching around and there's no place where the condition parameters are explained, I bet it's not that hard but some things I've tried just don't work. For example (using the strong haste spell that comes by default)
Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)

local condition = Condition(CONDITION_INVISIBLE)
condition:setParameter(CONDITION_PARAM_TICKS, 22000)
condition:setFormula(0.7, -56, 0.7, -56)
combat:setCondition(condition)

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

Changing CONDITION_HASTE for CONDITION_INVISIBLE as I expected turned the player invisible for 22 seconds (and I assume that the condition:setFormula in this case does nothing?). But when I change it and use
CONDITION_CURSED it does nothing at all.

Also in the enums in https://otland.net/threads/tfs-1-x-enums.225588/ I see there are "Condition Types" and "Condition Action Types", what's the difference between them? Is this explained somewhere I missed?

I'm using TFS 1.1
 
Last edited:
condition type gives the player the icon on the bar under the eq, condition action type is what should be happening with the condition / what should be happening to the player.
setting formula to a condition that does no damage isn't going to work lol
 
You don't need set formula. You can add a damage condition like so:

Code:
local condition = CONDITION_CURSED 
condition:addDamage(10, 1000, 20) -- how many ticks, how long inbetween ticks in ms, damage; this will deal 20 cursed damage once every second for 10 turns.
combat:setCondition(condition)
 
Back
Top