Thread Tools Display Modes
11-07-13, 08:23 PM   #1
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
get target of unit's target

How would I get the target of my target through lua?
  Reply With Quote
11-07-13, 08:32 PM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
I'm not sure what you mean?
Its name?

If that's the case UnitName("targettarget")

If you mean like actually targeting your target's target programmatically that's not possible outside of the secure system.
Meaning you have to construct a secure frame that can target the target's target through a hardware event (mouse click or keybind)

Or a unitframe that shows the target's target (there's a bunch of addons that do that eg. targetAssist)
  Reply With Quote
11-07-13, 09:18 PM   #3
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
I'm sorry I should have clarified, I simply want the name of my targets target.

I'm not sure if it's possible but I figure someone here would know.

Also, the user will not be targeting the person all the time, basically what I'm asking is, is it possible to retrieve the name of someones target if you are not targeting them?

Last edited by Spawnova : 11-07-13 at 09:52 PM.
  Reply With Quote
11-08-13, 02:23 AM   #4
Malsomnus
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Apr 2013
Posts: 203
It's possible to use the UnitName function on party/ raid members, pets, bosses, your focus, etc., and you can append "target" to each of those to get that unit's target. You can find a list of UnitID values here and just add "target" to any of them. So you can, for example, get the name of the unit targeted by the 6th member of your raid group, or the unit targeted by your focus, and so on, but you cannot get the name of the Unit targeted by a specific NPC.
__________________
SanityCheck - If you've ever said the words "Sorry, I forgot" then you need this add-on.

Remember, every time you post a comment on an add-on, a kitten gets its wings!
  Reply With Quote
11-08-13, 05:42 PM   #5
Spawnova
A Warpwood Thunder Caller
 
Spawnova's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2012
Posts: 96
You are correct, after making some alterations everything is working just fine, thank you. =)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » get target of unit's target


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off