Modul:Npcinfo/Dokumentation

Aus Terraria Wiki
Wechseln zu: Navigation, Suche

Dies ist die Dokumentationsseite für Modul:Npcinfo

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 module is used to obtain the base statistics of each NPC.

It can calculate NPC stats for different numbers of players (for multiplayer) and/or different stages/modes of the game (normal / expert pre-Hardmode / expert Hardmode / expert post-Plantera).

The code is synchronized with version 1.3.5.3Desktopversion of Terraria.

Usage[Quelltext bearbeiten]

{{#invoke:Npcinfo|getInfo| id = <npcid> | players = <active players count> | prefix = <prefix for output varnames> }}

id

NPC id. Can be -1 to -65, 1 to 579 (except 76, 146, 408). (76/146/408 are unused)

(optional) players

The number of active players, default is 1. For some bosses and boss-like NPCs in Expert mode, the number of players determines the health.

(optional) prefix

The prefix for the output variable. Default is _npcinfo_. For example, the default variable name for damage is _npcinfo_damage. If you used prefix=my_, the variable name would be my_damage.

When you use this module, it sets a number of DPL variables you can retrieve by using {{#dplvar:_npcinfo_defense}}, for instance. Use {{getNpcInfo}} for easily retrieving these variables and using them in articles.

Main variables:

dplvar
(without prefix)
Content
aiStyle The id of the AI it uses.
boss <empty> = false, 1 = true.
buffImmuneAll Is it immune to all buffs? <empty> = false, 1 = true.
buffImmune A comma-separated list of buffs the NPC is immune to. Only makes sense when buffImmuneAll is false.
friendly Is it a friendly NPC? <empty> = false, 1 = true.
townNPC Is it a town NPC? <empty> = false, 1 = true.
townCritter Is it a town Critter?(by source code, NPCID.Sets.TownCritter) <empty> = false, 1 = true.
critter Is it a critter? (by Critter page.)<empty> = false, 1 = true.
projectileNPC Is it a projectile? <empty> = false, 1 = true.
playersCount The value of the players parameter you used.
netID NPC id, the value of the id parameter you used.
type NPC type id. For a positive NPC id, it is equal to netID. For a negative NPC id, it is the id of the corresponding "master" variant.
internalName NPC internal name.
damage
damage_expert
damage_hardmode
damage_postplantera
damage / defense / knockBack /l ifeMax values for normal, expert pre-Hardmode, expert Hardmode, and expert post-Plantera, respectively.
The knockBackResist values are original value, the value displayed in the NPC infobox is (1 - knockBackResist).
defense
defense_expert
defense_hardmode
defense_postplantera
knockBackResist
knockBackResist_expert
knockBackResist_hardmode
knockBackResist_postplantera
lifeMax
lifeMax_expert
lifeMax_hardmode
lifeMax_postplantera
value
value_expert
value_hardmode
value_postplantera
Coins dropped for normal, expert pre-Hardmode, expert Hardmode, and expert post-Plantera, respectively. Counted in Copper Coins.

Examples[Quelltext bearbeiten]

See the source code of this documentation for details.

id= -3 (Green Slime):

aiStyle: 1
boss:
buffImmune: 20, 70
buffImmuneAll:
damage: 6
damage_expert: 12
damage_hardmode: 86
damage_postplantera: 118
defense: 0
defense_expert: 0
defense_hardmode: 0
defense_postplantera: 0
dontCountMe:
friendly:
knockBackResist: 1.2
knockBackResist_expert: 0.972
knockBackResist_hardmode: 0.972
knockBackResist_postplantera: 0.972
lifeMax: 14
lifeMax_expert: 28
lifeMax_hardmode: 246
lifeMax_postplantera: 338
internalName: GreenSlime
netID: -3
npcSlots: 1
playersCount: 1
rarity: 0
scale: 0.9
townNPC:
townCritter:
type: 1
value: 3
value_expert: 7
value_hardmode: 47
value_postplantera: 65

id=4 (Eye of Cthulhu):

aiStyle: 4
boss: 1
buffImmune: 31
buffImmuneAll:
damage: 15
damage_expert: 30
damage_hardmode: 30
damage_postplantera: 30
defense: 12
defense_expert: 12
defense_hardmode: 12
defense_postplantera: 12
dontCountMe:
friendly:
knockBackResist: 0
knockBackResist_expert: 0
knockBackResist_hardmode: 0
knockBackResist_postplantera: 0
lifeMax: 2800
lifeMax_expert: 3640
lifeMax_hardmode: 3640
lifeMax_postplantera: 3640
internalName: EyeofCthulhu
netID: 4
npcSlots: 5
playersCount: 1
rarity: 0
scale: 1
townNPC:
townCritter:
type: 4
value: 30000
value_expert: 75000
value_hardmode: 75000
value_postplantera: 75000

id=4 (Eye of Cthulhu), players=3 (more health):

aiStyle: 4
boss: 1
buffImmune: 31
buffImmuneAll:
damage: 15
damage_expert: 30
damage_hardmode: 30
damage_postplantera: 30
defense: 12
defense_expert: 12
defense_hardmode: 12
defense_postplantera: 12
dontCountMe:
friendly:
knockBackResist: 0
knockBackResist_expert: 0
knockBackResist_hardmode: 0
knockBackResist_postplantera: 0
lifeMax: 2800
lifeMax_expert: 6976
lifeMax_hardmode: 6976
lifeMax_postplantera: 6976
internalName: EyeofCthulhu
netID: 4
npcSlots: 5
playersCount: 3
rarity: 0
scale: 1
townNPC:
townCritter:
type: 4
value: 30000
value_expert: 75000
value_hardmode: 75000
value_postplantera: 75000

id=54 (Clothier, NPC):

aiStyle: 7
boss:
buffImmune: 31
buffImmuneAll:
damage: 10
damage_expert: 10
damage_hardmode: 10
damage_postplantera: 10
defense: 15
defense_expert: 15
defense_hardmode: 15
defense_postplantera: 15
dontCountMe:
friendly: 1
knockBackResist: 0.5
knockBackResist_expert: 0.5
knockBackResist_hardmode: 0.5
knockBackResist_postplantera: 0.5
lifeMax: 250
lifeMax_expert: 250
lifeMax_hardmode: 250
lifeMax_postplantera: 250
internalName: Clothier
netID: 54
npcSlots: 1
playersCount: 1
rarity: 0
scale: 1
townNPC: 1
townCritter:
type: 54
value: 0
value_expert: 0
value_hardmode: 0
value_postplantera: 0