Template:Infobox NPC: Difference between revisions

From OpenSpell Wiki
Jump to navigationJump to search
Created page with "<noinclude> {{#cargo_declare:_table=npcs | name = String | combat_level = Integer | hitpoints = Integer | accuracy = Integer | strength = Integer | defense = Integer | magic = Integer | range = Integer | speed = Integer | aggro = Boolean | aggro_radius = Integer | respawn = Integer | pickpocketable = Boolean | can_shop = Boolean }} == Usage == Place on any NPC article page. All parameters are optional except <..."
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
{{#cargo_declare:_table=npcs
== Infobox NPC ==
| name        = String
Use this template at the top of every NPC article.
| combat_level = Integer
| hitpoints    = Integer
| accuracy    = Integer
| strength    = Integer
| defense      = Integer
| magic        = Integer
| range        = Integer
| speed        = Integer
| aggro        = Boolean
| aggro_radius = Integer
| respawn      = Integer
| pickpocketable = Boolean
| can_shop    = Boolean
}}


== Usage ==
=== Parameters ===
Place on any NPC article page. All parameters are optional except <code>name</code>.
{| class="wikitable"
! Parameter !! Required !! Description
|-
| <code>name</code> || Yes || The NPC's in-game name, exactly as it appears
|-
| <code>image</code> || No || Full image syntax, e.g. <code><nowiki>[[File:Knight.png|250px]]</nowiki></code>. Upload images via [[Special:Upload]].
|-
| <code>caption</code> || No || Short caption shown below the image
|-
| <code>description</code> || No || The in-game description/examine text
|-
| <code>combat_level</code> || No || Leave empty for non-combat NPCs
|-
| <code>hitpoints</code> || No ||
|-
| <code>accuracy</code> || No ||
|-
| <code>strength</code> || No ||
|-
| <code>defense</code> || No ||
|-
| <code>magic</code> || No ||
|-
| <code>range</code> || No ||
|-
| <code>speed</code> || No ||
|-
| <code>aggro</code> || No || <code>yes</code> or <code>no</code>
|-
| <code>respawn</code> || No || Respawn time in game ticks
|-
| <code>pickpocketable</code> || No || <code>yes</code> or <code>no</code>
|-
| <code>can_shop</code> || No || <code>yes</code> or <code>no</code>
|}


=== Example ===
<pre>
<pre>
{{Infobox NPC
{{Infobox NPC
| name         =  
| name           = Knight
| image        =  
| image         = [[File:Knight.png|250px]]
| description =  
| caption       = A Knight patrolling the overworld
| combat_level =  
| description   = A noble warrior
| hitpoints   =  
| combat_level   = 60
| accuracy     =  
| hitpoints     = 65
| strength     =  
| accuracy       = 40
| defense     =  
| strength       = 45
| magic       =  
| defense       = 40
| range       =  
| magic         = 1
| speed       =  
| range         = 1
| aggro       =
| speed         = 1
| aggro_radius =  
| aggro         = no
| respawn     =  
| respawn       = 75
| pickpocketable =
| pickpocketable = yes
| can_shop     =  
| can_shop       = no
}}
}}
</pre>
</pre>


=== Cargo queries ===
See also: [[Template:NPC/preload]] for the full NPC page skeleton.
List all monsters between level 40 and 60:
<pre>{{#cargo_query: tables=npcs | fields=name,combat_level,hitpoints | where=combat_level>=40 AND combat_level<=60 | order by=combat_level}}</pre>
 
List all aggressive NPCs:
<pre>{{#cargo_query: tables=npcs | fields=name,combat_level,aggro_radius | where=aggro=true | order by=combat_level}}</pre>
 
List all pickpocketable NPCs:
<pre>{{#cargo_query: tables=npcs | fields=name,combat_level | where=pickpocketable=true}}</pre>


[[Category:Infobox templates]]
[[Category:Infobox templates]]
</noinclude><includeonly>
</noinclude>
<div class="infobox-wrapper">
<includeonly>
{| class="wikitable infobox infobox-npc" style="float:right; margin: 0 0 1em 1em; clear:right; text-align:center; min-width:200px;"
{| class="wikitable" style="float:right; clear:right; margin:0 0 1em 1.5em; text-align:left; width:300px; font-size:13px; border:1px solid #a2a9b1;"
|-
|-
! colspan="2" class="infobox-title" style="background:#2c2c2c; color:#f0e6c8; font-size:1.1em; padding:6px 10px;" |
! colspan="2" style="background:#2c2c2c; color:#f0e6c8; font-size:1.15em; padding:8px 12px; text-align:center; border-bottom:2px solid #c8a96e;" | {{{name|Unknown NPC}}}
{{#if:{{{name|}}}|{{{name}}}|Unknown NPC}}
|-
|-
| colspan="2" style="padding:8px;" |
| colspan="2" style="text-align:center; padding:10px; background:#1a1a1a;" |
{{#if:{{{image|}}}|[[File:{{{image}}}|200px]]|[[File:NPC placeholder.png|200px]]}}
{{{image|}}}
 
{{{caption|}}}
|-
|-
! colspan="2" class="infobox-section" style="background:#3a3a3a; color:#c8a96e;" | General
! colspan="2" style="background:#3a3a3a; color:#c8a96e; text-align:center; padding:4px;" | General
|-
|-
{{#if:{{{description|}}}|
! style="width:45%; padding:4px 8px; background:#f8f9fa;" | Description
! | Description
| style="padding:4px 8px;" | ''{{{description|}}}''
| style="font-style:italic;" | {{{description}}}
|-
|-
}}
! style="padding:4px 8px; background:#f8f9fa;" | Pickpocketable
{{#if:{{{can_shop|}}}|
| style="padding:4px 8px;" | {{{pickpocketable|}}}
! | Shop
| {{#ifeq:{{{can_shop}}}|yes|[[Yes]]|No}}
|-
|-
}}
! style="padding:4px 8px; background:#f8f9fa;" | Shop
{{#if:{{{pickpocketable|}}}|
| style="padding:4px 8px;" | {{{can_shop|}}}
! | Pickpocketable
| {{#ifeq:{{{pickpocketable}}}|yes|[[Yes]]|No}}
|-
|-
}}
! colspan="2" style="background:#3a3a3a; color:#c8a96e; text-align:center; padding:4px;" | Combat stats
{{#if:{{{combat_level|}}}|
! colspan="2" class="infobox-section" style="background:#3a3a3a; color:#c8a96e;" | Combat stats
|-
|-
! | Combat level
! style="padding:4px 8px; background:#f8f9fa;" | Combat level
| {{{combat_level}}}
| style="padding:4px 8px;" | {{{combat_level|—}}}
|-
|-
! | Hitpoints
! style="padding:4px 8px; background:#f8f9fa;" | Hitpoints
| {{{hitpoints|}}}
| style="padding:4px 8px;" | {{{hitpoints|}}}
|-
|-
! | Accuracy
! style="padding:4px 8px; background:#f8f9fa;" | Accuracy
| {{{accuracy|}}}
| style="padding:4px 8px;" | {{{accuracy|}}}
|-
|-
! | Strength
! style="padding:4px 8px; background:#f8f9fa;" | Strength
| {{{strength|}}}
| style="padding:4px 8px;" | {{{strength|}}}
|-
|-
! | Defense
! style="padding:4px 8px; background:#f8f9fa;" | Defense
| {{{defense|}}}
| style="padding:4px 8px;" | {{{defense|}}}
|-
|-
! | Magic
! style="padding:4px 8px; background:#f8f9fa;" | Magic
| {{{magic|}}}
| style="padding:4px 8px;" | {{{magic|}}}
|-
|-
! | Ranged
! style="padding:4px 8px; background:#f8f9fa;" | Ranged
| {{{range|}}}
| style="padding:4px 8px;" | {{{range|}}}
|-
|-
! | Speed
! style="padding:4px 8px; background:#f8f9fa;" | Speed
| {{{speed|}}}
| style="padding:4px 8px;" | {{{speed|}}}
|-
|-
{{#if:{{{aggro|}}}|
! style="padding:4px 8px; background:#f8f9fa;" | Aggressive
! | Aggressive
| style="padding:4px 8px;" | {{{aggro|}}}
| {{#ifeq:{{{aggro}}}|yes|'''Yes''' (radius: {{{aggro_radius|?}}})|No}}
|-
|-
}}
! style="padding:4px 8px; background:#f8f9fa;" | Respawn (ticks)
{{#if:{{{respawn|}}}|
| style="padding:4px 8px;" | {{{respawn|}}}
! | Respawn (ticks)
| {{{respawn}}}
|-
}}
}}
|}
|}
</div>
</includeonly>
{{#cargo_store: _table=npcs
| name          = {{{name|}}}
| combat_level  = {{{combat_level|}}}
| hitpoints    = {{{hitpoints|}}}
| accuracy      = {{{accuracy|}}}
| strength      = {{{strength|}}}
| defense      = {{{defense|}}}
| magic        = {{{magic|}}}
| range        = {{{range|}}}
| speed        = {{{speed|}}}
| aggro        = {{#ifeq:{{{aggro|}}}|yes|1|0}}
| aggro_radius  = {{{aggro_radius|}}}
| respawn      = {{{respawn|}}}
| pickpocketable = {{#ifeq:{{{pickpocketable|}}}|yes|1|0}}
| can_shop      = {{#ifeq:{{{can_shop|}}}|yes|1|0}}
}}</includeonly>

Latest revision as of 09:17, 28 February 2026

Infobox NPC

[edit]

Use this template at the top of every NPC article.

Parameters

[edit]
Parameter Required Description
name Yes The NPC's in-game name, exactly as it appears
image No Full image syntax, e.g. [[File:Knight.png|250px]]. Upload images via Special:Upload.
caption No Short caption shown below the image
description No The in-game description/examine text
combat_level No Leave empty for non-combat NPCs
hitpoints No
accuracy No
strength No
defense No
magic No
range No
speed No
aggro No yes or no
respawn No Respawn time in game ticks
pickpocketable No yes or no
can_shop No yes or no

Example

[edit]
{{Infobox NPC
| name           = Knight
| image          = [[File:Knight.png|250px]]
| caption        = A Knight patrolling the overworld
| description    = A noble warrior
| combat_level   = 60
| hitpoints      = 65
| accuracy       = 40
| strength       = 45
| defense        = 40
| magic          = 1
| range          = 1
| speed          = 1
| aggro          = no
| respawn        = 75
| pickpocketable = yes
| can_shop       = no
}}

See also: Template:NPC/preload for the full NPC page skeleton.