模板:Loot

出自Terraria Wiki
跳至導覽 跳至搜尋
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 文檔 以下文檔來自Template:Loot/doc。(編輯 | 歷史

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: "掉落". Use @primary and @secondary for two other standard, localized captions: "主要物品(只一件)" and "次要物品", 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|-----------------|-

}}
掉落
物品數量幾率
學徒誘餌學徒誘餌1–42/9 (22.22%)
黑曜石皮藥水黑曜石皮藥水1–31/14 (7.14%)
敏捷藥水敏捷藥水2–41/28 (3.57%)
鐵皮藥水鐵皮藥水4–78
夜貓子藥水夜貓子藥水11/112 (0.89%)
光芒藥水光芒藥水1/224 (0.45%)
銀幣銀幣9991/100 (1%)
金幣金幣991/45 (2.22%)
旗魚靴旗魚靴(電腦版、主機版、和移動版)11/40 (2.5%)
海嘯瓶海嘯瓶(電腦版、主機版、和移動版)1/41 (2.44%)
提煉機提煉機1/53 (1.89%)
銅錠銅錠1–71/14 (7.14%)
鐵錠鐵錠2–7
金錠金錠3–7
錫錠錫錠4–112/3
鉛錠鉛錠3/4
鈷錠鈷錠1–74.17% (電腦版、主機版、和移動版)
2.56% (前代主機版、和3DS版)
鈀金錠鈀金錠2–7
山銅錠山銅錠3–7
銅礦銅礦1–71/7 (14.29%)
鐵礦鐵礦2–72/7 (28.57%)
鞋帶束頭鞋帶束頭11/45 (2.22%)
傘
攀爬爪攀爬爪
植物纖維繩索寶典植物纖維繩索寶典(電腦版、主機版、和移動版)
雷達雷達(電腦版、主機版、和移動版)
金礦金礦(in worlds with Gold)
鉑金礦鉑金礦(in worlds with Platinum)
5–93/7 (42.86%)
金錠金錠(in worlds with Gold)
鉑金錠鉑金錠(in worlds with Platinum)
3–72/7 (28.57%)