• 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 Spell Rune Function doChangeSpeed

JohnColner

New Member
Joined
Mar 16, 2013
Messages
23
Reaction score
1
I need this rune to change the speed of the player reached to 200 for 3 seconds

Code:
configSlow = {
                players = {
                    speed = 200 -- speed which players will have in event
                },
}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, false)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 41)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 12)

local condition = createConditionObject(CONDITION_OUTFIT)
setConditionParam(condition, CONDITION_PARAM_TICKS, 3 * 1000)
setConditionParam(condition, CONDITION_PARAM_SUBID, 8)
addOutfitCondition(condition, {lookType = 0, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 7172, lookAddons = 0})
setCombatCondition(combat, condition) 

-- local slow = createConditionObject(CONDITION_PARALYZE)
-- setConditionParam(slow, CONDITION_PARAM_TICKS, 3 * 1000)
-- setConditionParam(slow, CONDITION_PARAM_SUBID, 2)
-- setConditionFormula(slow, -0.9, 100, -0.9, 100)
-- setCombatCondition(combat, slow) 
 t1 = 1000
t2 = 1000
t3 = 1000

function effect(cid)
if not isCreature(cid) then
return false
end
    local targ = getCreatureTarget(cid)
if not isCreature(targ) then
return false
end
    doSendMagicEffect(getThingPos(targ), CONST_ME_SLEEP)
end

function onTargetCreature(cid, target)
     if target then
         local target = getCreatureTarget(cid)
        doAddCondition(target, condition)
        end
     return true
end


setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")


function onCastSpell(cid, var)   
    local target2 = getCreatureTarget(cid)
    local speed = getCreatureSpeed(target2)
    doChangeSpeed(target2, -speed) 
    addEvent(doChangeSpeed, 350, target2, speed) 

    addEvent(effect,t1,cid)
    addEvent(effect,t2,cid)   
    addEvent(effect,t3,cid)   
    return doCombat(cid, combat, var)
end
     
     
-- function onCastSpell(cid, var)
-- local target = getCreatureTarget(cid)
-- local speed = getCreatureSpeed(target)
    -- doChangeSpeed(target, -speed)
    -- doAddCondition(target, paralyze)
    -- doAddCondition(target, muted)
    -- doAddCondition(target, pacified)
    -- doAddCondition(target, exhaust)
    -- addEvent(doChangeSpeed, 4000, target, speed)
    -- addEvent(effect,t1,cid)
    -- addEvent(effect,t2,cid)
    -- return doCombat(cid, combat, var)
-- end     
     
     
-- end

    -- local target = getCreatureTarget(cid)
    -- local speed = getCreatureSpeed(target)
    -- doChangeSpeed(target, -speed) 
    -- addEvent(doChangeSpeed, 4000, target, speed)
    -- doAddCondition(target, paralyze)
    -- doAddCondition(target, muted)
    -- doAddCondition(target, pacified)
    -- doAddCondition(target, exhaust)
    -- for j = 0, 4 do
        -- addEvent(effect, 1000)
    -- end
       
    -- return doCombat(cid, combat, var)
-- end
 
Back
Top