Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!

API UnitFactionGroup

From Wowpedia
Jump to: navigation, search

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

englishFaction, localizedFaction = UnitFactionGroup("unit")

Arguments

unit 
String (unitId) - unit you want to get the faction for.

Returns

englishFaction 
String - Unit's faction name in English, i.e. "Alliance", "Horde", "Neutral" 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 nil,nil.
  • Pandaren player characters on the Wandering Isle return "Neutral", "".