API:ResetMarketingReward
From RoR Wiki
UI Lua API · Game functions
Version: WAR 1.4.8
Asks the server to reset a reward in the account rewards ("claim") window.
ResetMarketingReward(rewardIndex)
Arguments
- rewardIndex
number– Position of the reward in the list from GameData.InteractData.GetClaimWindowList, starting at 1.
Returns
Nothing.
Details
- The client sends the same request as ClaimMarketingReward, with a "reset" flag set. What a reset does is decided by the server. The stock UI only shows its Reset button for rewards whose
rewardCanResetfield istrue. - Nothing is sent if the stored item list and reward list have different lengths, or the index is too large. Only the low byte of
rewardIndexis used. - The range check accepts an index one past the end of the list. In that case the client reads past the end of its stored list. Pass only indexes of entries in the list.
- The argument check names the wrong function: if the argument is missing or not a number, the Invalid Parameters message names
ItemContainerLootItem. - Exactly one argument must be passed.
Errors
None besides the generic Invalid Parameters message (see Details).
Example
From default/ea_claimwindow/source/claimwindow.lua:
function EA_Window_Claim.ResetReward() if EA_Window_Claim.currentlySelectedChoice ~= EA_Window_Claim.NO_SELECTION_MADE then ResetMarketingReward( EA_Window_Claim.currentlySelectedChoice ) end end
