API:GetRewardPools
From RoR Wiki
UI Lua API · PublicQuest functions
Version: WAR 1.4.8
Returns the two reward pool values and the time until the next pool shift, as shown in the stock zone control bar tooltip.
winnerPool, loserPool, isNextShift, timeUntilShift = GetRewardPools()
Arguments
None.
Returns
- winnerPool
number– First pool value. The stock UI labels it as the winner's reward pool.- loserPool
number– Second pool value. The stock UI labels it as the loser's reward pool.- isNextShift
boolean–trueif a shift time is set.- timeUntilShift
number– Seconds from now until the stored shift time.
Details
- All four values come from one block of data the client stores (the same block that holds the public quest results). If that block does not exist, the function returns nothing.
- When no shift time is set, the client stores the largest single-precision float as the time.
isNextShiftis thenfalseandtimeUntilShiftis that huge value minus the current time. CheckisNextShiftbefore usingtimeUntilShift. timeUntilShiftis a fraction and is not clamped; it becomes negative once the shift time has passed.- The pool values are whole numbers from 0 to 255.
Errors
None.
Example
From default/easystem_threepartbar/source/ea_threepartbar.lua (tooltip, shortened):
local winnerRewardPool, loserRewardPool, isNextShift, timeUntilShift = GetRewardPools()
Tooltips.SetTooltipText( currentRow, 2, GetStringFormatFromTable( "WorldControl", StringTables.WorldControl.TEXT_CONTROL_CURRENT_POOLS_DETAILS, { towstring(winnerRewardPool), towstring(loserRewardPool) } ) )
if ( isNextShift )
then
Tooltips.SetTooltipText( currentRow, 2, TimeUtils.FormatSeconds( timeUntilShift ) )
end
