• 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 Shinra Tensei: Repel them!

thx it works perfectly but could u make the area like exori's area not only the target that is infront of you
 
Last edited:
u can help me with that? actually only u had thead about repel spells.. i want some skill like exori con with repel

have a nice day :p
 
jeje xD ups hmm i need help with one repel spell. i want look like "exori con" but with repel one or two square to target :) thanks 4 all

omg fast reply xD
 
hey guys cant u fix my request? i want the area that the player repels ppl on to be like exori's area
 
ahm yes, thanks for the bug reports
i'll post it soon as you have requested it, working on it atm
 
this is v3 (beta). only for tests tho, not 100% yet

Lua:
function onCastSpell(cid, var)
    local target = getThingfromPos(getPosByDir(getCreaturePosition(cid), getCreatureLookDirection(cid), 1))
    if isNpc(target.uid) or not isCreature(target.uid) then
        doPlayerSendCancel(cid, 'There\'s nobody to repel.')
        doSendMagicEffect(getCreaturePosition(cid), 2)
    return false
    end
       
    if doTileQueryAdd(target.uid, getPosByDir(getCreaturePosition(cid), getCreatureLookDirection(cid), 2)) == RETURNVALUE_NOTPOSSIBLE then
        doPlayerSendCancel(cid, 'There\'s something in the road that avoids you from repelling.')
        doSendMagicEffect(getCreaturePosition(cid), 2)
    return false
    end
    
    if getTileInfo(getCreaturePosition(target.uid)).protection or getTileInfo(getCreaturePosition(target.uid)).nopvp then
        doSendMagicEffect(getCreaturePosition(cid), 2)
    return false
    end

    doRepelCreature(cid, target.uid, getPlayerAccess(cid) == 1 and getRepelTiles(cid) or 99)
    return true
end

function getRepelTiles(cid)
local tile = {{20, 3},{40, 4},{60, 5},{80, 6},{100, 7},{120, 8}}
table.sort(tile, function(a, b) return a[1] > b[1] end)
    for _, t in ipairs(tile) do    
        if(getPlayerLevel(cid) >= t[1]) then
            return t[2]
        end
    end
    return tile[1][2]
end

--[[function getNextPos(cid, tiles)
p = getCreaturePosition(cid)
x,y,z = p.x,p.y,p.z
local places = {
  [0] = {x=x, y=(y-tiles), z=z, stackpos = 253},
  [1] = {x=(x+tiles), y=y, z=z, stackpos = 253},
  [2] = {x=x, y=(y+tiles), z=z, stackpos = 253},
  [3] = {x=(x-tiles), y=y, z=z, stackpos = 253}}
    return places[getPlayerLookDir(cid)]
end]]--

function doRepelCreature(cid, target, tiles)
    if doTileQueryAdd(target, getPosByDir(getCreaturePosition(cid), getCreatureLookDirection(cid), 2)) ~= RETURNVALUE_NOTPOSSIBLE then
        doCreatureSetLookDirection(target, getCreatureLookDirection(cid))
        repeat
            doTeleportThing(target, getPosByDir(getCreaturePosition(target), getCreatureLookDirection(target), 1), true)
            doSendMagicEffect(getCreaturePosition(target), CONST_ME_GROUNDSHAKER)
            tiles = tiles - 1
        until tiles == 0 or doTileQueryAdd(target, getPosByDir(getCreaturePosition(target), getCreatureLookDirection(target), 1)) == RETURNVALUE_NOTPOSSIBLE
    end
end
 
Last edited:
third version of the script
and other ppl have requested the same :p
 
PZ Locked in PZ?

Apparently I can Repel someone into protection zone when they're PZ Locked...Is there anyway you could fix that for me? :) I tried fixing it myself but I'm not the best at scripting... :(
 
Apparently I can Repel someone into protection zone when they're PZ Locked...Is there anyway you could fix that for me? :) I tried fixing it myself but I'm not the best at scripting... :(
sureh
 
Back
Top