Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:UpgradeEquipment

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

Sends an equipment upgrade request for an item, optionally with a second item used for the upgrade.

UpgradeEquipment(isTest, mainBackpack, mainSlot, secondBackpack, secondSlot)

Arguments

isTest
boolean – Sent with the request. The stock UI passes the isTest flag of its upgrade window.
mainBackpack
number – Backpack of the item to upgrade, as an EA_Window_Backpack.TYPE_* value: 2 (TYPE_INVENTORY), 3 (TYPE_CURRENCY) or 4 (TYPE_CRAFTING).
mainSlot
number – Slot of that item inside the backpack, starting at 1.
secondBackpack
number – Backpack of the second item, same values as mainBackpack, or 0 for no second item.
secondSlot
number – Slot of the second item, or 0.

Returns

Nothing.

Details

  • mainBackpack must be 2, 3 or 4, or the error below is raised and nothing is sent.
  • If secondBackpack is not 2, 3 or 4, the request is sent without a second item.
  • Both items are converted to absolute inventory slots before sending.
  • isTest must be a real boolean. Passing nil or a number raises an Invalid Parameters error.
  • If there is no player object or the Lua state is not available, nothing happens.
  • The function needs at least five arguments and only reads the last five.

Errors

  • Error in function call 'UpgradeEquipment': Invalid main item backpack.
  • The generic Invalid Parameters message when an argument has the wrong type.

Example

From default/ea_craftingwindow/source/equipmentupgradewindow.lua:

UpgradeEquipment( isTest, currentItems[SLOT_MAINITEM].sourceBackpack, currentItems[SLOT_MAINITEM].sourceSlot, currentItems[SLOT_REFINEMENT].sourceBackpack, currentItems[SLOT_REFINEMENT].sourceSlot )

Without a second item:

UpgradeEquipment( isTest, currentItems[SLOT_MAINITEM].sourceBackpack, currentItems[SLOT_MAINITEM].sourceSlot, 0, 0 )

See also