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

TalkAction Find Target Hunting Area

Sync

Ø,ø
Joined
May 26, 2009
Messages
1,901
Reaction score
26
Location
Canada
Well, I was browsing thru the Lua Functions and found this
Code:
getCreatureTarget(cid) //TODO
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:
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

2uemkps.jpg
 
This is an awesome idea! I will probably use this it. Thanks.

+Rep

P.S. What happens when the player (param) has no creature near it?
 
huh? just knowing who a player's target is?
 
I did some script few days ago:
Code:
function onThink(interval, lastExecution, thinkInterval)
	for _, cid in ipairs(getPlayersOnline()) do
		if (doConvertIntegerToIp(getPlayerIp(cid)) == "0.0.0.0" and getCreatureName(getCreatureTarget(cid)) == "Training Monk") then
			doRemoveCreature(cid)
		end
	end
	return true
end

And getCreatureTarget(cid) works :)
 
lol, gesior had posted something like this months ago, u only added it that it takes money/writes in letter. o_O
 
lol, gesior had posted something like this months ago, u only added it that it takes money/writes in letter. o_O

I didn't know that. And for anyone that cares I'm done posting scripts on otland all you get is fags critizing everytime. Enjoy shitty otland.
 
Well, letting them get to you is letting them win. So just ignore them and continue to help the part of the community that is actually grateful?

Thanks again for the nice script.
 
are you sure is working ??? dont you need to set the param for target :S?
 
Last edited:
what on talkactions xlm?
i will try
<talkaction words="/find" event="script" value="exivam.lua"/>
xd
 
It would be cool if you could make it NPC based.. like:

(blabla random rpg text)
You: Hi
NPC: Hello, I have lost my eye in a bet with the devil, I can now overlook Tibia from the suns angle.. Do you need any information about any player?
You: Find Chris
NPC: It will cost you 1000 gold to look into the eye of the black sun, are you willing to pay that price?
You: Yes
*Glitter Effect*
Text: You see Chris in a battle between an Orshabaal.
 
This doesn't work, I get a letter, but nothing is written inside of it and It doesn't say "New Mail has Arrived" and it doesn't take away your money
What's wrong?
 
Back
Top