Terraria Wiki
Terraria Wiki
K (Moved some {{tr}}s. $namesub and $namenote are in German throughout the entire process.)
(sync :: en revid:1175034::)
 
Zeile 1: Zeile 1:
 
<includeonly><!--
 
<includeonly><!--
  +
Note: The "tabs" functionality of this template requires JavaScript in MediaWiki:Common.js and/or MediaWiki:Mobile.js
   
NOTE: This template needs javascript in mediawiki:common.js and/or mediawiki:mobile.js
 
   
  +
==========================================================================================================================
  +
=========================================== INITIALIZATION ===========================================
  +
==========================================================================================================================
   
//localization info in [[template:npc_infobox/l10n]].(autoload)
 
   
  +
+++++++++++++ 1. Localization +++++++++++++
//ext l10n info: how to get english npc name from {{BASEPAGENAME}}?
 
-->{{#vardefine:npcnamefrompagename|{{pagename2en|{{#titleparts:{{ROOTPAGENAME}}}}}}}}<!--
 
   
  +
// localization info is autoloaded from Template:Npc infobox/l10n
//don't forget template:npc_infobox/cate
 
   
  +
// additional l10n: how to get the English NPC name from {{BASEPAGENAME}}?
=== l10n end ==========================================================================================================
 
  +
-->{{#vardefine:npcnamefrompagename|{{pagename2en|{{#titleparts:{{ROOTPAGENAME}}}}}}}}<!--
   
// cargo: (defining this up here because we already need it in the drop section)
 
-->{{#vardefine:cargo|}}<!--
 
-->{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{#ifeq:{{PAGENAME}}|{{ROOTPAGENAME}}|{{#vardefine:cargo|y}}}}}}<!-- mainspace rootpages
 
-->{{#switch:{{{cargo|}}}<!--
 
-->|force|yes|y={{#vardefine:cargo|y}}<!--
 
-->|no|n={{#vardefine:cargo|}}<!--
 
-->}}<!--
 
-->{{#if:{{langList|isOnWiki|{{lang}}}}|{{#vardefine:cargo|}}}}<!-- don't store for non-english languages on mainwiki
 
   
  +
+++++++++++++ 2. View-related options +++++++++++++
//view name:
 
  +
-->{{#vardefine:ni:viewmodename|{{lc:{{{mode|{{{output|{{{view|{{#var:_npc_infobox_flag_view|infobox}}}}}}}}}}}}}}}<!--
 
  +
-->{{#vardefine:ni:viewmodename|{{lc:{{{mode|{{{output|{{{view|{{options/get|npc infobox|view}}}}}}}}}}}}}}}<!--
 
-->{{#switch:{{#var:ni:viewmodename}}<!--
 
-->{{#switch:{{#var:ni:viewmodename}}<!--
-->|infobox=<!-- @todo
+
-->|infobox=<!--
-->{{#arraydefine:extargs|float/css/style/boxwidth/shownpcid/{{{extargs|{{npc infobox/options|get|extargs}}}}}|/}}<!--
+
-->{{#arraydefine:extargs|float/css/style/boxwidth/shownpcid/{{{extargs|{{options/get|npc infobox|extargs}}}}}|/}}<!--
-->{{#arrayprint:extargs||@@@@|{{#if:@@@@|{{#vardefine:ni:ext:@@@@|{{{@@@@|}}}}}}}}}<!-- ext parameters for view
 
-->{{#vardefine:imagemode|{{{imagemode|full}}}}}<!--
 
 
-->|table=<!--
 
-->|table=<!--
-->{{#arraydefine:extargs|cols/{{{extargs|{{npc infobox/options|get|extargs}}}}}|/}}<!--
+
-->{{#arraydefine:extargs|cols/{{{extargs|{{options/get|npc infobox|extargs}}}}}|/}}<!--
  +
-->{{#arraydefine:ni:table:cols|{{{cols|{{options/get|npc infobox|cols}}}}}|{{{colsep|{{#or:{{options/get|npc infobox|colsep}}|/}}}}}}}<!-- default cols value from options
-->{{#arrayprint:extargs||@@@@|{{#if:@@@@|{{#vardefine:ni:ext:@@@@|{{{@@@@|}}}}}}}}}<!-- ext parameters for view
 
  +
// and pass all custom col values
-->{{#vardefine:colsep|{{npc infobox/options|get|colsep}}}}<!--
 
-->{{#vardefine:cells|{{{cells|{{npc infobox/options|get|cells}}}}}}}<!--
 
-->{{#arraydefine:ni:table:cols|{{#var:ni:ext:cols|{{#var:_npc_infobox_flag_cols}}}}|{{{colsep|{{#var:colsep|/}}}}}}}<!-- default cols value from options
 
// and pass all custom col values.
 
 
-->{{#arrayprint:ni:table:cols||@@@@|{{#if:{{#rmatch:@@@@|/^col:/|y}}|{{#vardefine:ni:@@@@|{{{@@@@|}}} }}}}}}<!--
 
-->{{#arrayprint:ni:table:cols||@@@@|{{#if:{{#rmatch:@@@@|/^col:/|y}}|{{#vardefine:ni:@@@@|{{{@@@@|}}} }}}}}}<!--
  +
-->|custom=<!--
-->{{#vardefine:imagemode|{{{imagemode|{{npc infobox/options|get|imagemode}}}}}}}<!--
 
  +
-->{{#arraydefine:extargs|template/{{{extargs|{{options/get|npc infobox|extargs}}}}}|/}}<!--
 
-->|#default=<!--
 
-->|#default=<!--
-->{{#arraydefine:extargs|{{{extargs|{{npc infobox/options|get|extargs}}}}}|/}}<!-- ext parameters for view
+
-->{{#arraydefine:extargs|{{{extargs|{{options/get|npc infobox|extargs}}}}}|/}}<!--
-->{{#arrayprint:extargs||@@@@|{{#if:@@@@|{{#vardefine:ni:ext:@@@@|{{{@@@@|}}}}}}}}}<!--
 
-->{{#vardefine:imagemode|{{{imagemode|{{npc infobox/options|get|imagemode}}}}}}}<!--
 
 
-->}}<!--
 
-->}}<!--
  +
-->{{#arrayprint:extargs||@@@@|{{#if:@@@@|{{#vardefine:ni:ext:@@@@|{{{@@@@|}}}}}}}}}<!-- ext parameters for view
  +
-->{{#vardefine:imagemode|{{{imagemode|{{#ifeq:{{#var:ni:viewmodename}}|infobox|full|{{options/get|npc infobox|imagemode}}}}}}}}}<!-- image mode
   
======== DATA MODEL ========
 
//reset all npcinfo fields
 
-->{{#invoke:npcinfo|clear|prefix=_npc_infobox:info:}}<!--
 
   
  +
//fetch data from npcinfo database if needed.
 
  +
==========================================================================================================================
-->{{#vardefine:_npc_auto_id|}}<!--
 
  +
============================================= DATA MODEL =============================================
-->{{#if:{{{auto|}}}|<!--
 
  +
==========================================================================================================================
-->{{#vardefine:_npc_auto_id|{{#if:{{#dplreplace:{{#trim:{{{auto|}}}}}|/^-?[0-9]+$/|}}|{{{id|}}}|{{#trim:{{{auto|}}}}}}}}}<!--
 
  +
-->{{#invoke:npcinfo|getInfo|id={{#var:_npc_auto_id}}|prefix=_npc_infobox:info:}}<!--
 
  +
Note: All "#lst*" parser functions ([[gphelp:Extension:ParserPower/List handling functions]]) will trim whitespace and discard empty elements.
  +
  +
+++++++++++++ 1. Set cargo flags +++++++++++++
  +
  +
// (defining this up here because we already need it in the drop section)
  +
-->{{#vardefine:cargo|}}<!--
  +
-->{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{#ifeq:{{PAGENAME}}|{{ROOTPAGENAME}}|{{#vardefine:cargo|y}}}}}}<!-- default: only main ns, only root pages (e.g. no translation subpages)
  +
-->{{#if:{{{cargo|}}}|<!--
  +
-->{{#switch:{{{cargo|}}}<!--
  +
-->|1|y|yes|true|force|on={{#vardefine:cargo|y}}<!-- on
  +
-->|0|n|no|false|off={{#vardefine:cargo|}}<!-- off
  +
-->|#default=<!-- invalid parameter value, so keep the variable unchanged
  +
-->}}<!--
 
-->}}<!--
 
-->}}<!--
  +
-->{{#if:{{langList|isOnWiki|{{lang}}}}|{{#vardefine:cargo|}}}}<!-- never store for non-english languages on mainwiki
//npc id (only for display)
 
-->{{#vardefine:ni:npcid|{{{id|{{#var:_npc_auto_id}}}}}}}<!--
 
   
  +
-->{{#vardefine:nidrop:cargo|{{#var:cargo}}}}<!-- store drops to cargo? by default, only do that if other data is also stored to cargo
//all data:
 
  +
-->{{#if:{{{cargodrops|}}}|<!--
  +
-->{{#switch:{{{cargodrops|}}}<!--
  +
-->|1|y|yes|true|force|on={{#vardefine:nidrop:cargo|y}}<!-- on
  +
-->|0|n|no|false|off={{#vardefine:nidrop:cargo|}}<!-- off
  +
-->|auto={{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{#ifeq:{{PAGENAME}}|{{ROOTPAGENAME}}|{{#vardefine:nidrop:cargo|y}}}}}}<!-- only main ns, only root pages(useful when set |cargo=y/n)
  +
-->|#default=<!-- invalid parameter value, so keep the variable unchanged
  +
-->}}<!--
  +
-->}}<!--
  +
-->{{#if:{{langList|isOnWiki|{{lang}}}}|{{#vardefine:nidrop:cargo|}}}}<!-- never store for non-english languages on mainwiki
   
type
 
-->{{#vardefine:ni:type|{{{type|Enemy}}}}}<!--
 
-->{{#vardefine:ni:type2|{{{type2|}}}}}<!--
 
-->{{#vardefine:ni:type3|{{{type3|}}}}}<!--
 
   
  +
+++++++++++++ 2. Set types, listcats, environments, mode exclusivity, variant flag, and notabs flag from parameter input +++++++++++++
//tabs?
 
-->{{#vardefine:ni:notab|{{{notabs|{{{notab|{{{variant|{{#switch:{{{tabs|{{{tab|}}}}}}|n|no=y}}}}}}}}}}}}}<!--
 
-->{{#switch:{{pagename2en|{{lc:{{#var:ni:type}}}}}}|npc|critter|gold critter|furniture={{#vardefine:ni:notab|{{#if:{{{tabs|{{{tab|}}}}}}||y}}}}}}<!-- tabs=y force it appear.
 
   
  +
// types: separated with "/".
environment
 
-->{{#vardefine:ni:environment|{{{environment|}}}/{{{environment2|}}}/{{{environment3|}}}}}<!--
+
-->{{#vardefine:ni:types|{{lcfirst:{{{type|Enemy}}}}}/{{lcfirst:{{{type2|}}}}}/{{lcfirst:{{{type3|}}}}}}}<!--
-->{{#vardefine:ni:environment|{{#dplreplace:{{#var:ni:environment}}|/\/\/+/|/}}}}<!--
 
-->{{#vardefine:ni:environment|{{#dplreplace:{{#var:ni:environment}}|/^\//|}}}}<!--
 
-->{{#vardefine:ni:environment|{{#dplreplace:{{#var:ni:environment}}|/\/$/|}}}}<!--
 
   
  +
// listcats: separated with "/".
name/namesub/namenote, and default image file name
 
  +
-->{{#vardefine:ni:listcats|{{#lstsep:{{{listcat|}}}/{{{listcat2|}}}/{{{listcat3|}}}|/|/}}}}<!-- #lstsep to remove empty elements
-->{{#if:{{#dplvar:_npc_infobox:info:netID}}|<!--
 
  +
-->{{#vardefine:ni:name|{{{name|<!--
 
  +
// environment
-->{{npc infobox/namedb}}<!-- loading npc name database (it's English)
 
  +
-->{{#vardefine:ni:environment|{{#lstsep:{{{environment|}}}/{{{environment2|}}}/{{{environment3|}}}|/|/}}}}<!-- #lstsep to remove empty elements
-->{{#dplvar:_npc_infobox:info:name}}<!--
 
  +
-->}}}}}<!--
 
  +
// mode exclusivity
-->{{#vardefine:_|{{npc infobox/namedb-{{lang}}}}}}<!-- loading db for local lang
 
-->{{#vardefine:ni:namesub|{{{namesub|{{#dplvar:_npc_infobox:{{lang}}:npcnamesub:{{#dplvar:_npc_infobox:info:netID}}}}}}}}}<!--
+
-->{{#vardefine:ni:hardmodeonly|{{bool|{{{hardmode|}}}}}}}<!--
-->{{#vardefine:ni:namenote|{{{namenote|{{#dplvar:_npc_infobox:{{lang}}:npcnamenote:{{#dplvar:_npc_infobox:info:netID}}}}}}}}}<!--
+
-->{{#vardefine:ni:expertonly|{{bool|{{{expertonly|}}}}}}}<!--
-->{{#vardefine:ni:imagename|{{{name|<!--
+
-->{{#vardefine:ni:masteronly|{{bool|{{{masteronly|}}}}}}}<!--
  +
-->{{npc infobox/namedb-en}}<!-- loading db for en
 
  +
// variant flag
-->{{#if:{{#dplvar:_npc_infobox:en:npcnamesub:{{#dplvar:_npc_infobox:info:netID}}}}|<!--
 
  +
-->{{#vardefine:ni:variant|{{bool|{{{variant|}}}}}}}<!--
-->{{#dplvar:_npc_infobox:en:npcnamesub:{{#dplvar:_npc_infobox:info:netID}}}}<!--
 
  +
-->|<!--
 
  +
// notabs flag
-->{{#var:ni:name}}<!--
 
  +
* reset
-->}}<!--
 
-->}}}<!--
+
-->{{#vardefine:ni:notab|}}<!--
  +
* default: set flag if the types contain certain strings
  +
-->{{#if:{{#lstfltr:npc/critter/gold critter/furniture|/|{{lc:{{#var:ni:types}}}}|/}}|{{#vardefine:ni:notab|y}}}}<!--
  +
* $tabs=y: force flag to false
  +
-->{{#if:{{bool|{{{tabs|{{{tab|}}}}}}}}|{{#vardefine:ni:notab|}}}}<!--
  +
* $variant / $notabs=y / $tabs=n: force flag to true ($variant because Expert Mode is post-1.3)
  +
-->{{#if:{{bool|{{{notabs|{{{notab|}}}}}}}}{{#var:ni:variant}}{{#switch:{{{tabs|{{{tab|}}}}}}|n|no|0|false=y}}|{{#vardefine:ni:notab|y}}}}<!--
  +
  +
  +
+++++++++++++ 3. Fetch automatic data +++++++++++++
  +
  +
-->{{#vardefine:ni:auto_id|{{#if:{{{auto|}}}|<!--
  +
-->{{#if:{{isNumber|{{{auto|}}}}}|<!--
  +
-->{{{auto|}}}<!-- $auto is number, use it as-is
  +
-->|<!--
  +
-->{{{id|{{NpcIdFromName|{{{name|{{#var:npcnamefrompagename}}}}}}}}}}<!-- $id -> idFromName
 
-->}}<!--
 
-->}}<!--
  +
-->}}}}<!--
  +
-->{{#if:{{#var:ni:auto_id}}|<!--
  +
-->{{#invoke:Npcinfo|getInfo|id={{#var:ni:auto_id}}|prefix=ni:info:}}<!-- fetch data
  +
-->|<!--
  +
-->{{#invoke:Npcinfo|clear|prefix=ni:info:}}<!-- reset the data-filled vars
  +
-->}}<!--
  +
  +
  +
+++++++++++++ 4. Process auto data, overriding with manual input if necessary +++++++++++++
  +
  +
---- id, name, and default imagename ----
  +
-->{{#vardefine:ni:npcid|{{{id|{{#var:ni:auto_id}}}}}}}<!-- npc id (only for display)
  +
-->{{#vardefine:ni:namesub|{{tr|{{{namesub|}}}}}}}<!--
  +
-->{{#vardefine:ni:namenote|{{tr|{{{namenote|}}}}}}}<!--
  +
-->{{#if:{{#dplvar:ni:info:netID}}|<!--
  +
-->{{#vardefine:ni:name|{{{name|{{#dplvar:ni:info:name}}}}}}}<!--
  +
-->{{#vardefine:_|{{npc infobox/namedb-{{lang|}}}}}}<!-- load db for local lang (in a dummy #vardefine to prevent redlink if db doesn't exist)
  +
-->{{#vardefine:ni:namesub|{{tr|{{#var:ni:namesub|{{{namesub|{{#dplvar:_npc_infobox:{{lang|}}:npcnamesub:{{#dplvar:ni:info:netID}}}}}}}}}}}}}<!-- by doing this we can use |namesub=<blank> to suppress auto value.
  +
-->{{#vardefine:ni:namenote|{{#var:ni:namenote|{{{namenote|{{#dplvar:_npc_infobox:{{lang|}}:npcnamenote:{{#dplvar:ni:info:netID}}}}}}}}}}}<!--
  +
-->{{#vardefine:ni:imagename|{{{name|<!--
  +
-->{{npc infobox/namedb-en}}<!-- load db for en
  +
-->{{#if:{{#dplvar:_npc_infobox:en:npcnamesub:{{#dplvar:ni:info:netID}}}}|<!--
  +
-->{{#dplvar:_npc_infobox:en:npcnamesub:{{#dplvar:ni:info:netID}}}}<!--
  +
-->|<!--
  +
-->{{#var:ni:name}}<!--
  +
-->}}<!--
  +
-->}}}}}<!--
 
-->|<!--
 
-->|<!--
 
-->{{#vardefine:ni:name|{{{name|{{#var:npcnamefrompagename}}}}}{{{name2|}}}}}<!--
 
-->{{#vardefine:ni:name|{{{name|{{#var:npcnamefrompagename}}}}}{{{name2|}}}}}<!--
-->{{#vardefine:ni:namesub|{{tr|{{{namesub|}}}}}}}<!--
 
-->{{#vardefine:ni:namenote|{{tr|{{{namenote|}}}}}}}<!--
 
 
-->{{#vardefine:ni:imagename|{{{name|{{#var:npcnamefrompagename}}}}}}}<!--
 
-->{{#vardefine:ni:imagename|{{{name|{{#var:npcnamefrompagename}}}}}}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->{{#vardefine:ni:name2|{{{name2|}}}}}<!--
 
-->{{#vardefine:ni:name2|{{{name2|}}}}}<!--
 
-->{{#vardefine:ni:namesub2|{{{namesub2|}}}}}<!--
 
-->{{#vardefine:ni:namesub2|{{{namesub2|}}}}}<!--
  +
--------
-->{{#vardefine:ni:hardmodeonly|{{{hardmode|}}}}}<!--
 
-->{{#vardefine:ni:expertonly|{{{expertonly|}}}}}<!--
 
-->{{#vardefine:ni:masteronly|{{{masteronly|}}}}}<!--
 
   
  +
---- ai ----
//version info
 
  +
-->{{#vardefine:ni:ai|{{#if:{{{ai|{{#dplvar:ni:info:aiStyle}}}}}|{{{ai|{{npc infobox/AI|{{#dplvar:ni:info:aiStyle}}}}}}}}}}}<!--
-->{{#vardefine:ni:variant|}}<!-- reset
 
  +
--------
-->{{#if:{{{version|{{{variant|}}}}}}|<!--
 
-->{{#if:{{#pos:{{lc:{{{version|}}}}}|desktop}}||<!--
 
-->{{#if:{{{version|}}}|<!--
 
-->{{#vardefine:ni:variant|<!--
 
-->{{#if:{{#pos:{{lc:{{{version}}}}}|desktop}}|desktop/}}<!--
 
-->{{#if:{{#pos:{{lc:{{{version}}}}}|console}}|console/}}<!--
 
-->{{#if:{{#pos:{{lc:{{{version}}}}}|oldgen}}|old-gen/}}<!--
 
-->{{#if:{{#pos:{{lc:{{{version}}}}}|mobile}}|mobile/}}<!--
 
-->{{#if:{{#pos:{{lc:{{{version}}}}}|3ds}}|3ds}}<!--
 
-->}}<!--
 
-->|<!--else
 
-->{{#vardefine:ni:variant|old-gen/3ds}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->}}<!--
 
   
  +
---- damage ----
//all images: (default auto main image filename is in {{#var:ni:imagename}} )
 
  +
-->{{#vardefine:ni:damage|{{{damage|{{#if:{{#dplvar:ni:info:damage}}|<!--
image 1
 
-->{{#vardefine:ni:image1|{{{imagealt|{{image|{{{image|{{#var:ni:imagename}}.png}}}|link=|size={{{imagesize|}}}}}}}}}}<!--
+
-->{{#invoke:Npcstat|format|lang={{lang|}}|hardmodeonly={{#var:ni:hardmodeonly}}|expertonly={{#var:ni:expertonly}}<!--
  +
-->|{{#dplvar:ni:info:damage}}<!--
-->{{#if:{{#var:ni:image1}}||{{#vardefine:ni:image1|[[File:{{{image|{{#var:ni:imagename}}.png}}}|link=]]}}}}<!-- fallback if {{image}} failed.
 
  +
-->|{{#dplvar:ni:info:damage_e}}|{{#dplvar:ni:info:damage_e_hm}}|{{#dplvar:ni:info:damage_e_pp}}<!--
-->{{#vardefine:ni:image1text|}}<!--
 
  +
-->|{{#dplvar:ni:info:damage_m}}|{{#dplvar:ni:info:damage_m_hm}}|{{#dplvar:ni:info:damage_m_pp}}<!--
image expert
 
-->{{#vardefine:imageexpert|{{{imageexpert|}}}}}<!--
 
init image 2/3
 
-->{{#vardefine:ni:image2|{{{image2|}}}}}<!--
 
-->{{#vardefine:ni:image2text|}}<!--
 
-->{{#vardefine:ni:image3|{{{image3|}}}}}<!--
 
-->{{#vardefine:ni:image3text|}}<!--
 
parse image 2/3
 
init all vars
 
-->{{#dplvar:set<!--
 
-->|d|t1|c|t1|o|t1|m|t1|3|t1<!--
 
-->|t1||t2||t3|<!--
 
-->}}<!--
 
try to auto discover: _(old).png, _(old).gif if needed. only for full mode
 
-->{{#ifeq:{{#var:imagemode}}|full|<!--
 
if($image2 === null)
 
-->{{#if:{{{image2|}}}||{{#if:{{{image2|null}}}|<!--
 
-->{{#vardefine:old|{{#if:{{{image|}}}|{{#explode:{{{image}}}|.|0}}|{{#var:ni:imagename}}}}_(old)}}<!--
 
-->{{#vardefine:ni:image2|<!--
 
-->{{#ifexist:Media:{{#var:old}}.png|<!--
 
-->{{#var:old}}.png<!--
 
-->|<!--
 
-->{{#ifexist:Media:{{#var:old}}.gif|{{#var:old}}.gif}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->}}}}<!--
 
-->}}<!--
 
versions for images2
 
-->{{#if:{{#var:ni:image2}}|<!--
 
imageversion2 examples: old,Console,Console-Mobile, any platform-platform-platform
 
-->{{#if:{{{imageversion2|}}}|<!--
 
-->{{#dplvar:set|imageversion|{{lc:{{{imageversion2}}}}}}}<!--
 
-->{{#if:{{#pos:{{#dplvar:imageversion}}|desktop}}|{{#dplvar:set|d|t2}}}}<!--
 
-->{{#if:{{#pos:{{#dplvar:imageversion}}|console}}|{{#dplvar:set|c|t2}}}}<!--
 
-->{{#if:{{#pos:{{#dplvar:imageversion}}|old-gen}}|{{#dplvar:set|o|t2}}}}<!--
 
-->{{#if:{{#pos:{{#dplvar:imageversion}}|mobile}}|{{#dplvar:set|m|t2}}}}<!--
 
-->{{#if:{{#pos:{{#dplvar:imageversion}}|3ds}}|{{#dplvar:set|3|t2}}}}<!--
 
-->|<!--
 
-->{{#dplvar:set|o|t2|3|t2}}<!-- default old versions
 
 
-->}}<!--
 
-->}}<!--
-->}}<!--
 
versions for images3
 
-->{{#if:{{#var:ni:image3}}|<!--
 
imageversion3 examples: Console,Console-Mobile, any platform-platform-platform
 
-->{{#if:{{{imageversion3|}}}|<!-- platforms specified
 
-->{{#dplvar:set|imageversion|{{lc:{{{imageversion3|}}}}}}}<!--
 
-->{{#if:{{#pos:{{#dplvar:imageversion}}|desktop}}|{{#dplvar:set|d|t3}}}}<!--
 
-->{{#if:{{#pos:{{#dplvar:imageversion}}|console}}|{{#dplvar:set|c|t3}}}}<!--
 
-->{{#if:{{#pos:{{#dplvar:imageversion}}|old-gen}}|{{#dplvar:set|o|t3}}}}<!--
 
-->{{#if:{{#pos:{{#dplvar:imageversion}}|mobile}}|{{#dplvar:set|m|t3}}}}<!--
 
-->{{#if:{{#pos:{{#dplvar:imageversion}}|3ds}}|{{#dplvar:set|3|t3}}}}<!--
 
-->}}<!--
 
-->}}<!--
 
tooltips, if needed
 
-->{{#if:{{#var:ni:image2}}{{#var:ni:image3}}|<!--
 
// now dplvars d/c/o/m/3 will be t1/t2/t3.
 
//append versions to t1/t2/t3:
 
-->{{#dplvar:set|{{#dplvar:d}}|{{#dplvar:{{#dplvar:d}}}}/desktop}}<!--
 
-->{{#dplvar:set|{{#dplvar:c}}|{{#dplvar:{{#dplvar:c}}}}/console}}<!--
 
-->{{#dplvar:set|{{#dplvar:o}}|{{#dplvar:{{#dplvar:o}}}}/old-gen}}<!--
 
-->{{#dplvar:set|{{#dplvar:m}}|{{#dplvar:{{#dplvar:m}}}}/mobile}}<!--
 
-->{{#dplvar:set|{{#dplvar:3}}|{{#dplvar:{{#dplvar:3}}}}/3ds}}<!--
 
//alt text for t1/t2/t3
 
-->{{#if:{{#dplvar:t1}}|{{#vardefine:ni:image1text|{{versions|{{#dplvar:t1}}|mode=text|nl=yes}}}}}}<!--
 
-->{{#if:{{#dplvar:t2}}|{{#vardefine:ni:image2text|{{versions|{{#dplvar:t2}}|mode=text|nl=yes}}}}}}<!--
 
-->{{#if:{{#dplvar:t3}}|{{#vardefine:ni:image3text|{{versions|{{#dplvar:t3}}|mode=text|nl=yes}}}}}}<!--
 
-->}}<!--
 
 
AI
 
-->{{#vardefine:ni:ai|{{#if:{{{ai|{{#dplvar:_npc_infobox:info:aiStyle}}}}}|{{{ai|{{npc infobox/AI|{{#dplvar:_npc_infobox:info:aiStyle}}}}}}}}}}}<!--
 
damage
 
-->{{#vardefine:ni:damage|{{{damage|{{#if:{{#dplvar:_npc_infobox:info:damage}}|<!--
 
-->{{#invoke:npcstat|format|lang={{lang}}|hardmodeonly={{{hardmode|}}}|expertonly={{{expertonly|}}}<!--
 
-->|{{#dplvar:_npc_infobox:info:damage}}<!--
 
-->|{{#dplvar:_npc_infobox:info:damage_e}}|{{#dplvar:_npc_infobox:info:damage_e_hm}}|{{#dplvar:_npc_infobox:info:damage_e_pp}}<!--
 
-->|{{#dplvar:_npc_infobox:info:damage_m}}|{{#dplvar:_npc_infobox:info:damage_m_hm}}|{{#dplvar:_npc_infobox:info:damage_m_pp}}<!--
 
-->}}<!--
 
 
-->}}}}}{{{damage2|}}}}}<!--
 
-->}}}}}{{{damage2|}}}}}<!--
 
-->{{#vardefine:ni:damage1|{{{damage|}}}}}<!--
 
-->{{#vardefine:ni:damage1|{{{damage|}}}}}<!--
 
-->{{#vardefine:ni:damage2|{{{damage2|}}}}}<!--
 
-->{{#vardefine:ni:damage2|{{{damage2|}}}}}<!--
-->{{#vardefine:ni:auto_damage|{{#dplvar:_npc_infobox:info:damage}}}}<!--
+
-->{{#vardefine:ni:auto_damage|{{#dplvar:ni:info:damage}}}}<!--
-->{{#vardefine:ni:auto_damage_e|{{#dplvar:_npc_infobox:info:damage_e}}}}<!--
+
-->{{#vardefine:ni:auto_damage_e|{{#dplvar:ni:info:damage_e}}}}<!--
-->{{#vardefine:ni:auto_damage_e_hm|{{#dplvar:_npc_infobox:info:damage_e_hm}}}}<!--
+
-->{{#vardefine:ni:auto_damage_e_hm|{{#dplvar:ni:info:damage_e_hm}}}}<!--
-->{{#vardefine:ni:auto_damage_e_pp|{{#dplvar:_npc_infobox:info:damage_e_pp}}}}<!--
+
-->{{#vardefine:ni:auto_damage_e_pp|{{#dplvar:ni:info:damage_e_pp}}}}<!--
-->{{#vardefine:ni:auto_damage_m|{{#dplvar:_npc_infobox:info:damage_m}}}}<!--
+
-->{{#vardefine:ni:auto_damage_m|{{#dplvar:ni:info:damage_m}}}}<!--
-->{{#vardefine:ni:auto_damage_m_hm|{{#dplvar:_npc_infobox:info:damage_m_hm}}}}<!--
+
-->{{#vardefine:ni:auto_damage_m_hm|{{#dplvar:ni:info:damage_m_hm}}}}<!--
-->{{#vardefine:ni:auto_damage_m_pp|{{#dplvar:_npc_infobox:info:damage_m_pp}}}}<!--
+
-->{{#vardefine:ni:auto_damage_m_pp|{{#dplvar:ni:info:damage_m_pp}}}}<!--
  +
--------
max life
 
  +
-->{{#vardefine:ni:lifemax|{{{life|{{#if:{{#dplvar:_npc_infobox:info:lifeMax}}|<!--
 
  +
---- max life ----
-->{{#invoke:npcstat|format|lang={{lang}}|hardmodeonly={{{hardmode|}}}|expertonly={{{expertonly|}}}<!--
 
-->|{{#dplvar:_npc_infobox:info:lifeMax}}<!--
+
-->{{#vardefine:ni:lifemax|{{{life|{{#if:{{#dplvar:ni:info:lifeMax}}|<!--
  +
-->{{#invoke:Npcstat|format|lang={{lang|}}|hardmodeonly={{#var:ni:hardmodeonly}}|expertonly={{#var:ni:expertonly}}<!--
-->|{{#dplvar:_npc_infobox:info:lifeMax_e}}|{{#dplvar:_npc_infobox:info:lifeMax_e_hm}}|{{#dplvar:_npc_infobox:info:lifeMax_e_pp}}<!--
 
-->|{{#dplvar:_npc_infobox:info:lifeMax_m}}|{{#dplvar:_npc_infobox:info:lifeMax_m_hm}}|{{#dplvar:_npc_infobox:info:lifeMax_m_pp}}<!--
+
-->|{{#dplvar:ni:info:lifeMax}}<!--
  +
-->|{{#dplvar:ni:info:lifeMax_e}}|{{#dplvar:ni:info:lifeMax_e_hm}}|{{#dplvar:ni:info:lifeMax_e_pp}}<!--
-->}}<!--
 
  +
-->|{{#dplvar:ni:info:lifeMax_m}}|{{#dplvar:ni:info:lifeMax_m_hm}}|{{#dplvar:ni:info:lifeMax_m_pp}}<!--
  +
-->}}<!--
 
-->}}}}}{{{life2|}}}}}<!--
 
-->}}}}}{{{life2|}}}}}<!--
 
-->{{#vardefine:ni:lifemax1|{{{life|}}}}}<!--
 
-->{{#vardefine:ni:lifemax1|{{{life|}}}}}<!--
 
-->{{#vardefine:ni:lifemax2|{{{life2|}}}}}<!--
 
-->{{#vardefine:ni:lifemax2|{{{life2|}}}}}<!--
-->{{#vardefine:ni:auto_lifemax|{{#dplvar:_npc_infobox:info:lifeMax}}}}<!--
+
-->{{#vardefine:ni:auto_lifemax|{{#dplvar:ni:info:lifeMax}}}}<!--
-->{{#vardefine:ni:auto_lifemax_e|{{#dplvar:_npc_infobox:info:lifeMax_e}}}}<!--
+
-->{{#vardefine:ni:auto_lifemax_e|{{#dplvar:ni:info:lifeMax_e}}}}<!--
-->{{#vardefine:ni:auto_lifemax_e_hm|{{#dplvar:_npc_infobox:info:lifeMax_e_hm}}}}<!--
+
-->{{#vardefine:ni:auto_lifemax_e_hm|{{#dplvar:ni:info:lifeMax_e_hm}}}}<!--
-->{{#vardefine:ni:auto_lifemax_e_pp|{{#dplvar:_npc_infobox:info:lifeMax_e_pp}}}}<!--
+
-->{{#vardefine:ni:auto_lifemax_e_pp|{{#dplvar:ni:info:lifeMax_e_pp}}}}<!--
-->{{#vardefine:ni:auto_lifemax_m|{{#dplvar:_npc_infobox:info:lifeMax_m}}}}<!--
+
-->{{#vardefine:ni:auto_lifemax_m|{{#dplvar:ni:info:lifeMax_m}}}}<!--
-->{{#vardefine:ni:auto_lifemax_m_hm|{{#dplvar:_npc_infobox:info:lifeMax_m_hm}}}}<!--
+
-->{{#vardefine:ni:auto_lifemax_m_hm|{{#dplvar:ni:info:lifeMax_m_hm}}}}<!--
-->{{#vardefine:ni:auto_lifemax_m_pp|{{#dplvar:_npc_infobox:info:lifeMax_m_pp}}}}<!--
+
-->{{#vardefine:ni:auto_lifemax_m_pp|{{#dplvar:ni:info:lifeMax_m_pp}}}}<!--
  +
--------
defense
 
  +
-->{{#vardefine:ni:defense|{{{defense|{{#if:{{#dplvar:_npc_infobox:info:defense}}|<!--
 
  +
---- defense ----
-->{{#invoke:npcstat|format|lang={{lang}}|hardmodeonly={{{hardmode|}}}|expertonly={{{expertonly|}}}<!--
 
-->|{{#dplvar:_npc_infobox:info:defense}}<!--
+
-->{{#vardefine:ni:defense|{{{defense|{{#if:{{#dplvar:ni:info:defense}}|<!--
  +
-->{{#invoke:Npcstat|format|lang={{lang|}}|hardmodeonly={{#var:ni:hardmodeonly}}|expertonly={{#var:ni:expertonly}}<!--
-->|{{#dplvar:_npc_infobox:info:defense_e}}|{{#dplvar:_npc_infobox:info:defense_e_hm}}|{{#dplvar:_npc_infobox:info:defense_e_pp}}<!--
 
-->|{{#dplvar:_npc_infobox:info:defense_m}}|{{#dplvar:_npc_infobox:info:defense_m_hm}}|{{#dplvar:_npc_infobox:info:defense_m_pp}}<!--
+
-->|{{#dplvar:ni:info:defense}}<!--
  +
-->|{{#dplvar:ni:info:defense_e}}|{{#dplvar:ni:info:defense_e_hm}}|{{#dplvar:ni:info:defense_e_pp}}<!--
-->}}<!--
 
  +
-->|{{#dplvar:ni:info:defense_m}}|{{#dplvar:ni:info:defense_m_hm}}|{{#dplvar:ni:info:defense_m_pp}}<!--
  +
-->}}<!--
 
-->}}}}}{{{defense2|}}}}}<!--
 
-->}}}}}{{{defense2|}}}}}<!--
 
-->{{#vardefine:ni:defense1|{{{defense|}}}}}<!--
 
-->{{#vardefine:ni:defense1|{{{defense|}}}}}<!--
 
-->{{#vardefine:ni:defense2|{{{defense2|}}}}}<!--
 
-->{{#vardefine:ni:defense2|{{{defense2|}}}}}<!--
-->{{#vardefine:ni:auto_defense|{{#dplvar:_npc_infobox:info:defense}}}}<!--
+
-->{{#vardefine:ni:auto_defense|{{#dplvar:ni:info:defense}}}}<!--
-->{{#vardefine:ni:auto_defense_e|{{#dplvar:_npc_infobox:info:defense_e}}}}<!--
+
-->{{#vardefine:ni:auto_defense_e|{{#dplvar:ni:info:defense_e}}}}<!--
-->{{#vardefine:ni:auto_defense_e_hm|{{#dplvar:_npc_infobox:info:defense_e_hm}}}}<!--
+
-->{{#vardefine:ni:auto_defense_e_hm|{{#dplvar:ni:info:defense_e_hm}}}}<!--
-->{{#vardefine:ni:auto_defense_e_pp|{{#dplvar:_npc_infobox:info:defense_e_pp}}}}<!--
+
-->{{#vardefine:ni:auto_defense_e_pp|{{#dplvar:ni:info:defense_e_pp}}}}<!--
-->{{#vardefine:ni:auto_defense_m|{{#dplvar:_npc_infobox:info:defense_m}}}}<!--
+
-->{{#vardefine:ni:auto_defense_m|{{#dplvar:ni:info:defense_m}}}}<!--
-->{{#vardefine:ni:auto_defense_m_hm|{{#dplvar:_npc_infobox:info:defense_m_hm}}}}<!--
+
-->{{#vardefine:ni:auto_defense_m_hm|{{#dplvar:ni:info:defense_m_hm}}}}<!--
-->{{#vardefine:ni:auto_defense_m_pp|{{#dplvar:_npc_infobox:info:defense_m_pp}}}}<!--
+
-->{{#vardefine:ni:auto_defense_m_pp|{{#dplvar:ni:info:defense_m_pp}}}}<!--
  +
--------
   
knockback
+
---- knockback ----
 
-->{{#vardefine:ni:knockback1|{{{knockback|}}}}}<!--
 
-->{{#vardefine:ni:knockback1|{{{knockback|}}}}}<!--
 
-->{{#vardefine:ni:knockback2|{{{knockback2|}}}}}<!--
 
-->{{#vardefine:ni:knockback2|{{{knockback2|}}}}}<!--
-->{{#vardefine:ni:auto_knockback|{{npc infobox/knockback|{{#dplvar:_npc_infobox:info:knockBackResist}}}}}}<!--
+
-->{{#vardefine:ni:auto_knockback|{{npc infobox/knockback|{{#dplvar:ni:info:knockBackResist}}}}}}<!--
-->{{#vardefine:ni:auto_knockback_e|{{npc infobox/knockback|{{#dplvar:_npc_infobox:info:knockBackResist_e}}}}}}<!--
+
-->{{#vardefine:ni:auto_knockback_e|{{npc infobox/knockback|{{#dplvar:ni:info:knockBackResist_e}}}}}}<!--
-->{{#vardefine:ni:auto_knockback_e_hm|{{npc infobox/knockback|{{#dplvar:_npc_infobox:info:knockBackResist_e_hm}}}}}}<!--
+
-->{{#vardefine:ni:auto_knockback_e_hm|{{npc infobox/knockback|{{#dplvar:ni:info:knockBackResist_e_hm}}}}}}<!--
-->{{#vardefine:ni:auto_knockback_e_pp|{{npc infobox/knockback|{{#dplvar:_npc_infobox:info:knockBackResist_e_pp}}}}}}<!--
+
-->{{#vardefine:ni:auto_knockback_e_pp|{{npc infobox/knockback|{{#dplvar:ni:info:knockBackResist_e_pp}}}}}}<!--
-->{{#vardefine:ni:auto_knockback_m|{{npc infobox/knockback|{{#dplvar:_npc_infobox:info:knockBackResist_m}}}}}}<!--
+
-->{{#vardefine:ni:auto_knockback_m|{{npc infobox/knockback|{{#dplvar:ni:info:knockBackResist_m}}}}}}<!--
-->{{#vardefine:ni:auto_knockback_m_hm|{{npc infobox/knockback|{{#dplvar:_npc_infobox:info:knockBackResist_m_hm}}}}}}<!--
+
-->{{#vardefine:ni:auto_knockback_m_hm|{{npc infobox/knockback|{{#dplvar:ni:info:knockBackResist_m_hm}}}}}}<!--
-->{{#vardefine:ni:auto_knockback_m_pp|{{npc infobox/knockback|{{#dplvar:_npc_infobox:info:knockBackResist_m_pp}}}}}}<!--
+
-->{{#vardefine:ni:auto_knockback_m_pp|{{npc infobox/knockback|{{#dplvar:ni:info:knockBackResist_m_pp}}}}}}<!--
-->{{#vardefine:ni:knockback|{{{knockback|{{#if:{{#dplvar:_npc_infobox:info:knockBackResist}}|<!--
+
-->{{#vardefine:ni:knockback|{{{knockback|{{#if:{{#dplvar:ni:info:knockBackResist}}|<!--
-->{{#invoke:npcstat|format|lang={{lang}}|hardmodeonly={{{hardmode|}}}|expertonly={{{expertonly|}}}<!--
+
-->{{#invoke:Npcstat|format|lang={{lang|}}|hardmodeonly={{#var:ni:hardmodeonly}}|expertonly={{#var:ni:expertonly}}<!--
 
-->|{{#var:ni:auto_knockback}}<!--
 
-->|{{#var:ni:auto_knockback}}<!--
-->|{{#var:ni:auto_knockback_e}}<!--
+
-->|{{#var:ni:auto_knockback_e}}|{{#var:ni:auto_knockback_e_hm}}|{{#var:ni:auto_knockback_e_pp}}<!--
-->|{{#var:ni:auto_knockback_e_hm}}<!--
+
-->|{{#var:ni:auto_knockback_m}}|{{#var:ni:auto_knockback_m_hm}}|{{#var:ni:auto_knockback_m_pp}}<!--
-->|{{#var:ni:auto_knockback_e_pp}}<!--
 
-->|{{#var:ni:auto_knockback_m}}<!--
 
-->|{{#var:ni:auto_knockback_m_hm}}<!--
 
-->|{{#var:ni:auto_knockback_m_pp}}<!--
 
 
-->}}<!--
 
-->}}<!--
 
-->}}}}}{{{knockback2|}}}}}<!--
 
-->}}}}}{{{knockback2|}}}}}<!--
  +
--------
buff info
 
-->{{#vardefine:ni:buffid|{{#if:{{{buffid|{{{buff|}}}}}}|<!--
 
-->{{{buffid|<!--
 
-->{{#if:{{#dplreplace:{{trim|{{{buff|}}}}}|/^[0-9]+$/|}}|<!--
 
-->{{buffIdFromName|{{{buff|}}}}}<!--
 
-->|<!--
 
-->{{{buff|}}}<!--
 
-->}}<!--
 
-->}}}<!--
 
-->}}}}<!--
 
-->{{#if:{{#var:ni:buffid}}|<!--
 
-->{{#vardefine:ni:buffduration|{{{buffduration|}}}}}<!--
 
-->{{#vardefine:ni:bufftip|{{{bufftip|{{tr|{{getBuffInfo|{{#var:ni:buffid}}|tooltip}}}}}}}}}<!--
 
-->}}<!--
 
   
  +
---- immunities ----
debuff info:
 
-->{{#vardefine:ni:debuffid|{{#if:{{{debuff|}}}|<!--
 
-->{{#if:{{#dplreplace:{{trim|{{{debuff|}}}}}|/^[0-9]+$/|}}|<!--
 
-->{{buffIdFromName|{{{debuff|}}}}}<!--
 
-->|<!--
 
-->{{{debuff|}}}<!--
 
-->}}<!--
 
-->}}}}<!--
 
-->{{#if:{{#var:ni:debuffid}}|<!--
 
-->{{#vardefine:ni:debuffchance|{{#if:{{{debuffchance|}}}|<!--
 
// this part is a relic of the old npc infobox, it is only kept for backwards compatibility
 
-->{{#ifeq:{{#sub:{{{debuffchance|}}}|-2}}|##|<!--
 
-->{{#sub:{{{debuffchance|}}}|0|-2}}<!-- if end with ## then use it as-is
 
-->|<!--
 
-->{{{debuffchance|}}}<!-- else use it as-is
 
-->}}<!--
 
-->}}}}<!--
 
-->{{#vardefine:ni:debuffchancenote|{{{debuffchancenote|}}}}}<!--
 
-->{{#vardefine:ni:debuffduration|{{{duration|{{{debuffduration|}}}}}}}}<!--
 
-->{{#vardefine:ni:debufftip|{{{debufftip|{{tr|{{getBuffInfo|{{#var:ni:debuffid}}|tooltip}}}}}}}}}<!--
 
-->{{#vardefine:ni:debuffmode|{{{debuffmode|}}}}}<!--
 
-->}}<!-- END debuff
 
-->{{#vardefine:ni:debuffid2|{{#if:{{{debuff2|}}}|<!--
 
-->{{#if:{{#dplreplace:{{trim|{{{debuff2|}}}}}|/^[0-9]+$/|}}|<!--
 
-->{{buffIdFromName|{{{debuff2|}}}}}<!--
 
-->|<!--
 
-->{{{debuff2|}}}<!--
 
-->}}<!--
 
-->}}}}<!--
 
-->{{#if:{{#var:ni:debuffid2}}|<!--
 
-->{{#vardefine:ni:debuffchance2|{{#if:{{{debuffchance2|}}}|<!--
 
// this part is a relic of the old npc infobox, it is only kept for backwards compatibility
 
-->{{#ifeq:{{#sub:{{{debuffchance2|}}}|-2}}|##|<!--
 
-->{{#sub:{{{debuffchance2|}}}|0|-2}}<!-- if end with ## then use it as-is
 
-->|<!--
 
-->{{{debuffchance2|}}}<!-- else use it as-is
 
-->}}<!--
 
-->}}}}<!--
 
-->{{#vardefine:ni:debuffchancenote2|{{{debuffchancenote2|}}}}}<!--
 
-->{{#vardefine:ni:debuffduration2|{{{duration2|{{{debuffduration2|}}}}}}}}<!--
 
-->{{#vardefine:ni:debufftip2|{{{debufftip2|{{tr|{{getBuffInfo|{{#var:ni:debuffid2}}|tooltip}}}}}}}}}<!--
 
-->{{#vardefine:ni:debuffmode2|{{{debuffmode2|}}}}}<!--
 
-->}}<!-- END debuff2
 
 
Immune
 
 
-->{{#vardefine:ni:immunities|}}<!--
 
-->{{#vardefine:ni:immunities|}}<!--
 
-->{{#vardefine:ni:immunenote|{{{immuneallnote|{{{immunenote|}}}}}}}}<!--
 
-->{{#vardefine:ni:immunenote|{{{immuneallnote|{{{immunenote|}}}}}}}}<!--
 
-->{{#vardefine:ni:cargo:immunities|}}<!--
 
-->{{#vardefine:ni:cargo:immunities|}}<!--
-->{{#if:{{#dplvar:_npc_infobox:info:friendly}}||<!--
+
-->{{#vardefine:_ignore_immunities|{{#dplvar:ni:info:friendly}}{{#lstfltr:projectile/invincible/critter/gold Critter|/|{{lc:{{#var:ni:types}}}}|/}}}}<!--
  +
-->{{#if:{{#var:_ignore_immunities}}||<!--
-->{{#arraydefine:skip_types|Projectile/Invincible/Critter|/}}<!-- skip types: Projectile|Invincible|Critter
 
-->{{#if:{{#arraysearch:skip_types|{{{type|}}}|0|y|}}||<!-- if not skip type
+
-->{{#if:{{bool|{{{immuneall|{{#dplvar:ni:info:buffImmuneAll}}}}}}}|<!-- immune to all debuffs
  +
-->{{#vardefine:ni:immunities|ALL}}<!--
-->{{#if:{{{immuneall|{{#dplvar:_npc_infobox:info:buffImmuneAll}}}}}|<!-- immune all
 
-->{{#vardefine:ni:immunities|ALL}}<!--
+
-->{{#vardefine:ni:cargo:immunities|ALL}}<!--
  +
-->|{{#if:{{bool|{{{immuneallnotwhips|{{#dplvar:ni:info:buffImmuneAllNotWhips}}}}}}}|<!-- immune to all debuffs but not whip debuffs
-->{{#vardefine:ni:cargo:immunities|ALL}}<!--
 
  +
-->{{#vardefine:ni:immunities|NOTWHIPS}}<!--
-->|{{#if:{{{immuneallnotwhips|{{#dplvar:_npc_infobox:info:buffImmuneAllNotWhips}}}}}|<!-- immune all but not whips.
 
-->{{#vardefine:ni:immunities|NOTWHIPS}}<!--
+
-->{{#vardefine:ni:cargo:immunities|NOTWHIPS}}<!--
  +
-->|<!-- only immune to certain debuffs, or none at all
-->{{#vardefine:ni:cargo:immunities|NOTWHIPS}}<!--
 
  +
-->{{#vardefine:ni:immunities_input|{{#forargs:immune|paramkey|paramvalue|/<!-- iterate over all parameters starting with "immune"
-->|<!--
 
  +
-->{{#if:{{#var:paramkey}}|<!--
-->{{#if:{{#dplvar:_npc_infobox:info:buffImmune}}{{{immune1|}}}{{{immune2|}}}{{{immune3|}}}{{{immune4|}}}{{{immune5|}}}{{{immune6|}}}{{{immune7|}}}{{{immune8|}}}{{{immune9|}}}{{{immune10|}}}|<!--
 
  +
-->{{#if:{{isNumber|{{#var:paramkey}}}}|{{#var:paramvalue}}}}<!-- if the paramkey is a number, then we take its value (e.g. $immune2)
-->{{#arraydefine:__buffs|{{#dplvar:_npc_infobox:info:buffImmune}},{{buffIdFromName|{{{immune1|}}}}},{{buffIdFromName|{{{immune2|}}}}},{{buffIdFromName|{{{immune3|}}}}},{{buffIdFromName|{{{immune4|}}}}},{{buffIdFromName|{{{immune5|}}}}},{{buffIdFromName|{{{immune6|}}}}},{{buffIdFromName|{{{immune7|}}}}},{{buffIdFromName|{{{immune8|}}}}},{{buffIdFromName|{{{immune9|}}}}},{{buffIdFromName|{{{immune10|}}}}}|,|unique}}<!-- //"unique" will also drop empty values.
 
  +
-->|<!--
-->{{#vardefine:ni:immunities|{{ #arrayprint:__buffs|,}}}}<!-- concat with ","
 
  +
-->{{#var:paramvalue}}<!-- if the paramkey doesn't exist, then the parameter is $immune, so we take its value
-->{{#vardefine:ni:cargo:immunities|{{#arrayprint:__buffs|^|@@@@|{{getBuffInfo|@@@@|name}}}}}}<!--
 
-->}}<!--
+
-->}}<!--
-->}}}}<!--
+
-->}}}}<!--
  +
-->{{#if:{{#dplvar:ni:info:buffImmune}}{{#var:ni:immunities_input}}|<!-- if there are auto or manual immunities
-->}}<!--
 
  +
// convert manual immunities to buff IDs (auto immunities are already IDs)
  +
-->{{#vardefine:ni:immunities_input|{{#lstmap:{{#var:ni:immunities_input}}|/|@@@@|<esc>{{buffIdFromName|@@@@}}</esc>|,}}}}<!--
  +
// list of buff IDs for the views, separator ","
  +
-->{{#vardefine:ni:immunities|{{#lstuniq:{{#dplvar:ni:info:buffImmune}},{{#var:ni:immunities_input}}|,|,}}}}<!--
  +
// list of buff names for cargo, separator "^"
  +
-->{{#vardefine:ni:cargo:immunities|{{#lstmap:{{#var:ni:immunities}}|,|@@@@|<esc>{{getBuffInfo|@@@@|name}}</esc>|^}}}}<!--
  +
-->}}<!--
  +
-->}}}}<!--
 
-->}}<!--
 
-->}}<!--
  +
--------
   
banner
+
---- banner ----
-->{{#vardefine:ni:banner|}}<!-- banner name.
+
-->{{#vardefine:ni:banner|}}<!-- banner item name
-->{{#vardefine:__banner_id|}}<!-- banner id for cargo.
+
-->{{#vardefine:__banner_id|}}<!-- banner item id for cargo
  +
-->{{#if:{{{banner|}}}|<!--
 
  +
// $banner can either be "y"/"yes"/... or the name of the banner
-->{{#if: {{{banner|}}}|<!--
 
-->{{#vardefine:__banner_name|{{#ifeq:{{{banner|}}}|yes|{{{bannername|}}}|{{{banner|}}}}}}}<!--
+
-->{{#vardefine:__banner_name|<!--
  +
-->{{#if:{{bool|{{{banner|}}}}}|{{{bannername|}}}|{{{banner|}}}}}<!--
  +
-->}}<!--
 
-->{{#vardefine:ni:banner|{{#var:__banner_name|{{#var:ni:name}} Banner}}}}<!--
 
-->{{#vardefine:ni:banner|{{#var:__banner_name|{{#var:ni:name}} Banner}}}}<!--
 
-->|<!--
 
-->|<!--
 
-->{{#if:{{{auto|}}}|<!--
 
-->{{#if:{{{auto|}}}|<!--
-->{{#if:{{#vardefineecho:__banner_id|{{#dplvar:_npc_infobox:info:banner}}}}|<!--
+
-->{{#if:{{#vardefineecho:__banner_id|{{#dplvar:ni:info:banner}}}}|<!--
 
-->{{#vardefine:ni:banner|{{ItemNameFromId|lang=en|{{#var:__banner_id}}}}}}<!--
 
-->{{#vardefine:ni:banner|{{ItemNameFromId|lang=en|{{#var:__banner_id}}}}}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->}}<!--
  +
--------
   
money
+
---- money ----
-->{{#ifeq:{{#dplvar:_npc_infobox:info:value}}|0|<!--
+
-->{{#ifeq:{{#dplvar:ni:info:value}}|0|<!--
 
-->{{#vardefine:ni:auto_money_value|}}<!--
 
-->{{#vardefine:ni:auto_money_value|}}<!--
 
-->{{#vardefine:ni:auto_money_value_e|}}<!--
 
-->{{#vardefine:ni:auto_money_value_e|}}<!--
Zeile 377: Zeile 282:
 
-->{{#vardefine:ni:auto_money_value_m_pp|}}<!--
 
-->{{#vardefine:ni:auto_money_value_m_pp|}}<!--
 
-->|<!--
 
-->|<!--
-->{{#vardefine:ni:auto_money_value|{{#dplvar:_npc_infobox:info:value}}}}<!--
+
-->{{#vardefine:ni:auto_money_value|{{#dplvar:ni:info:value}}}}<!--
-->{{#vardefine:ni:auto_money_value_e|{{#dplvar:_npc_infobox:info:value_e}}}}<!--
+
-->{{#vardefine:ni:auto_money_value_e|{{#dplvar:ni:info:value_e}}}}<!--
-->{{#vardefine:ni:auto_money_value_e_hm|{{#dplvar:_npc_infobox:info:value_e_hm}}}}<!--
+
-->{{#vardefine:ni:auto_money_value_e_hm|{{#dplvar:ni:info:value_e_hm}}}}<!--
-->{{#vardefine:ni:auto_money_value_e_pp|{{#dplvar:_npc_infobox:info:value_e_pp}}}}<!--
+
-->{{#vardefine:ni:auto_money_value_e_pp|{{#dplvar:ni:info:value_e_pp}}}}<!--
-->{{#vardefine:ni:auto_money_value_m|{{#dplvar:_npc_infobox:info:value_m}}}}<!--
+
-->{{#vardefine:ni:auto_money_value_m|{{#dplvar:ni:info:value_m}}}}<!--
-->{{#vardefine:ni:auto_money_value_m_hm|{{#dplvar:_npc_infobox:info:value_m_hm}}}}<!--
+
-->{{#vardefine:ni:auto_money_value_m_hm|{{#dplvar:ni:info:value_m_hm}}}}<!--
-->{{#vardefine:ni:auto_money_value_m_pp|{{#dplvar:_npc_infobox:info:value_m_pp}}}}<!--
+
-->{{#vardefine:ni:auto_money_value_m_pp|{{#dplvar:ni:info:value_m_pp}}}}<!--
 
-->}}<!--
 
-->}}<!--
-->{{#vardefine:ni:money|{{{money|{{#if:{{#var:ni:auto_money_value|}}|<span class="money">{{#uesc:{{#invoke:npcstat|format|lang={{lang}}|hardmodeonly={{{hardmode|}}}|expertonly={{{expertonly|}}}|prefix=y<!--
+
-->{{#vardefine:ni:money|{{{money|{{#if:{{#var:ni:auto_money_value|}}|<span class="money">{{#uesc:<!--
  +
-->{{#invoke:Npcstat|format|prefix=y|lang={{lang|}}|hardmodeonly={{#var:ni:hardmodeonly}}|expertonly={{#var:ni:expertonly}}<!--
-->|<esc>{{coin|</esc>{{#var:ni:auto_money_value|}}<esc>}}</esc><!--
 
-->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_e|}}<esc>}}</esc><!--
+
-->|<esc>{{coin|</esc>{{#var:ni:auto_money_value|}}<esc>}}</esc><!--
-->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_e_hm|}}<esc>}}</esc><!--
+
-->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_e|}}<esc>}}</esc><!--
-->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_e_pp|}}<esc>}}</esc><!--
+
-->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_e_hm|}}<esc>}}</esc><!--
-->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_m|}}<esc>}}</esc><!--
+
-->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_e_pp|}}<esc>}}</esc><!--
-->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_m_hm|}}<esc>}}</esc><!--
+
-->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_m|}}<esc>}}</esc><!--
-->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_m_pp|}}<esc>}}</esc><!--
+
-->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_m_hm|}}<esc>}}</esc><!--
  +
-->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_m_pp|}}<esc>}}</esc><!--
-->}}}}</span>}}}}}}}<!--
 
  +
-->}}<!--
  +
-->}}</span>}}}}}}}<!--
 
-->{{#vardefine:ni:money1|{{{money1|}}}}}<!--
 
-->{{#vardefine:ni:money1|{{{money1|}}}}}<!--
 
-->{{#vardefine:ni:money2|{{{money2|}}}}}<!--
 
-->{{#vardefine:ni:money2|{{{money2|}}}}}<!--
 
-->{{#vardefine:ni:cargo:money|{{#var:ni:money|}}{{#var:ni:money2}}}}<!--
 
-->{{#vardefine:ni:cargo:money|{{#var:ni:money|}}{{#var:ni:money2}}}}<!--
  +
--------
  +
  +
---- sounds ----
  +
-->{{#arraydefine:ni:sounds|<!--
  +
-->{{#if:{{{soundhurt|{{#dplvar:ni:info:HitSound}}}}}|<!--
  +
-->normal@@{{l10n|npc_infobox|th_hurt}}@@{{{soundhurt|<!--
  +
-->{{#lstmap:{{#dplvar:ni:info:HitSound}}|,|$$$|$$$.wav|,}}<!--
  +
-->}}}<!--
  +
-->}}<!--
  +
-->{{#if:{{{soundkilled|{{#dplvar:ni:info:DeathSound}}}}}|<!--
  +
-->@@@@normal@@{{l10n|npc_infobox|th_killed}}@@{{{soundkilled|<!--
  +
-->{{#lstmap:{{#dplvar:ni:info:DeathSound}}|,|$$$|$$$.wav|,}}<!--
  +
-->}}}<!--
  +
-->}}<!--
  +
// l10n for very common and standard soundcaptions:
  +
-->{{#vardefine:_soundcaption_Idle|{{l10n|npc_infobox|th_idle}}}}<!--
  +
-->{{#vardefine:_soundcaption_Attack|{{l10n|npc_infobox|th_attack}}}}<!--
  +
-->{{#vardefine:_soundcaption_Teleport|{{l10n|npc_infobox|th_teleport}}}}<!--
  +
-->{{#forargs:sound|k|v|<!--
  +
"@@" is the delimiter between mode, caption, and sound(s); "@@@@" the delimiter between array elements
  +
-->{{#if:{{{soundcaption{{#var:k}}|}}}|<!--
  +
-->@@@@{{{soundmode{{#var:k}}|normal}}}<!--
  +
-->@@{{#var:_soundcaption_{{{soundcaption{{#var:k}}|}}}|{{{soundcaption{{#var:k}}|}}}}}<!--
  +
-->@@{{#var:v}}<!--
  +
-->}}<!--
  +
-->}}<!--
  +
-->|@@@@<!--
  +
-->}}<!--
  +
-->{{#arrayunique:ni:sounds}}<!-- removing empty and duplicate elements
  +
--------
  +
  +
  +
+++++++++++++ 5. Process additional parameter input, unrelated to auto data +++++++++++++
  +
  +
---- images ----
  +
// all images: default auto main image filename is in {{#var:ni:imagename}}
  +
// image 1
  +
-->{{#vardefine:ni:image1|{{{imagealt|<!--
  +
-->{{image|{{{image|{{#var:ni:imagename}}.png}}}|link=|size={{{imagesize|}}}}}<!--
  +
-->}}}}}<!--
  +
-->{{#if:{{#var:ni:image1}}||<!--
  +
// if there is no #var:ni:image1, then {{image}} failed, so use [[File:]] syntax as fallback
  +
-->{{#vardefine:ni:image1|[[File:{{{image|{{#var:ni:imagename}}.png}}}|link=]]}}<!--
  +
-->}}<!--
  +
-->{{#vardefine:ni:image1text|}}<!--
  +
// image expert
  +
-->{{#vardefine:imageexpert|{{{imageexpert|}}}}}<!--
  +
// init images 2 and 3
  +
-->{{#vardefine:ni:image2|{{{image2|}}}}}<!--
  +
-->{{#vardefine:ni:image2text|}}<!--
  +
-->{{#vardefine:ni:image3|{{{image3|}}}}}<!--
  +
-->{{#vardefine:ni:image3text|}}<!--
  +
// try to auto discover: _(old).png, _(old).gif if needed, but only in full mode
  +
-->{{#ifeq:{{#var:imagemode}}|full|{{#ifeq:{{{image2|-unset}}}|{{{image2|unset-}}}||<!-- if $image2 is not set (excluding "|image2=<blank>")
  +
-->{{#vardefine:_ni:imagenameold|<!-- set the name of the old image
  +
-->{{#if:{{{image|}}}|<!--
  +
// remove the file extension, i.e. everything after the last period
  +
// #rpos returns -1 if no period is found, so the length parameter for #sub should be 0 in that case
  +
// (which causes the string to remain unchanged)
  +
-->{{#sub:{{{image|}}}||{{max|{{#rpos:{{{image|}}}|.}}|0}}}}<!--
  +
-->|<!--
  +
-->{{#var:ni:imagename}}<!--
  +
-->}}<!--
  +
-->_(old)<!--
  +
-->}}<!--
  +
-->{{#vardefine:ni:image2|<!--
  +
// check .png
  +
-->{{#ifexist:Media:{{#var:_ni:imagenameold}}.png|<!--
  +
-->{{#var:_ni:imagenameold}}.png<!--
  +
-->|<!--
  +
// if .png not found, check .gif
  +
-->{{#ifexist:Media:{{#var:_ni:imagenameold}}.gif|{{#var:_ni:imagenameold}}.gif}}<!--
  +
-->}}<!--
  +
-->}}<!--
  +
-->}}}}<!--
  +
// init all variables
  +
-->{{#dplvar:set<!--
  +
-->|d|t1|c|t1|o|t1|m|t1|3|t1<!-- set all versions to "t1"
  +
-->|t1||t2||t3|<!-- set all tooltips to empty string
  +
-->}}<!--
  +
// versions for image2
  +
-->{{#if:{{#var:ni:image2}}|<!--
  +
// $imageversion2 examples: "old,Console,Console-Mobile", any "platform-platform-platform"
  +
-->{{#if:{{{imageversion2|}}}|<!--
  +
-->{{#dplvar:set|imageversion|{{lc:{{{imageversion2}}}}}}}<!--
  +
-->{{#if:{{#pos:{{#dplvar:imageversion}}|desktop}}|{{#dplvar:set|d|t2}}}}<!--
  +
-->{{#if:{{#pos:{{#dplvar:imageversion}}|console}}|{{#dplvar:set|c|t2}}}}<!--
  +
-->{{#if:{{#pos:{{#dplvar:imageversion}}|old-gen}}|{{#dplvar:set|o|t2}}}}<!--
  +
-->{{#if:{{#pos:{{#dplvar:imageversion}}|mobile}}|{{#dplvar:set|m|t2}}}}<!--
  +
-->{{#if:{{#pos:{{#dplvar:imageversion}}|3ds}}|{{#dplvar:set|3|t2}}}}<!--
  +
-->|<!--
  +
-->{{#dplvar:set|o|t2|3|t2}}<!-- no $imageversion2 specified, default to old versions
  +
-->}}<!--
  +
-->}}<!--
  +
// versions for image3
  +
-->{{#if:{{#var:ni:image3}}|<!--
  +
// $imageversion3 examples: "old,Console,Console-Mobile", any "platform-platform-platform"
  +
-->{{#if:{{{imageversion3|}}}|<!--
  +
-->{{#dplvar:set|imageversion|{{lc:{{{imageversion3|}}}}}}}<!--
  +
-->{{#if:{{#pos:{{#dplvar:imageversion}}|desktop}}|{{#dplvar:set|d|t3}}}}<!--
  +
-->{{#if:{{#pos:{{#dplvar:imageversion}}|console}}|{{#dplvar:set|c|t3}}}}<!--
  +
-->{{#if:{{#pos:{{#dplvar:imageversion}}|old-gen}}|{{#dplvar:set|o|t3}}}}<!--
  +
-->{{#if:{{#pos:{{#dplvar:imageversion}}|mobile}}|{{#dplvar:set|m|t3}}}}<!--
  +
-->{{#if:{{#pos:{{#dplvar:imageversion}}|3ds}}|{{#dplvar:set|3|t3}}}}<!--
  +
-->}}<!--
  +
-->}}<!--
  +
// image hovertexts (tooltips)
  +
-->{{#if:{{#var:ni:image2}}{{#var:ni:image3}}|<!--
  +
// each version's dplvar now has an associated tooltip, so we now need to gather the versions of each tooltip
  +
// example situation to demonstrate the following part: #dplvar:d="t1", #dplvar:c="t2", #dplvar:o="t2", #dplvar:m="t1", #dplvar:3="t2"
  +
-->{{#dplvar:set|{{#dplvar:d}}|{{#dplvar:{{#dplvar:d}}}}/desktop}}<!-- e.g.: #dplvar:t1 := #dplvar:t1 + "/desktop" -> "/desktop"
  +
-->{{#dplvar:set|{{#dplvar:c}}|{{#dplvar:{{#dplvar:c}}}}/console}}<!-- e.g.: #dplvar:t2 := #dplvar:t2 + "/console" -> "/console"
  +
-->{{#dplvar:set|{{#dplvar:o}}|{{#dplvar:{{#dplvar:o}}}}/old-gen}}<!-- e.g.: #dplvar:t2 := #dplvar:t2 + "/old-gen" -> "/console/old-gen"
  +
-->{{#dplvar:set|{{#dplvar:m}}|{{#dplvar:{{#dplvar:m}}}}/mobile}}<!-- e.g.: #dplvar:t1 := #dplvar:t1 + "/mobile" -> "/desktop/mobile"
  +
-->{{#dplvar:set|{{#dplvar:3}}|{{#dplvar:{{#dplvar:3}}}}/3ds}}<!-- e.g.: #dplvar:t2 := #dplvar:t2 + "/3ds" -> "/console/old-gen/3ds"
  +
// now each tooltip's dplvar has a defined set of versions which can easily be fed into {{versions}}
  +
-->{{#if:{{#dplvar:t1}}|{{#vardefine:ni:image1text|{{versions|{{#dplvar:t1}}|mode=text|nl=yes}}}}}}<!--
  +
-->{{#if:{{#dplvar:t2}}|{{#vardefine:ni:image2text|{{versions|{{#dplvar:t2}}|mode=text|nl=yes}}}}}}<!--
  +
-->{{#if:{{#dplvar:t3}}|{{#vardefine:ni:image3text|{{versions|{{#dplvar:t3}}|mode=text|nl=yes}}}}}}<!--
  +
-->}}<!--
  +
// image other
  +
-->{{#vardefine:ni:imageother|{{{imageother|}}}}}<!--
  +
// l10n for very common and standard imageothercaptions:
  +
-->{{#vardefine:_imageothercaption_map icon|{{l10n|npc_infobox|map_icon}}}}<!--
  +
-->{{#vardefine:ni:imageothercaption|{{#var:_imageothercaption_{{lc:{{{imageothercaption|}}}}}|{{{imageothercaption|}}}}}}}<!--
  +
--------
  +
  +
---- buffs and debuffs ----
  +
-->{{#vardefine:ni:buffs|}}<!--
  +
-->{{#vardefine:ni:debuffs|}}<!--
  +
  +
// loop: {{#var:bufftype}} is "buff" during first iteration and "debuff" during second iteration
  +
// (buff and debuff handling is identical, only the names are different)
  +
-->{{#loop:_i|0|2|{{#vardefine:bufftype|{{#ifexpr:{{#var:_i}}|de}}buff}}<!--
  +
// we have an ni:buffs and an ni:debuffs array ("ni:{{#var:bufftype}}s"), which hold the indices of all $de-/buff parameters
  +
// the unindexed "|buff=" / "|debuff=" parameters are represented by "-1", which is always the first element of these arrays, if those parameters are set
  +
-->{{#if:{{{ {{#var:bufftype}}|}}}|{{#vardefine:ni:{{#var:bufftype}}s|-1}}}}<!-- set first array element to -1
  +
-->{{#forargs:{{#var:bufftype}}|k|_|{{#if:{{isNumber|onlypositive=y|{{#var:k}}}}|<!-- for all parameters: if parameter name is "{de-/buff}<integer>"
  +
-->{{#vardefine:ni:{{#var:bufftype}}s|{{#lstapp:{{#var:ni:{{#var:bufftype}}s}}|₪|{{#var:k}}}}}}<!-- then add buff index to de-/buffs array
  +
-->}}}}<!--
  +
-->{{#vardefine:ni:{{#var:bufftype}}s|{{#lstsrt:{{#var:ni:{{#var:bufftype}}s}}|₪|₪|numeric}}}}<!-- sort parameter indices
  +
-->{{#loop:i|1|{{#lstcnt:{{#var:ni:{{#var:bufftype}}s}}|₪}}|<!-- iterate over parameter indices
  +
-->{{#vardefine:j|{{#lstelem:{{#var:ni:{{#var:bufftype}}s}}|₪|{{#var:i}}}}}}<!-- j is the parameter index
  +
-->{{#vardefine:k|{{#ifeq:{{#var:j}}|-1||{{#var:j}}}}}}<!-- k=j, unless j==-1, in which case k=(empty), since we use "${de-/buff}" instead of "${de-/buff}-1"
  +
// we store the information that the view needs in variables with a "ni:<bufftype><parameter index>:<stat>" format
  +
-->{{#vardefine:data_for_buffinfo_array|{{{ {{#var:bufftype}}{{#var:k}}|}}}}}<!--
  +
-->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:mode|{{lc:{{#sub:{{#var:data_for_buffinfo_array}}|-7}}}}}}<!--
  +
-->{{#switch:{{#var:ni:{{#var:bufftype}}{{#var:j}}:mode}}<!--
  +
-->|#normal|#expert|#master|@normal|@expert|@master=<!--
  +
// if the last 7 characters of the ${de-/buff} parameter are one of the valid mode identifiers,
  +
// then strip them from the data that will be used for the buffinfo array
  +
-->{{#vardefine:data_for_buffinfo_array|{{#sub:{{#var:data_for_buffinfo_array}}|0|-7}}}}<!--
  +
-->|#default=<!--
  +
// if they aren't, then they do not hold valid mode information, so the variable must be reset
  +
-->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:mode|}}<!--
  +
// (and also don't strip them, but use the whole parameter value for the buffinfo array)
  +
-->}}<!--
  +
-->{{#arraydefine:buffinfo|{{#var:data_for_buffinfo_array}}|/}}<!--
  +
-->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:mobile|}}<!--
  +
// buff id
  +
-->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:id|{{{id{{#var:bufftype}}{{#var:k}}|<!--
  +
-->{{buffIdFromName|{{#arrayindex:buffinfo|0}}}}<!-- buffinfo[0] will always contain the de-/buff name, regardless of whether compact mode was used or not
  +
-->}}}}}<!--
  +
-->{{#if:{{#var:ni:{{#var:bufftype}}{{#var:j}}:id}}|{{#ifeq:{{#sub:{{#var:ni:{{#var:bufftype}}{{#var:j}}:id}}|0|1}}|m|<!-- if is mobile id
  +
-->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:id|{{#sub:{{#var:ni:{{#var:bufftype}}{{#var:j}}:id}}|1}}}}<!--
  +
-->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:mobile|m}}<!--
  +
-->}}}}<!--
  +
// de-/buff name
  +
-->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:name|<!--
  +
-->{{#if:{{#var:ni:{{#var:bufftype}}{{#var:j}}:id}}|<!--
  +
-->{{getBuffInfo|{{#var:ni:{{#var:bufftype}}{{#var:j}}:mobile}}{{#var:ni:{{#var:bufftype}}{{#var:j}}:id}}|ename}}<!--
  +
-->|<!--
  +
-->{{#arrayindex:buffinfo|0}}<!--
  +
-->}}<!--
  +
-->}}<!--
  +
// de-/buff duration and chance
  +
-->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:duration|{{{ {{#var:bufftype}}duration{{#var:k}}|{{#arrayindex:buffinfo|1}}}}}}}<!--
  +
-->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:chance|{{{ {{#var:bufftype}}chance{{#var:k}}|{{#arrayindex:buffinfo|2}}}}}}}<!--
  +
// de-/buff tooltip
  +
-->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:tooltip|{{{ {{#var:bufftype}}tip{{#var:k}}|<!--
  +
-->{{getBuffInfo|{{#var:ni:{{#var:bufftype}}{{#var:j}}:mobile}}{{#var:ni:{{#var:bufftype}}{{#var:j}}:id}}|tooltip}}<!--
  +
-->}}}}}<!--
  +
// de-/buff link
  +
-->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:link|{{{ {{#var:bufftype}}link{{#var:k}}|<!--
  +
-->{{getBuffInfo|{{#var:ni:{{#var:bufftype}}{{#var:j}}:mobile}}{{#var:ni:{{#var:bufftype}}{{#var:j}}:id}}|page}}<!--
  +
-->}}}}}<!--
  +
// de-/buff vanity id
  +
-->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:idshow|{{{id{{#var:bufftype}}show{{#var:k}}|}}}}}<!--
  +
// de-/buff mode
  +
// normalization: the mode var contains the "#expert"/"@master"/... syntax from the ${de-/buff} parameter,
  +
// but the ${de-/buff}mode parameter contains the "expert"/"master"/"expertonly" syntax,
  +
// so we transform the latter to the former
  +
-->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:mode|{{#switch:{{{ {{#var:bufftype}}mode{{#var:k}}|}}}<!--
  +
-->|expert=#expert|master=#master|expertonly=@expert<!--
  +
-->|#default={{{ {{#var:bufftype}}mode{{#var:k}}|{{#var:ni:{{#var:bufftype}}{{#var:j}}:mode}}}}}<!--
  +
-->}}}}<!--
  +
-->}}<!--
  +
-->}}<!--
  +
--------
   
drops:
+
---- drops ----
 
-->{{#vardefine:ni:drops|<!--
 
-->{{#vardefine:ni:drops|<!--
 
-->{{#vardefine:_item_small_snap|{{options|item|small}}}}{{options/set|item|small=y}}<!--
 
-->{{#vardefine:_item_small_snap|{{options|item|small}}}}{{options/set|item|small=y}}<!--
 
-->{{#vardefine:_eicons_small_snap|{{options|eicons|small}}}}{{options/set|eicons|small=y}}<!--
 
-->{{#vardefine:_eicons_small_snap|{{options|eicons|small}}}}{{options/set|eicons|small=y}}<!--
  +
 
-->{{#vardefine:dropclass|}}<!--
 
-->{{#vardefine:dropclass|}}<!--
 
-->{{#dplvar:set<!--
 
-->{{#dplvar:set<!--
 
-->|_npc_infobox:trsbg|<!--
 
-->|_npc_infobox:trsbg|<!--
 
-->|_npc_infobox:group|0<!--
 
-->|_npc_infobox:group|0<!--
  +
-->|_npc_infobox:in_group|<!--
//every 3 unnamed arguments form a group.
 
  +
// every 3 unnamed arguments form a group
 
-->|_npc_infobox:group_arg_1|<!--
 
-->|_npc_infobox:group_arg_1|<!--
-->|_npc_infobox:group_arg_2|<!--
+
-->|_npc_infobox:group_arg_2|<!--
  +
used in npc_infobox/drop, init
  +
-->|_npc_infobox:in_loot|<!--
  +
-->|_npc_infobox:loot_source|<!--
 
-->}}<!--
 
-->}}<!--
//used in npc_infobox/drop, defined here for better performance
+
// used in npc_infobox/drop, defined here for better performance
 
-->{{#vardefine:nidrop:nameraw|{{#var:ni:name}}}}<!--
 
-->{{#vardefine:nidrop:nameraw|{{#var:ni:name}}}}<!--
 
-->{{#vardefine:nidrop:name|<!--
 
-->{{#vardefine:nidrop:name|<!--
-->{{eil|{{{link|{{ROOTPAGENAME}}}}}|{{tr|{{#var:ni:name}}}}}}<!--
+
-->{{eil|{{ROOTPAGENAME}}|{{tr|{{#var:ni:name}}}}|epage={{#var:npcnamefrompagename}}}}<!--
 
-->{{#if:{{#var:ni:namesub}}|{{note|block=y|paren=y|{{#var:ni:namesub}}}}}}<!--
 
-->{{#if:{{#var:ni:namesub}}|{{note|block=y|paren=y|{{#var:ni:namesub}}}}}}<!--
 
-->{{#if:{{#var:ni:namenote}}|{{note|block=y|paren=y|small=y|{{#var:ni:namenote}}}}}}<!--
 
-->{{#if:{{#var:ni:namenote}}|{{note|block=y|paren=y|small=y|{{#var:ni:namenote}}}}}}<!--
 
-->}}<!--
 
-->}}<!--
  +
// iterate over all unnamed parameters
-->{{#vardefine:nidrop:cargo|{{{cargodrops|{{#var:cargo}}}}}}}<!--
 
 
 
-->{{#fornumargs:i|v|<!--
 
-->{{#fornumargs:i|v|<!--
 
-->{{#ifexpr:{{#vardefineecho:_mod|{{#expr:{{#var:i}} mod 3}}}}|<!--
 
-->{{#ifexpr:{{#vardefineecho:_mod|{{#expr:{{#var:i}} mod 3}}}}|<!--
 
-->{{#dplvar:set|_npc_infobox:group_arg_{{#var:_mod}}|{{#var:v}}}}<!--
 
-->{{#dplvar:set|_npc_infobox:group_arg_{{#var:_mod}}|{{#var:v}}}}<!--
  +
-->|<!-- every three unnamed parameters, go into {{npc infobox/drop}}
-->|<!--
 
-->{{npc infobox/drop<!-- //value of named parameters will be auto trimmed, more convenient.
+
-->{{npc infobox/drop<!-- the values of named parameters ($A instead of $1) will be auto trimmed, which is more convenient
 
-->|A={{#dplvar:_npc_infobox:group_arg_1}}<!--
 
-->|A={{#dplvar:_npc_infobox:group_arg_1}}<!--
 
-->|B={{#dplvar:_npc_infobox:group_arg_2}}<!--
 
-->|B={{#dplvar:_npc_infobox:group_arg_2}}<!--
Zeile 433: Zeile 543:
 
-->{{options/set|eicons|small={{#var:_eicons_small_snap}}}}<!--
 
-->{{options/set|eicons|small={{#var:_eicons_small_snap}}}}<!--
 
-->}}<!--
 
-->}}<!--
  +
--------
   
imageother:
 
-->{{#vardefine:ni:imageother|{{{imageother|}}}}}<!--
 
-->{{#vardefine:ni:imageothercaption|{{#ifeq:{{{imageothercaption|}}}|Map Icon|{{l10n|npc_infobox|map_icon}}|{{{imageothercaption|}}}}}}}<!--
 
   
  +
+++++++++++++ 5. Categorize and store to cargo +++++++++++++
sounds:
 
-->{{#arraydefine:ni:sounds|<!--
 
-->{{#if:{{{soundhurt|{{#dplvar:_npc_infobox:info:HitSound}}}}}|<!--
 
-->normal@@{{l10n|npc_infobox|th_hurt}}@@{{{soundhurt|<!--
 
-->{{#lstmap:{{#dplvar:_npc_infobox:info:HitSound}}|,|$$$|$$$.wav|,}}<!--
 
-->}}}<!--
 
-->}}<!--
 
-->{{#if:{{{soundkilled|{{#dplvar:_npc_infobox:info:DeathSound}}}}}|<!--
 
-->@@@@normal@@{{l10n|npc_infobox|th_killed}}@@{{{soundkilled|<!--
 
-->{{#lstmap:{{#dplvar:_npc_infobox:info:DeathSound}}|,|$$$|$$$.wav|,}}<!--
 
-->}}}<!--
 
-->}}<!--
 
   
  +
---- determine validity of categorization ----
l10n for very common and standard soundcaptions:
 
-->{{#vardefine:_soundcaption_Idle|{{l10n|npc_infobox|th_idle}}}}<!--
+
-->{{#vardefine:cate|}}<!--
-->{{#vardefine:_soundcaption_Attack|{{l10n|npc_infobox|th_attack}}}}<!--
+
-->{{#switch:{{{cate|}}}<!--
-->{{#vardefine:_soundcaption_Teleport|{{l10n|npc_infobox|th_teleport}}}}<!--
+
-->|1|y|yes|true|force={{#vardefine:cate|y}}<!--
-->{{#forargs:sound|k|v|<!--
+
-->|0|n|no|false={{#vardefine:cate|}}<!--
  +
-->|#default=<!--
"@@" is the delimiter between mode, caption, and sound(s); "@@@@" the delimiter between array elements
 
-->{{#if:{{{soundcaption{{#var:k}}|}}}|<!--
+
-->{{#ifeq:{{NAMESPACE}}|{{ns:0}}|<!-- only in main ns
  +
-->{{#switch:{{#var:ni:viewmodename}}|infobox|table={{#vardefine:cate|y}}}}<!-- only cate for infobox/table view, no cate for void/item view
-->@@@@{{{soundmode{{#var:k}}|normal}}}<!--
 
  +
-->}}<!--
-->@@{{#var:_soundcaption_{{{soundcaption{{#var:k}}|}}}|{{{soundcaption{{#var:k}}|}}}}}<!--
 
-->@@{{#var:v}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->|@@@@<!--
 
 
-->}}<!--
 
-->}}<!--
  +
--------
-->{{#arrayunique:ni:sounds}}<!-- removing empty and duplicate elements
 
===== DATA END ======
 
   
  +
---- categorize ----
===== CATE & CARGO ======
 
  +
// note: printing the same category more than once is unnecessarily expensive, so we cache a category in its "cateset" variable
 
-->{{#vardefine:cate|{{#switch:{{{cate|}}}<!--
+
-->{{#if:{{#var:cate}}|<!--
  +
// allversions
-->|y|yes|force=y<!--
 
  +
-->{{#if:{{#switch:{{lc:{{{allversions|}}}}}|y|yes|1|true=y|n|no|0|false=|#default=<!--
-->|n|no=<!--nothing
 
-->|#default={{#ifeq:{{NAMESPACE}}|{{ns:0}}|<!-- only in main ns
 
-->{{#switch:{{#var:ni:viewmodename}}|infobox|table=y}}<!-- only cate for infobox/table view, no cate for void/item view
 
-->}}<!--
 
-->}}}}<!--
 
-->{{#if:{{#var:cate}}|<!-- cate note: printing the same category two or more times is unnecessarily expensive, so we cache a category in its "cateset" var
 
-->{{#if:{{#switch:{{lc:{{{allversions|}}}}}|y|yes|true=y|n|no|false=|#default=<!--
 
 
-->{{#if:{{#var:ni:npcid}}|{{#if:{{eversions|{{#var:ni:name}}|raw=y}}|<!--not all versions-->|y}}}}<!-- auto detect: id exists and eversions is null
 
-->{{#if:{{#var:ni:npcid}}|{{#if:{{eversions|{{#var:ni:name}}|raw=y}}|<!--not all versions-->|y}}}}<!-- auto detect: id exists and eversions is null
-->}}|<!-- allversions?
+
-->}}|<!--
-->{{#if:{{#var:ni:cateset:allversion}}||<!--
+
-->{{#if:{{#var:ni:cateset:allversions}}||<!--
-->{{#vardefine:ni:cateset:allversion|y}}{{all versions}}<!--
+
-->{{#vardefine:ni:cateset:allversions|y}}<!--
  +
-->{{all versions}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->}}<!--
  +
// environments
-->{{#if:{{#var:ni:environment}}|<!--
 
-->{{#uesc:<!--
+
-->{{#if:{{#var:ni:environment}}|{{#uesc:<!--
-->{{#lstmap:{{#var:ni:environment}}|/|$$$|<esc><!--
+
-->{{#lstmap:{{#var:ni:environment}}|/|$$$|<esc><!--
  +
-->{{#lstmap:$$$|+|@@@@|<!--
-->{{#lstmap:$$$|+|@@@@|{\{#if:{\{#var:ni:cateset:env:@@@@}\}\!\!{\{#vardefine:ni:cateset:env:@@@@\!y}\}{\{l10n\!npc_infobox\!cate_environment\!$env$=@@@@}\}\}\}|<!--no sep-->}}<!--
 
--></esc>|<!--no sep-->}}<!--
+
-->{\{#if:{\{#var:ni:cateset:env:@@@@}\}\!\!<!--
-->}}<!--
+
-->{\{#vardefine:ni:cateset:env:@@@@\!y}\}<!--
  +
-->{\{l10n\!npc_infobox\!cate_environment\!$env$=@@@@}\}<!--
-->}}<!--
 
  +
-->\}\}<!--
-->{{#if:{{#var:ni:type}}|{{#if:{{#var:ni:cateset:type:{{#var:ni:type}}}}||<!--
 
  +
-->|<!--no sep-->}}<!--
-->{{#vardefine:ni:cateset:type:{{#var:ni:type}}|y}}{{l10n|npc_infobox|cate_type|$type$={{#var:ni:type}}}}<!--
 
-->}}}}<!--
+
--></esc>|<!--no sep-->}}<!--
-->{{#if:{{#var:ni:type2}}|{{#if:{{#var:ni:cateset:type:{{#var:ni:type2}}}}||<!--
 
-->{{#vardefine:ni:cateset:type:{{#var:ni:type2}}|y}}{{l10n|npc_infobox|cate_type|$type$={{#var:ni:type2}}}}<!--
 
-->}}}}<!--
 
-->{{#if:{{#var:ni:type3}}|{{#if:{{#var:ni:cateset:type:{{#var:ni:type3}}}}||<!--
 
-->{{#vardefine:ni:cateset:type:{{#var:ni:type3}}|y}}{{l10n|npc_infobox|cate_type|$type$={{#var:ni:type3}}}}<!--
 
 
-->}}}}<!--
 
-->}}}}<!--
  +
// types
  +
-->{{#if:{{#var:ni:types}}|<!--
  +
-->{{#lstmap:{{#var:ni:types}}|/|@@@@|<esc><!--
  +
-->{{#if:{{#var:ni:cateset:type:@@@@}}||<!--
  +
-->{{#vardefine:ni:cateset:type:@@@@|y}}<!--
  +
-->{{l10n|npc_infobox|cate_type|$type$=@@@@}}<!--
  +
-->}}<!--
  +
--></esc>|}}<!--
  +
-->}}<!--
  +
// ai
 
-->{{#if:{{#var:ni:ai}}|{{#if:{{#var:ni:cateset:ai:{{#var:ni:ai}}}}||<!--
 
-->{{#if:{{#var:ni:ai}}|{{#if:{{#var:ni:cateset:ai:{{#var:ni:ai}}}}||<!--
-->{{#vardefine:ni:cateset:ai:{{#var:ni:ai}}|y}}{{l10n|npc_infobox|cate_ai|$ai$={{#var:ni:ai}}}}<!--
+
-->{{#vardefine:ni:cateset:ai:{{#var:ni:ai}}|y}}<!--
  +
-->{{l10n|npc_infobox|cate_ai|$ai$={{#var:ni:ai}}}}<!--
 
-->}}}}<!--
 
-->}}}}<!--
  +
// listcats
-->{{#if:{{#var:ni:listcat}}|{{#if:{{#var:ni:cateset:listcat:{{#var:ni:listcat}}}}||<!--
 
  +
-->{{#if:{{#var:ni:listcats}}|<!--
-->{{#vardefine:ni:cateset:listcat:{{#var:ni:listcat}}|y}}{{l10n|npc_infobox|cate_listcat|$listcat$={{#var:ni:listcat}}}}<!--
 
  +
-->{{#lstmap:{{#var:ni:listcats}}|/|@@@@|<esc><!--
-->}}}}<!--
 
-->{{#if:{{#var:ni:listcat2}}|{{#if:{{#var:ni:cateset:listcat:{{#var:ni:listcat2}}}}||<!--
+
-->{{#if:{{#var:ni:cateset:listcat:@@@@}}||<!--
-->{{#vardefine:ni:cateset:listcat:{{#var:ni:listcat2}}|y}}{{l10n|npc_infobox|cate_listcat|$listcat$={{#var:ni:listcat2}}}}<!--
+
-->{{#vardefine:ni:cateset:listcat:@@@@|y}}<!--
  +
-->{{l10n|npc_infobox|cate_listcat|$listcat$=@@@@}}<!--
-->}}}}<!--
 
  +
-->}}<!--
-->{{#if:{{#var:ni:listcat3}}|{{#if:{{#var:ni:cateset:listcat:{{#var:ni:listcat3}}}}||<!--
 
  +
--></esc>|}}<!--
-->{{#vardefine:ni:cateset:listcat:{{#var:ni:listcat3}}|y}}{{l10n|npc_infobox|cate_listcat|$listcat$={{#var:ni:listcat3}}}}<!--
 
-->}}}}<!--
+
-->}}<!--
  +
// hardmode and expert mode
-->{{#if:{{{hardmode|}}}|{{#if:{{#var:ni:cateset:hardmode}}||<!--
 
-->{{#vardefine:ni:cateset:hardmode|y}}{{l10n|npc_infobox|cate_hardmode|$type$={{#var:ni:type}}}}<!--
+
-->{{#if:{{#var:ni:hardmodeonly}}|{{#if:{{#var:ni:cateset:hardmode}}||<!--
  +
-->{{#vardefine:ni:cateset:hardmode|y}}<!--
  +
-->{{l10n|npc_infobox|cate_hardmode|$type$={{#lstelem:{{#var:ni:types}}|/|1}}}}<!--
 
-->}}}}<!--
 
-->}}}}<!--
-->{{#if:{{{expertonly|}}}|{{#if:{{#var:ni:cateset:expertonly}}||<!--
+
-->{{#if:{{#var:ni:expertonly}}|{{#if:{{#var:ni:cateset:expertonly}}||<!--
-->{{#vardefine:ni:cateset:expertonly|y}}{{l10n|npc_infobox|cate_expertonly|$type$={{#var:ni:type}}}}<!--
+
-->{{#vardefine:ni:cateset:expertonly|y}}<!--
  +
-->{{l10n|npc_infobox|cate_expertonly|$type$={{#lstelem:{{#var:ni:types}}|/|1}}}}<!--
 
-->}}}}<!--
 
-->}}}}<!--
 
-->}}<!--
 
-->}}<!--
  +
--------
   
// cargo
+
---- store to cargo ----
 
-->{{#if:{{#var:cargo}}|<!--
 
-->{{#if:{{#var:cargo}}|<!--
-->{{#lstmap:{{{idcargo|{{#var:_npc_auto_id|{{{id|}}}}}}}}|,|@@@@|<!--
+
-->{{#lstmap:{{{idcargo|{{#var:ni:auto_id|{{{id|}}}}}}}}|,|@@@@|<!--
--><esc>{{#cargo_store:_table=NPCs<!--
+
-->\{\{#cargo_store:_table=NPCs<!--
-->|name=</esc>{{eil|{{ROOTPAGENAME}}|{{tr|{{#var:ni:name}}}}}}<!--
+
-->\!name=<!--
-->{{#if:{{#var:ni:namesub}}|{{note|block=y|paren=y|{{#var:ni:namesub}}}}}}<!--
+
-->{{eil|{{ROOTPAGENAME}}|{{tr|{{#var:ni:name}}}}|epage={{#var:npcnamefrompagename}}}}<!--
-->{{#if:{{#var:ni:namenote}}|{{note|block=y|paren=y|small=y|{{#var:ni:namenote}}}}}}<esc><!--
+
-->{{#if:{{#var:ni:namesub}}|{{note|block=y|paren=y|{{#var:ni:namesub}}}}}}<!--
-->|nameraw=</esc>{{#var:ni:name}}<esc><!--
+
-->{{#if:{{#var:ni:namenote}}|{{note|block=y|paren=y|small=y|{{#var:ni:namenote}}}}}}<!--
  +
-->\!nameraw={{#var:ni:name}}<!--
-->|image=</esc><span class="npcimg">{{{imagecargo|{{{imagealt|[[File:{{{image|{{#var:ni:imagename}}.png}}}|link=]]}}}}}}</span><esc><!--
 
-->|environment=</esc>{{#var:ni:environment}}<esc><!--
+
-->\!image=<span class="npcimg">{{{imagecargo|{{{imagealt|[[File:{{{image|{{#var:ni:imagename}}.png}}}|link=]]}}}}}}</span><!--
-->|ai=</esc>{{#var:ni:ai}}<esc><!--
+
-->\!environment={{#var:ni:environment}}<!--
-->|damage=</esc>{{npc infobox/strip|{{#var:ni:damage}}}}<esc><!--
+
-->\!ai={{#var:ni:ai}}<!--
-->|life=</esc>{{npc infobox/strip|{{#var:ni:lifemax}}}}<esc><!--
+
-->\!damage={{npc infobox/strip|{{#var:ni:damage}}}}<!--
-->|defense=</esc>{{npc infobox/strip|{{#var:ni:defense}}}}<esc><!--
+
-->\!life={{npc infobox/strip|{{#var:ni:lifemax}}}}<!--
-->|knockback=</esc>{{npc infobox/strip|{{#var:ni:knockback}}}}<esc><!--
+
-->\!defense={{npc infobox/strip|{{#var:ni:defense}}}}<!--
-->|bannername=</esc>{{#var:ni:banner}}<esc><!--
+
-->\!knockback={{npc infobox/strip|{{#var:ni:knockback}}}}<!--
-->|banner=</esc>{{#if:{{#var:ni:banner}}|{{item|{{#var:ni:banner}}|wrap=y}}}}<esc><!--
+
-->\!bannername={{#var:ni:banner}}<!--
-->|money=</esc>{{#var:ni:cargo:money}}<esc><!--
+
-->\!banner={{#if:{{#var:ni:banner}}|{{item|{{#var:ni:banner}}|wrap=y}}}}<!--
-->|npcid=@@@@<!--
+
-->\!money={{#var:ni:cargo:money}}<!--
  +
-->\!npcid=@@@@<!--
-->|immunities=</esc>{{#var:ni:cargo:immunities}}<esc><!--
 
-->}}</esc><!--
+
-->\!immunities={{#var:ni:cargo:immunities}}<!--
  +
-->\}\}<!--
 
-->}}<!--
 
-->}}<!--
//since enemy banners is too many, we can't store them in enemy banners page, store them here.
+
// since the enemy banners are too many, we can't store them all in the "Banners (enemy)" page, so we store them here
 
-->{{#if:{{#var:__banner_id}}|{{#if:{{#var:ni:_banner_id_is_stored:{{#var:__banner_id}}}}||<!--
 
-->{{#if:{{#var:__banner_id}}|{{#if:{{#var:ni:_banner_id_is_stored:{{#var:__banner_id}}}}||<!--
-->{{#vardefine:ni:_banner_id_is_stored:{{#var:__banner_id}}|y}}<!--
+
-->{{#vardefine:ni:_banner_id_is_stored:{{#var:__banner_id}}|y}}<!-- store the same banner only once per page
 
-->{{item infobox| view=void | auto = {{#var:__banner_id}}<!--
 
-->{{item infobox| view=void | auto = {{#var:__banner_id}}<!--
-->| buffid = {{#ifexpr:(({{#var:__banner_id}} > 3836) AND ({{#var:__banner_id}} <3847))||147}}<!--
+
-->| buffid = {{#ifexpr:(({{#var:__banner_id}} > 3836) AND ({{#var:__banner_id}} < 3847))||147}}<!--
-->| type = Furniture | width = 1 | height = 3 | tags = drop / enemy banner | hardmode = {{{hardmode|}}}<!--
+
-->| type = Furniture | width = 1 | height = 3 | tags = drop / enemy banner | hardmode = {{#var:ni:hardmodeonly}}<!--
 
-->}}<!--
 
-->}}<!--
 
-->}}}}<!--
 
-->}}}}<!--
 
 
-->}}<!--
 
-->}}<!--
   
  +
===== OUTPUT VIEW ======
 
  +
select view base on viewmodename. e.g. mode=table means {{npc infobox/tableView}}, default is {{ infobox/infoboxView}}
 
  +
==========================================================================================================================
  +
============================================= DATA VIEW ==============================================
  +
==========================================================================================================================
  +
  +
  +
// select view based on viewname, e.g. "|mode=table" means {{npc infobox/tableView}}, default is {{npc infobox/infoboxView}}
 
-->{{npc infobox/{{#var:ni:viewmodename}}View}}<!--
 
-->{{npc infobox/{{#var:ni:viewmodename}}View}}<!--
   
 
--></includeonly><!--
 
--></includeonly><!--
   
--><noinclude>
+
--><noinclude><!--
  +
  +
-->
 
* {{#cargo_declare:_table=NPCs
 
* {{#cargo_declare:_table=NPCs
|name=Wikitext (size=1000)
+
| name = Wikitext (size=1000)
|nameraw=String
+
| nameraw = String
|image=Wikitext
+
| image = Wikitext
|environment=String
+
| environment = String
|ai=String
+
| ai = String
|damage=Wikitext (size=2500)
+
| damage = Wikitext (size=2500)
|life=Wikitext (size=2000)
+
| life = Wikitext (size=2000)
|defense=Wikitext (size=1000)
+
| defense = Wikitext (size=1000)
|knockback=Wikitext (size=1000)
+
| knockback = Wikitext (size=1000)
|banner=Wikitext (size=1000)
+
| banner = Wikitext (size=1000)
|bannername=String
+
| bannername = String
|money=Wikitext (size=1000)
+
| money = Wikitext (size=1000)
|npcid=Integer
+
| npcid = Integer
|immunities=List (^) of String
+
| immunities = List (^) of String
 
}}
 
}}
* {{#cargo_attach:_table=Items}}<!-- for enemy banners.-->
+
* {{#cargo_attach:_table=Items}}<!-- for enemy banners -->
{{i18n-ready}}{{doc}}</noinclude>
+
{{i18n-ready}}{{lua|Npcinfo}}{{doc}}
  +
{{category|Npc infobox| }}
  +
{{language info|en=Template:Npc infobox}}
  +
</noinclude>

Aktuelle Version vom 8. März 2022, 00:33 Uhr

Diese Vorlage ist synchronisiert-lokalisiert, d. h. sie ist mit der Version des englischen Terraria Wikis identisch. Änderungen an dieser Vorlage sollten zunächst dort vorgenommen werden.
Siehe Vorlage:Npc infobox/l10n für die Lokalisierung dieser Vorlage.
Diese Vorlage verwendet Lua.
Diese Vorlage verwendet Modul:Npcinfo, ein Skript, das in der Programmiersprache Lua verfasst wurde. Siehe Terraria Wiki:Lua, um mehr über Lua zu erfahren.
Template-info Dokumentation Die folgende Dokumentation stammt von der Seite Vorlage:Npc infobox/Dokumentation. (bearbeiten | Versionsgeschichte)
Siehe auch die englische Vorlagenseite: Template:Npc infobox. Sie enthält möglicherweise umfassendere oder aktuellere Informationen.

Infobox-Vorlage zur Verwendung in allen NPC-Artikeln. Wird an den Anfang der Seite gesetzt und bietet einen knappen Überblick über die wichtigsten Informationen.

Alle Parameter sind optional. Wird {{nameen}} jedoch nicht spezifiziert und existiert kein Eintrag im Wörterbuch, sollte er mit angegeben werden.

Verwendung

Parameter Description Auto Example Default value
(if omitted)
Note
{{npc infobox

Box-related parameters

Boxbezogene Parameter
| boxwidth Breite der Infobox 27em Zahl mit Einheit. Der Rahmen wird standardmäßig an die Breite der Bilder angepasst.
| float Position der Infobox left right
| css
 or
| style
CSS style, der die gesamte Infobox betrifft Jede width oder float Eigenschaft, die hier definiert wird, überschreibt die Parameter $boxwidth und $float der Vorlage.
| tab
 or
| tabs
Umschalten der Schwierigkeitsregisterkarten n Die Registerkarten Classic/Expert/Master werden nicht für Haus-NPCs, Tiere, Einrichtungsgegenstände, und exklusive Varianten verwendet, sondern für alle anderen NPCs. Dieser Parameter setzt diese Standardkonfiguration außer Kraft.
| auto Ermöglicht automatische Daten 201 Kann auch yes sein (siehe notes oben).
| id ID des NPC 201 Kosmetische ID, die angezeigt werden soll; überschreibt die Anzeige von $auto und $idcargo.
| name Name des NPC Skeleton <page name> Wird als Überschrift der Infobox angezeigt.
| name2 Kosmetischer Zusatz zum Namen &#32; / {{expert|Lunatic Cultist}} Wird direkt an $name angehängt.
| namesub Name Unter-Überschrift Zusätzliche Informationen direkt unter dem Titel der Infobox. Hauptsächlich interne NPC-Variantennamen, wie Astronauten-Skelett.
| namesub2 Name Unter-Überschrift First Form Zusätzliche Informationen direkt unter dem Titel der Infobox oder unter $namesub. Soll als manueller $namesub verwendet werden, da das manuelle Setzen von $namesub auf etwas die automatische Anzeige verhindern würde.
| namenote Name Unter-Unterüberschrift Wird unter $namesub angezeigt / $namesub2 angezeigt. Hauptsächlich NPC-Variantenbeschreibungen, wie Halloween Variante 2.
| variant Hinweis zur Plattformexklusivität yes Zeigt einen Hinweis am oberen Rand der Infobox an, der über die Old-gen-Konsolenversion Old-gen-Konsolen- und 3DSNintendo 3DS-Version-Version-Exklusivität des NPCs informiert.
| expertonly Expert-Exklusiv des NPC yes Entfernt die Registerkarte "Classic" und zeigt die folgende Zeile unter dem Titel an / $namesub / $namesub2 / $namenote: (Experten-Modus-exklusiv)
| masteronly Master-Exklusiv des NPC yes Entfernt die Registerkarte "Classic" und "Experte" und zeigt die folgende Zeile unter dem Titel an / $namesub / $namesub2 / $namenote: (Meister-Modus-exklusiv)

Image-related parameters

Image-related parameters
| imagealt Complete custom control over the display of the first image [[File:Skeleton.png]] Overrides the $image and $imagesize parameters. Multiple images can be provided and/or text and other formatting.
| image Main image of the NPC Skeleton.png $namesub.png or $name.png This is the image that is stored to cargo by default.
| imagesize Size of the main image 40x20px*0.75 *1 Corresponds to the size parameter of {{image}}: <width>x<height>*<scale>
| imageexpert Image of the Expert variant Skeleton.png
| image2 Additional image Skeleton.png Default value: <$image without ".png">_(old).png / .gif. Leave it empty to disable this automatic old image discovering.
| imagemode Controls image display full Setting it to anything other than full prevents the automatic display of $image2.
| image3 Additional image Skeleton.png
| imageversion2 Exclusive versions of $image2 desktop-console old-gen-3ds Versions that will be displayed when hovering over $image2 (by default the _(old) one, so the "old" versions are the default). Valid values are desktop, console, mobile, old-gen, and 3ds.
| imageversion3 Exclusive versions of $image3 desktop-console Versions that will be displayed when hovering over $image3. Valid values are the same as for $imageversion2.
| imageother Additional, visually separated image Map Icon Skeletron.png Will be displayed underneath all other images, above the statistics, separated by a horizontal line at the bottom of the infobox. Usually used for map icons or sprites of NPCs' temporary states (e.g. the "rolling" state of the Sroller). Can be a slash-separated (/) list for multiple images.
| imageothercaption Caption of $imageother Rolling state Will be displayed underneath $imageother. Has no effect if $imageother is not set. Is not mandatory; the image will also be displayed if the caption is omitted.

Statistics-related parameters

Statistics-related parameters
| type
 (deprecated:
| type2,
| type3)
Classification and categorization Boss Enemy Broad classifications like "Flying Enemy", "Critter", etc. Separate multiple values with a slash (/). All types will be linked, if the respective page exists.
| environment
 (deprecated:
| environment2,
| environment3)
Native environment of the NPC Desert
Forest+Rain
Desert / Forest
Desert / Forest+Rain
Biome in which or event during which the NPC naturally spawns. All environments will be linked if the respective page exists. A plus (+) means "AND" and a slash (/) means "OR".

The $environment2 and $environment3 parameters are connected to $environment via an "OR" (i.e. |environment=A|environment2=B|environment3=C is the same as |environment=A/B/C), but please note that these two parameters are deprecated. Only $environment should be used.

| ai AI style of the NPC Fighter AI
| damage Damage
| damage2 Addition to the damage Will be directly appended to $damage. Can be used, for instance, for differentiation between different attacks of the NPC or different platforms.
| life Maximum health of the NPC
| life2 Addition to the maximum health Will be directly appended to $life.
| defense Defense of the NPC
| defense2 Addition to the defense Will be directly appended to $defense.
| knockback Resistance to knockback of the NPC
| knockback2 Addition to the knockback resistance Will be directly appended to $knockback.
| banner Banner of the NPC yes Setting it to yes will cause it to take $name Banner as the banner name, but it can also simply be set to the name of the banner.

Note that, if using $auto and the NPC having a valid banner associated to it, the banner item will be stored to cargo in a hidden {{item infobox}}.

| immune
 (deprecated:
| immune1
| immune2
 ...
| immune<n>)
Debuffs to which the NPC is immune Poisoned / Frostburn The $immune1/etc. parameters are deprecated, instead use only the $immune parameter. Separate multiple debuff names with a slash (/).

All immunity-related information will only be displayed if $type does not contain Projectile, Invincible, and Critter.

| immuneall Immunity to all debuffs yes All immunity-related information will only be displayed if $type does not contain Projectile, Invincible, and Critter.
| immuneallnotwhips Immunity to all debuffs except whip debuffs yes
| immuneallnote
 or
| immunenote
Addition to $immuneall/$immuneallnotwhips Will be directly appended to the text that is displayed if $immuneall/$immuneallnotwhips is set.

Example: <br/><span style="color:#666;">(except {{item|Stunned|scale=0.5}})</span>

All immunity-related information will only be displayed if $type does not contain Projectile, Invincible, and Critter.

Buff- & Debuff-related parameters

Buff- & Debuff-related parameters
| buff Buff that the NPC causes Dryad's Blessing Name of the buff. As a shortcut for $buffduration, $buffchance, and $buffmode, they can be appended to this value, separated with a slash: | buff = <name> / <duration> / <chance> <mode>. Chance and mode may also be omitted, and only the standard mode values[1] are allowed.

Examples:

  • Regeneration / 5 / 50% #expert (The NPC grants the Regeneration buff for 5 seconds with a chance of 50%, but only in Expert and Master Mode.)
  • Ironskin @normal (The NPC grants the Ironskin buff in Classic Mode. Duration and chance information can be passed in their respective parameters.)
| idbuff Buff ID
| bufflink Buff link target
| bufftip Buff tooltip
| buffchance Buff chance
| buffduration Buff duration Enter the value using the {{duration}} template.
| buffmode Mode-exclusivity of the buff Can be one of the standard mode options[1] or expert, master, or expertonly. The buff will only be displayed in the respective tab(s). By default, it will be displayed in all three tabs.
| buffidshow Vanity buff ID
| buff<n> Additional buff that the NPC causes Can be continued nearly infinitely, e.g. buff2, buff3, etc.
| idbuff<n> Buff ID
| bufflink<n> Buff link target
| bufftip<n> Buff tooltip
| buffchance<n> Buff chance
| buffduration<n> Buff duration
| buffmode<n> Mode-exclusivity
| buffidshow<n> Vanity buff ID
| debuff Debuff that the NPC inflicts See above. Debuffs and buffs are handled identically.
| iddebuff Debuff ID
| debufflink Debuff link target
| debufftip Debuff tooltip
| debuffchance Debuff chance
| debuffduration Debuff duration
| debuffmode Mode-exclusivity of the debuff
| debuffidshow Vanity debuff ID
| debuff<n> Additional debuff that the NPC causes Can be continued nearly infinitely, e.g. debuff2, debuff3, etc.
| iddebuff<n> Debuff ID
| debufflink<n> Debuff link target
| debufftip<n> Debuff tooltip
| debuffchance<n> Debuff chance
| debuffduration<n> Debuff duration
| debuffmode<n> Mode-exclusivity
| debuffidshow<n> Vanity debuff ID

Drop-related parameters

Drop-related parameters
| money Base amount of money that the NPC drops {{coin|3gc 80sc}} Use the {{Vorlage:Nslink}} template.
| money2 Addition to dropped money Will be directly appended to $money.
| <item name 1>
| <item quantity 1>
| <item rate 1>


| <item name 2>
| <item quantity 2>
| <item rate 2>

...

| <item name n>
| <item quantity n>
| <item rate n>

Dropped item |Gel|2–5|{{modes|75%|100%}}


|Eye of Cthulhu Relic||{{master|100%}} @master

Note that these are unnamed parameters, i.e., they are not used with an equals sign (=) like the other parameters.


Repeat this triple of parameters as many times as necessary.


Use {{modes}} to mark drop amounts or rates as exclusive to certain modes.
Append one of the standard mode values[1] to the drop rate to mark the entire item drop as exclusive to certain modes. By default, an item drop will be displayed in all three tabs.


The data, i.e., the name of the NPC, item, quantity, rate, and mode, will be stored to cargo to enable the functionality of {{drop infobox}}.

|:group:start
| <group heading>
| <group mode>


| <group item name 1>
| <group item quantity 1>
| <group item rate 1>


| <group item name n>
| <group item quantity n>
| <group item rate n>

...

|:group:end
|---------
|---------

Group of dropped items |:group:start|Only one of the following 4 will drop|@normal

...

|:group:end|---------|---------

Note that these are unnamed parameters, i.e., they are not used with an equals sign (=) like the other parameters.


Visually groups dropped items. See most bosses' pages, e.g. Queen Bee, for examples.

|:loot:start
|---------
| <loot mode>

...

|:loot:end
|---------
|-

Subgroup of a dropped item Note that these are unnamed parameters, i.e., they are not used with an equals sign (=) like the other parameters.


Used for creating an indented list of dropped items, mainly used for Treasure Bag contents. Supports the group construct from above. See most bosses' pages, e.g. Queen Bee, for examples.

All items inside the section will be stored to cargo with the name of the item directly above the section, instead of the name of the NPC as usual. For example, preceding a loot section on Wall of Flesh that contains the Demon Heart with Treasure Bag (Wall of Flesh) will store the dropping entity of the Demon Heart as "Treasure Bag (Wall of Flesh)" instead of "Wall of Flesh", as would be the case with all items outside the loot section.

| custom:<raw item name(s)>
| <custom item display>
| <item rate>
Custom dropped item Note that these are unnamed parameters, i.e., they are not used with an equals sign (=) like the other parameters.


Grants custom control over $<item name> and $<item quantity>. See Guide for an example. The first parameter should be followed by the raw names of the items that receive a custom formatting (separate multiple with a slash (/) character). Although this is not necessary for a correct output, it ensures that the row's data is correctly stored to cargo and can thus be displayed by {{drop infobox}}.

Sound-related parameters

Sound-related parameters
| soundhurt Hurt sound effect NPC_Hit_1.wav Can be a comma-separated list for multiple sounds. Caption is "Getroffen". Set to an empty value (|soundhurt=) to hide the automatically generated sounds.
| soundkilled Killed sound effect NPC_Killed_1.wav Can be a comma-separated list for multiple sounds. Caption is "Getötet". Set to an empty value (|soundkilled=) to hide the automatically generated sounds.
| sound1 Custom additional sound effect Can be a comma-separated list for multiple sounds.
| soundcaption1 Caption for the sound effect
| soundmode1 Mode-exclusivity of the sound effect expert Can be expert, master, or expertonly. The sound(s) will only be displayed in the respective tab (both Expert and Master if set to expert). By default, a sound will be displayed in all three tabs.
| sound2 Custom additional sound effect See above. These parameters behave in the exact same manner.
| soundcaption2 Caption for the sound effect
| soundmode2 Mode-exclusivity of the sound effect
| sound<n> Custom additional sound effect Can be continued nearly infinitely. Sounds will only be displayed if there is a sound<n> parameter with a corresponding soundcaption<n> parameter.
| soundcaption<n> Caption for the sound effect
| soundmode<n> Mode-exclusivity of the sound effect

Back-end-related parameters

Back-end-related parameters
| cate Toggles all categorization no Set to yes to force categorization when it is disabled by default (on non-mainspace pages). Set to no to disable categorization.
| listcat
 (deprecated:
| listcat2)
Categorization Supplemental category names (Category:<$listcat> NPCs). Separate multiple with a slash (/).

Note: The template mainly categorizes the page based on the $type, $environment, and $ai parameters. Therefore, it is often not necessary to add a $listcat.

| allversions Platform version availability no Set to yes to assert that the NPC is available on all platforms of Terraria. This is only to be used if no {{exclusive}} banner is on the page. If omitted, it will be detected automatically based on the result of {{eversions|<NPC name>}} (even though $auto might not be set!). Categorizes the page in all five version content categories (with the exception of Category:Japanese console content), if yes is determined.
| hardmode Hardmode-exclusivity yes Set to yes to assert that the NPC is not available in pre-Hardmode, but only becomes available in Hardmode. Categorizes the page in Category:Hardmode-only NPCs.
| cargo Toggles cargo data storage no Set to yes to force cargo data storage when it is disabled by default (on non-mainspace root pages[2]). Set to no to disable cargo data storage.
| cargodrops Toggles drops cargo data storage no By default, dropped item data will be stored to cargo if $cargo, i.e., main cargo data storage, is enabled. Use this parameter to override that.

A frequently used example is in cases where an enemy with multiple parts, e.g. a worm, does not store its main infobox data to cargo (since only the individual parts should be stored), but contains the drop information in the main infobox, which should be stored to cargo. $cargo will be no in this case, and $cargodrops will be yes.

| idcargo NPC ID to store to cargo 201 Can be a comma-separated list. Can also be left empty to prevent cargo storage as well.
| imagecargo NPC image to store to cargo [[File:Skeleton.png]] Define an image to store to cargo, completely overriding the image parameters.

Subpages

There are numerous supplemental subpages which are mainly used for formatting certain data:

See also

Footnotes

  1. 1,0 1,1 1,2 The following values are available:
    • @normal – Classic Mode only
    • @expert – Expert Mode only
    • @master – Master Mode only
    • #normal – Classic and Expert Mode only
    • #expert – Expert and Master Mode only
  2. A root page is a page that is not a subpage. This prevents language subpages from storing duplicates by default.