Difference between revisions of "NPC info"

m (added disposition variable instead of relying on NPC organization)
m (removed repetition)
 
(68 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly><div class="infobox-right"><!--
 
<includeonly><div class="infobox-right"><!--
 
DEFINITIONS
 
DEFINITIONS
 +
 +
disposition
 +
used for CSS classes
 +
-->{{#vardefine:disposition class|{{#switch:{{lc:{{{disposition|}}}}}
 +
|ally=NPC-ally
 +
|enemy=NPC-enemy
 +
|neutral=NPC-neutral
 +
|#default=NPC-neutral<!-- NPCs with no disposition are assumed to be neutral -->
 +
}}}}<!--
  
 
organization
 
organization
used for categorization and determining infobox color
+
used for categorization
 
if a name parameter is given, it is assumed that the template isn't on the NPC's main article, therefore it isn't categorized
 
if a name parameter is given, it is assumed that the template isn't on the NPC's main article, therefore it isn't categorized
 
-->{{#arraydefine:organizationRow|{{#switch:{{lc:{{{organization|}}}}}<!--
 
-->{{#arraydefine:organizationRow|{{#switch:{{lc:{{{organization|}}}}}<!--
 
cultures
 
cultures
-->|elaniens=,class="skill-infobox-row-heading",[[:Category:Cultures{{!}}Culture]],,class="skill-infobox-row-data",[[Elaniens]]{{#if:{{{name}}}{{!}}[[Category:Elaniens]]}}
+
-->|elaniens=Culture,[[Elaniens]]
|faidens=,class="skill-infobox-row-heading",[[:Category:Cultures{{!}}Culture]],,class="skill-infobox-row-data",[[Faidens]]{{#if:{{{name}}}{{!}}[[Category:Faidens]]}}
+
|faidens=Culture,[[Faidens]]
|quaddari=,class="skill-infobox-row-heading",[[:Category:Cultures{{!}}Culture]],,class="skill-infobox-row-data",[[Quaddari]]{{#if:{{{name}}}{{!}}[[Category:Quaddari]]}}
+
|quaddari=Culture,[[Quaddari]]
|yorners=,class="skill-infobox-row-heading",[[:Category:Cultures{{!}}Culture]],,class="skill-infobox-row-data",[[Yorners]]{{#if:{{{name}}}{{!}}[[Category:Yorners]]}}<!--
+
|yorners=Culture,[[Yorners]]<!--
enemy types (note: rename "Enemy" to an official name)
+
camp creatures
-->|gnats=,class="skill-infobox-row-heading",Enemy Type,,class="skill-infobox-row-data",[[:Category:Gnats]]{{#if:{{{name}}}{{!}}[[Category:Gnats]]}}
+
-->|archosaurs=Enemy Type,[[:Category:Archosaurs]]
|imps=,class="skill-infobox-row-heading",Enemy Type,,class="skill-infobox-row-data",[[:Category:Imps]]{{#if:{{{name}}}{{!}}[[Category:Imps]]}}
+
|boars=Enemy Type,[[:Category:Boars]]
|leaves=,class="skill-infobox-row-heading",Enemy Type,,class="skill-infobox-row-data",[[:Category:Leaves]]{{#if:{{{name}}}{{!}}[[Category:Leaves]]}}
+
|fingi=Enemy Type,[[:Category:Fingi]]
|mutant rats=,class="skill-infobox-row-heading",Enemy Type,,class="skill-infobox-row-data",[[:Category:Mutant Rats]]{{#if:{{{name}}}{{!}}[[Category:Mutant Rats]]}}
+
|gnats=Enemy Type,[[:Category:Gnats]]
|occultists=,class="skill-infobox-row-heading",Enemy Type,,class="skill-infobox-row-data",[[:Category:Occultists]]{{#if:{{{name}}}{{!}}[[Category:Occultists]]}}
+
|imps=Enemy Type,[[:Category:Imps]]
|spiders=,class="skill-infobox-row-heading",Enemy Type,,class="skill-infobox-row-data",[[:Category:Spiders]]{{#if:{{{name}}}{{!}}[[Category:Spiders]]}}<!--
+
|insects=Enemy Type,[[:Category:Insects]]<!-- no official name; contains bomboslug, gravedigger fly, termite queen etc -->
unique enemies
+
|leafies=Enemy Type,[[:Category:Leafies]]
-->|wandering bosses=,class="skill-infobox-row-heading",Boss Type,,class="skill-infobox-row-data",[[:Category:Wandering Bosses{{!}}Wandering Boss]]{{#if:{{{name}}}{{!}}[[Category:Wandering Boss]]}}
+
|lost fronts=Enemy Type,[[:Category:Lost Fronts]]
|world bosses=,class="skill-infobox-row-heading",Boss Type,,class="skill-infobox-row-data",[[:Category:World Bosses{{!}}World Boss]]{{#if:{{{name}}}{{!}}[[Category:World Boss]]}}
+
|mutant rats=Enemy Type,[[:Category:Mutant rats]]
 +
|occultists=Enemy Type,[[:Category:Occultists]]
 +
|spiders=Enemy Type,[[:Category:Spiders]]
 +
|wolves=Enemy Type,[[:Category:Wolves]]<!--
 +
unique
 +
-->|critters=Type,[[:Category:Critters{{!}}Critter]]<!-- no official name; contains NPCs with 1 health -->
 +
|wandering bosses=Type,[[:Category:Wandering bosses{{!}}Wandering Boss]]
 +
|world bosses=Type,[[:Category:World bosses{{!}}World Boss]]
 
}}}}<!--
 
}}}}<!--
 +
-->{{#if:{{{name|}}}<!-- if name parameter is not given
 +
-->||{{#if:{{#arrayprint:organizationRow}}<!-- if the organization is correct (i.e. organizationRow exists)
 +
-->|[[Category:{{ucfirst:{{{organization}}}}}]]<!-- add to specific category
 +
-->|[[Category:NPCs]]}}}}<!-- else add to NPC category
  
 
quests
 
quests
-->{{#arraydefine:quests|{{{quest|}}}|<br>}}<!--
+
-->{{#arraydefine:questText|{{{quests}}}|;}}<!--
  
 
TABLE -->
 
TABLE -->
 
{| class="wikitable" style="width: 100%;"
 
{| class="wikitable" style="width: 100%;"
 
|-
 
|-
| colspan="2" | <center>{{#if:{{{image|}}}|[[{{{image}}}|85px]]<!-- use provided image -->
+
| colspan="2" | <center><!--
{{#vardefine:defaultImage|File:{{#replace:{{#titleparts:{{PAGENAME}}}}|:|-}}.png}}<!-- get default image -->
+
NPC image
{{#ifexist:{{#var:defaultImage}}
+
-->{{#if:{{{icon|}}}<!-- if icon exists
|[[{{#var:defaultImage}}|85px]]
+
-->|<span class="{{#var:disposition class}}">[[{{{icon}}}|85px]]</span><!-- use provided icon
|[[{{#var:defaultImage}}|Upload an NPC image.]]}}}}
+
-->|{{#vardefine:defaultIcon|File:{{#replace:{{#titleparts:{{PAGENAME}}}}|:|-}} Icon.png}}<!-- else use default icon
</center>
+
-->{{#ifexist:{{#var:defaultIcon}}<!-- if default icon exists
 +
-->|<span class="{{#var:disposition class}}">[[{{#var:defaultIcon}}|85px]]</span><!-- use default icon
 +
-->|[[{{#var:defaultIcon}}|Upload NPC icon.]]}}}}<!-- else prompt for icon upload
 +
-->{{#if:{{{random|}}}|<br><small>(This NPC's appearance may change randomly.)</small>}}</center>
 
|-
 
|-
! colspan="2" class="{{#switch:{{#lc:{{{disposition|}}}}}
+
! colspan="2" class="{{#var:disposition class}}" | <center>{{{name|{{PAGENAME}}}}}</center><!-- name -->
|ally=NPC-ally
+
|-
|enemy=NPC-enemy
+
{{#if:{{#arraysize:organizationRow}}|{{InfoboxRow|'''{{#arrayindex:organizationRow|0}}'''|{{#arrayindex:organizationRow|1}}}}}}<!-- prints the organization as a row-->
|neutral=NPC-neutral
 
|#default=NPC-neutral<!-- NPCs with no disposition are assumed to be neutral -->
 
}}" | <center>{{{name|{{PAGENAME}}}}}</center><!-- name -->
 
 
|-
 
|-
{{#arrayprint:organizationRow|{{!}}}}<!-- prints the organization as a row-->
+
{{#if:{{{level|}}}|{{InfoboxRow|'''[[Level]]'''|{{{level}}}}}}}
 
|-
 
|-
{{#if:{{{level|}}}|{{!}}class="skill-infobox-row-heading"{{!}}'''[[Level]]'''{{!}}{{!}}class="skill-infobox-row-data"{{!}}{{{level}}}}}
+
{{#if:{{{health|}}}|{{InfoboxRow|'''[[Health]]'''|{{{health}}}}}}}
 
|-
 
|-
{{#if:{{{health|}}}|{{!}}class="skill-infobox-row-heading"{{!}}'''[[Health]]'''{{!}}{{!}}class="skill-infobox-row-data"{{!}}{{{health}}}}}
+
{{#if:{{{location|}}}|{{InfoboxRow|'''Location'''|[[{{{location}}}]]}}}}
 
|-
 
|-
{{#if:{{{location|}}}|{{!}}class="skill-infobox-row-heading"{{!}}'''[[Health]]'''{{!}}{{!}}class="skill-infobox-row-data"{{!}}{{{location}}}}}
+
{{#if:{{{quests|}}}|{{InfoboxRow|'''Involved In'''|{{#arrayprint:questText|<br>|@|[[@]]}}}}}}
 
|-
 
|-
{{#if:{{{quest|}}}||{{!}}class="skill-infobox-row-heading"{{!}}'''Involved In'''{{!}}{{!}}class="skill-infobox-row-data"{{!}}{{#arrayprint:quests|<br>|@|[[@]]}}}}<!-- formats the quests array -->
+
{{#if:{{{image|}}}|{{InfoboxRow|'''Image'''|[[File:{{{image|}}}|250x200px]]}}<!-- provided image
 +
-->|{{#vardefine:defaultImage|File:{{#replace:{{#titleparts:{{PAGENAME}}}}|:|-}}.jpg}}<!-- get default image
 +
-->{{#ifexist:{{#var:defaultImage}}<!-- if default image exists
 +
-->|{{InfoboxRow|'''Image'''|[[{{#var:defaultImage}}|250x200px]]}}}}<!-- use default image
 +
-->}}
 
|}</div><!--
 
|}</div><!--
 
DESCRIPTION
 
DESCRIPTION
-->{{{description}}}</includeonly><noinclude>{{NPC info/Documentation}}</noinclude>
+
-->{{{description|{{error|No description provided. Add a description parameter.}}}}}<!--
 +
PROPERTIES
 +
-->{{#if:{{{name|}}}|<!-- if there is a name parameter don't set any properties
 +
-->|{{#if:{{{location|}}}|{{#set:Has location={{{location}}}}}}}<!-- set 'Has location' property
 +
-->}}</includeonly><noinclude>{{NPC info/Documentation}}</noinclude>

Latest revision as of 20:29, 16 May 2024

Description[edit]

Displays an information page about a non-player character (NPC).

Usage[edit]

{{NPC info|<icon=icon>|<name=name>|<description=description>|<disposition=disposition>|<organization=organization>|<level=level>|<quest=Quest 1, Quest 2>}}

Parameters[edit]

Arrow.pngicon: An icon of the NPC.
Optional. Defaults to '{{PAGENAME}} Icon.png'.
Notes: Only use if the icon name differs from the name of the page.
Arrow.pngrandom: Displays a note stating that the NPC's appearance may change randomly.
Optional.
Notes: Set to any value to enable.
Arrow.pngname: The name of the NPC.
Optional. Defaults to '{{PAGENAME}}'.
Notes: Only use if the template is on a different page to the NPC's main article.
Arrow.pngdisposition: The NPC's disposition toward the player.
Optional. Defaults to 'neutral'.
Notes: Used to determine the background color of the table heading. Choose from "ally", "neutral", or "enemy".
Arrow.pngdescription: A description of the NPC.
Optional.
Arrow.pnglevel: The NPC's level. Can be a range of levels.
Optional.
Arrow.pnghealth: The NPC's health. Can be a range of values.
Optional.
Arrow.pnglocation: The NPC's location.
Optional.
Arrow.pngorganization: The NPC's organization.
Optional.
Arrow.pngimage: An image of the NPC.
Optional. Defaults to '{{PAGENAME}}.jpg'.
Notes: Only use if the image name differs from the name of the page.

Possible organizations:

Cultures
Elaniens
Faidens
Quaddari
Yorners
Camp Creatures
Archosaurs
Boars
Gnats
Fingi
Imps
Insects (no official name; contains bomboslug, gravedigger fly, termite queen, etc)
Leafies
Lost Fronts
Mutant Rats
Occultists
Spiders
Wolves
Unique
Critters
Wandering Bosses
World Bosses
Arrow.pngquests: The semicolon-separated names of quests the NPC is a part of.
Optional.

Errors[edit]

No description was provided. Add a description parameter.