<?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%3ARequestEquipTrophy</id>
	<title>API:RequestEquipTrophy - 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%3ARequestEquipTrophy"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:RequestEquipTrophy&amp;action=history"/>
	<updated>2026-10-18T04:54:20Z</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:RequestEquipTrophy&amp;diff=30669&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:RequestEquipTrophy&amp;diff=30669&amp;oldid=prev"/>
		<updated>2026-10-16T19:48:12Z</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=Item}}&lt;br /&gt;
Asks the server to move a trophy into one of the player&amp;#039;s trophy slots and, optionally, to attach it to a point on the character.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
RequestEquipTrophy(sourceLocation, sourceSlot, trophySlot, trophyLocation, trophyLocIndex)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;sourceLocation : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Where the trophy is now, as a &amp;lt;code&amp;gt;GameData.ItemLocs&amp;lt;/code&amp;gt; value.&lt;br /&gt;
;sourceSlot : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Slot of the trophy in &amp;lt;code&amp;gt;sourceLocation&amp;lt;/code&amp;gt;, starting at 1.&lt;br /&gt;
;trophySlot : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – The equipment slot to put it in. Must be one of the five trophy slots; the stock UI computes it as &amp;lt;code&amp;gt;position + GameData.Player.c_TROPHY_START_INDEX - 1&amp;lt;/code&amp;gt;.&lt;br /&gt;
;trophyLocation : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Attachment point location, as returned in &amp;lt;code&amp;gt;trophyLocation&amp;lt;/code&amp;gt; by [[API:GetLocationsForTrophies|GetLocationsForTrophies]].&lt;br /&gt;
;trophyLocIndex : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Attachment point index (&amp;lt;code&amp;gt;trophyLocIndex&amp;lt;/code&amp;gt; from the same table), starting at 1. 0 means &amp;quot;do not attach&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* If &amp;lt;code&amp;gt;trophySlot&amp;lt;/code&amp;gt; is not one of the trophy slots, nothing is sent.&lt;br /&gt;
* Otherwise the client first sends a move request from the source slot to the trophy slot.&lt;br /&gt;
* Then, if &amp;lt;code&amp;gt;trophyLocIndex&amp;lt;/code&amp;gt; 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:&lt;br /&gt;
** the item is a trophy (&amp;lt;code&amp;gt;GameData.ItemTypes.TROPHY&amp;lt;/code&amp;gt;);&lt;br /&gt;
** its current &amp;lt;code&amp;gt;trophyLocation&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;trophyLocIndex&amp;lt;/code&amp;gt; differ from the requested ones;&lt;br /&gt;
** the requested location passes the client&amp;#039;s check against the trophy&amp;#039;s allowed locations.&lt;br /&gt;
* &amp;lt;code&amp;gt;GameData.ItemLocs.BANK&amp;lt;/code&amp;gt; is not supported as a source location by the slot conversion this function uses.&lt;br /&gt;
* The function needs at least five arguments and only reads the last five.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None besides the generic &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; message when an argument is not a number.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_characterwindow/source/characterwindowtrophies.lua&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;CharacterWindow.AutoAttachTrophy&amp;lt;/code&amp;gt;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local trophyLocation = GameData.Player.c_INVALID_TROPHY_LOCATION&lt;br /&gt;
local trophyLocIndex = 0&lt;br /&gt;
...&lt;br /&gt;
local index, attachPointData = CharacterWindow.GetNextAvailableAttachmentPoint( itemData )&lt;br /&gt;
if index ~= 0 then&lt;br /&gt;
    trophyLocation = attachPointData.trophyLocation&lt;br /&gt;
    trophyLocIndex = attachPointData.trophyLocIndex&lt;br /&gt;
end&lt;br /&gt;
...&lt;br /&gt;
RequestEquipTrophy( sourceLocation, sourceSlot, trophySlot, trophyLocation, trophyLocIndex )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:AttachTrophyToLocation|AttachTrophyToLocation]]&lt;br /&gt;
* [[API:GetLocationsForTrophies|GetLocationsForTrophies]]&lt;br /&gt;
* [[API:GetTrophyData|GetTrophyData]]&lt;br /&gt;
* [[API:RequestMoveItem|RequestMoveItem]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>