<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetCampaignPairingData</id>
	<title>API:GetCampaignPairingData - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetCampaignPairingData"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetCampaignPairingData&amp;action=history"/>
	<updated>2026-10-17T15:21:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:GetCampaignPairingData&amp;diff=30354&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetCampaignPairingData&amp;diff=30354&amp;oldid=prev"/>
		<updated>2026-10-16T19:43:14Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=RvR}}&lt;br /&gt;
Returns the RvR campaign state of one racial pairing: who controls it, which zone is contested, the fortress zones and the campaign timers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pairingData = GetCampaignPairingData(pairingId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;pairingId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Pairing id, for example the &amp;lt;code&amp;gt;pairingId&amp;lt;/code&amp;gt; from [[API:GetCampaignZoneData|GetCampaignZoneData]].&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;pairingData : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – Pairing table (see below), or nothing if the id is invalid.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;pairingId&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Pairing id.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;controllingRealm&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Realm that controls the pairing.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;contestedZone&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Zone id of the zone currently being fought over, or &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;. The stock UI uses &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; as &amp;quot;the battle is not in this pairing&amp;#039;s zones&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;orderFortressZone&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Zone id of Order&amp;#039;s fortress zone, or &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;destructionFortressZone&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Zone id of Destruction&amp;#039;s fortress zone, or &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;isLocked&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; whenever &amp;lt;code&amp;gt;controllingRealm&amp;lt;/code&amp;gt; is 1 or 2; see Details.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;fortressPQTimeRemaining&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || – (may be fractional)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;captureTimeRemaining&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || – (may be fractional)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* &amp;lt;code&amp;gt;isLocked&amp;lt;/code&amp;gt; is not stored as such. It is &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; only when &amp;lt;code&amp;gt;controllingRealm&amp;lt;/code&amp;gt; is 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 is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The two time values are stored as floats by the client and passed on unchanged.&lt;br /&gt;
* When the client has no campaign data at all, the function returns nothing without an error.&lt;br /&gt;
* The function takes exactly one argument.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;GetCampaignPairingData&amp;#039;: Paring %d is not a valid campaign pairing id.&amp;lt;/code&amp;gt; (sic, &amp;quot;Paring&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_objectivetrackers/source/battlefieldobjectivetracker.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local pairingData = GetCampaignPairingData( zoneData.pairingId )&lt;br /&gt;
if( pairingData.contestedZone ~= 0  )&lt;br /&gt;
then&lt;br /&gt;
    -- The Battle is in annother zone in this pairing or in the city&lt;br /&gt;
    local frontLineZoneName = GetZoneName(pairingData.contestedZone)&lt;br /&gt;
    ...&lt;br /&gt;
else&lt;br /&gt;
    -- This pairing has been captured but a city is not yet unlocked&lt;br /&gt;
    local capturedRealmName = ( GetRealmName(pairingData.controllingRealm) )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GetCampaignZoneData|GetCampaignZoneData]]&lt;br /&gt;
* [[API:GetCampaignCityData|GetCampaignCityData]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>