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

Paralyze rune like RL, TFS 1.3

darkjav

Senior Developer
Joined
Apr 29, 2008
Messages
195
Reaction score
12
Location
Mexico City
Hi, i'm trying to make a paralyze rune like Tibia Rl, this should work as follows:

If the player have equipment that increases the speed, for example prismatic armor, grasshopper legs, boots of haste, time of ring, etc.

Then the paralyze rune must decrease speed to 40, and if the player does not have any equipment that raises the speed, he must also decrease to 40

Does not matter if player have equipment or not.

Code:

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 20000)
--condition:setFormula(-1, 80, -1, 80)
condition:setFormula(-1, ((creature:getSpeed() * 0) + 80), -1, ((creature:getSpeed() * 0) + 80))
combat:setCondition(condition)

function onCastSpell(creature, variant, isHotkey)
    if not combat:execute(creature, variant) then
        return false
    end

    creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
    return true
end

But i get error:

Lua Script Error: [Test Interface]
data/spells/scripts/support/paralyze rune.lua
data/spells/scripts/support/paralyze rune.lua:7: attempt to index global 'creature' (a nil value)
stack traceback:
[C]: in function '__index'
data/spells/scripts/support/paralyze rune.lua:7: in main chunk
[C]: in function 'reload'
data/talkactions/scripts/reload.lua:76: in function <data/talkactions/scripts/reload.lua:59>
[Warning - Event::checkScript] Can not load script: scripts/support/paralyze rune.lua

I appreciate your help, thanks.
 
Last edited:
of course it won't work, creature is out of the function scope
you need to put the condition:setFormula line inside onCastSpell
 
@Static_ Yes, i try, but not work, player get paralyze icon, but formula not applied.
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 20000)

combat:setCondition(condition)

function onCastSpell(creature, variant, isHotkey)
    if not combat:execute(creature, variant) then
        return false
    end

    condition:setFormula(-1, ((creature:getSpeed() * 0) + 80), -1, ((creature:getSpeed() * 0) + 80))
    creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
    return true
end

@Dnomyar That not work, not like rl.

Formula of TFS not is like to RL, is wrong, and all OTs have the same issue.
 
Last edited:
@Static_ Yes, i try, but not work, player get paralyze icon, but formula not applied.
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 20000)

combat:setCondition(condition)

function onCastSpell(creature, variant, isHotkey)
    if not combat:execute(creature, variant) then
        return false
    end

    condition:setFormula(-1, ((creature:getSpeed() * 0) + 80), -1, ((creature:getSpeed() * 0) + 80))
    creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
    return true
end

@Dnomyar That not work, not like rl. I wanna put speed to 0, and later add 40.

Formula of TFS not is like to RL, is wrong, and all OTs have the same issue.
you're multiplying the player's speed by 0 for absolutely no reason
ANY value multipled by 0 is always 0, you don't need creature:getSpeed() for this
your max values for the condition will always be 80 just like the script he posted
if you want to set the player's speed to 0, i'm pretty sure you just need to use 0, 0, 0, 0
and use addEvent to set creature speed back to 40 or whatever you're trying to accomplish
i still don't exactly understand
 
@Static_
Ok, maybe i need use another way, but the paralyze rune not work like RL.

Steps to reproduce
1.- Player use paralyze rune in another player with equipment that raises speed, for example boots of haste, time of ring, etc.
2.- Targeted player get decreased speed, but not to 40.

Only work if the player not have equipment of speed.

You understand me now?
 
@Static_ Yes, i get speed 40 when paralyzed player not have any equipment that raises the speed.
But if player have in the set prismatic armor, grasshopper legs, boots of haste, time of ring, etc. Then the player not decrease speed to 40.

And the idea is that it should work just like Tibia RL.

Then this code not work how intended.

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 20000)
condition:setFormula(-1, 80, -1, 80)
combat:setCondition(condition)

function onCastSpell(creature, variant, isHotkey)
    if not combat:execute(creature, variant) then
        return false
    end

    creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
    return true
end
 
I have researched this rune on some recent update on rl (the otherworld stuff), but you got me now. All I remember is that the target speed is decreased to 40 independently of target's (a player) base speed. Unfortunately, I don't remember nor have I noted down if it is still decreased to 40 even if it's wearing items with speed attribute.

If you can make a video (rl) showing those particularities, I can later make a pr (hoping it'll be trivial xD) fixing it on tfs.
 
Last edited:
Did you solve this???
I have this problem aswell!

and also if you are Hasted before being paralyzed you still have the Haste Speed, paralyze rune only decrease the base speed, not Attribute speed or spell speed, i want it to set down all speed to same value with or without haste/items that gives haste.
 
Back
Top