From Dark and Darker Wiki

mNo edit summary
(Changing Template to use calls that work with Merchant Data.)
Line 1: Line 1:
<includeonly>{{#arraydefine:craftables|{{Crafting Data|{{{1}}}}} }}
<includeonly>{{#arraydefine:craftables|{{Merchant Data|{{{1}}}|Crafts|All}} }}
{{
{{
#loop: i
#loop: i
Line 5: Line 5:
|{{#arraysize:craftables}}
|{{#arraysize:craftables}}
|<nowiki/>{{#vardefine:craft|{{#arrayindex:craftables|{{#var:i}} }} }}<!--
|<nowiki/>{{#vardefine:craft|{{#arrayindex:craftables|{{#var:i}} }} }}<!--
-->{{#if:{{{ingredient|}}}<!--
If the ingredient is in the list of ingredients for the craft
-->|{{#if:{{#pos:{{Crafting Data|{{#var:craft}}|ingredients}}|{{{ingredient|}}}}}<!--
OR the ingredient is empty, generate the crafting row.
-->|{{GenerateCraftingRow|{{#var:craft}}}} }}<!--
-->{{#if:{{#pos:{{Merchant Data|{{{1}}}|Crafts|{{#var:craft}}|ingredients}}|{{{ingredient|}}}}}{{#if:{{{ingredient|}}}||continue}}<!--
-->|{{GenerateCraftingRow|{{#var:craft}}}} }}
-->|{{GenerateCraftingRow|{{#var:craft}} }} }}
}}
}}
</includeonly><noinclude>
</includeonly><noinclude>
Line 24: Line 24:
<pre>
<pre>
{{CraftingTable|
{{CraftingTable|
{{GenerateCraftingRows|all|ingredient=Gold}}
{{GenerateCraftingRows|Alchemist|ingredient=Gold}}
}}
}}
</pre>
</pre>
{{CraftingTable|
{{CraftingTable|
{{GenerateCraftingRows|all|ingredient=Gold}}
{{GenerateCraftingRows|Alchemist|ingredient=Gold}}
}}
==Example==
<pre>
{{CraftingTable|
{{GenerateCraftingRows|Weaponsmith|ingredient=Gold}}
}}
</pre>
{{CraftingTable|
{{GenerateCraftingRows|Weaponsmith|ingredient=Gold}}
}}
==Example==
<pre>
{{CraftingTable|
{{GenerateCraftingRows|Armourer|ingredient=Gold}}
}}
</pre>
{{CraftingTable|
{{GenerateCraftingRows|Armourer|ingredient=Gold}}
}}
}}
</noinclude>
</noinclude>

Revision as of 05:11, 25 March 2024

Auto creates crafting row

Example

{{CraftingTable|
	{{GenerateCraftingRows|Alchemist}}
}}

Template:CraftingTable

Example

{{CraftingTable|
	{{GenerateCraftingRows|Alchemist|ingredient=Gold}}
}}

Template:CraftingTable

Example

{{CraftingTable|
	{{GenerateCraftingRows|Weaponsmith|ingredient=Gold}}
}}

Template:CraftingTable

Example

{{CraftingTable|
	{{GenerateCraftingRows|Armourer|ingredient=Gold}}
}}

Template:CraftingTable