<?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%3AGetPQLootWinners</id>
	<title>API:GetPQLootWinners - 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%3AGetPQLootWinners"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetPQLootWinners&amp;action=history"/>
	<updated>2026-10-17T22:57:31Z</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:GetPQLootWinners&amp;diff=30446&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:GetPQLootWinners&amp;diff=30446&amp;oldid=prev"/>
		<updated>2026-10-16T19:44:42Z</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=PublicQuest}}&lt;br /&gt;
Returns the final loot roll results of the public quest the player has just finished.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data = GetPQLootWinners()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;data : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – Result table (see below), or nothing if the client holds no public quest result.&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;PQName&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Name of the public quest.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;metMinContribution&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;optedOut&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;forcedOut&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;scoreboardData&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || Up to 24 loot rows, see below.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;playerData&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || The local player&amp;#039;s row, see below. Empty if the client has no row for the player.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Each row in &amp;lt;code&amp;gt;scoreboardData&amp;lt;/code&amp;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;name&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Character name.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;grade&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;sackType&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Bag won. &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt; for the first rows, one per gold bag; for later rows the stored bag type if it is 1 to 4, otherwise &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;roll&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;persistence&amp;lt;/code&amp;gt; plus two other values stored for the row.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;persistence&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || –&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;bonus&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Always &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; in this function.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;playerData&amp;lt;/code&amp;gt;, when filled, has the same fields plus:&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;place&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || The player&amp;#039;s place.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;looserPrize&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Text of a consolation prize; the stock UI shows it when it is not empty. (The key is spelled &amp;lt;code&amp;gt;looserPrize&amp;lt;/code&amp;gt;.)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;code&amp;gt;playerData&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sackType&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt; when &amp;lt;code&amp;gt;place&amp;lt;/code&amp;gt; is not larger than the number of gold bags; otherwise it is worked out as for the other rows.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* Compared to [[API:GetPQTopContributors|GetPQTopContributors]], this table has no bag counts, no &amp;lt;code&amp;gt;numContributors&amp;lt;/code&amp;gt; and no &amp;lt;code&amp;gt;timeUntilPQReset&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;bonus&amp;lt;/code&amp;gt; is always &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt;. The stock UI shows no contribution text when &amp;lt;code&amp;gt;bonus&amp;lt;/code&amp;gt; is negative.&lt;br /&gt;
* Slots with an empty name are skipped, but each row keeps the index of its slot, so &amp;lt;code&amp;gt;scoreboardData&amp;lt;/code&amp;gt; can have gaps.&lt;br /&gt;
* The data is kept until [[API:ClearPQLootData|ClearPQLootData]] is called; after that the function returns nothing.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/easystem_utils/source/publicqueststates.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local winnersData = GetPQLootWinners()&lt;br /&gt;
if winnersData ~= nil&lt;br /&gt;
then&lt;br /&gt;
    PQData.ParseScoreboardData( winnersData )&lt;br /&gt;
elseif (GameData.PQData.pqName ~= nil) and (GameData.PQData.pqName ~= L&amp;quot;&amp;quot;)&lt;br /&gt;
then&lt;br /&gt;
    PQData.SetResettingData()&lt;br /&gt;
else&lt;br /&gt;
    ERROR(L&amp;quot;PQData.ShowFinalResults Error: no data found&amp;quot;)&lt;br /&gt;
    return&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GetPQTopContributors|GetPQTopContributors]]&lt;br /&gt;
* [[API:ClearPQLootData|ClearPQLootData]]&lt;br /&gt;
* [[API:PQLootItem|PQLootItem]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>