Difference between revisions of "Template:Trades"

 
(18 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 +
<noinclude>
 +
== Usage ==
 +
<nowiki>{{Trades|TRADED ITEM NAME|Quantity=QUANTITY OF ITEM RECEIVED|Item1=REQUIRED ITEM|Count1=NUMBER OF 1ST REQUIRED ITEM|Item2=ANOTHER REQUIRED ITEM|Count2=NUMBER OF 2ND REQUIRED ITEM}}</nowiki>
 +
 +
* You may use any number of <code>|Item#=|Count#=</code> parameters.
 +
* Each <code>|Item#=</code> '''MUST''' be paired with a <code>|Count#=</code> parameter, as the 'Count' parameter '''IS REQUIRED''' for the regex in the 'Traded To:' code on the [[Template:ARR Infobox Item|Item Template]] to work.
 +
* The <code>|Quantity=</code> CAN be omitted, but looks sloppy.
 +
* If the item you RECEIVE from the Merchant is [[HQ]], you must add <code>|HQItem=x</code> somewhere in the Template line (Preferably before the Item1/Count1, after the Quantity part.)
 +
 +
== Examples ==
 +
<nowiki>{{Trades|Augmented Ironworks Sollerets of Striking|Item1=Carbontwine|Count1=1|Item2=Ironworks Sollerets of Striking|Count2=1}}</nowiki>
 +
 +
<nowiki>{{Trades|Ironworks Magitek Sword|Quantity=1|Item1=Rowena's Token (Poetics)|Count1=7|Item2=Encrypted Tomestone|Count2=1}}</nowiki>
 +
 +
<nowiki>{{Trades|Augmented Nightsteel Sword|Quantity=1|HQItem=x|Item1=Resistance Token|Count1=15|Item2=Thavnairian Rain|Count2=4}}</nowiki>
 +
 +
<nowiki>{{Trades|Green Fallen Star|Quantity=2|Item1=Yellow Fallen Star|Count1=1}}</nowiki>
 +
 +
*(Last one translates to: 2 Green Fallen Stars received for trading 1 Yellow Fallen Star)
 +
 +
<!-- TEMPLATE CODE BELOW THIS LINE --></noinclude><includeonly>
 
{{!}}-
 
{{!}}-
 
{{!}}{{#ifexist:{{{1|}}}|{{#dpl:
 
{{!}}{{#ifexist:{{{1|}}}|{{#dpl:
Line 5: Line 26:
 
| namespace    =  
 
| namespace    =  
 
|  allowcachedresults=true
 
|  allowcachedresults=true
|  dplcache={{{1|x}}}sells2
+
|  dplcache={{{1|x}}}sells-4
 
| format      =,,\n
 
| format      =,,\n
 
| suppresserrors=true
 
| suppresserrors=true
 
}}|style="width: 5%;" {{!}}&nbsp;{{!}}{{!}}&nbsp;[[{{{1}}}]]{{!}}{{!}}&nbsp;{{!}}{{!}}&nbsp;{{!}}{{!}}&nbsp;}}
 
}}|style="width: 5%;" {{!}}&nbsp;{{!}}{{!}}&nbsp;[[{{{1}}}]]{{!}}{{!}}&nbsp;{{!}}{{!}}&nbsp;{{!}}{{!}}&nbsp;}}
{{!}}&nbsp;{{#if:{{{Quantity|}}}|<small>x</small>&nbsp;{{{Quantity|}}}}}
+
{{!}}&nbsp;{{#if:{{{Quantity|}}}|<small>x</small>&nbsp;{{{Quantity|}}}}}{{#if:{{{HQItem|}}}|{{HQ|2}}}}
 
{{!}}
 
{{!}}
{{#forargs:Item| ik | iv | {{#if:{{#var:iv|}}|{{#ifeq:{{#var:ik}}|{{#explode:{{#var:ik}}||0}}|<nowiki/>}}}}
+
{{#forargs:Item| ik | iv | {{#if:{{#var:iv|}}|{{#ifeq:{{#var:ik}}|{{#explode:{{#var:ik}}||0}}|<nowiki/>}}}}[[Category:Trades {{{Item{{#var:ik}}|unknown}}}]]
{{#if:{{{Item{{#var:ik}}|}}}|[[File:{{{Item{{#var:ik}}|}}} Icon.png|20px|link={{{Item{{#var:ik}}|unknown}}}]][[Category:Trades {{{Item{{#var:ik}}|unknown}}}]]
+
{{#if:{{{HQ{{#var:ik}}|}}}|{{HQo|{{{Item{{#var:ik}}|}}}|width=30px|HQ=x}}|[[File:{{{Item{{#var:ik}}|}}} Icon.png|30px|link={{{Item{{#var:ik}}|}}}]]}}{{#if:{{{Collectability{{#var:ik}}|}}}|<span style="white-space:nowrap">{{CollectableVendor|x}}{{{Collectability{{#var:ik}}}}}</span>|&nbsp;<small>x</small>&nbsp;{{formatnum:{{{Count{{#var:ik}}|1}}}}}}}<br>}}{{#if:{{{Requirement|}}}|[[File:Red-exclamation2.png|This item will not appear for sale until after the following requirements are met: {{{Requirement|}}}.|24px|link={{#ifexist: {{{Requirement}}} | {{{Requirement|}}} |}}]]}}
{{#if:{{{HQ{{#var:ik}}|}}}|{{HQ|x}}|{{#if:{{{Collectability{{#var:ik}}|}}}|<span style="white-space:nowrap">{{Collectable|x}}{{{Collectability{{#var:ik}}}}}</span>}}}}&nbsp;<small>x</small>&nbsp;{{formatnum:{{{Count{{#var:ik}}|1}}}
+
[[Category:{{Fixand|{{{1}}}}} Traded by Merchant]][[Category:Merchant]]</includeonly><noinclude>[[Category:Templates|{{PAGENAME}}]]</noinclude>
}}}}<br>}}
 
[[Category:{{Fixand|{{{1}}}}} Traded by Merchant]]<includeonly>[[Category:Merchant]]</includeonly><noinclude>[[Category:Template|{{PAGENAME}}]]</noinclude>
 

Latest revision as of 16:24, 24 March 2020

Usage

{{Trades|TRADED ITEM NAME|Quantity=QUANTITY OF ITEM RECEIVED|Item1=REQUIRED ITEM|Count1=NUMBER OF 1ST REQUIRED ITEM|Item2=ANOTHER REQUIRED ITEM|Count2=NUMBER OF 2ND REQUIRED ITEM}}

  • You may use any number of |Item#=|Count#= parameters.
  • Each |Item#= MUST be paired with a |Count#= parameter, as the 'Count' parameter IS REQUIRED for the regex in the 'Traded To:' code on the Item Template to work.
  • The |Quantity= CAN be omitted, but looks sloppy.
  • If the item you RECEIVE from the Merchant is HQ, you must add |HQItem=x somewhere in the Template line (Preferably before the Item1/Count1, after the Quantity part.)

Examples

{{Trades|Augmented Ironworks Sollerets of Striking|Item1=Carbontwine|Count1=1|Item2=Ironworks Sollerets of Striking|Count2=1}}

{{Trades|Ironworks Magitek Sword|Quantity=1|Item1=Rowena's Token (Poetics)|Count1=7|Item2=Encrypted Tomestone|Count2=1}}

{{Trades|Augmented Nightsteel Sword|Quantity=1|HQItem=x|Item1=Resistance Token|Count1=15|Item2=Thavnairian Rain|Count2=4}}

{{Trades|Green Fallen Star|Quantity=2|Item1=Yellow Fallen Star|Count1=1}}

  • (Last one translates to: 2 Green Fallen Stars received for trading 1 Yellow Fallen Star)