View Single Post
05-25-16, 05:42 PM   #7
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,246
Throwing darts here, but this might help. Or not LOL.

First, what kind of unit is "UNITZ"? Surely that's a typo...
Lua Code:
  1. do
  2. reaction = UnitReaction(UNITZ, "player")
  3. end

Next, since NPCs don't have unitIDs unless you are directly interracting with them, but they do have GUIDs, you might want to sort that out. In other words, if you want to keep the reaction color for an NPC that you are indirectly interracting with (IE target of target, where target == tankPlayer and target'starget == boss), you will need to store or cache that.
Lua Code:
  1. local color
  2. -- if a player unitID then ...
  3. color = CUSTOM_CLASS_COLORS[class] or RAID_CLASS_COLORS[class]
  4. -- elseif unitID is an NPC then ...
  5. color = CUSTOM_FACTION_BAR_COLORS[UnitReaction(unitID)] or UnitReaction(unitID)
  6. -- end
  Reply With Quote