Difference between revisions of "Template:NPCLootTable/row"
Jump to navigation
Jump to search
A) With a NPC
B) With
m (Test) |
(Fix & clean base logic. The category icons are how planned. Needs images fix for the items in each category.) |
||
Line 1: | Line 1: | ||
<includeonly><!-- {{NPCLootTable/row| | <includeonly><!-- {{NPCLootTable/row|Bert|Sells|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}}}}}}}<!-- | -->{{#vardefine:Datastring|{{:NPCLoot data|{{{1}}}}}}}<!-- | ||
-- | --- Maybe implement later with Friendly data -- | ||
-->{{#vardefine:Name|{{{1}}}}} <!-- define npcname for tests | |||
-->{{#vardefine: | -->{{#vardefine:Action|{{{2}}}}}<!-- Defines Action = second parameter | ||
-->{{#vardefine:Category|{{{3}}}}}<!-- Defines Category = third parameter | |||
-->{{#vardefine:CategoryData|{{#var:Datastring|{{{3}}}}}}}<!-- "| Weapons" | |||
-->{{#vardefine: | -->{{#vardefine:Items|{{#explode:{{#var:CategoryData}}|;}}}}<!--"Training Crossbow" | ||
-->{{#vardefine: | --- First column: Category --> | ||
-->{{#vardefine: | |- | ||
| <!--{{#ifexist:{{#var:Action}}|[[File:Purse.png|42px]]|No Action provided for image}} | |||
-->'''{{{3}}}'''<br>{{#if:{{#var:Category}}|[[File:{{#var:Category}}_icon.png|42px]]}}<!-- | |||
--- Second column: Items --> | |||
--> {{#vardefine: | | <!--{{#if:{{#var:Items}}|{{:CategoryData|{{#var:Items}}}}|No Items Found}} | ||
--- | --><span class="stoneshard sortable" style="display: flex; text-align: center; justify-content: center;"><!-- Flex container --- | ||
-- | -->{{#if:{{#explode:{{#var:Items}}|;|1}}|{{#explode:{{#var:Items}}|;|1}} [[File:{{#explode:{{#var:Items}}|;|1}}_icon.png|37px|link=]]|No image found }}<!-- | ||
-->{{#if:{{#explode:{{#var:Items}}|;|2}}|{{#explode:{{#var:Category}}|;|2}} [[File:{{#explode:{{#var:Category}}|;|2}}.png|45px|link=]]|B }}<!-- | |||
-->{{#if:{{#explode:{{#var:Items}}|;|3}}|{{#explode:{{#var:Category}}|;|3}} [[File:{{#explode:{{#var:Category}}|;|3}}.png|45px|link=]]|C }}<!-- | |||
-->{{#if:{{#explode:{{#var:Items}}|;|4}}|{{#explode:{{#var:Category}}|;|4}} [[File:{{#explode:{{#var:Category}}|;|4}}.png|45px|link=]]|D }}<!-- | |||
-->{{#if:{{#explode:{{#var:Items}}|;|5}}|{{#explode:{{#var:Category}}|;|5}} [[File:{{#explode:{{#var:Category}}|;|5}}.png|45px|link=]]|E }}<!-- | |||
--></span><!-- | |||
--- | |||
-- | |||
-->< | |||
--> | |||
--></includeonly><noinclude>{{doc|Template:NPCLootTable/row}}[[Category:Templates]]</noinclude> | --></includeonly><noinclude>{{doc|Template:NPCLootTable/row}}[[Category:Templates]]</noinclude> |
Revision as of 22:08, 26 January 2025
![]() |
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 foundBCDE | |||||||
{{{2}}}) |
- With "head" & "Buys"
Category | Types |
---|---|
{{{3}}} [[File:{{{3}}}_icon.png|42px]] |
No image foundBCDE |
Sells
- With "head", "Sells" & "end"
Category | Types | |||||||
---|---|---|---|---|---|---|---|---|
Weapons![]() |
No image foundBCDE | |||||||
{{{2}}}) |
- With "head|Bert|Sells" & "SellsX3"
Bert Sells | |
---|---|
Category | Types |
Weapons![]() |
No image foundBCDE |
Armor![]() |
No image foundBCDE |
Tools![]() |
No image foundBCDE |
- With "head" & "SellsX2"
Category | Types |
---|---|
Weapons![]() |
No image foundBCDE |
Tools![]() |
No image foundBCDE |