Difference between revisions of "Template:NPCLootTable/row"

From Stoneshard wiki
Jump to navigation Jump to search
(Fix & clean base logic. The category icons are how planned. Needs images fix for the items in each category.)
(Finally Working. Item images working. Needs logic for "Buys" Action.)
Line 1: Line 1:
<includeonly><!--  {{NPCLootTable/row|Bert|Sells|Weapons}} ---
<noinclude>'''WORKING: [INCOMPLETE]'''<br>The {{c|+|&#8239}}; Represents a space " ", to not break the reference for the items. {{c|-|DO NOT DELETE}}.</noinclude>
<includeonly><!--  {{NPCLootTable/row|Jurg|Sell|Weapons}} ---
     --- 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:Datastring|{{:NPCLoot data|{{{1}}}}}}}<!--
     --- Loads the parameters from the NPC specified in the first parameter ---
    --- Maybe implement later with Friendly data --
     -->{{#vardefine:Name|{{{1}}}}} <!-- Define NPC name
     -->{{#vardefine:Name|{{{1}}}}} <!-- define npcname for tests
     -->{{#vardefine:Action|{{{2}}}}}<!-- Defines Action = second parameter
     -->{{#vardefine:Action|{{{2}}}}}<!-- Defines Action = second parameter
     -->{{#vardefine:Category|{{{3}}}}}<!-- Defines Category = third parameter
     -->{{#vardefine:Category|{{{3}}}}}<!-- Defines Category = third parameter
     -->{{#vardefine:CategoryData|{{#var:Datastring|{{{3}}}}}}}<!-- "| Weapons"
    -->{{#vardefine:DataCategories|{{:NPCLoot data|{{{1}}}}}}}<!-- Fetches data for the specified NPC
     -->{{#vardefine:Items|{{#explode:{{#var:CategoryData}}|;}}}}<!--"Training Crossbow"
     -->{{#vardefine:CategoryData|{{#explode:{{#var:DataCategories}}|{{{3}}}}}}}<!-- Fetches the data for the specified category
     --- First column: Category -->
     -->{{#vardefine:ItemList|{{#explode:{{:NPCLoot data|{{{1}}}|{{{3}}}}}}}}}<!-- This access the {{{3}}} param directly.
     -->{{#vardefine:TestWeaponImage|{{#explode:{{#var:TestDirectAcccess|;|0}}}}}}<!-- test fetches the data for the specified Param.
    -->
     |-
     |-
     | <!--{{#ifexist:{{#var:Action}}|[[File:Purse.png|42px]]|No Action provided for image}}
     <!-- First column: Category -->
    -->'''{{{3}}}'''<br>{{#if:{{#var:Category}}|[[File:{{#var:Category}}_icon.png|42px]]}}<!--
    | '''{{{3}}}'''<br>{{#if:{{#var:Category}}|[[File:{{#var:Category}}_icon.png|42px]]}}<!--
     --- Second column: Items -->
     --- Second column: Items -->
     | <!--{{#if:{{#var:Items}}|{{:CategoryData|{{#var:Items}}}}|No Items Found}}
     | <span class="stoneshard sortable" style="display: flex; text-align: center; justify-content: center;"><!-- Flex container ---
    --><span class="stoneshard sortable" style="display: flex; text-align: center; justify-content: center;"><!-- Flex container ---
        --><span>'''[[{{#replace:{{#explode:{{#var:ItemList}}|;|0}}|_|&#8239;}}]]'''<br>{{#if:{{#explode:{{#var:ItemList}}|;|0}}|[[File:{{#explode:{{#var:ItemList}}|;|0}}.png|64px|link=]]|No image found.}}</span><!--  
         -->{{#if:{{#explode:{{#var:Items}}|;|1}}|{{#explode:{{#var:Items}}|;|1}} [[File:{{#explode:{{#var:Items}}|;|1}}_icon.png|37px|link=]]|No image found }}<!--
         --><span>'''[[{{#replace:{{#explode:{{#var:ItemList}}|;|1}}|_|&#8239;}}]]'''<br>{{#if:{{#explode:{{#var:ItemList}}|;|1}}|[[File:{{#explode:{{#var:ItemList}}|;|1}}.png|64px|link=]]|No image found }}</span><!--
         -->{{#if:{{#explode:{{#var:Items}}|;|2}}|{{#explode:{{#var:Category}}|;|2}} [[File:{{#explode:{{#var:Category}}|;|2}}.png|45px|link=]]|B }}<!--
         --><span>'''[[{{#replace:{{#explode:{{#var:ItemList}}|;|2}}|_|&#8239;}}]]'''<br>{{#if:{{#explode:{{#var:ItemList}}|;|2}}|[[File:{{#explode:{{#var:ItemList}}|;|2}}.png|64px|link=]]|No image found }}</span><!--
         -->{{#if:{{#explode:{{#var:Items}}|;|3}}|{{#explode:{{#var:Category}}|;|3}} [[File:{{#explode:{{#var:Category}}|;|3}}.png|45px|link=]]|C }}<!--
         --><span>'''[[{{#replace:{{#explode:{{#var:ItemList}}|;|3}}|_|&#8239;}}]]'''<br>{{#if:{{#explode:{{#var:ItemList}}|;|3}}|[[File:{{#explode:{{#var:ItemList}}|;|3}}.png|64px|link=]]|No image found }}</span><!--
         -->{{#if:{{#explode:{{#var:Items}}|;|4}}|{{#explode:{{#var:Category}}|;|4}} [[File:{{#explode:{{#var:Category}}|;|4}}.png|45px|link=]]|D }}<!--
         --><span>'''[[{{#replace:{{#explode:{{#var:ItemList}}|;|4}}|_|&#8239;}}]]'''<br>{{#if:{{#explode:{{#var:ItemList}}|;|4}}|[[File:{{#explode:{{#var:ItemList}}|;|4}}.png|64px|link=]]|No image found }}</span><!--
         -->{{#if:{{#explode:{{#var:Items}}|;|5}}|{{#explode:{{#var:Category}}|;|5}} [[File:{{#explode:{{#var:Category}}|;|5}}.png|45px|link=]]|E }}<!--
         --><span>'''[[{{#replace:{{#explode:{{#var:ItemList}}|;|5}}|_|&#8239;}}]]'''<br>{{#if:{{#explode:{{#var:ItemList}}|;|5}}|[[File:{{#explode:{{#var:ItemList}}|;|5}}.png|64px|link=]]|No image found }}</span><!--
    --></span><!--
        --><span>'''[[{{#replace:{{#explode:{{#var:ItemList}}|;|6}}|_|&#8239;}}]]'''<br>{{#if:{{#explode:{{#var:ItemList}}|;|6}}|[[File:{{#explode:{{#var:ItemList}}|;|6}}.png|64px|link=]]|No image found }}</span>
    </span><!--
--></includeonly><noinclude>{{doc|Template:NPCLootTable/row}}[[Category:Templates]]</noinclude>
--></includeonly><noinclude>{{doc|Template:NPCLootTable/row}}[[Category:Templates]]</noinclude>

Revision as of 06:11, 27 January 2025

WORKING: [INCOMPLETE]
The &#8239; Represents a space " ", to not break the reference for the items. DO NOT DELETE.

Template-info.png Documentation

This article is a stub. You can help Stoneshard wiki by expanding it.

This Template is used to display every category & type of items a NPC trades.

Syntax

{{NPCTable/head}}

Usage

The header is always followed by the {{NPCLootTable/row}}, according to the necessary amount of NPCs to be display.

{{NPCLootTable/head|Bert}}
{{NPCLootTable/row}}
|}

Any NPC Loot information added in NPCLoot data, can be used with the '/row' template.

Examples

A) With a NPC {{NPCLootTable/head|Bert}}:

Category Types

B) With {{NPCLootTable/head|Bert}} & {{NPCLootTable/row|NPC*}}:

Trades

Bert as example

Buys

  • With "head|Bert|Buys", "Buys" & "end"
Bert Buys
Category Types


{{{3}}}
[[File:{{{3}}}_icon.png|42px]]
[[]]
No image found.
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
   
{{{2}}})
  • With "head" & "Buys"
Category Types


{{{3}}}
[[File:{{{3}}}_icon.png|42px]]
[[]]
No image found.
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
   

Sells

  • With "head", "Sells" & "end"
Category Types


Weapons
Weapons icon.png
Training Crossbow
Training Crossbow.png
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
   
{{{2}}})
  • With "head|Bert|Sells" & "SellsX3"
Bert Sells
Category Types


Weapons
Weapons icon.png
Training Crossbow
Training Crossbow.png
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
   


Armor
Armor icon.png
Travelling Shoes
Travelling Shoes.png
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
   


Tools
Tools icon.png
Hammer
File:Hammer.png
Pickaxe
Pickaxe.png
Bedroll
Bedroll.png
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
   
  • With "head" & "SellsX2"
Category Types


Weapons
Weapons icon.png
Training Crossbow
Training Crossbow.png
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found
   


Tools
Tools icon.png
Hammer
File:Hammer.png
Pickaxe
Pickaxe.png
Bedroll
Bedroll.png
[[]]
No image found
[[]]
No image found
[[]]
No image found
[[]]
No image found