API:ClaimMarketingReward
From RoR Wiki
UI Lua API · Game functions
Version: WAR 1.4.8
Asks the server to deliver a reward from the account rewards ("claim") window.
ClaimMarketingReward(rewardIndex)
Arguments
- rewardIndex
number– Position of the reward in the list from GameData.InteractData.GetClaimWindowList, starting at 1.
Returns
Nothing.
Details
- The client looks up the reward in its stored claim list and sends the server a claim request for it. ResetMarketingReward sends the same request with a "reset" flag instead.
- 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 (
rewardIndexequal to the number of rewards plus 1). 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.ClaimReward() if EA_Window_Claim.currentlySelectedChoice ~= EA_Window_Claim.NO_SELECTION_MADE then ClaimMarketingReward( EA_Window_Claim.currentlySelectedChoice ) end end
