Template:Npc infobox

{{#vardefine:ni:money|{{{money| {{npc infobox/modestat|prefix=y|{{#dplvar:_npc_infobox:info:value}|{{#dplvar:_npc_infobox:info:value_e}}|{{#dplvar:_npc_infobox:info:value_e_hm}}|{{#dplvar:_npc_infobox:info:value_e_pp}}|{{#dplvar:_npc_infobox:info:value_m}}|{{#dplvar:_npc_infobox:info:value_m_hm}}|{{#dplvar:_npc_infobox:info:value_m_pp}}}} }}}}}{{#ifeq:{{#dplvar:_npc_infobox:info:value}}|0|{{#vardefine:ni:auto_money_value|}}{{#vardefine:ni:auto_money_value_e|}}{{#vardefine:ni:auto_money_value_e_hm|}}{{#vardefine:ni:auto_money_value_e_pp|}}{{#vardefine:ni:auto_money_value_m|}}{{#vardefine:ni:auto_money_value_m_hm|}}{{#vardefine:ni:auto_money_value_m_pp|}}|{{#vardefine:ni:auto_money_value|{{coin|{{#dplvar:_npc_infobox:info:value}}}}}}{{#vardefine:ni:auto_money_value_e|{{coin|{{#dplvar:_npc_infobox:info:value_e}}}}}}{{#vardefine:ni:auto_money_value_e_hm|{{coin|{{#dplvar:_npc_infobox:info:value_e_hm}}}}}}{{#vardefine:ni:auto_money_value_e_pp|{{coin|{{#dplvar:_npc_infobox:info:value_e_pp}}}}}}{{#vardefine:ni:auto_money_value_m|{{coin|{{#dplvar:_npc_infobox:info:value_m}}}}}}{{#vardefine:ni:auto_money_value_m_hm|{{coin|{{#dplvar:_npc_infobox:info:value_m_hm}}}}}}{{#vardefine:ni:auto_money_value_m_pp|{{coin|{{#dplvar:_npc_infobox:info:value_m_pp}}}}}}}}{{#vardefine:ni:money2|{{{money2|}}}}}{{#vardefine:ni:drops|{{#if:{{{1|}}}|{{item/options|smallicons=y}}{{eicons/options|small=y}}{{#vardefine:dropclass|}}{{#dplvar:set|_npc_infobox:group|0}}{{#dplvar:set|_npc_infobox:group_arg_1||_npc_infobox:group_arg_2|}}{{#fornumargs:i|v|{{#switch:{{#expr:{{#var:i}} mod 3}}|1={{#dplvar:set|_npc_infobox:group_arg_1|{{#var:v}}}}|2={{#dplvar:set|_npc_infobox:group_arg_2|{{#var:v}}}}|0={{npc infobox/drop|{{#dplvar:_npc_infobox:group_arg_1}}|{{#dplvar:_npc_infobox:group_arg_2}}|{{#var:v}}}}}}}}{{item/options|reset}}{{eicons/options|reset}}}}}}{{#vardefine:ni:imageother|{{{imageother|}}}}}{{#vardefine:ni:imageothercaption|{{{imageothercaption|}}}}}{{#arraydefine:ni:sounds|{{#if:{{{soundhurt|{{#dplvar:_npc_infobox:info:HitSound}}}}}|{{l10n|npc_infobox|th_hurt}}@@{{{soundhurt|{{#arraydefine:_hurtsounds|{{#dplvar:_npc_infobox:info:HitSound}}}}{{#arrayprint:_hurtsounds|,|@|@.wav}}}}}}}{{#if:{{{soundkilled|{{#dplvar:_npc_infobox:info:DeathSound}}}}}|@@@@{{l10n|npc_infobox|th_killed}}@@{{{soundkilled|{{#arraydefine:_deathsounds|{{#dplvar:_npc_infobox:info:DeathSound}}}}{{#arrayprint:_deathsounds|,|@|@.wav}}}}}}}{{#forargs:sound|k|v|{{#if:{{{soundcaption{{#var:k}}|}}}|@@@@{{{soundcaption{{#var:k}}|}}}@@{{#var:v}}}}}}|@@@@}}{{#arrayunique:ni:sounds}}{{#vardefine:cate|}}{{#switch:{{{cate|}}}|yes|force={{#vardefine:cate|y}}|no={{#vardefine:cate|}}|#default={{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{#switch:{{#var:viewmodename}}|infobox|table={{#vardefine:cate|y}}}}}}}}{{#if:{{#var:cate}}|{{npc infobox/cate|type={{#var:ni:type}}|type2={{#var:ni:type2}}|type3={{#var:ni:type3}}|environment={{#var:ni:environment}}|ai={{#var:ni:ai}}|listcat={{{listcat|}}}||listcat2={{{listcat2|}}}|hardmode={{{hardmode|}}}|expertonly={{{expertonly|}}}|allversions={{{allversions|}}}}}}}{{#vardefine:cargo|}}{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{#ifeq:{{PAGENAME}}|{{ROOTPAGENAME}}|{{#vardefine:cargo|y}}}}}}{{#switch:{{{cargo|}}}|force|yes|y={{#vardefine:cargo|y}}|no|n={{#vardefine:cargo|}}}}{{#if:{{#var:cargo}}|{{#ifeq:{{FULLPAGENAME}}|{{ROOTPAGENAME}}|{{#ifeq:{{#sub:{{{cargo|}}}|0|1}}|n||{{#vardefine:__id|{{{idcargo|{{#var:_npc_auto_id|{{{id|}}}}}}}}}}{{#if:{{#var:__id}}|{{#cargo_store:_table=NPCs|name={{eil|{{ROOTPAGENAME}}|{{#var:ni:name}}}}{{#if:{{#var:ni:namesub}}|{{note|block=y|paren=y|{{tr|{{#var:ni:namesub}}}}}}}}{{#if:{{#var:ni:namenote}}|{{note|block=y|paren=y|small=y|{{#var:ni:namenote}}}}}}|nameraw={{#var:ni:name}}|image= {{{imagecargo|{{{imagealt|}}}}}} |environment={{#var:ni:environment}}|ai={{#var:ni:ai}}|damage={{#var:ni:damage}}|life={{#var:ni:lifemax}}|defense={{#var:ni:defense}}|knockback={{#var:ni:knockback}}|bannername={{#var:ni:banner}}|banner={{#if:{{#var:ni:banner}}|{{item|{{#var:ni:banner}}|wrap=y}}}}|money={{#var:ni:money|{{coin|{{#var:ni:money_value}}}}}}{{#var:ni:money2}}|npcid={{#var:__id}}|immunities={{#var:ni:cargo:immunities}}}}}}}}}}}}{{npc new infobox/{{#var:viewmodename}}View}}