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

Nearest Town scroll?

Fresh

Quack!
Joined
Oct 21, 2009
Messages
1,855
Solutions
18
Reaction score
671
Hello.
I have a nice idea for RPG servers also i need someone who can make that script.

TFS 0.3.6pl1 [8.54]

Let me explain:
- We have scroll, we can't use that scroll while we are in combat/player attacking
- After use scroll we are teleported to nearest city

What's mean nearest city ?

Look at this map:
beznazwyov.jpg


If we are hunting in yellow area (near Kazordoon) and we use the nearest town scroll we are teleported to Kazordoon.
If we are hunting in red area (near Thais) and we use the nearest town scroll we are teleported to Thais
If we are hunting in green area (near Venore) and after use the scroll, we are teleported to Venore.


etc, etc.

Anyone can make script of that idea? :)
It's awesome for RPGish servers i think.
Regards,
Fresh.
 
Easy.. I will work on it now but am not sure if it will work "Never tested it". Will send ya pm with it when done.

Edit: its 1 use only right? and 10 sec exhaust?
 
LUA:
local pos = {
	{
		check = { -- if player is in one of those areas it's teleporting him to teleportPos
		-- {{fromPos}, {toPos}}
			{{x=75, y=115, z=7}, {x=75, y=115, z=7}}, 
			{{x=75, y=115, z=7}, {x=75, y=115, z=7}}, 
			{{x=75, y=115, z=7}, {x=75, y=115, z=7}}, 
			{{x=75, y=115, z=7}, {x=75, y=115, z=7}}
		},		
		teleportPos = {x=75, y=115, z=7}
	},
	{
		check = {
			{{x=75, y=115, z=7}, {x=75, y=115, z=7}}, 
			{{x=75, y=115, z=7}, {x=75, y=115, z=7}}, 
			{{x=75, y=115, z=7}, {x=75, y=115, z=7}}, 
			{{x=75, y=115, z=7}, {x=75, y=115, z=7}}
		},		
		teleportPos = {x=75, y=115, z=7}
	},
	{
		check = {
			{{x=75, y=115, z=7}, {x=75, y=115, z=7}}, 
			{{x=75, y=115, z=7}, {x=75, y=115, z=7}}, 
			{{x=75, y=115, z=7}, {x=75, y=115, z=7}}, 
			{{x=75, y=115, z=7}, {x=75, y=115, z=7}}
		},		
		teleportPos = {x=75, y=115, z=7}
	}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getCreatureCondition(cid, CONDITION_INFIGHT) then
		return doPlayerSendCancel(cid, 'You may not create portal during or immediately after a fight.')
	end
	
	local p = getThingPos(cid)	
	for _, v in pairs(pos) do
		for __, position in pairs(v.check) do
			if isInRange(p, position[1], position[2]) then
				doTeleportThing(cid, v.teleportPos)
				doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
				doRemoveItem(item.uid)
				return true
			end
		end
	end	
	return true
end
 
Back
Top