View Single Post
03-08-14, 08:15 AM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Duugu View Post
The if clause has the same result for every single nameplate. Because you're requesting a general aggro value and not the value for the actual namplate unit (I'm not sure what UnitThreatSituation("player") does reaturn. But whatever it is ... it's the same value for ever single step in you loop.)
UnitThreatSituation("player") without a second unit will return information based on the unit the player's threat is highest against. If you're on the threat table for 5 mobs, but only have aggro on 1, then it will indicate that you have aggro. To get information about your threat vs. a specific unit, you need to pass a second unit, eg. UnitThreatSituation("player", "target")

However, this only works for units with a current (and known) unit token, so it isn't a suitable solution for nameplates. Use the solution posted by Oppugno instead to get the information from the nameplate's default threat region.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote