Wikia

WoWWiki

Changes: API UnitFactionGroup

Edit

Back to page

(Clarify return values)
 
Line 7: Line 7:
   
 
== Returns ==
 
== Returns ==
;englishFaction : String - Unit's faction name in English.
+
;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.
+
;localizedFaction : String - Unit's faction name in the client's locale or nil.
   
 
== Details ==
 
== Details ==
 
The functon returns correct results after the PLAYER_ENTERING_WORLD event.
 
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>.

Latest revision as of 01:58, September 6, 2008

WoW API < UnitFactionGroup

Get the name of the faction (Horde/Alliance) a unit belongs to.

englishFaction, localizedFaction = UnitFactionGroup(unit)

Arguments Edit

unit 
String - UnitID you want to get the faction for

Returns Edit

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 Edit

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 nil,nil.

Around Wikia's network

Random Wiki