Редактирование: Шаблон:Vendor table row
Материал из Guild Wars 2 wiki
Внимание! Вы не авторизовались на сайте. Ваш IP-адрес будет публично видимым, если вы будете вносить любые правки. Если вы войдёте или создадите учётную запись, правки вместо этого будут связаны с вашим именем пользователя, а также у вас появятся другие преимущества.
Правка может быть отменена. Пожалуйста, просмотрите сравнение версий, чтобы убедиться, что это именно те изменения, которые вас интересуют, и нажмите «Записать страницу», чтобы изменения вступили в силу.
На этой странице невозможны семантические аннотации в тексте из-за ограничений пространства имён. Детали относительно того, как разрешить пространство имен, находятся в справочной странице конфигурации.
Текущая версия | Ваш текст | ||
Строка 1: | Строка 1: | ||
− | <includeonly>|- | + | <includeonly>|- {{#vardefine:item_page|{{#if:{{{id|}}}|{{#ask:[[Has item rarity::+]][[Has game id::{{{id}}}]]|link=none}}|{{{item|}}}}}}}<!-- Grab the target page object containing item data, id overrides item --> |
− | | | + | | {{item icon|{{#var:item_page}}}} {{#if: {{{quantity|}}} | ({{{quantity}}}) }}{{#show:{{#var:item_page}} |
− | + | |?Has armor weight class | |
− | + | |?Has item type | |
− | + | |?Has armor type | |
− | + | |?Has weapon type | |
− | + | |?Has trinket type | |
− | + | |?Has upgrade component type | |
− | + | |?Has item rarity | |
− | + | |?Has level requirement | |
− | + | |?Has equipment prefix | |
− | + | |?Has upgrade component | |
− | + | | link = none | |
− | + | | format = template | |
− | + | | template = Vendor table row result format | |
− | + | | default = {{Vendor table row result format|{{{class|}}}|{{{type|}}}|<!--3-->|<!--4-->|<!--5-->|<!--6-->|{{{rarity|-}}}|{{{level|}}}|{{{prefix|}}}}} | |
− | + | }} | |
− | }} | + | | align="right" | {{#arraymap:{{{cost|}}} | + | @@@ | {{currency|{{#explode:@@@| |0}}|{{#sub:@@@|{{#pos:@@@| }}}}|{{#ifeq:{{#sub:@@@|{{#pos:@@@| }}}}|coin|y}}}} | + }} |
− | + | {{#subobject:vendor{{#vardefineecho:vendorcnt|{{#expr:{{#var:vendorcnt|0}}+1}}}} | |
− | |||
− | |||
− | |||
− | |||
|Has vendor={{PAGENAME}} | |Has vendor={{PAGENAME}} | ||
− | |||
|Sells item={{#var:item_page}} | |Sells item={{#var:item_page}} | ||
|Has item quantity={{{quantity|1}}} | |Has item quantity={{{quantity|1}}} | ||
− | |Has item cost={{#if: {{{cost|}}} | {{# | + | |Has item cost ={{#if: {{{cost|}}} | {{#explode:{{#explode:{{{cost}}}|+|0}}| |0}};{{ucfirst:{{#sub:{{#explode:{{{cost}}}|+|0}}|{{#pos:{{#explode:{{{cost}}}|+|0}}| }}}}}} }} |
− | | | + | |Has item cost ={{#if: {{#explode:{{{cost}}}|+|1}} | {{#explode:{{#explode:{{{cost}}}|+|1}}| |0}};{{ucfirst:{{#sub:{{#explode:{{{cost}}}|+|1}}|{{#pos:{{#explode:{{{cost}}}|+|1}}| }}}}}} }} |
− | + | |Has item cost ={{#if: {{#explode:{{{cost}}}|+|2}} | {{#explode:{{#explode:{{{cost}}}|+|2}}| |0}};{{ucfirst:{{#sub:{{#explode:{{{cost}}}|+|2}}|{{#pos:{{#explode:{{{cost}}}|+|2}}| }}}}}} }} | |
− | + | }}{{#if: {{{rarity|}}}{{{level|}}}{{{type|}}} | [[Category:Pages with incorrect template usage]] }}</includeonly><noinclude> | |
− | | | ||
− | | | ||
− | |Has | ||
− | | | ||
− | | | ||
− | | | ||
− | }}}} | ||
− | {{#if: {{{rarity|}}}{{{level|}}}{{{type|}}} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
== Usage == | == Usage == | ||
+ | The table row for items for use in vendor inventory tables. For use with {{tl|vendor table header}}. The template queries for the item supplied by either name or id. If the item exists, the information is displayed. If the item doesn't exist, the item parameters can be supplied manually. | ||
+ | |||
<pre> | <pre> | ||
{{vendor table row | {{vendor table row | ||
Строка 54: | Строка 38: | ||
| item = | | item = | ||
| id = | | id = | ||
− | | type = | + | | type = |
− | | level = | + | | level = |
− | | rarity = | + | | rarity = |
| quantity = | | quantity = | ||
| cost = | | cost = | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
}} | }} | ||
</pre> | </pre> | ||
− | === Parameters | + | === Subobject === |
+ | The table creates a subobject with the following properties: | ||
+ | * Has vendor | ||
+ | * Sells item | ||
+ | * Has item quantity | ||
+ | * Has item cost | ||
+ | |||
+ | == Parameters == | ||
;item | ;item | ||
: Required. Name of the item. The ''id'' parameter overrides this parameter. | : Required. Name of the item. The ''id'' parameter overrides this parameter. | ||
Строка 84: | Строка 68: | ||
;rarity | ;rarity | ||
: Optional. Rarity of the item. Only required if the item has more than one possible rarity or undefined. Defaults to [[Property:Has item rarity]]. | : Optional. Rarity of the item. Only required if the item has more than one possible rarity or undefined. Defaults to [[Property:Has item rarity]]. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | == Example == | |
<pre> | <pre> | ||
{{vendor table header}} | {{vendor table header}} | ||
Строка 135: | Строка 85: | ||
}} | }} | ||
{{vendor table row | {{vendor table row | ||
− | | item = Mystery Tonic | + | | item = Mystery Tonic |
| quantity = 2 <!-- displays a (2) after the item name. --> | | quantity = 2 <!-- displays a (2) after the item name. --> | ||
| cost = 200 coin | | cost = 200 coin | ||
}} | }} | ||
{{vendor table row | {{vendor table row | ||
− | | | + | | id = -1337 <!-- negative id will break template --> |
− | | cost = | + | | cost = 100 laurel + 5 Glob of Ectoplasm |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
}} | }} | ||
|} | |} | ||
− | |||
</pre> | </pre> | ||
Строка 167: | Строка 110: | ||
}} | }} | ||
{{vendor table row | {{vendor table row | ||
− | | item = Mystery Tonic | + | | item = Mystery Tonic |
| quantity = 2 <!-- displays a (2) after the item name. --> | | quantity = 2 <!-- displays a (2) after the item name. --> | ||
| cost = 200 coin | | cost = 200 coin | ||
}} | }} | ||
{{vendor table row | {{vendor table row | ||
− | | | + | | id = -1337 <!-- negative id will break template --> |
− | | cost = | + | | cost = 100 laurel + 5 Glob of Ectoplasm |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
}} | }} | ||
|} | |} | ||
− | + | [[Category:Vendor formatting templates]] | |
− | |||
− | |||
− | [[Category:Vendor formatting templates]] | ||
[[Category:Subobject templates]] | [[Category:Subobject templates]] | ||
</noinclude> | </noinclude> |