View Single Post
12-01-19, 07:22 AM   #3
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
Originally Posted by myrroddin View Post
You need two things:
  1. https://wow.gamepedia.com/API_UnitReaction in which case the unitID ("player") and the unitID of the comparison.
  2. The global table FACTION_BAR_COLORS in which to pass the reaction number above.

Lua Code:
  1. local reaction = UnitReaction("target", "player")
  2. local reactionColor = FACTION_BAR_COLORS[reaction]
Thanks for the code.
I ended up using it like below and it works fine:
Lua Code:
  1. local reaction = UnitReaction("target", "player")          
  2. local color = CUSTOM_FACTION_BAR_COLORS[reaction] or RAID_CLASS_COLORS[ccolor] or {r = 1, g = 1, b = 0}

So thanks again.
Coke
  Reply With Quote