User:Tolkyria/Sandbox2

From Guild Wars 2 Wiki
Jump to: navigation, search

Source: Guild Wars 2 Wiki:NPC formatting

Location[edit]

Template:NPC location[edit]

<includeonly>{{#if: {{{1|}}} | {{#if: {{{2|}}} | {{#switch: {{lc: {{{2|}}} }} | armorsmith | artificer | chef | huntsman | jeweler | leatherworker | scribe | tailor | weaponsmith = {{crafter|{{{2|}}}}} | #default = {{vendor|{{{2}}}|{{{3|}}}|{{{4|}}} }} }} }} {{cname|{{{1}}}}} {{#if: {{{level|}}} | ({{{level|}}})}} {{#if: {{{notes|}}} |<small>{{{notes|}}}</small>}}{{increment|NPCcnt}}<!--
-->{{#subobject: NPC{{#var:NPCcnt}} 
  |Has NPC location={{{1}}} 
  |Has NPC location level={{{level|}}}
  |Has NPC location notes={{{notes|}}}
  |@sortkey={{#var:sortkey|{{#vardefineecho: sortkey | {{#switch: {{#explode: {{#vardefineecho: tree|{{#show: {{PAGENAME}} |?Located in tree }}}}|;|0}} | Tyria = A | Elonia = B <!-- Tyria < Elonia needed ?-->| The Mists = T }};{{#var:tree}};{{PAGENAME}} }} }}
}}
| ''Missing first parameter {{{1}}}.'' }}</includeonly><noinclude>
== Description ==
This template is used on [[Area]] pages.

== Usage ==
<pre>
{{NPC location|<NPC name>|level=<NPC level>|notes=<Notes: during event only, etc...>}}
{{NPC location|<NPC name>|<service>}}
{{NPC location|<NPC name>|misc|<icon name>|<hover display name>}}
!!!<pre>

=== Parameters ===
;1 ''(unnamed parameter)''
:Required, NPC name, sets [[Property:Has NPC location]].
;2 ''(unnamed parameter)''
:Optional, NPC icon for using template {{tl|vendor}} or {{tl|crafter}}.
;2-4  ''(unnamed parameter)''
:Optional, <code>misc</code> option for template {{tl|vendor}}.
;level
:Optional, NPC level, sets [[Property:Has NPC location level]].
;notes
:Optional, NPC notes, sets [[Property:Has NPC location notes]].

== See also ==
* {{tl|NPC location list}}
</noinclude>

Template:NPC location list[edit]

<includeonly>{{#ask: [[Has NPC location::{{{1|{{PAGENAME}}}}}]] [[Has location type::Area]]
| ?-Has subobject.Located in tree
| ?Has NPC location level
| ?Has NPC location notes
| sort = <!-- alphabetically by sortkey -->
| format = template
| template = NPC location list result format
| default = ''No locations found.''
}}</includeonly><noinclude>
== Description ==
This template is used on [[NPC]] pages. Format using {{tl|Template:NPC location list result format}}.

== Usage ==
<pre>{{NPC location list}}
!!!<pre>
</noinclude>

Template:NPC location list result format[edit]

<includeonly>{{#switch: {{#explode: {{{2|}}}|;|0}} 
| The Mists = {{#vardefine: this_region|{{#explode: {{{2|}}}|;|0}} }} {{#vardefine: this_zone|{{#explode: {{{2|}}}|;|1}} }} {{#vardefine: this_area|{{{1|}}}}} 
| Tyria =  {{#vardefine: this_region|{{#explode: {{{2|}}}|;|1}} }} {{#vardefine: this_zone|{{#explode: {{{2|}}}|;|2}} }} {{#vardefine: this_area|{{{1|}}}}} }}
{{#ifeq: {{#var: last_region}} | {{#var: this_region}} |<!-- do nothing -->|{{#vardefine: last_region | {{#var: this_region}} }} ; {{cname|{{#var:this_region}}}}}}
{{#ifeq: {{#var: last_zone  }} | {{#var: this_zone  }} |<!-- do nothing -->|{{#vardefine: last_zone   | {{#var: this_zone  }} }} * {{cname|{{#var:this_zone  }}}}}}
{{#ifeq: {{#var: last_area  }} | {{#var: this_area  }} |<!-- do nothing -->|{{#vardefine: last_area   | {{#var: this_area  }} }} **{{cname|{{#var:this_area  }}}}}}<!--
-->{{#if: {{{3|}}} | ({{{3|}}})}} {{#if: {{{4|}}} | <small>{{{4|}}}</small>}}</includeonly><noinclude>

The result format for {{tl|NPC location list}}.
# Area page subobject
# -Has subobject.Located in tree
# Has NPC location level
# Has NPC location notes
</noinclude>

Story involvement[edit]

Property:Has story storyline numberProperty:Has story chapter numberProperty:Has story requirement numberProperty:Has story step number

Requries Property:Has story requirement number! Set to 0 if there is no choice or order requirement, otherwise set to distinct 1,2,3,... accordingly, in order to ensure semantic mediawiki sorting.

Template:NPC story involvement[edit]

<includeonly>{{#if: {{{1|}}} | {{cname|{{{1}}}}}{{#set: Has NPC story involvement={{{1}}} }} | ''Missing first parameter {{{1}}}.'' }}</includeonly><noinclude>

== Description ==
This template is used on [[Story]] pages.

== Usage ==
<pre>
{{NPC story involvement|<NPC name>}}
!!!<pre>

=== Parameters ===
;1 ''(unnamed parameter)''
:Required, NPC name, sets [[Property:Has NPC story involvement]].

== See also ==
* {{tl|NPC story involvement list}}
</noinclude>

Template:NPC story involvement list[edit]

<includeonly>{{#ask: [[Has NPC story involvement::{{{1|{{PAGENAME}}}}}]] [[Has context::Story]]
| ?Is part of storyline
| ?Has story chapter
| ?Has personal story choice requirement
| sort = Has story storyline number,Has story chapter number,Has story choice number,Has story step number
| format = template
| template = NPC story involvement list result format
| valuesep = ;
| default = ''No stories found.''
}}</includeonly><noinclude>
== Description ==
This template is used on [[NPC]] pages. Format using {{tl|Template:NPC story involvement list result format}}.

== Usage ==
<pre>{{NPC story involvement list}}
!!!<pre>

== See also ==
* {{tl|NPC story involvement}}
</noinclude>

Template:NPC story involvement list result format[edit]

<includeonly>{{#vardefine: this_line|{{{2|}}} }} {{#vardefine: this_chapter|{{{3}}} }} {{#vardefine: this_choice|{{{4|}}} }}<!--
-->{{#ifeq: {{#var: last_line}} | {{#var: this_line   }} |<!-- do nothing -->|{{#vardefine: last_line    | {{#var: this_line   }} }} <h3>{{#var:this_line}}</h3> }}
{{#ifeq: {{#var: last_chapter}} | {{#var: this_chapter}} |<!-- do nothing -->|{{#vardefine: last_chapter | {{#var: this_chapter}} }} * {{#var:this_chapter}} }}
{{#ifeq: {{#var: last_choice }} | {{#var: this_choice }} |<!-- do nothing -->|{{#vardefine: last_choice  | {{#var: this_choice }} }} **{{#var:this_choice}} }}
{{#if: {{#var: this_choice }} |*** {{{1|}}}|**{{{1|}}}}}

The result format for {{tl|NPC story involvement list}}.
# Story step page
# Is part of storyline
# Has story chapter
# Has personal story choice requirement

Heart involvement[edit]

Template:NPC heart involvement[edit]

<includeonly>{{#if: {{{1|}}} | {{cname|{{{1}}}}}{{#set: Has NPC heart involvement={{{1}}} }} | ''Missing first parameter {{{1}}}.'' }}</includeonly><noinclude>

== Description ==
This template is used on [[Renown Heart]] pages.
== Usage ==
<pre>
{{NPC heart involvement|<NPC name>}}
!!!<pre>

=== Parameters ===
;1 ''(unnamed parameter)''
:Required, NPC name, sets [[Property:Has NPC heart involvement]].

== See also ==
* {{tl|NPC heart involvement list}}
</noinclude>

Template:NPC heartinvolvement list[edit]

<includeonly>{{#ask: [[Has NPC heart involvement::{{{1|{{PAGENAME}}}}}]] [[Has context::Renown heart]]
| ?Located in <!-- uniquely determined -->
| ?Located in.Located in <!-- hence, also uniquely determined -->
| sort = <!-- alphabetically -->
| format = template
| template = NPC heart involvement list result format
| valuesep = ;
| default = ''No heart found.''
}}</includeonly><noinclude>
== Description ==
This template is used on [[NPC]] pages. Format using {{tl|Template:NPC heart involvement list result format}}.

== Usage ==
<pre>{{NPC heart involvement list}}
!!!<pre>
</noinclude>

Template:NPC heart involvement list result format[edit]

<includeonly>{{heart|{{{1|}}} — located in {{{2|}}} ({{{3|}}})</includeonly><noinclude>

The result format for {{tl|NPC heart list}}.
# Renwon Heart page
# Located in 
# Located in.Located in
</noinclude>

Event involvement[edit]

Template:NPC event involvement[edit]

<includeonly>{{#if: {{{1|}}} | {{cname|{{{1}}}}}{{#set: Has NPC event involvement={{{1}}} }} | ''Missing first parameter {{{1}}}.'' }}</includeonly><noinclude>

== Description ==
This template is used on [[Dynamic Event]] pages.
== Usage ==
<pre>
{{NPC event involvement|<NPC name>}}
!!!<pre>

=== Parameters ===
;1 ''(unnamed parameter)''
:Required, NPC name, sets [[Property:Has NPC event involvement]].

== See also ==
* {{tl|NPC event involvement list}}
</noinclude>

Template:NPC event involvement list[edit]

<includeonly>{{#ask: [[Has NPC event involvement::{{{1|{{PAGENAME}}}}}]] [[Has context::Event]]
| ?Starts in
| sort = <!-- alphabetically -->
| format = template
| template = NPC event involvement list result format
| valuesep = ;
| default = ''No events found.''
}}</includeonly><noinclude>
== Description ==
This template is used on [[NPC]] pages. Format using {{tl|Template:NPC event involvement list result format}}.

== Usage ==
<pre>{{NPC event involvement list}}
!!!<pre>
</noinclude>

Template:NPC event involvement list result format[edit]

<includeonly>{{event|{{{1|}}} — starts in {{#arraymap: {{{2|}}}|;|@@@| {{{2|}}} ({{#show: {{{2|}}} |?Located in|default=''Not specified''}})|, }}</includeonly><noinclude>

The result format for {{tl|NPC event involvement list}}.
# Event page
# Starts in
</noinclude>

Simplifications[edit]











Old example/Help[edit]

Inverse properties (example)
{{#ask: [[Has ingredient.Has ingredient name::Mithril Ore]] 
| ?-Has subobject
| ?-Has subobject.Has canonical name
}}
Inverse properties Source
with subobjects
{{#ask: [[Has NPC location::{{{1|{{PAGENAME}}}}}]] [[Has location type::Area]]
| ?-Has subobject.Located in tree
| sort = <!-- by sortkey -->
| format = template
| template = NPC location list result format
| default = ''No locations found.''
}}
without subobjects
{{#ask: [[Has NPC location::{{{1|{{PAGENAME}}}}}]] [[Has location type::Area]]
| ?Located in tree
| sort = Located in tree,
| format = template
| template = NPC location list result format
| default = ''No locations found.''
}}
Subobject with sortkey Source
with subobjects
{{#if: {{{1|}}} | {{cname|{{{1}}}}} {{increment|NPCcnt}}
{{#subobject: NPC{{#var:NPCcnt}} 
  | Has NPC location = {{{1}}} 
  | Has NPC level    = {{{level|}}}
  | Has NPC suffix   = {{{suffix|}}}
  | @sortkey = {{#var:sortkey|{{#vardefineecho: sortkey | {{#switch: 
                                                    {{#explode: {{#vardefineecho: tree|{{#show: {{PAGENAME}} |?Located in tree }}}}|;|0}} 
                                                    | Tyria = A <!-- ensure that: Tyria < The Mists -->
                                                    | The Mists = T
                                                  }};{{#var:tree}};{{PAGENAME}} }}
               }}
}} | ''Missing first parameter {{{1}}}.'' }}
without subobjects
{{#if: {{{1|}}} | {{cname|{{{1}}}}}{{#set: NPC has location={{{1}}} }} | ''Missing first parameter {{{1}}}.'' }}