• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[Spell] Backstab & Invisible (Rogue)

Synergy

New Member
Joined
Nov 24, 2011
Messages
334
Reaction score
0
Hello guys!

I request 2 spells for my custom server.
An backstab spell that kinda "teleports" you behind the target from a distance of 3-4-5 sqm
And an Invisible spell that DOESNT match the utana vid, thats shitty
I want him to go fully invisible, like GMS "Ghost" mode
And hes uncloaked if he hit on something else its gone in 10-20 seconds.



And please remember:
IM USING TFS 0.2.12 MYSTIC SPIRIT
CLIENT 9.46

And I only have global.lua as lua of functions.



Thank you in advance, please help me out.
Rep++


/ J
 
[23/05/2012 22:37:25] Lua Script Error: [Spell Interface]
[23/05/2012 22:37:25] data/spells/scripts/attack/backstab.lua:onCastSpell
[23/05/2012 22:37:25] data/global.lua:1459: attempt to index local 'aux' (a boolean value)
[23/05/2012 22:37:25] stack traceback:
[23/05/2012 22:37:25] [C]: in function '__newindex'
[23/05/2012 22:37:25] data/global.lua:1459: in function 'isWalkable'
[23/05/2012 22:37:25] data/spells/scripts/attack/backstab.lua:4: in function <data/spells/scripts/attack/backstab.lua:1>



Heres the new errors.
 
yea like this:

LUA:
function getTargetBehind(cid) -- function by WotT
	
	local target = getCreatureTarget(cid)
	local targetPos = getCreaturePosition(target)
	local direction = getPlayerLookDir(target)
	local SQM = 1
	local positions = {
		north = {x = targetPos.x, y = targetPos.y-SQM, z = targetPos.z},
		south = {x = targetPos.x, y = targetPos.y+SQM, z = targetPos.z},
		west = {x = targetPos.x-SQM, y = targetPos.y, z = targetPos.z},
		east = {x = targetPos.x+SQM, y = targetPos.y, z = targetPos.z}
	}
	
	if(direction == NORTH) then
		return positions.south
	elseif(direction == SOUTH) then
		return positions.north
	elseif(direction == WEST) then
		return positions.east
	elseif(direction == EAST) then
		return positions.west
	end
	return true
end	

function isWalkable(cid,pos)
    local aux = pos
    aux.stackpos = 253
    if doTileQueryAdd(cid, pos) == 1 and getTilePzInfo(pos) == FALSE and isCreature(getThingFromPos(aux).uid) == FALSE then
        return TRUE
    end
    return FALSE
end
 
It may be something with "getTargetBehind" because the function "isWalkable" is saying that the position "getTargetBehind" gives is bool. (bool = returns true/false)

I don't know whats wrong, but with TFS 0.3.6 it worked perfectly.
 
function onCastSpell(cid, var)
local target = getCreatureTarget(cid)

if(isWalkable(cid, getTargetBehind(cid))) then
doTeleportThing(cid, getTargetBehind(cid))
doPlayerCastSpell(cid, "Hard Strike") -- <a href="http://otland.net/f35/doplayercastspell-cid-spell-80043/" target="_blank">http://otland.net/f35/doplayercastsp...d-spell-80043/</a>
else
doPlayerSendCancel(cid, "You cannot teleport to your target while the tile is blocked.")
return false
end

return true
end


Here is the spell,


And 2nd: Im using the spell with gamemaster on a monster.


Is there anything with that that makes it impossible?
 
@UP
thats not necessarily, just remove that line. Just for now...
paste this over the getTargetBehind function:
LUA:
function getTargetBehind(cid, target) -- function by WotT
	
	local target = getCreatureTarget(cid)
	local targetPos = getCreaturePosition(target)
	local direction = getPlayerLookDir(target)
	local SQM = 1
	local positions = {
		north = {x = targetPos.x, y = targetPos.y-SQM, z = targetPos.z},
		south = {x = targetPos.x, y = targetPos.y+SQM, z = targetPos.z},
		west = {x = targetPos.x-SQM, y = targetPos.y, z = targetPos.z},
		east = {x = targetPos.x+SQM, y = targetPos.y, z = targetPos.z}
	}
	
	if(direction == NORTH) then
		return positions.south
	elseif(direction == SOUTH) then
		return positions.north
	elseif(direction == WEST) then
		return positions.east
	elseif(direction == EAST) then
		return positions.west
	end
	return true
end

paste this over the spell:

LUA:
function onCastSpell(cid, var)
	local target = getCreatureTarget(target)

	if(isWalkable(cid, getTargetBehind(target))) then
		doTeleportThing(cid, getTargetBehind(cid))
	else
		doPlayerSendCancel(cid, "You cannot teleport to your target while the tile is blocked.")
		return false
	end

	return true
end

Dunno if this will work
 
[23/05/2012 22:57:02] Lua Script Error: [Spell Interface]
[23/05/2012 22:57:02] data/spells/scripts/attack/backstab.lua:onCastSpell
[23/05/2012 22:57:02] data/global.lua:1439: attempt to index local 'targetPos' (a boolean value)
[23/05/2012 22:57:02] stack traceback:
[23/05/2012 22:57:02] [C]: in function '__index'
[23/05/2012 22:57:02] data/global.lua:1439: in function 'getTargetBehind'
[23/05/2012 22:57:02] data/spells/scripts/attack/backstab.lua:4: in function <data/spells/scripts/attack/backstab.lua:1>


Here you go.. errors again

What does those mean??
 
Back
Top