WoW:API UnitFactionGroup: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Move page script moved page API UnitFactionGroup to API UnitFactionGroup without leaving a redirect) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{wowapi}} | {{wowapi}} | ||
Get the | Get the name of the faction (Horde/Alliance) a unit belongs to. | ||
englishFaction, localizedFaction = UnitFactionGroup( | englishFaction, localizedFaction = UnitFactionGroup(unit) | ||
== Arguments == | == Arguments == | ||
; [[API_TYPE_UnitId|UnitID]] | ; unit : String - [[API_TYPE_UnitId|UnitID]] you want to get the faction for | ||
== Returns == | == Returns == | ||
;englishFaction : String - | ;englishFaction : String - Unit's faction name in English, i.e. "Alliance", "Horde" or nil. | ||
;localizedFaction : String - | ;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. | |||
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 04:47, 15 August 2023
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.