Vorlage:GetNpcInfo/Dokumentation

Aus Terraria Wiki
Wechseln zu: Navigation, Suche
Important.svg Diese Seite ist nicht oder unvollständig übersetzt.
Hilf mit, indem du den Text übersetzt und anschließend diesen Hinweis entfernst. Dies entfernt diese Seite auch aus der Liste von Seiten mit unzureichender Übersetzung.

This template is used to dynamically and reliably display an NPC's stats. It is based on Module:Npcinfo, which takes its data directly from the source code. This facilitates displaying stats without having to change them in case of updates. {{npcinfo}} can be used as a shortcut for this template.

An example usage can be found on the Bosses page, where the health of almost every boss is presented using this template.

Usage[Quelltext bearbeiten]

{{ npcinfo | <name or ID of the NPC> | <specific stat> (optional) | format=y/yes (optional) }}

First unnamed parameter

ID of the NPC or name of the NPC, as used in the database: Template:NpcIdFromName.

Second unnamed parameter

Specific stat to be displayed; see the tables below for valid values. If it is omitted or empty, a box with all stats will be output.

Original raw variable name
(case-insensitive)
Alias Note
aiStyle ai ID of the AI the NPC uses.
boss Prints 1 if NPC is a boss.
buffImmuneAll Prints 1 if NPC is immune to all buffs.
buffImmune immunities
immune
A comma-separated, linked list of buffs the NPC is immune to.
critter Prints 1 if NPC is a critter (by wiki definition).
damage Damage the NPC deals in normal mode / ExpertDesktopversionKonsolenversionMobilversion pre-Hardmode / Expert Hardmode / Expert post-Plantera.
damage_expert
damage_hardmode
damage_postplantera
defense Defense of the NPC in normal mode / Expert pre-Hardmode / Expert Hardmode / Expert post-Plantera.
defense_expert
defense_hardmode
defense_postplantera
friendly Prints 1 if NPC is a friendly NPC.
internalName internal name Internal name of the NPC.
knockBackResist knockback
kb
Knockback resistance of the NPC in normal mode / Expert pre-Hardmode / Expert Hardmode / Expert post-Plantera.
knockBackResist_expert knockback_expert
kb_expert
knockBackResist_hardmode knockback_hardmode
kb_hardmode
knockBackResist_postplantera knockback_postplantera
kb_postplantera
lifeMax maxlife
health
hp
Max Health of the NPC in normal mode / Expert pre-Hardmode / Expert Hardmode / Expert post-Plantera.
lifeMax_expert maxlife_expert
health_expert
hp_expert
lifeMax_hardmode maxlife_hardmode
health_hardmode
hp_hardmode
lifeMax_postplantera maxlife_postplantera
health_postplantera
hp_postplantera
netID id ID of the NPC.
townNPC Prints 1 if NPC is a Town NPC.
townCritter Prints 1 if NPC is a town critter (by source code definition).
type Corresponding "base" or "master" variant of this NPC if netID is negative. Equal to netID if netID is positive.
projectileNPC Prints 1 if NPC is a projectile.
value coin
coindrop
Amount of coins the NPC drops in normal mode / Expert pre-Hardmode / Expert Hardmode / Expert post-Plantera.
value_expert coin_expert
coindrop_expert
value_hardmode coin_hardmode
coindrop_hardmode
value_postplantera coin_postplantera
coindrop_postplantera
Combined values (only if not using raw=y)
damage_all Displays the combined values of normal mode / Expert pre-Hardmode / Expert Hardmode / Expert post-Plantera. Value (coins dropped) is in Copper Coins.
defense_all
knockBackResist_all knockback_all
kb_all
lifeMax_all maxlife_all
health_all
hp_all
value_all coin_all
coindrop_all
damage_expert_all Displays the combined values of Expert pre-Hardmode / Expert Hardmode / Expert post-Plantera. Value (coins dropped) is in Copper Coins.
defense_expert_all
knockBackResist_expert_all knockback_all
kb_all
lifeMax_expert_all maxlife_all
health_all
hp_all
value_expert_all coin_all
coindrop_all
format = y/yes

Use this parameter to wrap the variable in the magic word {{formatnum:}} (documentation). Only available when using a second unnamed parameter.

raw = y/yes

Use this parameter to output the value exactly as it exists in the source code. See Module:Npcinfo for information about how to interpret the output values. Only available when using a second unnamed parameter. Requires the second unnamed parameter to constitute an original variable name, i.e. no aliases are allowed. format is still applicable. Renders the second unnamed parameter case-sensitive.

Examples[Quelltext bearbeiten]

  • The Eye of Cthulhu has {{npcinfo|Eye of Cthulhu|hp|format=y}} / {{expert|{{npcinfo|Eye of Cthulhu|hp_expert}}}} health and deals {{npcinfo|Eye of Cthulhu|damage}} damage. It is immune to the {{npcinfo|Eye of Cthulhu|immunities}} debuff.
results in:
The Eye of Cthulhu has 2.800 / 3640 health and deals 15 damage. It is immune to the Confused debuff.
  • {{npcinfo|Blue Slime|damage}} results in: 7
  • {{npcinfo|1|damage}} results in: 7
  • {{npcinfo|Blue Slime|hp_all}} results in: 25 / 50 (274) (330)
  • {{npcinfo|Blue Slime|hp_expert_all}} results in: 50 (274) (330)
  • {{npcinfo|Blue Slime|knockback_all}} results in: 0 % / 10 %
  • {{npcinfo|Blue Slime}} results in:
Blue Slime (ID = 1) Info:
aiStyle: 1
boss:
buffImmune: 20, 70
buffImmuneAll:
damage: 7
damage_expert: 14
damage_hardmode: 62
damage_postplantera: 74
defense: 2
defense_expert: 2
defense_hardmode: 10
defense_postplantera: 12
dontCountMe:
friendly:
internalName=BlueSlime
knockBackResist: 1
knockBackResist_expert: 0.9
knockBackResist_hardmode: 0.9
knockBackResist_postplantera: 0.9
lifeMax: 25
lifeMax_expert: 50
lifeMax_hardmode: 274
lifeMax_postplantera: 330
netID: 1
npcSlots: 1
playersCount: 1
rarity: 0
scale: 1
townNPC:
townCritter:
type: 1
value: 25
value_expert: 62
value_hardmode: 250
value_postplantera: 300