Шаблон:Default item parameter — различия между версиями

Материал из Guild Wars 2 wiki
Перейти к: навигация, поиск
Строка 1: Строка 1:
 
{{#set:Has context=Item}}{{#if: {{{collection|}}} |
 
{{#set:Has context=Item}}{{#if: {{{collection|}}} |
;[[Collections|Коллекция]]
+
;[[Collections|Collection]]
 
:{{#arraymap:{{{collection}}}|,|@@@|[[Is part of collection::@@@|{{#replace:@@@|(achievement)}}]]|<br>}}
 
:{{#arraymap:{{{collection}}}|,|@@@|[[Is part of collection::@@@|{{#replace:@@@|(achievement)}}]]|<br>}}
 
}}{{#if: {{{rarity|}}} |
 
}}{{#if: {{{rarity|}}} |
;[[Item#Quality|Редкость]]
+
;[[Item#Quality|Rarity]]
 
:{{#arraymap:{{lc:{{{rarity}}}}}|,|@@@|{{#switch:@@@
 
:{{#arraymap:{{lc:{{{rarity}}}}}|,|@@@|{{#switch:@@@
 
|gray|junk={{#set:Has item rarity=Junk}}
 
|gray|junk={{#set:Has item rarity=Junk}}
Строка 16: Строка 16:
 
}} {{rarity|@@@}}
 
}} {{rarity|@@@}}
 
|<br>}}}}{{#if: {{{level|}}}|
 
|<br>}}}}{{#if: {{{level|}}}|
;[[Character#Progression|Треб. уровень]]  
+
;[[Character#Progression|Req. level]]  
 
:{{#arraymap: {{{level}}} |,|@@@|[[Has level requirement::@@@]]}}
 
:{{#arraymap: {{{level}}} |,|@@@|[[Has level requirement::@@@]]}}
}}{{ #if: {{{race|}}} |  
+
}}{{#if: {{{race|}}} |  
;[[Playable races|Треб. раса]] :[[Is for race::{{ucfirst:{{{race|}}}}}]]
+
;[[Playable races|Req. race]] :[[Is for race::{{ucfirst:{{{race|}}}}}]]
 
}}{{#ifeq: {{{unique}}} | y | {{#set:Is unique=Y}}
 
}}{{#ifeq: {{{unique}}} | y | {{#set:Is unique=Y}}
;[[Unique|Уникальность]]
+
;[[Unique]]
 
:Yes
 
:Yes
| {{#set:Is unique=N}} }}{{#vardefine:tradable|{{#var:tradable|{{#if:{{{tradable|}}}|{{{tradable}}}|yes}}}}}}{{#if:{{{bound|}}}|{{#ifeq: {{lc:{{{bound}}}}} | no | |
+
| {{#switch: {{lc:{{{rarity|}}}}} | pink | ascended = {{#set:Is unique=N}} }} }}{{#vardefine:tradable|{{#var:tradable|{{#if:{{{tradable|}}}|{{{tradable}}}|yes}}}}}}{{#if:{{{bound|}}}|{{#ifeq: {{lc:{{{bound}}}}} | no | |
;[[Binding|Привязка]]
+
;[[Binding]]
 
:{{#switch: {{lc:{{{bound}}}}}
 
:{{#switch: {{lc:{{{bound}}}}}
|u|use|on use = [[Soulbound|Привязка к персонажу]] при использовании {{#set:Has item binding=SoulBindOnUse}}
+
|u|use|on use = [[Soulbound]] on Use {{#set:Has item binding=SoulBindOnUse}}
|a|acquire|on acquire = [[Soulbound|Привязка к персонажу]] при получении{{#vardefine:tradable|no}} {{#set:Has item binding=SoulbindOnAcquire}}
+
|a|acquire|on acquire = [[Soulbound]] on Acquire{{#vardefine:tradable|no}} {{#set:Has item binding=SoulbindOnAcquire}}
|ab|account|account bound|account bound on acquire = [[Account Bound|Привязка к аккаунту]]{{#vardefine:tradable|no}} {{#set:Has item binding=AccountBound}}
+
|ab|account|account bound|account bound on acquire = [[Account Bound]]{{#vardefine:tradable|no}} {{#set:Has item binding=AccountBound}}
|absb|accountsoul|account soul = [[Account Bound|Привязка к аккаунту]]<br>[[Soulbound|Привязка к персонажу]] при использовании{{#vardefine:tradable|no}} {{#set:Has item binding=AccountBound,SoulBindOnUse|+sep=,}}
+
|absb|accountsoul|account soul = [[Account Bound]]<br>[[Soulbound]] on Use{{#vardefine:tradable|no}} {{#set:Has item binding=AccountBound,SoulBindOnUse|+sep=,}}
|abu|accountuse|account on use = [[Account Bound|Привязка к аккаунту]] при использовании {{#set:Has item binding=AccountBindOnUse}}
+
|abu|accountuse|account on use = [[Account Bound]] on Use {{#set:Has item binding=AccountBindOnUse}}
 
|#default = ''Unknown''
 
|#default = ''Unknown''
}} }} }}{{ #if: {{{cost|}}} |  
+
}} }} }}{{#if: {{{cost|}}} |  
;[[Currency#Cost versus Value|Стоимость]]  
+
;[[Currency#Cost versus Value|Cost]]  
:{{{cost|}}}}}{{ #if: {{{value|}}} |  
+
:{{{cost|}}}
;[[Currency#Cost versus Value|Ценность]]{{#set:Has vendor value={{{value|}}}}}
+
}}{{#if: {{{value|}}} |  
 +
;[[Currency#Cost versus Value|Value]]{{#set:Has vendor value={{{value|}}}}}
 
:{{coin|{{{value|}}}}}
 
:{{coin|{{{value|}}}}}
}}
+
}}{{#if: {{{id|}}} |
{{#if: {{{id|}}} |
+
;[[Chat link format|{{#if:{{{skin id|}}}|Item|Game}} link]]
;[[Chat link format|{{#if:{{{skin id|}}}|Ссылка на предмет|Игр. ссылка}}]]
 
 
:{{#arraymap:{{{id}}}|,|@@@|{{#set:Has game id=@@@}}{{item link|@@@}}|<br>}}
 
:{{#arraymap:{{{id}}}|,|@@@|{{#set:Has game id=@@@}}{{item link|@@@}}|<br>}}
 
}}{{#if: {{{skin id|}}} |
 
}}{{#if: {{{skin id|}}} |
;[[Chat link format|Ссылка на шкурку]]
+
;[[Chat link format|Skin link]]
 
:{{#arraymap:{{{skin id}}}|,|@@@| {{skin link|@@@}} |<br>}}
 
:{{#arraymap:{{{skin id}}}|,|@@@| {{skin link|@@@}} |<br>}}
}}
+
}}{{#if: {{{id|}}} |
{{#if: {{{id|}}} |
+
{{#ifeq:{{#var:tradable}}|yes|{{#ifeq: {{#switch: {{{status|}}} | unimplemented | future | historical = true | #default = false }} |false|<!-- only show if it's not historical, they'd only lead to 404's otherwise -->{{#vardefine:firstId|{{#explode:{{{id}}}|,|0}}}}
{{#ifeq:{{#var:tradable}}|yes|{{#ifeq:{{#show:{{PAGENAME}}|?Is historical}}|нет|<!-- only show if it's not historical, they'd only lead to 404's otherwise -->
+
;Trading post
{{#vardefine:firstId|{{#explode:{{{id}}}|,|0}}}}
+
:<span class="gw2-tpprice" data-id="{{#var:firstId}}">…</span>{{#Widget:TP prices}}
;Торговый пост
+
}}}}}}{{#if:{{#varexists:firstId}}|
:<span class="gw2-tpprice" data-id="{{#var:firstId}}">…</span>
+
;External links
}}}}}}{{#if:{{{id|}}}|
+
:[https://www.gw2bltc.com/en/item/{{#var:firstId}} GW2BLTC]<br>[https://www.gw2spidy.com/item/{{#var:firstId}} GW2Spidy]<br>[https://www.gw2tp.com/item/{{#var:firstId}} GW2TP]
<dt class="api hide">You have</dt><!--
 
--><dd class="api hide api-youhave" data-itemid="{{{id|}}}">…</dd>
 
}}{{#if:{{#varexists:firstId}}|
 
;Внешние ссылки
 
:[https://www.gw2bltc.com/en/item/{{#var:firstId}} GW2BLTC]<br>[http://www.gw2shinies.com/item/{{#var:firstId}} GW2Shinies]<br>[http://www.gw2spidy.com/item/{{#var:firstId}} GW2Spidy]<br>[http://www.gw2tp.com/item/{{#var:firstId}} GW2TP]
 
 
}}{{#if: {{{other ids|}}} | {{#arraymap:{{{other ids}}}|,|@@@|{{#set:Has game id=@@@}}|}}
 
}}{{#if: {{{other ids|}}} | {{#arraymap:{{{other ids}}}|,|@@@|{{#set:Has game id=@@@}}|}}
 
}}<noinclude>
 
}}<noinclude>
Строка 64: Строка 59:
 
<pre>
 
<pre>
 
{{default item parameter
 
{{default item parameter
 +
| status =
 
| collection =
 
| collection =
 
| rarity =
 
| rarity =
Строка 77: Строка 73:
  
 
===Parameters===
 
===Parameters===
{{:Template:Default item parameter/documentation}}
+
{{Default item parameter/documentation}}
  
 
=== Implemented on ===
 
=== Implemented on ===
Строка 87: Строка 83:
 
* {{tl|Item infobox}} for general items
 
* {{tl|Item infobox}} for general items
 
* {{tl|Trinket infobox}} for accessories
 
* {{tl|Trinket infobox}} for accessories
 +
* {{tl|Upgrade component infobox}} for upgrade components
 
* {{tl|Weapon infobox}} for weapons
 
* {{tl|Weapon infobox}} for weapons
  
 
[[Category:Infobox subtemplates|Default item parameter]]
 
[[Category:Infobox subtemplates|Default item parameter]]
 
</noinclude>
 
</noinclude>

Версия 12:39, 4 апреля 2018


Documentation

Usage

This template defines values available on all items and is implemented as a subtemplate on all infobox templates for items.

{{default item parameter
| status =
| collection =
| rarity =
| level =
| race = 
| unique =
| bound =
| cost =
| value =
| id =
| skin id =
}}

Parameters

The following parameters are handled by the {{Default item parameter}} template:

collection 
Optional. If the item is part of any collections.
rarity 
Specified rarity: junk, basic, fine, masterwork, rare, exotic, ascended, legendary. Will be set to Unspecified per default.
level 
Optional. Required level to use the item.
race 
Optional. Required race to use item. Currently only used for cultural armor and cultural weapons.
unique 
Optional. Whether the item is unique. "y" for yes, omit parameter if no.
bound 
Optional. Under what conditions the item becomes bound: no binding (default), use (soulbound on use), acquire (soulbound on acquisition), account, account soul (account bound on acquire, soul bound on use)
cost
Optional. Currency cost of the item when purchased from a vendor. To match it to the display in any vendor window, use the amount and the appropriate icon template, e.g. {{coin|500}}, 500 {{item icon|zhaitaffy}}, or 500 {{token|Guild Commendation}}
value
Optional. The number of Медная монета coins a vendor will pay for this item; use only the number, since the template assumes copper coins.
id
Optional. The item id. Does allow multiple ids to be set by using a comma-separated list.
other ids
Optional. Other item ids that are not displayed as chat links.
skin id
Optional. If given, an additional skin chat link will be displayed above the item chat link.


Implemented on