Well, I was browsing thru the Lua Functions and found this
And then i figured hey! lets try and make a really gross version of that! xD So what i've done is got the script checking around the player(Param) for a Monster. Another player can use the Command to perhaps find out where this player is hunting, or what not. But it costs Money to do (configurable in the script). Enjoy and please post comments.
I also wouldn't mind people re-writing the script cause I did this very quickly and its pretty sloppy. Here it is!
Code:
getCreatureTarget(cid) //TODO
I also wouldn't mind people re-writing the script cause I did this very quickly and its pretty sloppy. Here it is!
Code:
Credits: Shawak (Thx for the Check Area for Monster code.)
Sync
Lua:
function getMonstersFromArena(pos, radiusx, radiusy, stack)
local monsters = {}
local starting = {x = (pos.x - radiusx), y = (pos.y - radiusy), z = pos.z}
local ending = {x = (pos.x + radiusx), y = (pos.y + radiusy), z = pos.z}
for x = starting.x, ending.x do
for y = starting.y, ending.y do
for z = starting.z, ending.z do
local pos = {x=x, y=y, z=z,stackpos = stack}
local thing = getThingfromPos(pos)
if thing.itemid > 0 then
if isMonster(thing.uid) == TRUE then
table.insert (monsters, thing.uid)
break
end
end
end
end
end
return monsters
end
function onSay(cid, words, param, channel)
local pos = getCreaturePosition(cid)
local config = {
monsters = getMonstersFromArena({x = pos.x,y = pos.y,z = pos.z}, 2, 2, 253),
target = getPlayerByNameWildcard(param),
price = 10, -- Ammount in Gold Coins
letter = doPlayerAddItem(cid, 2598) -- 2589 is a Letter
}
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires a players name.")
return TRUE
end
for i = 1, #config.monsters do
if(doPlayerRemoveMoney(cid, config.price) == TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "New mail has Arrived.")
doSetItemText(config.letter, "Dear Player, I have searched feircely to find "..getCreatureName(config.target)..", Luckily i am a great spy and have found his current enemy that surrounded him! The target he was surrounded by was a "..getCreatureName(config.monsters[i]).."!")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need "..config.price.." gold in order to use this command.")
end
return TRUE
end
end
Code:
/find Chris