• 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 Paralyze rune

Zoolek

Member
Joined
Jul 3, 2017
Messages
88
Solutions
1
Reaction score
9
Hey i want paralyze rune work as "speedchange -500" instaed of "paralyze"
just like monsters example:
I want something like this:
<attack name="speed" interval="1000" chance="8" target="1" speedchange="-500" duration="60000"> -- something like this i want

This V suck:
<attack name="paralyze" interval="3000" chance="40" target="1">
<attribute key="areaEffect" value="redshimmer"/>
</attack>

I found something like this but doesnt work:
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
 
Last edited:
OP
OP
Zoolek

Zoolek

Member
Joined
Jul 3, 2017
Messages
88
Solutions
1
Reaction score
9
Well thats bad =d.
After i "paralyze" = "changespeed" someone
I want "paralyzed" player to have 50speed. Doesnt matter if its 500lv or 100lv. I want it to have 50speed
 
OP
OP
Zoolek

Zoolek

Member
Joined
Jul 3, 2017
Messages
88
Solutions
1
Reaction score
9
Found something like this but it doesnt work =/
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
 

a Shadou

New Member
Joined
Oct 22, 2020
Messages
13
Reaction score
4
Location
Poland
I will share my code.
This script will always set movement speed to 40, doesn't matter if you have any bonus movement speed from items, mounts or spells.
Don't add dispel haste condition, because if you dispel haste, it will instantly remove players speed to minimum and he won't be able to move.
This script needs target so you can't use paralyze rune on battle list without marking the target.
If you want set movement speed to 50, just change + 80 to + 100.
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
 
Last edited:
Top