API:GameData.GetInfluenceRewards
From RoR Wiki
UI Lua API · PublicQuest functions
Version: WAR 1.4.8
Returns the reward items of an influence track, grouped by reward tier.
rewards = GameData.GetInfluenceRewards(influenceId)
Arguments
- influenceId
number– Influence id, for example theinfluenceIdof a War Journal chapter.
Returns
- rewards
table– Array of three tier tables,rewards[1]torewards[3], or nothing (see Details).
Each tier table is an array of item tables, indexed from 1, in the format described in GetInventoryItemData: item data table.
Details
- The function returns nothing if there is no player object, or if the client has no reward data stored for
influenceId. - All three tier tables are always present when a table is returned. A tier without items is an empty table.
- A new table is built on every call.
- The function takes exactly one argument.
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a number.
Example
From default/ea_tomeofknowledge/source/tomewindow_warjournal.lua (shortened):
local influenceRewards = GameData.GetInfluenceRewards( influenceId )
if( influenceRewards == nil ) then
return
end
for level = 1, TomeWindow.NUM_REWARD_LEVELS do
local levelRewards = influenceRewards[level]
for reward = 1, TomeWindow.MAX_REWARDS_PER_LEVEL do
local itemData = nil
if levelRewards then
...
