模板: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%)