Navigation menu

WoW:API UnitFactionGroup: Difference between revisions

Jump to navigation Jump to search
m
Move page script moved page API UnitFactionGroup to WoW:API UnitFactionGroup without leaving a redirect
mNo edit summary
m (Move page script moved page API UnitFactionGroup to WoW:API UnitFactionGroup without leaving a redirect)
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
UnitFactionGroup("player") returns the faction of the currently logged in character (Horde or Alliance).
{{wowapi}}
UnitFactionGroup("player") returns nil before PLAYER_ENTERING_WORLD and after/during PLAYER_LEAVING_WORLD event.
Get the name of the faction (Horde/Alliance) a unit belongs to.
UnitFactionGroup("target") returns the faction group the current target or nil if there is no current target.
englishFaction, localizedFaction = UnitFactionGroup(unit)


[[Category:API Functions|UnitFactionGroup]]
== Arguments ==
[[Category:API Faction Functions|UnitFactionGroup]]
; unit : String - [[API_TYPE_UnitId|UnitID]] you want to get the faction for
[[Category:API Unit Functions|UnitFactionGroup]]
 
== 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>.
Anonymous user