WoW:API GetWorldPVPAreaInfo: Difference between revisions
Jump to navigation
Jump to search
(boilerplate) |
(The redundancies listed are not accurate. The passed index value does not equal the return ID value. The start time in seconds equals the start of the following battle when the zone is active.) |
||
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, localizedName, isActive, canQueue, startTime, canEnter = GetWorldPVPAreaInfo(index) | ||
== Arguments == | == Arguments == | ||
; | ;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 | ;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 20: | Line 20: | ||
local _, localizedName, _, canQueue, startTime, canEnter = GetWorldPVPAreaInfo(1) | local _, localizedName, _, canQueue, startTime, canEnter = GetWorldPVPAreaInfo(1) | ||
if | if isActive then | ||
if canEnter and canQueue then | |||
print("Get over to " .. name .. ", quick!") | |||
else | |||
print("They're fighting over in " .. name .. ". Don't you wish you could join in?") | |||
end | |||
else | |||
print("Cool your jets, " .. name .. " doesn't start for another " .. SecondsToTime(start) .. ".") | print("Cool your jets, " .. name .. " doesn't start for another " .. SecondsToTime(start) .. ".") | ||
end | end | ||
Line 39: | Line 41: | ||
== Details == | == Details == | ||
: | Notes: | ||
: The "startTime" is always greater than 0. Once 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 = 21. |
Revision as of 22:01, 9 February 2011
← WoW API < GetWorldPVPAreaInfo
Get information regarding a world PvP zone (e.g. Wintergrasp or Tol Barad).
pvpID, localizedName, isActive, canQueue, startTime, canEnter = GetWorldPVPAreaInfo(index)
Arguments
- index
- Number - the zone's index, from 1 to GetNumWorldPVPAreas()
Returns
- pvpID, localizedName, isActive, canQueue, startTime, canEnter
- pvpID
- Number - ID number of the zone assigned by Blizzard. (see "Details" below)
- 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
- canQueue
- Boolean - whether players can currently queue for the next or current battle
- startTime
- Number - time until the next battle starts, in seconds
- canEnter
- Boolean - whether the player meets the necessary requirements to participate in the zone's battle
Example
local _, localizedName, _, canQueue, startTime, canEnter = GetWorldPVPAreaInfo(1) if isActive then if canEnter and canQueue then print("Get over to " .. name .. ", quick!") else print("They're fighting over in " .. name .. ". Don't you wish you could join in?") end else print("Cool your jets, " .. name .. " doesn't start for another " .. SecondsToTime(start) .. ".") end
Result
-- if the battle hasn't started yet "Cool your jets, Tol Barad doesn't start for another 12:34."
-- if the battle is active and the player can join it "Get over to Tol Barad, quick!"
-- if the battle is active but the player cannot join "They're fighting over in Tol Barad. Don't you with you could join in?"
Details
Notes:
- The "startTime" is always greater than 0. Once 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 = 21.