• 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 0.X Paralyze Rune like RL [0.3.7]

OTcreator

Active Member
Joined
Feb 14, 2022
Messages
425
Solutions
1
Reaction score
44
Hello!
I need paralyze rune like RL (or with exhaustion).
I found this but for TFS 1.X. I need for TFS 0.3.7.

Lua:
function onCastSpell(creature, var)
local target = creature:getTarget()
    if not target then
        creature:sendCancelMessage("You need to target creature first.")
        creature:getPosition():sendMagicEffect(CONST_ME_POFF)
        return false
    end

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(0, -(target:getSpeed()) + 80, 0, -(target:getSpeed()) + 80)
    combat:addCondition(condition)

    if not combat:execute(creature, var) then
        return false
    end
    creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
    return true
end
 
Hello!
I need paralyze rune like RL (or with exhaustion).
I found this but for TFS 1.X. I need for TFS 0.3.7.

Lua:
function onCastSpell(creature, var)
local target = creature:getTarget()
    if not target then
        creature:sendCancelMessage("You need to target creature first.")
        creature:getPosition():sendMagicEffect(CONST_ME_POFF)
        return false
    end

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(0, -(target:getSpeed()) + 80, 0, -(target:getSpeed()) + 80)
    combat:addCondition(condition)

    if not combat:execute(creature, var) then
        return false
    end
    creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
    return true
end
try this:

XML
XML:
    <rune name="Paralyze" id="2278" allowfaruse="1" charges="1" maglv="18" exhaustion="1300" mana="900" needtarget="1" blocktype="solid" event="script" value="support/paralyze rune.lua">
        <vocation name="Druid"/>
        <vocation id="6" showInDescription="1"/>
    </rune>


LUA
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(condition, -0.9, 0, -0.9, 0)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
    if(not doCombat(cid, combat, var)) then
        return false
    end

    doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_GREEN)
    return true
end
 
try this:

XML
XML:
    <rune name="Paralyze" id="2278" allowfaruse="1" charges="1" maglv="18" exhaustion="1300" mana="900" needtarget="1" blocktype="solid" event="script" value="support/paralyze rune.lua">
        <vocation name="Druid"/>
        <vocation id="6" showInDescription="1"/>
    </rune>


LUA
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(condition, -0.9, 0, -0.9, 0)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
    if(not doCombat(cid, combat, var)) then
        return false
    end

    doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_GREEN)
    return true
end
No, this is bad script. This is not the same script with changespeed player...
 
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(condition, -getCreatureSpeed(target) + 80, -getCreatureSpeed(target) + 80)
setCombatCondition(combat, condition)

function onCastSpell(creature, variant)
    local target = creature:getTarget()
    if not target then
        doCreatureSay(creature, "You need to target a creature first.", TALKTYPE_ORANGE_1)
        doSendMagicEffect(getThingPosition(creature), CONST_ME_POFF)
        return false
    end

    if not doCombat(creature, combat, variant) then
        return false
    end

    doSendMagicEffect(getThingPosition(creature), CONST_ME_MAGIC_GREEN)
    return true
end
Test it out to see if it works. I just converted to version 0.3.7
 
Last edited:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(condition, -getCreatureSpeed(target) + 80, -getCreatureSpeed(target) + 80)
setCombatCondition(combat, condition)

function onCastSpell(creature, variant)
    local target = creature:getTarget()
    if not target then
        doCreatureSay(creature, "You need to target a creature first.", TALKTYPE_ORANGE_1)
        doSendMagicEffect(getThingPosition(creature), CONST_ME_POFF)
        return false
    end

    if not doCombat(creature, combat, variant) then
        return false
    end

    doSendMagicEffect(getThingPosition(creature), CONST_ME_MAGIC_GREEN)
    return true
end
Test it out to see if it works. I just converted to version 0.3.7

Not working.
First: local target = creature:getTarget()

But I edit this and nothing...
 
This creature:getTarget() function is from TFS 1.x and up. Here I use the TFS 0.3.7 compatible getCreatureTarget function. Let's see what happens

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(condition, -getCreatureSpeed(getCreatureTarget(creature)) + 80, -getCreatureSpeed(getCreatureTarget(creature)) + 80)
setCombatCondition(combat, condition)

function onCastSpell(creature, variant)
    local target = getCreatureTarget(creature)
    if not target then
        doCreatureSay(creature, "You need to target a creature first.", TALKTYPE_ORANGE_1)
        doSendMagicEffect(getCreaturePosition(creature), CONST_ME_POFF)
        return false
    end

    if not doCombat(creature, combat, variant) then
        return false
    end

    doSendMagicEffect(getCreaturePosition(target), CONST_ME_MAGIC_GREEN)
    return true
end
 
This creature:getTarget() function is from TFS 1.x and up. Here I use the TFS 0.3.7 compatible getCreatureTarget function. Let's see what happens

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(condition, -getCreatureSpeed(getCreatureTarget(creature)) + 80, -getCreatureSpeed(getCreatureTarget(creature)) + 80)
setCombatCondition(combat, condition)

function onCastSpell(creature, variant)
    local target = getCreatureTarget(creature)
    if not target then
        doCreatureSay(creature, "You need to target a creature first.", TALKTYPE_ORANGE_1)
        doSendMagicEffect(getCreaturePosition(creature), CONST_ME_POFF)
        return false
    end

    if not doCombat(creature, combat, variant) then
        return false
    end

    doSendMagicEffect(getCreaturePosition(target), CONST_ME_MAGIC_GREEN)
    return true
end

Sorry, not working.
This script work, but not change speed:

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 19000)

setCombatCondition(combat, condition)

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, 20000)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 10000)
setCombatCondition(combat, exhaust)

function onCastSpell(cid, var)
    setConditionFormula(condition, 0, -(getCreatureSpeed(cid) + 50), 0, -(getCreatureSpeed(cid) + 50))
    return doCombat(cid, combat, var)
end
 
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

function onCastSpell(cid, var)
local detectspeed = getCreatureSpeed(getTopCreature(variantToPosition(var)).uid)
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
setConditionFormula(condition, 0, -(detectspeed + 80), 0, -(detectspeed + 80))
setCombatCondition(combat, condition)
doAddCondition(getTopCreature(variantToPosition(var)).uid, condition)
     return doCombat(cid, combat, var)
end
 
If it doesn't work above, you can try changing it here.
change
setConditionFormula(condition, 0, -(getCreatureSpeed(cid) + 50), 0, -(getCreatureSpeed(cid) + 50))

per
setConditionFormula(condition, -getCreatureSpeed(cid) + 20, -getCreatureSpeed(cid) + 20, -getCreatureSpeed(cid) + 20, -getCreatureSpeed(cid) + 20)
 
Not working.
This script works, add paralyze icon, but not change target speed.

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 19000)

setCombatCondition(combat, condition)

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, 20000)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 10000)
setCombatCondition(combat, exhaust)

function onCastSpell(cid, var)
    setConditionFormula(condition, 0, -(getCreatureSpeed(cid) + 50), 0, -(getCreatureSpeed(cid) + 50))
    return doCombat(cid, combat, var)
end
 
Back
Top