• 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!

Teleport

Scurzo

New Member
Joined
Aug 23, 2008
Messages
66
Reaction score
0
I need a rune to avoid using noob chars doing traps in wars
I need a rune that when used on a lvl 80- it will teleport the guy to x,y,z
It will help if the rune couldnt be used on pz
Or maybe a spell that needs 100soul

Im using TFS Mystic Spirit
 
data/actions/actions.xml
Code:
	<action itemid="XXXX" script="scriptname.lua"/>
data/actions/scripts/scriptname.lua
Code:
local pos = {x=33262, y=31835, z=12}
local level = 80
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (isInArray({0, 65535}, toPosition.x) == FALSE and getTilePzInfo(toPosition) == TRUE) or getTilePzInfo(getThingPos(cid)) == TRUE then
		doPlayerSendCancel(cid, 'You cannot use this item inside a protection zone.')
	elseif isPlayer(itemEx.uid) ~= TRUE then
		doPlayerSendCancel(cid, 'You can only use this rune on players.')
	elseif itemEx.uid == cid then
		doPlayerSendCancel(cid, 'You cannot use this rune on yourself.')
	elseif getPlayerLevel(cid) < level then
		doPlayerSendCancel(cid, 'You need level ' .. level .. ' to use this rune.')
	elseif getPlayerLevel(itemEx.uid) >= level then
		doPlayerSendCancel(cid, 'You can only use this rune on players of level lower than ' .. level .. '.')
	else	
		doTeleportThing(itemEx.uid, pos)
		doSendMagicEffect(toPosition, CONST_ME_TELEPORT)
		doSendMagicEffect(pos, CONST_ME_TELEPORT)
		doChangeTypeItem(item.uid, item.type - 1)
		return TRUE, doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have teleported ' .. getCreatureName(itemEx.uid) .. '.')
	end
	return TRUE, doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
 
data/actions/actions.xml
Code:
	<action itemid="XXXX" script="scriptname.lua"/>
data/actions/scripts/scriptname.lua
Code:
local pos = {x=33262, y=31835, z=12}
local level = 80
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (isInArray({0, 65535}, toPosition.x) == FALSE and getTilePzInfo(toPosition) == TRUE) or getTilePzInfo(getThingPos(cid)) == TRUE then
		doPlayerSendCancel(cid, 'You cannot use this item inside a protection zone.')
	elseif isPlayer(itemEx.uid) ~= TRUE then
		doPlayerSendCancel(cid, 'You can only use this rune on players.')
	elseif itemEx.uid == cid then
		doPlayerSendCancel(cid, 'You cannot use this rune on yourself.')
	elseif getPlayerLevel(cid) < level then
		doPlayerSendCancel(cid, 'You need level ' .. level .. ' to use this rune.')
	elseif getPlayerLevel(itemEx.uid) >= level then
		doPlayerSendCancel(cid, 'You can only use this rune on players of level lower than ' .. level .. '.')
	else	
		doTeleportThing(itemEx.uid, pos)
		doSendMagicEffect(toPosition, CONST_ME_TELEPORT)
		doSendMagicEffect(pos, CONST_ME_TELEPORT)
		doChangeTypeItem(item.uid, item.type - 1)
		return TRUE, doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have teleported ' .. getCreatureName(itemEx.uid) .. '.')
	end
	return TRUE, doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end

How can I make this action to need and waste 100 soul when used?
 
Code:
local pos = {x=33262, y=31835, z=12}
local level = 80
local soul = 100
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (isInArray({0, 65535}, toPosition.x) == FALSE and getTilePzInfo(toPosition) == TRUE) or getTilePzInfo(getThingPos(cid)) == TRUE then
		doPlayerSendCancel(cid, 'You cannot use this item inside a protection zone.')
	elseif getPlayerSoul(cid) < soul then
		doPlayerSendCancel(cid, 'You need ' .. soul .. ' soul points to use this item.')
	elseif isPlayer(itemEx.uid) ~= TRUE then
		doPlayerSendCancel(cid, 'You can only use this rune on players.')
	elseif itemEx.uid == cid then
		doPlayerSendCancel(cid, 'You cannot use this rune on yourself.')
	elseif getPlayerLevel(cid) < level then
		doPlayerSendCancel(cid, 'You need level ' .. level .. ' to use this rune.')
	elseif getPlayerLevel(itemEx.uid) >= level then
		doPlayerSendCancel(cid, 'You can only use this rune on players of level lower than ' .. level .. '.')
	else
		doPlayerAddSoul(cid, -soul)
		doTeleportThing(itemEx.uid, pos)
		doSendMagicEffect(toPosition, CONST_ME_TELEPORT)
		doSendMagicEffect(pos, CONST_ME_TELEPORT)
		doChangeTypeItem(item.uid, item.type - 1)
		return TRUE, doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have teleported ' .. getCreatureName(itemEx.uid) .. '.')
	end
	return TRUE, doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
 
Back
Top