Шаблон:Vendor table row — различия между версиями

Материал из Guild Wars 2 wiki
Перейти к: навигация, поиск
 
 
Строка 1: Строка 1:
<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 -->
+
<includeonly>|- id="vendor{{#vardefineecho:vendorcount|{{#expr:{{#var:vendorcount|0}}+1}}}}" class="{{{rowclass|{{#ifeq: {{{status|}}}|historical|gray}}}}}" {{#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}}
+
| data-sort-value="{{#var:item_page}}" | {{#show:{{#var:item_page}}
|?Has armor weight class
+
    | ?
|?Has item type
+
    | ?Has canonical name
|?Has armor type
+
    | ?Has game icon
|?Has weapon type
+
    | ?Has armor weight class
|?Has trinket type
+
    | ?Has item type
|?Has upgrade component type
+
    | ?Has item rarity
|?Has item rarity
+
    | ?Has level requirement
|?Has level requirement
+
    | ?Has equipment prefix
|?Has equipment prefix
+
    | ?Has upgrade component
|?Has upgrade component
+
    | ?Is tradable
| link = none
+
    | ?Has game id#
| format = template
+
    | link = none
| template = Vendor table row result format
+
    | format = template
| default = {{Vendor table row result format|{{{class|}}}|{{{type|}}}|<!--3-->|<!--4-->|<!--5-->|<!--6-->|{{{rarity|-}}}|{{{level|}}}|{{{prefix|}}}}}
+
    | template = Vendor table row result format{{!}}requirement={{{requirement|}}}{{!}}collection={{{collection|}}}{{!}}per day={{{per day|}}}{{!}}per week={{{per week|}}}{{!}}per character={{{per character|}}}{{!}}total={{{total|}}}{{!}}quantity={{{quantity|1}}}{{!}}cost={{{cost|}}}{{!}}rarity={{{rarity|}}}
}}
+
    | default = {{Vendor table row result format|{{#var:item_page}}|{{#var:item_page}}|File:{{#var:item_page}}.png|{{{class|}}}|{{{type|}}}|{{{rarity|-}}}|{{{level|}}}|{{{prefix|}}}|id={{{id|}}}|quantity={{{quantity|1}}}}}|cost={{{cost|}}}
| align="right" | {{#arraymap:{{{cost|}}} | + | @@@ | {{currency|{{#explode:@@@| |0}}|{{#sub:@@@|{{#pos:@@@| }}}}|{{#ifeq:{{#sub:@@@|{{#pos:@@@| }}}}|coin|y}}}} |&nbsp;+&nbsp;}}
+
}}<!--
{{#subobject:vendor{{#vardefineecho:vendorcnt|{{#expr:{{#var:vendorcnt|0}}+1}}}}
+
 
 +
Subobject
 +
 
 +
-->{{#if: {{#var:suppress VTR subobjects|}} {{#if:{{NAMESPACE}}|suppress subobjects outside mainspace}} | |
 +
{{#subobject:vendor{{#var:vendorcount}}
 
|Has vendor={{PAGENAME}}
 
|Has vendor={{PAGENAME}}
 +
|Has vendor section={{#var:vendor_section|General}}<!-- Defined in Template:Vendor table header -->
 
|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|}}}                 | {{#explode:{{#explode:{{{cost}}}|+|0}}| |0}};{{ucfirst:{{#sub:{{#explode:{{{cost}}}|+|0}}|{{#pos:{{#explode:{{{cost}}}|+|0}}| }}}}}} }}
+
|Has item cost={{#if: {{{cost|}}} | {{#arraymap:{{{cost}}}|+|@@@|{{#explode:@@@| |0}};{{ucfirst:{{#sub:@@@|{{#pos:@@@| }}}}}}|+}} }}|+sep=+
|Has item cost ={{#if: {{#explode:{{{cost}}}|+|1}} | {{#explode:{{#explode:{{{cost}}}|+|1}}| |0}};{{ucfirst:{{#sub:{{#explode:{{{cost}}}|+|1}}|{{#pos:{{#explode:{{{cost}}}|+|1}}| }}}}}} }}
+
|Located in={{{location|{{#var:vendor location}}}}}|+sep=;
|Has item cost ={{#if: {{#explode:{{{cost}}}|+|2}} | {{#explode:{{#explode:{{{cost}}}|+|2}}| |0}};{{ucfirst:{{#sub:{{#explode:{{{cost}}}|+|2}}|{{#pos:{{#explode:{{{cost}}}|+|2}}| }}}}}} }}
+
|Has requirement={{#var:vendor requirement}};{{{requirement|}}}|+sep=;
}}{{#if: {{{rarity|}}}{{{level|}}}{{{type|}}} | [[Category:Pages with incorrect template usage]] }}</includeonly><noinclude>
+
|Is purchasable during collection={{{collection|}}}
 +
|Has daily purchase cap={{{per day|}}}
 +
|Has weekly purchase cap={{{per week|}}}
 +
|Has character purchase cap={{{per character|}}}
 +
|Has total purchase cap={{{total|}}}
 +
|Is historical={{#switch:{{lc:{{{status|}}}}}|unimplemented|future|historical|discontinued|temporary=true|#default={{#var:vendor historical status|false}}}}
 +
|Has availability={{ucfirst:{{{status|{{#var:vendor availability status|Current}}}}}}}
 +
}}}}{{#if: {{NAMESPACE}} | <!-- outside of mainspace, don't categorize --> |
 +
{{#if: {{{rarity|}}}{{{level|}}}{{{type|}}}{{{id|}}}{{{item|}}}
 +
| <!-- proper parameters provided -->
 +
| [[Category:Pages with incorrect template usage]]
 +
}}}}</includeonly><noinclude>
 +
== Description ==
 +
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. Additional formatting is provided by {{tl|Vendor table row result format}} and {{tl|Vendor table notes}}.
  
 
== 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
Строка 38: Строка 54:
 
| item =  
 
| item =  
 
| id =  
 
| id =  
| type =
+
| type =  
| level =
+
| level =  
| rarity =
+
| rarity =  
 
| quantity =  
 
| quantity =  
 
| cost =  
 
| cost =  
 +
| cost icon =
 +
| per day =
 +
| per week =
 +
| per character =
 +
| total =
 +
| requirement =
 +
| collection =
 
}}
 
}}
 
</pre>
 
</pre>
  
=== Subobject ===
+
=== Parameters ===
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.
Строка 68: Строка 84:
 
;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]].
 +
;location
 +
: Optional. Set the location of this item. Defaults to the vendor's location. Separate multiple locations with a semicolon.
 +
;per day
 +
: Optional. How many of this item can be purchased per day.
 +
;per week
 +
: Optional. How many of this item can be purchased per week.
 +
;per character
 +
: Optional. How many of this item can be purchased per character.
 +
;total
 +
: Optional. How many of this item can be purchased in total.
 +
;requirement
 +
: Optional. Completed requirement to purchase this item, set to a page. Set ''showNotes'' in the header to "true" to show it in an extra column, otherwise it's displayed below the item. Use a semi-colon to separate multiple requirements.
 +
;collection
 +
: Optional. Specify the collection during which this this item can be purchased
 +
;status
 +
: Optional. Sets [[Property:Has availability]], use values per that page.
 +
;rowclass
 +
: Optional. Add a css class to the row.
 +
 +
=== Subobject ===
 +
The table creates a subobject with the following properties:
 +
* Has vendor
 +
* Has vendor section
 +
* Sells item
 +
* Has item quantity
 +
* Has item cost
 +
* Located in
 +
* Has requirement
 +
* Is purchasable during collection
 +
* Has daily purchase cap
 +
* Has weekly purchase cap
 +
* Has total purchase cap
 +
* Is historical
 +
* Has availability
  
== Example ==
+
=== Example ===
 
<pre>
 
<pre>
 
{{vendor table header}}
 
{{vendor table header}}
Строка 85: Строка 135:
 
}}
 
}}
 
{{vendor table row
 
{{vendor table row
| item = Mystery Tonic
+
| item = Mystery Tonic (furniture)
 
| 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 -->
+
| item = Bjora Marches Portal Scroll
| cost = 100 laurel + 5 Glob of Ectoplasm
+
| cost = 24500 karma
 +
| requirement = The Invitation
 +
}}
 +
{{vendor table row
 +
| item = Eternal Ice Shard
 +
| cost = 2668 Karma
 +
| per day = 10
 
}}
 
}}
 
|}
 
|}
 +
 
</pre>
 
</pre>
  
Строка 110: Строка 167:
 
}}
 
}}
 
{{vendor table row
 
{{vendor table row
| item = Mystery Tonic
+
| item = Mystery Tonic (furniture)
 
| 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 -->
+
| item = Bjora Marches Portal Scroll
| cost = 100 laurel + 5 Glob of Ectoplasm
+
| cost = 24500 karma
 +
| requirement = The Invitation
 +
}}
 +
{{vendor table row
 +
| item = Eternal Ice Shard
 +
| cost = 2668 Karma
 +
| per day = 10
 
}}
 
}}
 
|}
 
|}
  
[[Category:Vendor formatting templates]]
+
== See also ==
 +
* {{tl|Vendor table (Black Lion Weapons)}} &mdash; Slimmed down version for Black Lion weapon sets.
 +
 
 +
[[Category:Vendor formatting templates]]
 
[[Category:Subobject templates]]
 
[[Category:Subobject templates]]
 
</noinclude>
 
</noinclude>

Текущая версия на 17:57, 31 марта 2023

Description[править]

The table row for items for use in vendor inventory tables. For use with {{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. Additional formatting is provided by {{Vendor table row result format}} and {{Vendor table notes}}.

Usage[править]

{{vendor table row
| item = 
| cost = 
}}

{{vendor table row
| item = 
| id = 
| type = 
| level = 
| rarity = 
| quantity = 
| cost = 
| cost icon = 
| per day = 
| per week = 
| per character = 
| total = 
| requirement = 
| collection = 
}}

Parameters[править]

item
Required. Name of the item. The id parameter overrides this parameter.
id
Optional. Look up an item by id rather than name. This is required if multiple items have the same name and you need the specific item sold by the vendor.
cost
Required. The cost of the item. Use a + symbol if the item requires multiple currencies.
type
Optional. The item type. Only required if the item type is undefined.
quantity
Optional. Quantity of item given by the purchase. Defaults to 1.
level
Optional. Level of the item. Only required if the item has more than one possible level or undefined. Defaults to Property:Has level requirement.
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.
location
Optional. Set the location of this item. Defaults to the vendor's location. Separate multiple locations with a semicolon.
per day
Optional. How many of this item can be purchased per day.
per week
Optional. How many of this item can be purchased per week.
per character
Optional. How many of this item can be purchased per character.
total
Optional. How many of this item can be purchased in total.
requirement
Optional. Completed requirement to purchase this item, set to a page. Set showNotes in the header to "true" to show it in an extra column, otherwise it's displayed below the item. Use a semi-colon to separate multiple requirements.
collection
Optional. Specify the collection during which this this item can be purchased
status
Optional. Sets Property:Has availability, use values per that page.
rowclass
Optional. Add a css class to the row.

Subobject[править]

The table creates a subobject with the following properties:

  • Has vendor
  • Has vendor section
  • Sells item
  • Has item quantity
  • Has item cost
  • Located in
  • Has requirement
  • Is purchasable during collection
  • Has daily purchase cap
  • Has weekly purchase cap
  • Has total purchase cap
  • Is historical
  • Has availability

Example[править]

{{vendor table header}}
{{vendor table row
| item = Endless Mystery Cat Tonic
| cost = 100 laurel
}}
{{vendor table row
| item = Elementalist Gear
| cost = 30 Watchwork Sprocket + 3000 coin <!-- separate prices composed of multiple currencies with a + sign. -->
}}
{{vendor table row
| id = 39613 <!-- looks up item with matching game id -->
| cost = 100 laurel + 5 Glob of Ectoplasm
}}
{{vendor table row
| item = Mystery Tonic (furniture)
| quantity = 2 <!-- displays a (2) after the item name. -->
| cost = 200 coin
}}
{{vendor table row
| item = Bjora Marches Portal Scroll
| cost = 24500 karma
| requirement = The Invitation
}}
{{vendor table row
| item = Eternal Ice Shard
| cost = 2668 Karma
| per day = 10
}}
|}

Предмет Тип Редкость Уровень Факты Цена
link-3DEndless Mystery Cat Tonic Endless Mystery Cat Tonic Z-
20px Elementalist Gear
30 Watchwork Sprocket.png
 + 30 Серебряная монета
item id: 39613 Z-
The page type input value ":" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process.
link-3DMystery Tonic (furniture) Mystery Tonic (furniture) (2) Z-
link-3DBjora Marches Portal Scroll Bjora Marches Portal Scroll Z-
link-3DEternal Ice Shard Eternal Ice Shard Z-

See also[править]

  • {{Vendor table (Black Lion Weapons)}} — Slimmed down version for Black Lion weapon sets.