UnitIsWarModePhased

From Wowpedia
Jump to: navigation, search

Indicates if a party or raid member is presently invisible to the player because only one has opted into War Mode.

warModePhased = UnitIsWarModePhased(unit)

Arguments

unit 
string - Party or raid member refenced using UnitId.

Returns

warModePhased 
boolean - True if the unit and player have differing warmode status and both are in an area where warmode takes effect; false otherwise

Example

The following example is adpated from FrameXML/PartyMemberFrame.lua[1]

for i=1, 4                                  
  local unit = "party"..i
  if UnitExists(unit) then                   
    if UnitInPhase(unit) then                
      if UnitIsWarModePhased(unit) then
        if C_PvP.IsWarModeDesired() then    
          print("Party member " .. i .. ": " .. ERR_PVP_TOGGLE_OFF)
        else
          print("Party member " .. i .. ": " .. ERR_PVP_TOGGLE_ON)
        end
      else
      print("Party member " .. i .. " is in phase.  Hurray!")
    else
        print("Party member " .. i .. " is out of phase.")
      end
    end
  end
end

Patch changes

See also

External Links