• 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 player spell is useless

Tbol

Well-Known Member
Joined
Apr 7, 2019
Messages
529
Reaction score
56
Hi,
I'm not at home but I have simple paralyze spell that I found in otland it just simple code that decrease the player speed, but it has one problem it's really useless if I have spell that gives speed it counters the paralyze spell and it takes that paralyze off which makes it useless. So does anyone have an idea how to make paralyze spell more useful like not allow to use speed spell if you are paralyzed it would have like a cooldown to use speed spell or I don't know need something that would make it more useful. If anyone could provide a code I would be grateful

TFS 1.2
 
Solution
?
Paralyze
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, 28)

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

local config = {
       storage = 11312,
       cooldown = 2
}

function onCastSpell(creature, variant, isHotkey)
    if not combat:execute(creature, variant) then
        setPlayerStorageValue(cid, config.storage, os.time())
        return false
    end

    return true
end
speed
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, 28)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)

local condition = Condition(CONDITION_HASTE)...
?
Paralyze
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, 28)

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

local config = {
       storage = 11312,
       cooldown = 2
}

function onCastSpell(creature, variant, isHotkey)
    if not combat:execute(creature, variant) then
        setPlayerStorageValue(cid, config.storage, os.time())
        return false
    end

    return true
end
speed
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, 28)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)

local condition = Condition(CONDITION_HASTE)
condition:setParameter(CONDITION_PARAM_SHOWICON, true)
condition:setParameter(CONDITION_PARAM_TICKS, 33000)
condition:setFormula(0.0, -0, 1.0, -56)
combat:setCondition(condition)

function onCastSpell(cid, var)
    if(os.time() - getPlayerStorageValue(cid, config.storage)) < config.cooldown then
    doPlayerSendCancel(cid, "You can use it just one time every 2 sec.")
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
    end
    combat:execute(cid, var)
    return false
end

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

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

local config = {
       storage = 11312, -- storage
       cooldown = 2 * 1000, --time in miliseconds
}

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

    local targetPlayer = Player(var.number)
    if targetPlayer then
        targetPlayer:setStorageValue(config.storage, os.mtime() + config.cooldown)
    end
    return true
end

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, 28)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, false)

local condition = Condition(CONDITION_HASTE)
condition:setParameter(CONDITION_PARAM_SHOWICON, true)
condition:setParameter(CONDITION_PARAM_TICKS, 33000)
condition:setFormula(0.0, -0, 1.0, -56)
combat:setCondition(condition)

local config = {
    storage = 11312, -- storage
    cooldown = 2 * 1000, --time in miliseconds
}

function onCastSpell(creature, var)
    if creature:getStorageValue(config.storage) >= os.mtime() then
        return false
    end

    return combat:execute(creature, var)
end
 
Solution
Back
Top