<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ATomeGetItemRewardData</id>
	<title>API:TomeGetItemRewardData - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ATomeGetItemRewardData"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:TomeGetItemRewardData&amp;action=history"/>
	<updated>2026-10-17T15:21:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:TomeGetItemRewardData&amp;diff=30806&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:TomeGetItemRewardData&amp;diff=30806&amp;oldid=prev"/>
		<updated>2026-10-16T19:50:25Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Tome}}&lt;br /&gt;
Returns the item behind a Tome of Knowledge item reward, and where in the Tome it is unlocked.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
itemData = TomeGetItemRewardData(rewardId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;rewardId : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Reward id: the &amp;lt;code&amp;gt;rewardId&amp;lt;/code&amp;gt; of an item reward (reward type &amp;lt;code&amp;gt;GameData.Tome.REWARD_ITEM&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;REWARD_ITEM_NO_AUTOCREATE&amp;lt;/code&amp;gt;), or of an entry from [[API:TomeGetItemRewardsList|TomeGetItemRewardsList]].&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;itemData : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – Always a table (possibly empty) when the argument is a number.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;unlockInfo&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; || Where the reward is unlocked (see below).&lt;br /&gt;
|-&lt;br /&gt;
| item fields || various || When the client knows the item, the table also holds the item&amp;#039;s data, in the same layout as other item tables (for example &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;iconNum&amp;lt;/code&amp;gt;, which the stock UI reads).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;unlockInfo&amp;lt;/code&amp;gt;:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Tome section of the unlocking entry, or &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;entry&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Id of the unlocking entry in that section, or &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Name of the unlocking entry.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; || Text describing the unlocking entry.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* &amp;lt;code&amp;gt;section&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;entry&amp;lt;/code&amp;gt; are both &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; when the reward has no unlocking entry. The stock UI then does not offer a link to it.&lt;br /&gt;
* If the id is not a valid item reward, an error is logged and an empty table is returned.&lt;br /&gt;
* The error message carries the name &amp;lt;code&amp;gt;TomeGetPlayerItemRewardData&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
These are written to the UI log; the call returns normally.&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;TomeGetPlayerItemRewardData&amp;#039;: %d is not a valid item reward id.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;ea_tomeofknowledge/source/tomewindow.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local itemData = TomeGetItemRewardData( rewardData.rewardId )&lt;br /&gt;
iconNum = itemData.iconNum&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;code&amp;gt;ea_tomeofknowledge/source/tomewindow_rewards.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local itemData = TomeGetItemRewardData( itemId )&lt;br /&gt;
if( itemData == nil ) then&lt;br /&gt;
    return&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
if( itemData.unlockInfo.section == 0 and itemData.unlockInfo.entry == 0 ) then&lt;br /&gt;
    return&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
TomeWindow.OpenTomeToEntry( itemData.unlockInfo.section, itemData.unlockInfo.entry )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:TomeGetItemRewardsList|TomeGetItemRewardsList]]&lt;br /&gt;
* [[API:TomeGetTacticRewardData|TomeGetTacticRewardData]]&lt;br /&gt;
* [[API:TomeGetPlayerTitleData|TomeGetPlayerTitleData]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>