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
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: