Template:Loot

From Terraria Wiki
Jump to navigation Jump to search
This template uses the Cargo extension.
This template uses Extension:Cargo, an integral part of the wiki's back-end.
This template is i18n-ready, which means it is easy to localize for different languages. Please see I18n & l10n for templates to learn more.
See Template:Loot/l10n for the localization of this template.
Template-info.svg Documentation The documentation below is transcluded from Template:Loot/doc. (edit | history)

This template is used to give a standardized tabular overview over the items that can be looted from items like Chests and crates, along with their respective quantities and chances.

It stores its information to the Drops cargo table, which is queried by {{drop infobox}}.

Usage

{{ loot | item = <item containing the loot> | id = <item ID of the item containing the loot> | title = <table caption> | cargo = force/y/yes/n/no | <loot information> }}

item, id

Item name or ID of the item that contains the loot; defaults to page name.

title

Caption of the table. Default: "Loot". Use @primary and @secondary for two other standard, localized captions: "Primary items (only one)" and "Secondary items", respectively. @default yields the default caption. These three placeholders can be combined with other wikitext, e.g. some {{eicons}}. Set this parameter to a blank value (|title=) to hide the caption.

cargo

By default, all mainspace root pages will store their {{loot}} content to Cargo. Use this parameter to prevent or force Cargo storage. See the "custom" mode below for preventing cargo storage of individual items.

Unnamed parameters

Loot information, passed in groups of three: item name, quantity, and rate/chance.

| <item 1> | <quantity 1> | <rate 1>
| <item 2> | <quantity 2> | <rate 2>
...
| <item n> | <quantity n> | <rate n>

If the rate is passed as a fraction, i.e., in an <integer>/<integer> format, then it will be wrapped in {{chance}} in the output. This can be prevented by replacing one number with its HTML entity (e.g. &#50; for 2).

It is possible to group items (i.e., suppress the horizontal line between them in the resulting table) by surrounding them with a group starter and a group terminator row:

| :group:start | <group quantity> | <group rate>
  | <group item 1> | <group item quantity 1> | <group item rate 1>
  | <group item 2> | <group item quantity 2> | <group item rate 2>
  ...
  | <group item n> | <group item quantity n> | <group item rate n>
| :group:end|-----------------|-

If group quantity and/or rate are not passed, then each item may specify an individual quantity/rate. If this information is defined in the group starter, though, then individual quantities/rates will be ignored.

The template supports altering the display of the item using a "custom" mode:

| :custom:<raw name(s) of the item>:<custom display> | <quantity> | <rate>

It is not mandatory to include the raw name of the item, but doing so ensures a correct cargo data storage. Separate multiple raw item names with a slash (/) character. The template does not support raw item names that contain colons (i.e., the following raw item names are illegal: Advanced Combat Techniques: Volume Two, Format:C). Omit the raw item name entirely to prevent cargo storage for that item.


All unnamed parameters can be used ad infinitum.

Examples

Code Result
{{loot|title=<i>{{green|@default}}</i>

| Apprentice Bait|1–4|2/9

|:group:start||<!-- no group stats -->
  | Obsidian Skin Potion|1–3|1/14
  | Swiftness Potion|2–4|1/28
  | Ironskin Potion|4–78|
  | Night Owl Potion|1|1/112
  | Shine Potion||1/224
|:group:end|-----------------|-

| Silver Coin|999|1/100
| Gold Coin|99|1/45

|:group:start|1|<!-- group quantity -->
  | Sailfish Boots||1/40
  | Tsunami in a Bottle|314|1/41<!-- individual quantity is ignored -->
  | Extractinator|foobar|1/53
|:group:end|-----------------|-

|:group:start||1/14<!-- group rate -->
  | Copper Bar|1–7|
  | Iron Bar|2–7|ignored rate<!-- individual rate is ignored -->
  | Gold Bar|3–7|42/42
|:group:end|-----------------|-

|:group:start|4–11|<!-- suppress {{chance}} -->
  | Tin Bar||&#50;/3
  | Lead Bar||3/&#52;
|:group:end|-----------------|-

|:group:start||4.17% {{eicons|1.4.0.1|small=y}}<br/>2.56% {{eicons|1.4.0.1|invert=y|small=y}}<!-- custom group rate -->
  | Cobalt Bar|1–7|
  | Palladium Bar|2–7|ignored rate
  | Orichalcum Bar|3–7|42/42
|:group:end|-----------------|-

| Copper Ore|1–7|1/7
| Iron Ore|2–7|2/7

|:group:start|1|1/45<!-- group quantity and group rate -->
  | Aglet|2.7812|1/78
  | Umbrella|56|2651/63178
  | Climbing Claws||{{item|Moon Lord}}
  | Guide to Plant Fiber Cordage||
  | Radar|141421|
|:group:end|-----------------|-

|:group:start||
  |:custom:Gold Ore/Platinum Ore:{{item|Gold Ore|note=(in worlds with Gold)}}<br/>{{item|Platinum Ore|note=(in worlds with Platinum)}}|5–9|3/7
  |:custom:Gold Bar/Platinum Bar:{{item|Gold Bar|note=(in worlds with Gold)}}<br/>{{item|Platinum Bar|note=(in worlds with Platinum)}}|3–7|2/7
|:group:end|-----------------|-

}}
Loot
ItemQuantityChance
Apprentice BaitApprentice Bait1–42/9 (22.22%)
Obsidian Skin PotionObsidian Skin Potion1–31/14 (7.14%)
Swiftness PotionSwiftness Potion2–41/28 (3.57%)
Ironskin PotionIronskin Potion4–78
Night Owl PotionNight Owl Potion11/112 (0.89%)
Shine PotionShine Potion1/224 (0.45%)
Silver CoinSilver Coin9991/100 (1%)
Gold CoinGold Coin991/45 (2.22%)
Sailfish BootsSailfish Boots(Desktop, Console and Mobile versions)11/40 (2.5%)
Tsunami in a BottleTsunami in a Bottle(Desktop, Console and Mobile versions)1/41 (2.44%)
ExtractinatorExtractinator1/53 (1.89%)
Copper BarCopper Bar1–71/14 (7.14%)
Iron BarIron Bar2–7
Gold BarGold Bar3–7
Tin BarTin Bar4–112/3
Lead BarLead Bar3/4
Cobalt BarCobalt Bar1–74.17% (Desktop, Console and Mobile versions)
2.56% (Old-gen console and 3DS versions)
Palladium BarPalladium Bar2–7
Orichalcum BarOrichalcum Bar3–7
Copper OreCopper Ore1–71/7 (14.29%)
Iron OreIron Ore2–72/7 (28.57%)
AgletAglet11/45 (2.22%)
UmbrellaUmbrella
Climbing ClawsClimbing Claws
Guide to Plant Fiber CordageGuide to Plant Fiber Cordage(Desktop, Console and Mobile versions)
RadarRadar(Desktop, Console and Mobile versions)
Gold OreGold Ore(in worlds with Gold)
Platinum OrePlatinum Ore(in worlds with Platinum)
5–93/7 (42.86%)
Gold BarGold Bar(in worlds with Gold)
Platinum BarPlatinum Bar(in worlds with Platinum)
3–72/7 (28.57%)