<?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%3ADestroyItem</id>
	<title>API:DestroyItem - 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%3ADestroyItem"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:DestroyItem&amp;action=history"/>
	<updated>2026-10-17T08:25: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:DestroyItem&amp;diff=30274&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:DestroyItem&amp;diff=30274&amp;oldid=prev"/>
		<updated>2026-10-16T19:41:57Z</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=Game}}&lt;br /&gt;
Asks the server to destroy the item in a given location and slot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DestroyItem(location, slot)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;location : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Where the item is, as a &amp;lt;code&amp;gt;GameData.ItemLocs&amp;lt;/code&amp;gt; value (the stock UI passes &amp;lt;code&amp;gt;Cursor.Data.Source&amp;lt;/code&amp;gt;).&lt;br /&gt;
;slot : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Slot of the item within that location.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* There is no confirmation step in the client. The stock UI shows a Yes/No dialog first and only calls &amp;lt;code&amp;gt;DestroyItem&amp;lt;/code&amp;gt; when the player confirms.&lt;br /&gt;
* The request is only sent for the item locations the client handles here. For any other location the call does nothing.&lt;br /&gt;
* Whether the item is actually destroyed is decided by the server; the inventory updates when the server replies.&lt;br /&gt;
* The function needs at least two arguments and only reads the last two.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None besides the &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; argument check.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;ea_cursor/source/cursor.lua&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;Cursor.DoDestroyItem&amp;lt;/code&amp;gt;, the dialog&amp;#039;s Yes callback):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if( Cursor.Data.Source == Cursor.SOURCE_EQUIPMENT or&lt;br /&gt;
    Cursor.Data.Source == Cursor.SOURCE_BANK or&lt;br /&gt;
    Cursor.Data.Source == Cursor.SOURCE_INVENTORY or&lt;br /&gt;
    ... ) then&lt;br /&gt;
    DestroyItem( Cursor.Data.Source, Cursor.Data.SourceSlot )&lt;br /&gt;
    Cursor.Clear()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:SetItemDragging|SetItemDragging]]&lt;br /&gt;
* [[API:SetCursor|SetCursor]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>