API:GetCampaignPairingData
From RoR Wiki
UI Lua API · RvR functions
Version: WAR 1.4.8
Returns the RvR campaign state of one racial pairing: who controls it, which zone is contested, the fortress zones and the campaign timers.
pairingData = GetCampaignPairingData(pairingId)
Arguments
- pairingId
number– Pairing id, for example thepairingIdfrom GetCampaignZoneData.
Returns
- pairingData
table– Pairing table (see below), or nothing if the id is invalid.
| Key | Type | Meaning |
|---|---|---|
pairingId |
number |
Pairing id. |
controllingRealm |
number |
Realm that controls the pairing. |
contestedZone |
number |
Zone id of the zone currently being fought over, or 0. The stock UI uses 0 as "the battle is not in this pairing's zones".
|
orderFortressZone |
number |
Zone id of Order's fortress zone, or 0.
|
destructionFortressZone |
number |
Zone id of Destruction's fortress zone, or 0.
|
isLocked |
boolean |
true whenever controllingRealm is 1 or 2; see Details.
|
fortressPQTimeRemaining |
number |
– (may be fractional) |
captureTimeRemaining |
number |
– (may be fractional) |
Details
isLockedis not stored as such. It isfalseonly whencontrollingRealmis neither 1 nor 2 and two further state values the client keeps for the pairing are both missing or below 2. In every other case it istrue.- The two time values are stored as floats by the client and passed on unchanged.
- When the client has no campaign data at all, the function returns nothing without an error.
- The function takes exactly one argument.
Errors
Error in function call 'GetCampaignPairingData': Paring %d is not a valid campaign pairing id.(sic, "Paring")
Example
From default/ea_objectivetrackers/source/battlefieldobjectivetracker.lua:
local pairingData = GetCampaignPairingData( zoneData.pairingId )
if( pairingData.contestedZone ~= 0 )
then
-- The Battle is in annother zone in this pairing or in the city
local frontLineZoneName = GetZoneName(pairingData.contestedZone)
...
else
-- This pairing has been captured but a city is not yet unlocked
local capturedRealmName = ( GetRealmName(pairingData.controllingRealm) )
