Latest revision |
Your text |
Line 4: |
Line 4: |
| category | | category |
| if a name parameter is given, it is assumed that the template isn't on the item's main article, therefore it isn't categorized | | if a name parameter is given, it is assumed that the template isn't on the item's main article, therefore it isn't categorized |
− | -->{{#vardefine:type text|{{#switch:{{lc:{{{category|}}}}} | + | -->{{#vardefine:typeText|{{#switch:{{lc:{{{category|}}}}} |
| |armor=[[Armor]] | | |armor=[[Armor]] |
| |artifacts=[[Artifact]] | | |artifacts=[[Artifact]] |
Line 16: |
Line 16: |
| }}}}<!-- | | }}}}<!-- |
| -->{{#if:{{{name|}}}<!-- if a name parameter is not given | | -->{{#if:{{{name|}}}<!-- if a name parameter is not given |
− | -->||{{#if:{{#var:type text}}<!-- if the type is correct (i.e. type text exists) | + | -->||{{#if:{{#var:typeText}}<!-- if the type is correct (i.e. typeText exists) |
− | -->|{{#ifeq:{{#var:type text}}|[[Raw Material]]<!-- if item is a raw material
| + | -->|[[Category:{{sc|{{{category}}}}}]]}}}}<!-- add to category |
− | -->|{{#arraydefine:professions|{{#ask:[[Has ingredient::?;{{PAGENAME}}]]<!-- get recipes with item as ingredient
| |
− | -->|?Has profession=|mainlabel=-|link=none}}}}<!-- get professions used in recipe
| |
− | -->{{#arrayprint:professions||@<!-- for each profession
| |
− | -->|{{#if:{{#ask:[[Category:Gathering Professions]][[@]]}}<!-- if profession is a gathering profession
| |
− | -->|[[Category:@ Raw Materials]]}}}}<!-- categorize
| |
− | -->|[[Category:{{sc|{{{category|Items}}}}}]]}}}}}}<!-- else add to category | |
− | | |
− | -->{{#vardefine:quality class|{{#switch:<!--
| |
− | -->{{#explode:{{lc:{{{quality|{{{category}}}}}}}}|-|0}}<!-- qualities may be defined using a range [quality1]-[quality2] so take the lower bound (quality1) -->
| |
− | |common=quality-common
| |
− | |uncommon=quality-uncommon
| |
− | |rare=quality-rare
| |
− | |epic=quality-epic
| |
− | |legendary=quality-legendary
| |
− | |quest items=quality-quest-item
| |
− | |#default=quality-common<!-- items with no quality are assumed to be common -->
| |
− | }}}}<!--
| |
− | | |
− | stats are comma-separated and in the format:
| |
− | [stat name]: [stat value]
| |
− | -->{{#arraydefine:stats|{{{stats|}}}}}<!--
| |
− | | |
− | satiety effects are comma-separated and in the format:
| |
− | [effect name] [effect value]
| |
− | -->{{#arraydefine:satiety effect|{{{satiety effect}}}}}<!--
| |
− | | |
− | quests
| |
− | -->{{#arraydefine:quest text|{{{quests}}}|;}}<!--
| |
| | | |
| TABLE --> | | TABLE --> |
Line 53: |
Line 25: |
| item icon | | item icon |
| -->{{#if:{{{icon|}}}<!-- if icon exists | | -->{{#if:{{{icon|}}}<!-- if icon exists |
− | -->|<span class="{{#var:quality class}}">[[File:{{{icon}}}|85px]]</span><!-- use provided icon | + | -->|[[{{{icon}}}|85px]]<!-- use provided icon |
− | -->|{{#ifeq:{{#explode:{{PAGENAME}}|:|0}}|Recipe<!-- if the item is a recipe
| |
− | -->|{{Recipe icon|quality={{#var:quality class}}}}<!-- use the recipe icon template
| |
| -->|{{#vardefine:defaultIcon|File:{{#replace:{{#titleparts:{{PAGENAME}}}}|:|-}}.png}}<!-- else use default icon | | -->|{{#vardefine:defaultIcon|File:{{#replace:{{#titleparts:{{PAGENAME}}}}|:|-}}.png}}<!-- else use default icon |
| -->{{#ifexist:{{#var:defaultIcon}}<!-- if default icon exists | | -->{{#ifexist:{{#var:defaultIcon}}<!-- if default icon exists |
− | -->|<span class="{{#var:quality class}}">[[{{#var:defaultIcon}}|85px]]</span><!-- use default icon | + | -->|[[{{#var:defaultIcon}}|85px]]<!-- use default icon |
− | -->|[[{{#var:defaultIcon}}|Upload item icon.]]}}}}}}<!-- else prompt for icon upload | + | -->|[[{{#var:defaultIcon}}|Upload item icon.]]}}}}<!-- else prompt for icon upload |
− | -->{{#if:{{{change|}}}|<br><small>(This Item's appearance may change.)</small>}}</center> | + | --></center> |
| |- | | |- |
− | ! colspan="2" class="{{#var:quality class}}"<!-- | + | ! colspan="2" class="{{#switch:{{lc:{{{quality|}}}}} |
− | --> | <center>{{{name|{{PAGENAME}}}}}</center><!-- name --> | + | |common=quality-common |
| + | |uncommon=quality-uncommon |
| + | |rare=quality-rare |
| + | |epic=quality-epic |
| + | |legendary=quality-legendary |
| + | |#default=quality-common<!-- items with no quality are assumed to be common --> |
| + | }}" | <center>{{{name|{{PAGENAME}}}}}</center><!-- name --> |
| |- | | |- |
− | {{#if:{{#var:type text}}|{{!}}class="skill-infobox-row-heading"{{!}}'''Type'''{{!}}{{!}}class="skill-infobox-row-data"{{!}}{{#var:type text}}}} | + | {{#if:{{#var:typeText}}|{{!}}class="skill-infobox-row-heading"{{!}}'''Type'''{{!}}{{!}}class="skill-infobox-row-data"{{!}}{{#var:typeText}}}} |
| |- | | |- |
− | {{#if:{{{quality|}}}|{{InfoboxRow|'''[[Quality]]'''|<!-- | + | {{#if:{{{quality|}}}|{{!}}class="skill-infobox-row-heading"{{!}}'''[[Quality]]'''{{!}}{{!}}class="skill-infobox-row-data"{{!}}{{ucfirst:{{lc:{{{quality}}}}}}}}} |
− | -->{{#arraydefine:qualities|{{lc:{{{quality}}}}}|-}}<!-- split range of qualities by '-' | |
− | -->{{#arrayprint:qualities|-|@|{{ucfirst:@}}}}}}<!-- ensure each quality starts with an uppercase letter -->}}
| |
| |- | | |- |
− | {{#if:{{{tier|}}}|{{InfoboxRow|'''[[Tier]]'''|{{{tier}}}}}}} | + | {{#if:{{{tier|}}}|{{!}}class="skill-infobox-row-heading"{{!}}'''[[Tier]]'''{{!}}{{!}}class="skill-infobox-row-data"{{!}}{{{tier}}}}} |
| |- | | |- |
− | {{#if:{{{level|}}}|{{InfoboxRow|'''Req. [[Level]]'''|{{{level}}}}}}} | + | {{#if:{{{level|}}}|{{!}}class="skill-infobox-row-heading"{{!}}'''Req. [[Level]]'''{{!}}{{!}}class="skill-infobox-row-data"{{!}}{{{level}}}}} |
| |- | | |- |
− | {{#if:{{{binding|}}}|{{InfoboxRow|'''[[Binding]]'''|{{#switch:{{lc:{{{binding}}}}}|pickup=[[Binding#On Pickup|On Pickup]]|equip=[[Binding#On Equip|On Equip]]|#default={{{binding}}}}}}}}} | + | {{#if:{{{value|}}}|{{!}}class="skill-infobox-row-heading"{{!}}'''Value'''{{!}}{{!}}class="skill-infobox-row-data"{{!}}{{stat|Gold|{{{value}}}|nolabel=yes}}}} |
− | |-
| + | |}</div><!-- |
− | {{#if:{{{hero|}}}|{{InfoboxRow|'''Req. [[Hero]]'''|[[{{{hero}}}]]}}}}
| |
− | |-
| |
− | {{#if:{{{mastery|}}}|{{InfoboxRow|'''Req. [[Mastery]]'''|[[{{{mastery}}}]]}}}}<!-- | |
− | | |
− | -->{{#arrayprint:stats||@|{{InfoboxRow|'''{{#explode:@|:|0}}'''|{{#sub:@|{{#expr:{{#pos:@|:}}+1}}}}}}}}
| |
− | |-
| |
− | {{#if:{{{duration|}}}|{{InfoboxRow|'''Duration'''|{{{duration}}}}}}}
| |
− | |-
| |
− | {{#if:{{{satiety effect|}}}|{{InfoboxRow|'''[[Satiety Effect]]'''|<!-- satiety effect row
| |
− | -->{{#arrayprint:satiety effect|<br><!-- print stats array, separated by line breaks | |
− | -->|@|{{#vardefine:name|{{#sub:@|{{#pos:@| }}}}}}<!-- stat name
| |
− | -->{{stat|{{sc|{{#var:name}}}}|{{#explode:@| |0}}|nolabel=yes}}}}}}<!-- stat template -->}}
| |
− | |-
| |
− | {{#if:{{{satiety duration|}}}|{{InfoboxRow|'''Satiety Duration'''|{{{satiety duration}}}}}}}
| |
− | |-
| |
− | {{#if:{{{quests|}}}|{{InfoboxRow|'''Involved in'''|{{#arrayprint:quest text|<br>|@|[[@]]}}}}}}
| |
− | |-
| |
− | {{#if:{{{value|}}}|{{InfoboxRow|'''Value'''|{{stat|Gold|{{{value}}}|nolabel=yes}}}}}}
| |
− | |} | |
− | </div><!-- | |
| DESCRIPTION | | DESCRIPTION |
− | -->{{#if:{{{tooltip|}}}|{{quotation|{{{tooltip}}}|game}}}}{{{description|{{error|No description was provided. Add a description parameter.}}}}}<!-- | + | -->{{{description|{{error|No description was provided. Add a description parameter.}}}}}</includeonly><noinclude>{{Item info/Documentation}}</noinclude> |
− | | |
− | PROPERTIES
| |
− | -->{{#if:{{{name|}}}{{NAMESPACE}}|<!-- if there is a name parameter or namespace don't set any properties
| |
− | -->|{{#if:{{#var:quality class}}|{{#set:Has quality=<!-- set 'Has quality' property
| |
− | -->{{sc|<!--
| |
− | -->{{#replace:<!--
| |
− | -->{{#sub:{{#var:quality class}}|{{#expr:{{#pos:{{#var:quality class}}|-}}+1}}}}<!-- remove 'quality-' from the string
| |
− | -->|-| }}<!-- replace '-' with ' '
| |
− | -->| }}<!-- put string into start case
| |
− | -->}}}}<!--
| |
− | -->{{#if:{{{icon|{{#var:defaultIcon}}}}}|{{#set:Has icon={{{icon|{{#explode:{{#var:defaultIcon}}|:|1}}}}}}}<!-- set 'Has icon' property
| |
− | -->}}}}</includeonly><noinclude>{{Item info/Documentation}}</noinclude>
| |