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

A stun in tibia.

Chaos ruler

New Member
Joined
Dec 1, 2008
Messages
73
Reaction score
0
Location
The Netherlands
Hello!

First of all.. I'm creating a custom server and i am full of ideas.. But! There is a problem with one of the spells that i tried to create. The spell is called " Blind-Stun ". It's a spell that stun-locks a target. With a stun lock i mean " Can't be moved, use spells or attack/heal. Now this sounds interesting but I'm afraid that I won't be able to script it on my own.

I've already been looking on (**-fans and otland ) but there aren't really specific scripts for this.

The problem is It stuns myself instead of the target.

I would like to Stun my target for 4 seconds with a cooldown of 1 minute.

Now this is what i have..

Code:
local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
    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)
      doTargetCombatCondition(0, target, exhausted, CONST_ME_MAGIC_RED)
	  local exhausted = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhausted, CONDITION_PARAM_TICKS,4000)
doCreatureSetNoMove(cid, true) 
addEvent(doCreatureSetNoMove, 4000, cid, false)
    return doCombat(cid, combat, var)
end


I know the spell isn't tagged etcetera.. I first wanted to get this spell done.
So i would really appreciate your help!

Reputation for the one that tries to help me!

Thanks in advance,

Ch@os~

PS: i might messed up the scripts a little bit, since i changed it 1000000 times.
 
Code:
local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
    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 = variantToNumber(var)	
    doTargetCombatCondition(0, target, exhausted, CONST_ME_MAGIC_RED)
	local exhausted = createConditionObject(CONDITION_EXHAUST)
	setConditionParam(exhausted, CONDITION_PARAM_TICKS,4000)
	
	doCreatureSetNoMove(target, true) 
	addEvent(doCreatureSetNoMove, 4000, target, false)
	
    return doCombat(cid, combat, var)
end
 
Code:
local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
    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 = variantToNumber(var)	
    doTargetCombatCondition(0, target, exhausted, CONST_ME_MAGIC_RED)
	local exhausted = createConditionObject(CONDITION_EXHAUST)
	setConditionParam(exhausted, CONDITION_PARAM_TICKS,4000)
	
	doCreatureSetNoMove(target, true) 
	addEvent(doCreatureSetNoMove, 4000, target, false)
	
    return doCombat(cid, combat, var)
end

Hey!

That was a fast reply. I've already tried the same but no result. It doesn't work. It still moves.
 
I'm using the latest TFS. And i copied your script, but no result. No stun.

<instant name="~~~~" words="~~~~" lvl="8" mana="35" prem="1" range="1" casterTargetOrDirection="1" blockwalls="1" exhaustion="1000" needlearn="0" event="script" value="~~~~">
<vocation id="1"/>
</instant>

Maybe there is something wrong here?


I've made ~~~~ since it doesn't matter!

And yes you have 100 mana on level 8. Still i think it's good, i don't see a problem.
I'm really trying for hours now. Since i want to get this job done! My scripting skills
ain't good enough to solve this. I don't have enough knowledge. I Really appreciate your help
but I hope someone else can come up with a solution.
 
Code:
	<instant name="Energy Strikea" words="exori visx" lvl="12" mana="20" prem="1" range="3" casterTargetOrDirection="1" blockwalls="1" exhaustion="2000" needlearn="1" event="script" value="damdam.lua">
		<vocation id="1"/>
		<vocation id="2"/>
		<vocation id="5"/>
		<vocation id="6"/>
		
		<vocation id="0"/>
	</instant>

Thats what I made :p
 
Hmm! Ok.. well mine doesn't work at all. I can use the spell see effects but no result in stunning it. It doesn't give a silence either. Damn.. I didn't know this was so hard!
let's hope i'll get a solution fast hehe!

@up: Could you edit it in my script? Since my edits ain't working.
 
What should i change then?

Code:
function onCastSpell(cid, var)
	
	local target = variantToNumber(var)	
    doTargetCombatCondition(0, target, exhausted, CONST_ME_MAGIC_RED)
	local exhausted = createConditionObject(CONDITION_EXHAUST)
	setConditionParam(exhausted, CONDITION_PARAM_TICKS,4000)
	
	doCreatureSetNoMove(target, true) 
	addEvent(doCreatureSetNoMove, 4000, target, false)
	
    return doCombat(cid, combat, var)
end
 
Lua:
function onCastSpell(cid, var)
	
	local target = getCreatureTarget(cid)	
    doTargetCombatCondition(0, target, exhausted, CONST_ME_MAGIC_RED)
	local exhausted = createConditionObject(CONDITION_EXHAUST)
	setConditionParam(exhausted, CONDITION_PARAM_TICKS,4000)
	
	doCreatureSetNoMove(target, true) 
	addEvent(doCreatureSetNoMove, 4000, target, false)
	
    return doCombat(cid, combat, var)
end
Save and test.
 
Is there not a way to recreate this script? I mean i thought in lua this would be easy. Is there no one else that made this script before?
I really appreciate your help KylerXX and Tarielle.
 
Back
Top