• 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
 
That's where you didnt pay attention to my post...

I have the latest distro, 9.46 and true ghost spell thread, i tried all that it doesnt work
the same goes with the backstab spell :/
 
@UP
http://otland.net/f132/true-ghost-spell-137611/
May work in the latest TFS.

@Luigilc
You could make two creaturescripts:
1 onStatChange:
[LUa]function onStatsChange(cid, attacker, type, combat, value)
local s = 100
local tn, tx = value*2, value*2.2
local target = getPlayerTarget(attacker)
if(getPlayerStorageValue(attacker, s) > 0) then
doTargetCombatHealth(attacker, target, COMBAT_PHYSICALDAMAGE, tn, tx, effect)
end
return true
end[/code]

1 onAttack:
LUA:
function onAttack(cid, target)
	local s = 100
	
	if(getPlayerStorageValue(cid, s) < 1) then
		setPlayerStorageValue(cid,s, 0)
	end
	return true
end

Register in login.lua and creaturescripts.xml
In the backstab spell, make so the player gets the storagevalue (ex. 100). As in the scripts onAttack/onStatChanges (s=100)
I don't know if it works xdd

@Topic
Any error?
 
Hey!

I love that you posted a working backstab but this is my errors :/

[23/05/2012 22:02:11] Lua Script Error: [Spell Interface]
[23/05/2012 22:02:11] data/spells/scripts/attack/backstab.lua:onCastSpell
[23/05/2012 22:02:11] data/global.lua:1436: attempt to call global 'getCreatureLookDirection' (a nil value)
[23/05/2012 22:02:11] stack traceback:
[23/05/2012 22:02:11] [C]: in function 'getCreatureLookDirection'
[23/05/2012 22:02:11] data/global.lua:1436: in function 'getTargetBehind'
[23/05/2012 22:02:11] data/spells/scripts/attack/backstab.lua:4: in function <data/spells/scripts/attack/backstab.lua:1>
 
Witch rev/tfs are you using?
It seems that you don't have the function: "getCreatureLookDirection".
go to ots/docs/LUAFUNCTIONS.file

search for function simpilar to this and post it here.
Ex. Search for "Direction" it will pop up some functions, post 'em here.

ps. it worked perfectly for me
 
function getTargetBehind(cid) -- function by WotT

local target = getCreatureTarget(cid)
local targetPos = getCreaturePosition(target)
local direction = getCreatureLookDirection(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


This?
 
Yeah

This is the complete function. Paste this over:
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
 
now i get this:

[23/05/2012 22:27:40] Lua Script Error: [Spell Interface]
[23/05/2012 22:27:40] data/spells/scripts/attack/backstab.lua:onCastSpell
[23/05/2012 22:27:40] data/spells/scripts/attack/backstab.lua:4: attempt to call global 'isWalkable' (a nil value)
[23/05/2012 22:27:40] stack traceback:
[23/05/2012 22:27:40] [C]: in function 'isWalkable'
[23/05/2012 22:27:40] data/spells/scripts/attack/backstab.lua:4: in function <data/spells/scripts/attack/backstab.lua:1>



EDIT: PS. IM TRYING THIS SPELL ON A MONSTER, SO YOU KNOW
 
You didn't paste the isWalkable function from the backstab spell.

Here it is, libs/050-functions.lua:
LUA:
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
 
Back
Top