WildStar:API TYPE Unit GetFaction

From AddOn Studio
Jump to navigation Jump to search

API types < Unit:GetFaction

Gets nFactionID for unit data.

local nFactionID = unit:GetFaction()

Examples[edit]

-- Determine if Exile Human or Cassian
local strRaceString = ""
local nRaceID = unit:GetRaceId()
local nFactionID = unit:GetFaction()
if nRaceID == GameLib.CodeEnumRace.Human then
    if nFactionID == Unit.CodeEnumFaction.ExilesPlayer then
        strRaceString = Apollo.GetString("CRB_ExileHuman")
    elseif nFactionID == Unit.CodeEnumFaction.DominionPlayer then
        strRaceString = Apollo.GetString("CRB_Cassian")
    end
end