Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:RequestEquipTrophy

From RoR Wiki

UI Lua API · Item functions
Version: WAR 1.4.8

Asks the server to move a trophy into one of the player's trophy slots and, optionally, to attach it to a point on the character.

RequestEquipTrophy(sourceLocation, sourceSlot, trophySlot, trophyLocation, trophyLocIndex)

Arguments

sourceLocation
number – Where the trophy is now, as a GameData.ItemLocs value.
sourceSlot
number – Slot of the trophy in sourceLocation, starting at 1.
trophySlot
number – The equipment slot to put it in. Must be one of the five trophy slots; the stock UI computes it as position + GameData.Player.c_TROPHY_START_INDEX - 1.
trophyLocation
number – Attachment point location, as returned in trophyLocation by GetLocationsForTrophies.
trophyLocIndex
number – Attachment point index (trophyLocIndex from the same table), starting at 1. 0 means "do not attach".

Returns

Nothing.

Details

  • If trophySlot is not one of the trophy slots, nothing is sent.
  • Otherwise the client first sends a move request from the source slot to the trophy slot.
  • Then, if trophyLocIndex is not 0, it looks at the item currently in the source slot. A second request, to set the attachment point of the trophy slot, is sent only when:
    • the item is a trophy (GameData.ItemTypes.TROPHY);
    • its current trophyLocation/trophyLocIndex differ from the requested ones;
    • the requested location passes the client's check against the trophy's allowed locations.
  • GameData.ItemLocs.BANK is not supported as a source location by the slot conversion this function uses.
  • The function needs at least five arguments and only reads the last five.

Errors

None besides the generic Invalid Parameters message when an argument is not a number.

Example

From default/ea_characterwindow/source/characterwindowtrophies.lua (CharacterWindow.AutoAttachTrophy):

local trophyLocation = GameData.Player.c_INVALID_TROPHY_LOCATION
local trophyLocIndex = 0
...
local index, attachPointData = CharacterWindow.GetNextAvailableAttachmentPoint( itemData )
if index ~= 0 then
    trophyLocation = attachPointData.trophyLocation
    trophyLocIndex = attachPointData.trophyLocIndex
end
...
RequestEquipTrophy( sourceLocation, sourceSlot, trophySlot, trophyLocation, trophyLocIndex )

See also