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
Line 1: Line 1:
<noinclude>
<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 ==
== Usage ==
Place on any NPC article page. All parameters are optional except <code>name</code>.
Displays a "View on map" link for NPC spawn locations.
Once the MapEmbed extension is installed this will render as an interactive button.
For now it renders as a plain text link.


<pre>
<pre>
{{Infobox NPC
{{Map spawn|label=Knight|cx=-273|cy=-254|level=1|markers=x,y,r;x,y,r}}
| name        =  
| image        =  
| description  =  
| combat_level =  
| hitpoints    =  
| accuracy    =
| strength    =
| defense      =
| magic        =
| range        =
| speed        =
| aggro        =
| aggro_radius =
| respawn      =
| pickpocketable =
| can_shop    =
}}
</pre>
</pre>
=== Cargo queries ===
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><includeonly>[https://highspellmap.com 🗺️ View on map] ({{{label|}}} · {{{markers|}}})
<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;"
|-
! colspan="2" class="infobox-title" style="background:#2c2c2c; color:#f0e6c8; font-size:1.1em; padding:6px 10px;" |
{{#if:{{{name|}}}|{{{name}}}|Unknown NPC}}
|-
| colspan="2" style="padding:8px;" |
{{#if:{{{image|}}}|[[File:{{{image}}}|200px]]|[[File:NPC placeholder.png|200px]]}}
|-
! colspan="2" class="infobox-section" style="background:#3a3a3a; color:#c8a96e;" | General
|-
{{#if:{{{description|}}}|
! | Description
| style="font-style:italic;" | {{{description}}}
|-
}}
{{#if:{{{can_shop|}}}|
! | Shop
| {{#ifeq:{{{can_shop}}}|yes|[[Yes]]|No}}
|-
}}
{{#if:{{{pickpocketable|}}}|
! | Pickpocketable
| {{#ifeq:{{{pickpocketable}}}|yes|[[Yes]]|No}}
|-
}}
{{#if:{{{combat_level|}}}|
! colspan="2" class="infobox-section" style="background:#3a3a3a; color:#c8a96e;" | Combat stats
|-
! | Combat level
| {{{combat_level}}}
|-
! | Hitpoints
| {{{hitpoints|}}}
|-
! | Accuracy
| {{{accuracy|}}}
|-
! | Strength
| {{{strength|}}}
|-
! | Defense
| {{{defense|}}}
|-
! | Magic
| {{{magic|}}}
|-
! | Ranged
| {{{range|}}}
|-
! | Speed
| {{{speed|}}}
|-
{{#if:{{{aggro|}}}|
! | Aggressive
| {{#ifeq:{{{aggro}}}|yes|'''Yes''' (radius: {{{aggro_radius|?}}})|No}}
|-
}}
{{#if:{{{respawn|}}}|
! | Respawn (ticks)
| {{{respawn}}}
|-
}}
}}
|}
</div>
{{#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>

Revision as of 09:07, 28 February 2026

Usage

Displays a "View on map" link for NPC spawn locations. Once the MapEmbed extension is installed this will render as an interactive button. For now it renders as a plain text link.

{{Map spawn|label=Knight|cx=-273|cy=-254|level=1|markers=x,y,r;x,y,r}}