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

Item Radar

R4ee

New Member
Joined
Apr 2, 2010
Messages
8
Reaction score
0
Hiya guys.

I was wondering whether you could help me writing a script for an item which would work like this:

Whenever I use the item (let's say a radar) and an item with id="x" lies on the ground, this radar shows me the directions to this item e.g. [Item Name] is at North East from you.

Thanks in advance for your help. Will repay in reputation points.
 
You mean like a tutorial on map or like grass makes green in small map of tibia small map?

bec if true then change tha hex (custom client)
 
No, no no... What I mean is that i want to have an item which will show me directions to an item/s with id/s="x".

Item (radar) ->
radar.jpg

Directions to the item on the map ->
radar-indicate.jpg


It should work like exiva (find) but instead of looking for players, it looks for particular items.
 
Code:
function onItemRadar(item, cid)
	local k = getThingPos(cid)
	local text, dist = item .. "", getDistanceBetween(k, getThingPos(getItemIdByName(item)))
	if dist > 10 then
		text = text .. " "is very far from you."
	elseif dist < 5 and dist > 2 then
		text = text .. " "is far from you."
	end
	return text
end
do the rest
 
Last edited:
No, no no... What I mean is that i want to have an item which will show me directions to an item/s with id/s="x".

Item (radar) ->
radar.jpg

Directions to the item on the map ->
radar-indicate.jpg


It should work like exiva (find) but instead of looking for players, it looks for particular items.

i think dragonball need to be update..
its spirt is so S.u.x
 
Code:
function onItemRadar(item, cid)
	local k = getThingPos(cid)
	local text, dist = item .. "", getDistanceBetween(k, getThingPos(getItemIdByName(item)))
	if dist > 10 then
		text = text .. " "is very far from you."
	elseif dist < 5 and dist > 2 then
		text = text .. " "is far from you."
	end
	return text
end
do the rest

It's not exactly what Im after. I shall explain it again.

First of all, make a list of items which the "radar" will look for on the map. Items from id 4380 to 4386 (Because there are 7 dragon balls).
Code:
1. Dragon Ball 1 = id(4380)
2. Dragon Ball 2 = id(4381)
3. Dragon Ball 3 = id(4382)
3. Dragon Ball 4 = id(4383)
3. Dragon Ball 5 = id(4384)
3. Dragon Ball 6 = id(4385)
3. Dragon Ball 7 = id(4386)

Secondly, once I click use on the radar, it should look for the items listed above and give exact directions to them. Like shown on the screenshot ('Dragon Ball 7 [depending on the id of the item] is at South West')
 
he wants the sprite to update to a new id depending on the direction.. like dice in tibia, well the concept.

if direction == northwest then
id = 1231
elseif direction == west then
id = 1243
else
id = nil
end
 
he wants the sprite to update to a new id depending on the direction.. like dice in tibia, well the concept.

Ehh ? No, like I said, I want the radar - when used - to show directions to the items which are placed on the ground. The radar has set item ids which he uses to find these items only.
 
heres a small idea to make it, you gotta just calculate the positions & difference between them in ur map editor:
Code:
function onItemRadar(item, cid)
	local iType = getThing(getItemIdByName(item)).uid
	local k, p = getThingPos(cid), getThingPos(iType)
	local search = getDistanceBetween(k, p)
	local text = item .. " "
	local dir, iPos = getCreatureLookDirection(cid), iType
	if search > 10 then
		text = text .. "is very far from you."
	elseif search > 2 and search < 9 then
		if dir == NORTH then
			if iPos.x > k.x then
				text = text .. "is to the north."
			elseif iPos.x < k.x then
				text = text .. "is to the south."
			else
				text = text .."is to the north"
			end
		end
	end
	return text
end
 
Last edited:
Back
Top