Template:Inventory/doc

From Terraria Mods Wiki
Jump to navigation Jump to search

For use with NPC vendors.

Usage

{{inventory
|<width1>|<width2>|<width3>|widths=y
|<item name>|<value>|<availability>
...
|<item name>|<value>|<availability>
}}
Optional column width parameters may be sent as first 3 parameters, followed by a widths flag

Unnamed Parameters: 1, 2, 3, Named Parameter: widths=y
Column widths are in pixels, 'px' is not necessary.

Unnamed Parameter 1, 4, 7, etc

The name of the sold item.

Unnamed Parameter 2, 5, 8, etc

The value at which said item is sold at. Use the {{coin}} or {{cc}}, {{sc}}, {{gc}}, and {{pc}} templates.

Unnamed Parameter 3, 6, 9, etc

The circumstances under which the item is sold. Leave empty for "Always available."

Example

{{inventory
|Torch|{{cc|3}}|
|Sake|{{coin|3|40}}|3% chance
|Code 1|{{gc|5}}|1.5% chance <small>after defeating <br/>the [[Eye of Cthulhu]]</small>
}}

results in:

Inventory
Item Cost Availability

TorchTorch 3 Always available.
SakeSake 340 3% chance
Code 1Code 1 5 1.5% chance after defeating
the Eye of Cthulhu
{{inventory
|400|280||widths=y
|Torch|{{cc|3}}|
|Sake|{{coin|3|40}}|3% chance
|Code 1|{{gc|5}}|1.5% chance <small>after defeating <br/>the [[Eye of Cthulhu]]</small>
}}

results in:

Inventory
Item Cost Availability

TorchTorch 3 Always available.
SakeSake 340 3% chance
Code 1Code 1 5 1.5% chance after defeating
the Eye of Cthulhu