Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:TomeGetItemRewardData

From RoR Wiki
Revision as of 19:50, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Tome functions
Version: WAR 1.4.8

Returns the item behind a Tome of Knowledge item reward, and where in the Tome it is unlocked.

itemData = TomeGetItemRewardData(rewardId)

Arguments

rewardId
number – Reward id: the rewardId of an item reward (reward type GameData.Tome.REWARD_ITEM or REWARD_ITEM_NO_AUTOCREATE), or of an entry from TomeGetItemRewardsList.

Returns

itemData
table – Always a table (possibly empty) when the argument is a number.
Key Type Meaning
unlockInfo table Where the reward is unlocked (see below).
item fields various When the client knows the item, the table also holds the item's data, in the same layout as other item tables (for example name and iconNum, which the stock UI reads).

unlockInfo:

Key Type Meaning
section number Tome section of the unlocking entry, or 0.
entry number Id of the unlocking entry in that section, or 0.
name wstring Name of the unlocking entry.
text wstring Text describing the unlocking entry.

Details

  • section and entry are both 0 when the reward has no unlocking entry. The stock UI then does not offer a link to it.
  • If the id is not a valid item reward, an error is logged and an empty table is returned.
  • The error message carries the name TomeGetPlayerItemRewardData.

Errors

These are written to the UI log; the call returns normally.

  • Error in function call 'TomeGetPlayerItemRewardData': %d is not a valid item reward id.

Example

From ea_tomeofknowledge/source/tomewindow.lua:

local itemData = TomeGetItemRewardData( rewardData.rewardId )
iconNum = itemData.iconNum

From ea_tomeofknowledge/source/tomewindow_rewards.lua:

local itemData = TomeGetItemRewardData( itemId )
if( itemData == nil ) then
    return
end

if( itemData.unlockInfo.section == 0 and itemData.unlockInfo.entry == 0 ) then
    return
end

TomeWindow.OpenTomeToEntry( itemData.unlockInfo.section, itemData.unlockInfo.entry )

See also