• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Spell ShinraTensei/BanshoTenin: Draw 'n Repulse BETA80%

hodleo

Formerly cbrm -Crypto enthusiast, Retired scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,598
Solutions
3
Reaction score
955
Location
Caribbean Sea
2yytst3.jpg

TESTED ON TFS 0.2.5
Well these spells do the same thing as Deva Pain's jutsus
Of course both haven't been completed though now they work well

First one repels the player in front of you from 1 to 7 tiles away from you, won't repel if there is something on the way, and won't pierce anything

Second one draws player from 4 tiles away to your pos, works as last one.

I will be greeted if anyone adds damage based on fist skill. These are other bugs I need to fix:
-Player is repeled and is placed over holes(wtf? what happend with isPosClear?)
-Maybe another bug I forgot
-Shorten the loops and/or the script
I didn't add it to requests since it is a release and I wanted everyone to check it out

Greetings to Colandus for his function isPositionFree(pos)

add to global.lua/function.lua

Lua:
function checkForward(cid, tile)
ppos = getCreaturePosition(cid)
zz = ppos.z
yy = ppos.y
xx = ppos.x

    if getPlayerLookDir(cid) == 3 then ---LOOKING LEFT
        c = {x=(xx-tile), y=yy, z=zz, stackpos = 253}
    elseif getPlayerLookDir(cid) == 1 then ---LOOKING RIGHT
        c = {x=(xx+tile), y=yy, z=zz, stackpos = 253}
    elseif getPlayerLookDir(cid) == 2 then ---LOOKING UP
        c = {x=xx, y=(yy+tile), z=zz, stackpos = 253}
    elseif getPlayerLookDir(cid) == 0 then ---LOOKING DOWN
        c = {x=xx, y=(yy-tile), z=zz, stackpos = 253}
    end
    return c
end

function isPosClear(pos)
        local thing = getTopCreature(pos)
        if isCreature(thing.uid) == FALSE and getTilePzInfo(pos) == FALSE then
                pos.stackpos = 0
                thing = getThingfromPos(pos)
                
                if thing.uid > 0 then
                        while hasProperty(thing.uid, CONST_PROP_BLOCKINGANDNOTMOVEABLE) == FALSE do
                                pos.stackpos = pos.stackpos + 1
                                thing = getThingfromPos(pos)
                                
                                if thing.uid == FALSE then
                                        return TRUE
                                end
                        end
                end
        end
        return FALSE
end
shinratensei.lua (7tiles)

Lua:
function doRepelCreature(cid, pos)
if isPosClear(pos) then
doTeleportThing(cid,pos,TRUE)
doSendMagicEffect(pos, CONST_ME_GROUNDSHAKER)
magnet = getThingfromPos(pos)
end
return LUA_NO_ERROR
end

function onCastSpell(cid, var)

--SHORTENING CHECKS
c1 = checkForward(cid, 1)
c2 = checkForward(cid, 2)
c3 = checkForward(cid, 3)
c4 = checkForward(cid, 4)
c5 = checkForward(cid, 5)
c6 = checkForward(cid, 6)
c7 = checkForward(cid, 7)
s1 = isPosClear(c1)
s2 = isPosClear(c2)
s3 = isPosClear(c3)
s4 = isPosClear(c4)
s5 = isPosClear(c5)
s6 = isPosClear(c6)
s7 = isPosClear(c7)
magnet = getThingfromPos(c1)

if isPlayer(magnet.uid) == TRUE and getTilePzInfo(getCreaturePosition(cid)) == FALSE then
if s2 == TRUE then
doRepelCreature(magnet.uid, c2)
end
if s2 == TRUE and s3 == TRUE then
doRepelCreature(magnet.uid, c3)
end
if s2 == TRUE and s3 == TRUE and s4 == TRUE then
doRepelCreature(magnet.uid, c4)
end
if s2 == TRUE and s3 == TRUE and s4 == TRUE and s5 == TRUE then
doRepelCreature(magnet.uid, c5)
end
if s2 == TRUE and s3 == TRUE and s4 == TRUE and s5 == TRUE and s6 == TRUE then
doRepelCreature(magnet.uid, c6)
end
if s2 == TRUE and s3 == TRUE and s4 == TRUE and s5 == TRUE and s6 == TRUE and s7 == TRUE then
doRepelCreature(magnet.uid, c7)
end
else
doPlayerSendCancel(cid,"There is no one to repel.")
doSendMagicEffect(ppos,2)
return LUA_ERROR
end
end

banshotenin.lua
Lua:
function doDrawCreature(cid, pos, effect) 
if isPosClear(pos) then
    doTeleportThing(cid,pos,TRUE) 
    doSendMagicEffect(pos, effect)
    close = getThingfromPos(pos)
end
    return LUA_NO_ERROR
end

function onCastSpell(cid, var) 

--SHORTENING CHECKS
close = getThingfromPos(checkTile(cid, 4))
s1 = isPosClear(checkTile(cid, 1))
s2 = isPosClear(checkTile(cid, 2))
s3 = isPosClear(checkTile(cid, 3))
s4 = isPosClear(checkTile(cid, 4))

if isPlayer(close.uid) == TRUE and getTilePzInfo(getCreaturePosition(cid)) == FALSE then
    if s1 == FALSE and s2 == FALSE and s3 == FALSE then
    doPlayerSendCancel(cid,"Something is on the way.")
    doSendMagicEffect(ppos,2)
    end    
        if s3 == TRUE then
        doDrawCreature(close.uid, checkTile(cid, 3), CONST_ME_GROUNDSHAKER)
        end
        if s3 == TRUE and s2 == TRUE then
        doDrawCreature(close.uid, checkTile(cid, 2), CONST_ME_GROUNDSHAKER) 
        end
        if s3 == TRUE and s2 == TRUE and s1 == TRUE then
        doDrawCreature(close.uid, checkTile(cid, 1), CONST_ME_GROUNDSHAKER) 
        end
else
doPlayerSendCancel(cid,"There is no one to draw.")
doSendMagicEffect(ppos,2)
return LUA_ERROR 
end
    end

if u ask why the heck is tobi doing shinra tensei then he stole it from nagato^_^
 
Last edited:
@up post ur bug here so I can fix it :) that way you can help me improve the spell, I remember you that the spell is@70%
 
Thanks for giving credits. Nice spell and well done!

I could help you out with your bugs if you have problems with them. For the last bug (mana spending) you have to return LUA_ERROR and not FALSE.

First bug I'll try to fix isPosClear to accept a second parameter.
 
thnx colan, I need to add combat condition, or simply the attack when the player is repelled
 
:s i tested it on 0.2, but i'll fix it for 0.3 then :)
 
Last edited:
I would really apreciate it if you could fix it for 0.3.5pl1, and also make a mini video to see what it does :)
 
Heh, Seems good, But let me tell a thing ^^ The IsPosClear(pos) function needs some fixing. Since it can teleport inside stairs and holes.
 
@up I already knew that
how do I fix it for 0.2.5 and 0.3.5pl1? adding many items id checkings to the function?
 
Last edited:
really cool gonna use it once it works. good spell to use for a high mana cost to give the player a chance to escape a trap
 
that spell is an old experiment for tfs 0.2
data/global.lua
if you have tfs 0.3, look for my new shinra tensei spell
 
Back
Top