Template:DropsLine: Difference between revisions

537 bytes removed ,  Tuesday at 19:57
Don't error if {{{name}}} is empty or not given, which is done as a placeholder on new pages
m (not sure what color to use for unknown)
(Don't error if {{{name}}} is empty or not given, which is done as a placeholder on new pages)
 
(9 intermediate revisions by 3 users not shown)
Line 3:
<td>{{#if:{{{displayname|}}}|[[{{{name}}}|{{{displayname}}}]]|[[{{{name}}}]]}}</td>
<td>{{#if:{{{quantity|}}}|{{{quantity}}}|Unknown}}</td>
{{#if:{{{rarity|}}}|[[Category:Page with deprecated rarity tag]]{{#switch:{{lc:{{{rarityfrequency|}}}}}
|always = <td data-sort-value="1" class="table-bg-greyblue"><span>Always</span></td>
|common = <td data-sort-value="16" class="table-bg-green"><span>Common</span></td>
|uncommon = <td data-sort-value="64" class="table-bg-blueyellow"><span>Uncommon</span></td>
|rare = <td data-sort-value="256" class="table-bg-purpleorange"><span>Rare</span></td>
|epicvery rare = <td data-sort-value="1024" class="table-bg-yellowred"><span>EpicVery rare</span></td>
|#default = <td data-sort-value="65536" class="table-bg-redgrey"><span>Unknown</span></td>
}}
}}}}{{#if:{{{frequency|}}}|{{#switch:{{lc:{{{frequency|}}}}}
<td>{{#vardefine:value|{{#ifeq:{{{name}}}|Coins|1|{{#ask:[[{{#if:{{{name|}}}|{{{name}}}|Project:No page}}]]|?Value=|mainlabel=-}}}}}}{{#if:{{#var:value}}|{{#if:{{{quantity|}}}|{{#ifeq:{{#rpos:{{{quantity}}}|-}}|-1|{{Currency|{{#exprvar:value}}*{{{quantity}}}}}|{{Currency|{{#var:value}}*{{#explode:{{{quantity}}}|-|0}}}} – {{Currency|{{#var:value}}*{{#explode:{{{quantity}}}|-|1}}}}}}|{{Currency|{{#var:value}}}}}}|Unknown}}</td>
|always = <td data-sort-value="1" class="table-bg-grey"><span>Always</span></td>
|common = <td data-sort-value="16" class="table-bg-green"><span>Common</span></td>
|uncommon = <td data-sort-value="64" class="table-bg-blue"><span>Uncommon</span></td>
|rare = <td data-sort-value="256" class="table-bg-purple"><span>Rare</span></td>
|epic = <td data-sort-value="1024" class="table-bg-yellow"><span>Epic</span></td>
|#default = <td data-sort-value="65536" class="table-bg-red"><span>Unknown</span></td>
}}}}{{#if:{{{frequency|}}}{{{rarity|}}}||<td data-sort-value="65536" class="table-bg-red"><span>Unknown</span></td>}}
<td>{{#vardefine:value|{{#ifeq:{{{name}}}|Coins|1|{{#ask:[[{{{name}}}]]|?Value=|mainlabel=-}}}}}}{{#if:{{#var:value}}|{{#if:{{{quantity|}}}|{{Currency|{{#expr:{{#var:value}}*{{{quantity}}}}}}}|{{Currency|{{#var:value}}}}}}|Unknown}}</td>
</tr>{{#subobject:DROP_{{{name}}}_{{#if:{{{rarity|}}}|{{{rarity}}}|Unknown}}|Dropped from={{FULLPAGENAME}}|Dropped item={{{name}}}|Dropped quantity={{#if:{{{quantity|}}}|{{{quantity}}}|Unknown}}|Rarity={{#if:{{{frequency|}}}|{{{frequency}}}|Unknown}}}}</includeonly><noinclude>{{/doc}}</noinclude>
121

edits