Difference between revisions of "Template:NPCTable/row"

From Stoneshard wiki
Jump to navigation Jump to search
(variables, check if NPC exists in Friendly data by loading its occupation (every NPC should have one), if it's empty, don't load in checkmarks)
m
 
(25 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!--
<includeonly><!--
--- Define variables, goal is to only load each property from the Data page once. ---
--- Define variables, goal is to only load each property from the Data page once. ---
-->{{#vardefine:Occupation|{{#ifeq: {{:Friendly data|{{{1}}}|Occupation}}|NPC {{{1}}} does not exist in Friendly data.||{{:Friendly data|{{{1}}}|Occupation}}}}}}<!--
-->{{#vardefine:Exists|{{#ifeq: {{:Friendly data|{{{1}}}|Occupation}}|NPC {{{1}}} does not exist in [[Friendly data]].||{{:Friendly data|{{{1}}}|Occupation}}}}}}<!--
-->{{#vardefine:Name|{{:Friendly data|{{{1}}}|Name}}}}<!--
-->{{#vardefine:Name|{{:Friendly data|{{{1}}}|Name}}}}<!--
-->{{#vardefine:Image|{{:Friendly data|{{{1}}}|Image}}}}<!--
-->{{#vardefine:Image|{{:Friendly data|{{{1}}}|Image}}}}<!--
-->{{#vardefine:Image2|{{:Friendly data|{{{1}}}|Image2}}}}<!--
-->{{#vardefine:Image3|{{:Friendly data|{{{1}}}|Image3}}}}<!--
-->{{#vardefine:Image4|{{:Friendly data|{{{1}}}|Image4}}}}<!--
-->{{#vardefine:Image5|{{:Friendly data|{{{1}}}|Image5}}}}<!--
-->{{#vardefine:Image6|{{:Friendly data|{{{1}}}|Image6}}}}
|-
|-
| {{#var:Occupation}}
| {{:Friendly data|{{{1}}}|Occupation}}
| {{#if:{{#var:Occupation}}|[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{{1}}}.png}}|37px|link={{{1}}}]]<br>[[{{#if:{{#var:Name}}|{{Translate|{{#var:Name}}|NPCNames}}|{{Translate|{{{1}}}|NPCNames}}}}]]}}
| {{#if:{{#var:Exists}}|[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{{1}}}.png}}|37px|link={{#if:{{#var:Name}}|{{#if:{{#pos:{{lc:{{#var:Name}}}}|random}}||{{Translate|{{#var:Name}}|NPCNames}}}}|{{Translate|{{{1}}}|NPCNames}}}}]]<!--
| {{#if:{{#var:Occupation}}|{{#if:{{:Friendly data|{{{1}}}|Contract}}|'''✓'''}}}}
--- Extra images for NPC entries like generic guards or peasants. Many face images with no link. ---
| {{#if:{{#var:Occupation}}|{{#if:{{:Friendly data|{{{1}}}|Quest}}|'''✓'''}}}}
-->{{#if:{{#var:Image2}}|[[File:{{#var:Image2}}|37px|link=]]}}<!--
| {{#if:{{#var:Occupation}}|{{#if:{{:Friendly data|{{{1}}}|Trader}}|'''✓'''}}}}
-->{{#if:{{#var:Image3}}|[[File:{{#var:Image3}}|37px|link=]]}}<!--
| {{#if:{{#var:Occupation}}|{{#if:{{:Friendly data|{{{1}}}|Repair}}|'''✓'''}}}}
-->{{#if:{{#var:Image4}}|[[File:{{#var:Image4}}|37px|link=]]}}<!--
| {{#if:{{#var:Occupation}}|{{#if:{{:Friendly data|{{{1}}}|Rumors}}|'''✓'''}}}}
-->{{#if:{{#var:Image5}}|[[File:{{#var:Image5}}|37px|link=]]}}<!--
| {{#if:{{#var:Occupation}}|{{#if:{{:Friendly data|{{{1}}}|Lore}}|'''✓'''}}}}
-->{{#if:{{#var:Image6}}|[[File:{{#var:Image6}}|37px|link=]]}}<!--
| {{#if:{{#var:Occupation}}|{{#if:{{:Friendly data|{{{1}}}|UniqueDialogue}}|'''✓'''}}}}
--><br>{{#if:{{#var:Name}}|{{#if:{{#pos:{{lc:{{#var:Name}}}}|random}}|{{Translate|{{#var:Name}}|NPCNames}}|[[{{Translate|{{#var:Name}}|NPCNames}}]]}}|[[{{Translate|{{{1}}}|NPCNames}}]]}}}}
}}
| {{#if:{{#var:Exists}}|{{#if:{{:Friendly data|{{{1}}}|Contract}}|'''✓'''}}}}
</includeonly><noinclude>{{doc|Template:NPCTable/row}}[[Category:Templates]]</noinclude>
| {{#if:{{#var:Exists}}|{{#if:{{:Friendly data|{{{1}}}|Quest}}|'''✓'''}}}}{{#if:{{{2|}}}|<sup>{{{2|}}}</sup>}}
| {{#if:{{#var:Exists}}|{{#if:{{:Friendly data|{{{1}}}|Trader}}|'''✓'''}}}}
| {{#if:{{#var:Exists}}|{{#if:{{:Friendly data|{{{1}}}|Repair}}|'''✓'''}}}}
| {{#if:{{#var:Exists}}|{{#if:{{:Friendly data|{{{1}}}|Rumors}}|'''✓'''}}}}
| {{#if:{{#var:Exists}}|{{#if:{{:Friendly data|{{{1}}}|Lore}}|'''✓'''}}}}
| {{#if:{{#var:Exists}}|{{#if:{{:Friendly data|{{{1}}}|UniqueDialogue}}|'''✓'''}}}}<!--
--></includeonly><noinclude>{{doc|Template:NPCTable/row}}[[Category:Templates]]</noinclude>

Latest revision as of 20:22, 18 October 2022

This template has no documentation. If you know how to use this template, please add some.