API:GetPQLootWinners
From RoR Wiki
UI Lua API · PublicQuest functions
Version: WAR 1.4.8
Returns the final loot roll results of the public quest the player has just finished.
data = GetPQLootWinners()
Arguments
None.
Returns
- data
table– Result table (see below), or nothing if the client holds no public quest result.
| Key | Type | Meaning |
|---|---|---|
PQName |
wstring |
Name of the public quest. |
metMinContribution |
boolean |
– |
optedOut |
boolean |
– |
forcedOut |
boolean |
– |
scoreboardData |
table |
Up to 24 loot rows, see below. |
playerData |
table |
The local player's row, see below. Empty if the client has no row for the player. |
Each row in scoreboardData:
| Key | Type | Meaning |
|---|---|---|
name |
wstring |
Character name. |
grade |
number |
– |
sackType |
number |
Bag won. 6 for the first rows, one per gold bag; for later rows the stored bag type if it is 1 to 4, otherwise 0.
|
roll |
number |
persistence plus two other values stored for the row.
|
persistence |
number |
– |
bonus |
number |
Always -1 in this function.
|
playerData, when filled, has the same fields plus:
| Key | Type | Meaning |
|---|---|---|
place |
number |
The player's place. |
looserPrize |
wstring |
Text of a consolation prize; the stock UI shows it when it is not empty. (The key is spelled looserPrize.)
|
For playerData, sackType is 6 when place is not larger than the number of gold bags; otherwise it is worked out as for the other rows.
Details
- Compared to GetPQTopContributors, this table has no bag counts, no
numContributorsand notimeUntilPQReset, andbonusis always-1. The stock UI shows no contribution text whenbonusis negative. - Slots with an empty name are skipped, but each row keeps the index of its slot, so
scoreboardDatacan have gaps. - The data is kept until ClearPQLootData is called; after that the function returns nothing.
Errors
None.
Example
From default/easystem_utils/source/publicqueststates.lua:
local winnersData = GetPQLootWinners()
if winnersData ~= nil
then
PQData.ParseScoreboardData( winnersData )
elseif (GameData.PQData.pqName ~= nil) and (GameData.PQData.pqName ~= L"")
then
PQData.SetResettingData()
else
ERROR(L"PQData.ShowFinalResults Error: no data found")
return
end
