<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Getitem</title><link>https://sourceforge.net/p/hercules/wiki/Getitem/</link><description>Recent changes to Getitem</description><atom:link href="https://sourceforge.net/p/hercules/wiki/Getitem/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 20 Feb 2023 05:01:32 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/hercules/wiki/Getitem/feed" rel="self" type="application/rss+xml"/><item><title>Getitem modified by Brynner</title><link>https://sourceforge.net/p/hercules/wiki/Getitem/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;span&gt;[Category:Script_Command]&lt;/span&gt;&lt;/p&gt;
&lt;div class="toc"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#syntax"&gt;Syntax&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#description"&gt;Description&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#examples"&gt;Examples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#see-also"&gt;See Also&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2 id="syntax"&gt;Syntax&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="alink" href="/p/hercules/wiki/Getitem/"&gt;[Getitem]&lt;/a&gt; &amp;lt;item id&amp;gt;,&amp;lt;amount&amp;gt;{,&amp;lt;account ID&amp;gt;}; &lt;/li&gt;
&lt;li&gt;&lt;a class="alink" href="/p/hercules/wiki/Getitem/"&gt;[Getitem]&lt;/a&gt; "&amp;lt;item name&amp;gt;",&amp;lt;amount&amp;gt;{,&amp;lt;account ID&amp;gt;}; &lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="description"&gt;Description&lt;/h2&gt;
&lt;p&gt;This command will give a specific amount of specified items to the target&lt;br/&gt;
character. If the character is not online, nothing will happen. If &amp;lt;character&lt;br/&gt;
ID&amp;gt; is not specified, items will be created in the invoking character&lt;br/&gt;
inventory instead.&lt;/p&gt;
&lt;p&gt;In the first and most commonly used version of this command, items are&lt;br/&gt;
referred to by their database ID number, which can be found in {{git|db/pre-&lt;br/&gt;
re/item_db.txt}} or {{git|db/re/item_db.txt}}&lt;/p&gt;
&lt;p&gt;Giving an item ID of -1 will give a specified number of random items from the&lt;br/&gt;
list of those that fall out of Old Blue Box. Unlike in all other cases, these&lt;br/&gt;
will be unidentified, if they turn out to be equipment. This is exactly what's&lt;br/&gt;
written in the Old Blue Box's item script.&lt;/p&gt;
&lt;p&gt;Other negative IDs also correspond to other random item generating item&lt;br/&gt;
tables:&lt;/p&gt;
&lt;p&gt;Giving an item ID of -2 will produce the effects of Old Violet Box. Giving an&lt;br/&gt;
item ID of -3 will produce the effects of Old Card Album. Giving an item ID of&lt;br/&gt;
-4 will produce the effects of Gift Box. Giving an item ID of -5 will produce&lt;br/&gt;
the effects of Worn Out Scroll, which drops only Jellopies anyway.&lt;/p&gt;
&lt;p&gt;This transaction is logged if the log script generated transactions option is&lt;br/&gt;
enabled.&lt;/p&gt;
&lt;p&gt;You may also create an item by it's name in the 'english name' field in the&lt;br/&gt;
item database:&lt;/p&gt;
&lt;p&gt;Which will do what you'd expect. If it can't find that name in the database,&lt;br/&gt;
apples will be created anyway. It is often a VERY GOOD IDEA to use it like&lt;br/&gt;
this.&lt;/p&gt;
&lt;p&gt;This is used in pretty much all NPC scripts that have to do with items and&lt;br/&gt;
quite a few item scripts. For more examples check just about any official&lt;br/&gt;
script.&lt;/p&gt;
&lt;h2 id="examples"&gt;Examples&lt;/h2&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;    getitem 502,10; // The person will receive 10 apples
    getitem 617,1;  // The person will receive 1 Old Violet Box
    getitem "RED_POTION",10;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="see-also"&gt;See Also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;[Getitem2]&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;[Category:Script Command]&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Brynner</dc:creator><pubDate>Mon, 20 Feb 2023 05:01:32 -0000</pubDate><guid>https://sourceforge.net5d3a240aea94a1463cf1494a508bbbeaa985bc5a</guid></item></channel></rss>