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

Spell Boomerang Step

Evan

A splendid one to behold
Senator
Premium User
Joined
May 6, 2009
Messages
7,019
Solutions
1
Reaction score
1,029
Location
United States

I will be releasing all of my "mini-scripts" over the course of the next two months.
I have approximately 70 of these scripts that would make your server unique.
You may visit my blog in my signature to view all scripts that have been released so far.


Boomerang Step

SFR_qu.gif

Please wait for animated GIF to finish loading

What does it do?
It is a spell for assassin-like vocations.
It teleports you to the targeted enemy and deals a damaging blow.
Then it teleports you back to your initial position, just like what a boomerang would do.

Installing the script:

Remember to change the damage, name, level, manacost, and other values if you wish.

Create a new Lua file in data/spells/scripts named boomerangstep and add the following:
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ASSASSIN)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_NONE)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -10, -1, -20, 5, 5, 1.4, 2.1)

local function delayedTeleport(cid, position)
	if(not isCreature(cid)) then return true end
	doTeleportThing(cid, position)
	return true
end

function onCastSpell(cid, var)
	addEvent(delayedTeleport, 500, cid, getCreaturePosition(cid))
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	doTeleportThing(cid, getThingPos(variantToNumber(var)), true)
	return doCombat(cid, combat, var)
end

In spells.xml, add the following lines:
XML:
<instant name="Boomerang Step" words="insinuendi" lvl="50" mana="20" prem="1" range="4" casterTargetOrDirection="1" blockwalls="1" exhaustion="2000" groups="1,2000" icon="88" needlearn="0" event="script" value="boomerangstep.lua">
        <vocation id="3"/>
        <vocation id="7"/>
    </instant>

BIG Thanks to Xagul for helping me on this and reducing my initial code
 
Last edited:
This will work better than what I currently have to recreate my Sephiroth monster ;)

Red
 
Pretty sure I'm just using an older version of TFS, but when I tried to compile and use this code I'm getting two different errors.

"Attempt to index a boolean value
Stack traceback:
[C]: in function 'doTeleportThing'
data/spells/scripts/custom/boomerangstep.lua:16: in function <data/spells/scripts/custom/boomerangstep.lua:13>"


and, in-game, "This target is not reachable", in plain land.

Any ideas? Thanks in advance.
 
How could i avoid this error?
90515c36b65a4ea5bf26ae6.png
It's caused when you use the spell without the attacking anyone.

I don't wanna to disable this, i just want to remove the error logging in my console.
_________________________________________________________________________________
NICE SCRIPT ++
 
When i tried the character i played on got teleported instead of target. :O
 
Cool one. gonna use it in my ot. works till a maximum of 4 squares away from target. then it says creature not reachable.
 
Back
Top