WoW:API GetWorldPVPAreaInfo: Difference between revisions

m
Move page script moved page API GetWorldPVPAreaInfo to WoW:API GetWorldPVPAreaInfo without leaving a redirect
(boilerplate)
 
m (Move page script moved page API GetWorldPVPAreaInfo to WoW:API GetWorldPVPAreaInfo without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 2: Line 2:
Get information regarding a world PvP zone (e.g. Wintergrasp or Tol Barad).
Get information regarding a world PvP zone (e.g. Wintergrasp or Tol Barad).


  pvpID, localizedName, isActive, canQueue, startTime, canEnter = GetWorldPVPAreaInfo(pvpID)
  pvpID, localizedName, isActive, canQueue, startTime, canEnter = GetWorldPVPAreaInfo(index)


== Arguments ==
== Arguments ==
;pvpID : Number - the zone's index, from 1 to {{api|GetNumWorldPVPAreas}}()
;index : Number - the zone's index, from 1 to {{api|GetNumWorldPVPAreas}}()


== Returns ==
== Returns ==
:pvpID, localizedName, isActive, canQueue, startTime, canEnter
:pvpID, localizedName, isActive, canQueue, startTime, canEnter


;pvpID : Number - the zone's index, from 1 to {{api|GetNumWorldPVPAreas}}()
;pvpID : Number - ID number of the zone assigned by Blizzard. (see "Details" below)
;localizedName : String - the zone's name, in the current locale
;localizedName : String - the zone's name, in the current locale (e.g. Wintergrasp or Tol Barad)
;isActive : Boolean - whether a battle is currently taking place in the zone
;isActive : Boolean - whether a battle is currently taking place in the zone
;canQueue : Boolean - whether players can currently queue for the next or current battle
;canQueue : Boolean - whether players can currently queue for the next or current battle
Line 18: Line 18:


== Example ==
== Example ==
  local _, localizedName, _, canQueue, startTime, canEnter = GetWorldPVPAreaInfo(1)
  local _, localizedName, isActive, canQueue, startTime, canEnter = GetWorldPVPAreaInfo(2)
   
   
  if startTime > 0 then
  if isActive then
     print("Cool your jets, " .. name .. " doesn't start for another " .. SecondsToTime(start) .. ".")
     if canEnter and canQueue then
elif canEnter and canQueue then
          print("Get over to " .. localizedName .. ", quick!")
    print("Get over to " .. name .. ", quick!")
    else
          print("They're fighting over in " .. localizedName .. ".  Don't you wish you could join in?")
    end
  else
  else
     print("They're fighting over in " .. name .. ". Don't you wish you could join in?")
     print("Cool your jets, " .. localizedName .. " doesn't start for another " .. SecondsToTime(startTime) .. ".")
  end
  end


Line 39: Line 41:


== Details ==
== Details ==
: Note that there is some redundancy in the return valuesFor example, the first return value is always the same as the argument passed and isActive will always be false when startTime is greater than 0.
Notes:
: The "startTime" is always greater than 0Once a battle begins, the "startTime" will be the number of seconds until the NEXT battle begins.
: The return value pvpID does not equal the passed value of "index".   There are currently (09FEB2011) only two zones -
::Index #1 = Wintergrasp with pvpID = 1
::Index #2 = Tol Barad with  pvpID = 2
Anonymous user