<?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%3AAttachTrophyToLocation</id>
	<title>API:AttachTrophyToLocation - 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%3AAttachTrophyToLocation"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:AttachTrophyToLocation&amp;action=history"/>
	<updated>2026-10-17T15:21:43Z</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:AttachTrophyToLocation&amp;diff=30177&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:AttachTrophyToLocation&amp;diff=30177&amp;oldid=prev"/>
		<updated>2026-10-16T19:40:28Z</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 attach an equipped trophy to a different point on the character.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
AttachTrophyToLocation(trophyPosition, trophyLocation, trophyLocIndex)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;trophyPosition : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Which trophy slot, 1 to 5 (the index into the [[API:GetTrophyData|GetTrophyData]] table).&lt;br /&gt;
;trophyLocation : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Attachment point location (&amp;lt;code&amp;gt;trophyLocation&amp;lt;/code&amp;gt; from [[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.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The request is only sent when:&lt;br /&gt;
** the trophy slot holds a trophy (&amp;lt;code&amp;gt;GameData.ItemTypes.TROPHY&amp;lt;/code&amp;gt;);&lt;br /&gt;
** the requested location or index differs from the one the trophy already has;&lt;br /&gt;
** the requested location passes the client&amp;#039;s check against the trophy&amp;#039;s allowed locations.&lt;br /&gt;
: Otherwise the call does nothing.&lt;br /&gt;
* The client does not range-check &amp;lt;code&amp;gt;trophyPosition&amp;lt;/code&amp;gt;. Use 1 to 5.&lt;br /&gt;
* The function needs at least three arguments and only reads the last three.&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;
Moving the selected trophy to the next free attachment point, from &amp;lt;code&amp;gt;default/ea_characterwindow/source/characterwindowtrophies.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local trophyData = CharacterWindow.trophyData[CharacterWindow.currentlySelectedTrophyPosition]&lt;br /&gt;
&lt;br /&gt;
local startIndex = CharacterWindow.GetIndexForTrophyLoc( trophyData.trophyLocation, trophyData.trophyLocIndex )&lt;br /&gt;
local index, attachPointData = CharacterWindow.GetNextAvailableAttachmentPoint( trophyData, startIndex+1 )&lt;br /&gt;
&lt;br /&gt;
if index ~= 0 then&lt;br /&gt;
    AttachTrophyToLocation( CharacterWindow.currentlySelectedTrophyPosition, attachPointData.trophyLocation, attachPointData.trophyLocIndex)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:GetLocationsForTrophies|GetLocationsForTrophies]]&lt;br /&gt;
* [[API:GetTrophyData|GetTrophyData]]&lt;br /&gt;
* [[API:RequestEquipTrophy|RequestEquipTrophy]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>