Posted by jummes on Sun, 27 May 2012 11:26:10
Hi. How to make addons which will write to print of coordinate of NPC on target? I want to take NPC in target to register command /coord and that to me to print wrote NPC coordinates
Posted by stolenlegacy on Sun, 27 May 2012 12:52:19
You cannot retrieve the position of any unit outside your party/raid. Sorry.
Posted by efindel on Tue, 29 May 2012 20:44:36
The best you can do is to give your own coordinates at the time, since you're close enough to target the thing.
local x, y = GetPlayerMapPosition("player"); print string.sub(x*100,1,4)..","..string.sub(y*100,1,4);
would be an example. If your goal is to output it to some sort of chat, you might want to look at "ChatSubs" on Curse. With it, you could do, for example:
/bg <target>: <targetlevel> <targetclass> incoming at <position>
Make that a macro, and you can hit it with someone targeted to send their name, level, class, and your coordinates when you spotted them out to your side.