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

Stunning Spell

You can use this to stun a person, don't know what else you want in the spell
Lua:
local target = getCreatureTarget(cid)
doCreatureSetNoMove(target, true)

addEvent(doCreatureSetNoMove, 4000, target, false)
 
Last edited:
it doesn't work

Code:
[23:43:08.393] [Error - Spell Interface]
[23:43:08.393] In a timer event called from:
[23:43:08.393] data/spells/scripts/atak/stun.lua:onCastSpell
[23:43:08.393] Description:
[23:43:08.394] (luaDoCreatureSetNoMove) Creature not found

this is my script:
Code:
local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
    setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
    setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN)
    setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)	

function onCastSpell(cid, var)
	
	local target = getCreatureTarget(cid)
	doCreatureSetNoMove(target, true)
	addEvent(doCreatureSetNoMove, 4000, target, false)

    return doCombat(cid, combat, var)
end

and xml:
Code:
<instant name="Stun" words="stun" lvl="1" mana="1" prem="0" range="3" casterTargetOrDirection="1" blockwalls="1" exhaustion="2000" needlearn="0" event="script" value="atak/stun.lua">
		<vocation id="2"/>
	</instant>
 
~~~
XML:
<instant name="Stun" words="stun" lvl="1" mana="1" prem="0" range="3" needtarget="1" blockwalls="1" exhaustion="2000" needlearn="0" event="script" value="atak/stun.lua">
	<vocation id="2"/>
</instant>
 
Ok, i wrote this script on my own and it works(on monsters too), if someone need that:
Code:
local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
    setCombatParam(combat, COMBAT_PARAM_BLOCKSHIELD, 1)
    setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_STUN)
    setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0)	

local paralyze = createConditionObject(CONDITION_PARALYZE)
setConditionParam(paralyze, CONDITION_PARAM_TICKS, 4000)
 
local muted = createConditionObject(CONDITION_MUTED)
setConditionParam(muted, CONDITION_PARAM_TICKS, 4000)

local pacified = createConditionObject(CONDITION_PACIFIED)
setConditionParam(pacified, CONDITION_PARAM_TICKS, 4000)

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 4000)

function onCastSpell(cid, var)
	
	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)
       
    return doCombat(cid, combat, var)
end
and xml:
Code:
<instant name="Stun" words="stun" lvl="20" mana="70" prem="0" range="5" needtarget="1" blockwalls="1" exhaustion="20000" needlearn="1" event="script" value="atak/stun.lua">
		<vocation id="2"/>
	</instant>
 
Back
Top