Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetTradeItemData

From RoR Wiki
Revision as of 19:45, 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 · Game functions
Version: WAR 1.4.8

Returns the items and money offered by one side of the current trade.

items, money = GetTradeItemData(side)

Arguments

side
number – 0 for the player's own offer, any other value for the other player's offer. The stock UI uses EA_Window_Trade.MY_OFFER_UPDATED (0) and EA_Window_Trade.OTHER_OFFER_UPDATED (1).

Returns

items
table – Array of 9 item data tables, indexed by trade slot from 1 to 9.
money
number – Amount of money offered.

Details

  • The offered items come first. The remaining slots, up to 9, are filled with blank item tables (id 0, empty name).
  • If there is no player object, or the Lua state is not available, the function returns nothing.

Errors

None.

Example

From ea_tradewindow/source/tradewindow.lua:

EA_Window_Trade.myOfferItemData, EA_Window_Trade.myOfferMoney = GetTradeItemData(EA_Window_Trade.MY_OFFER_UPDATED)
EA_Window_Trade.otherOfferItemData, EA_Window_Trade.otherOfferMoney = GetTradeItemData(EA_Window_Trade.OTHER_OFFER_UPDATED)

See also