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

Teleport Spell/Rune that tp you anywhere you see on your screen.

Misticoo

New Member
Joined
Dec 9, 2011
Messages
13
Reaction score
0
Hi guys,
So i've been looking for this spell script for ages, honestly like few months... So basically i am looking for a script for a spell that will either teleport you 'x' steps forward just like the God's command /a 'x'... or a rune that will move you anywhere on the screen but not mountains and other peoples houses, it'd be cool if the rune was never ending.
Ps. Please move to the right thread if needed.
@Edit.
The prefix is 8.54 or if it just worked on TFS 0.3.6 :')
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

function onCastSpell(cid, var)

    local pos = getClosestFreeTile(cid, getPosByDir(getCreaturePosition(cid), getCreatureLookDirection(cid), 2), false, false)
    if(not pos or isInArray({pos.x, pos.y}, 0)) or (getTilePzInfo(pos)) or not isWalkable(pos) then
        doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
        return false
    end
    local cpos = getCreaturePosition(cid)
    if(doTeleportThing(cid, pos, true)) then
        doSendMagicEffect(pos, CONST_ME_TELEPORT)
    end
    return doCombat(cid, combat, var)
end

Function for isWalkable by Nord:

Code:
function isWalkable(pos, creature, proj, pz)-- by Nord
    if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
    if getTopCreature(pos).uid > 0 and creature then return false end
    if getTileInfo(pos).protection and pz then return false, true end
    local n = not proj and 3 or 2
    for i = 0, 255 do
        pos.stackpos = i
        local tile = getTileThingByPos(pos)
        if tile.itemid ~= 0 and not isCreature(tile.uid) then
            if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
                return false
            end
        end
    end
    return true
end
 
Its an instant spell.


Code:
    <instant name="Teleport" words="teleport" magiclevel="0" mana="0" prem="0" aggressive="0" selftarget="1" exhaustion="2000" needlearn="0" event="script" value="teleport.lua">
        <vocation id="1"/>
        <vocation id="5"/>
    </instant>
 
Try add the script for a rune and see if it works.

Code:
<rune name="xx" id="xx" allowfaruse="1" charges="1" magiclevel="xx" exhaustion="2000" blocktype="solid" event="script" value=xx.lua"/>
 
Thanks, i really can't be bothered with doing this right now as it's really late and i need to get some sleep. I'll do it when i get up.
 
Back
Top