m
Move page script moved page API UnitFactionGroup to WoW:API UnitFactionGroup without leaving a redirect
(Updated info to be accurate.) |
m (Move page script moved page API UnitFactionGroup to WoW:API UnitFactionGroup without leaving a redirect) |
||
| (3 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
Get the | {{wowapi}} | ||
Get the name of the faction (Horde/Alliance) a unit belongs to. | |||
UnitFactionGroup( | englishFaction, localizedFaction = UnitFactionGroup(unit) | ||
== Arguments == | |||
; unit : String - [[API_TYPE_UnitId|UnitID]] you want to get the faction for | |||
: | |||
== Returns == | |||
;englishFaction : String - Unit's faction name in English, i.e. "Alliance", "Horde" or nil. | |||
;localizedFaction : String - Unit's faction name in the client's locale or nil. | |||
== Details == | |||
The functon returns correct results after the PLAYER_ENTERING_WORLD event. | |||
Note that for NPCs, the function will only return Alliance/Horde for factions closely allied with either side. Goblins, for instance, return <tt>nil,nil</tt>. | |||