From Dark and Darker Wiki
(Added merchant parameter to GenCraftingRow call.) |
(Combined crafting templates into GenerateCraftingTable) |
||
Line 1: | Line 1: | ||
<includeonly>{{#arraydefine:craftables|{{Merchant Data|{{{1}}}|Crafts|All}} }} | <includeonly><!-- | ||
{{ | -->{{#arraydefine:craftables|{{Merchant Data|{{{1}}}|Crafts|All}} }}<!-- | ||
--><table cellspacing="0" class="wikitable sortable jquery-tablesorter" style="width:55%; min-width:500px; background:transparent; text-align:center; vertical-align:middle;"> | |||
<tr> | |||
<th style="font-weight:bold; width:15%">Name</th> | |||
<th style="font-weight:bold; width:25%">Ingredients</th> | |||
<th style="font-weight:bold; width:10%">Trader</th></tr><!-- | |||
-->{{#loop:i|0|{{#arraysize:craftables}} | |||
|{{#vardefine:craft|{{#arrayindex:craftables|{{#var:i}} }} }}<!-- | |||
If the ingredient is in the list of ingredients for the craft | |||
}} | OR the ingredient is empty, generate the crafting row. | ||
</includeonly><noinclude> | -->{{#if: {{#pos:{{Merchant Data|{{{1}}}|Crafts|{{#var:craft}}|ingredients}}|{{{ingredient|}}}}}<!-- | ||
-->{{#if:{{{ingredient|}}}||continue}}<!-- | |||
-->|{{#arraydefine:ingredients|{{Merchant Data|{{{1}}}|Crafts|{{#var:craft}}|ingredients}} }}<!-- | |||
--><tr> | |||
<td>{{Iconbox|<!-- | |||
-->{{#if:{{#pos:{{#var:craft}}|Potion}}<!-- | |||
-->|{{#explode:{{#var:craft}}| |1|2}}<!-- | |||
-->|{{#var:craft}} }}<!-- | |||
-->|size=x100px<!-- | |||
-->|amount={{Merchant Data|{{{1}}}|Crafts|{{#var:craft}}|quantity}}<!-- | |||
-->|rarity={{Merchant Data|{{{1}}}|Crafts|{{#var:craft}}|rarity}} }}</td> | |||
<td>{{#loop:i|0|{{#arraysize:ingredients}}<!-- | |||
-->|{{#vardefine:ingredient|{{#arrayindex:ingredients|{{#var:i}} }} }}<!-- | |||
-->{{Iconbox|<!-- | |||
-->{{#explode:{{#var:ingredient}}|-|1}}<!-- | |||
-->|size=x100px<!-- | |||
-->|caption=no<!-- | |||
-->|amount={{#explode:{{#var:ingredient}}|-|0}}<!-- | |||
-->|rarity=<!-- | |||
-->{{#if:{{#explode:{{#var:ingredient}}|-|2}}<!-- | |||
-->|{{#explode:{{#var:ingredient}}|-|2}}<!-- | |||
-->|{{Misc Data|{{#explode:{{#var:ingredient}}|-|1}}|Rarities}} }} }} }}</td> | |||
<td>[[{{{1}}}]]</td></tr>}} }}</table><!-- | |||
--></includeonly><noinclude> | |||
Auto creates crafting row | Auto creates crafting row | ||
==Example== | ==Example== | ||
<pre> | <pre>{{GenerateCraftingTable|Alchemist}}</pre> | ||
{{GenerateCraftingTable|Alchemist}} | |||
</pre> | |||
{{ | |||
}} | |||
==Example== | ==Example== | ||
<pre> | <pre>{{GenerateCraftingTable|Alchemist|ingredient=Gold}}</pre> | ||
{{GenerateCraftingTable|Alchemist|ingredient=Gold}} | |||
</pre> | |||
{{ | |||
}} | |||
==Example== | ==Example== | ||
<pre> | <pre>{{GenerateCraftingTable|Weaponsmith|ingredient=Gold}}</pre> | ||
{{GenerateCraftingTable|Weaponsmith|ingredient=Gold}} | |||
</pre> | |||
{{ | |||
}} | |||
==Example== | ==Example== | ||
<pre> | <pre>{{GenerateCraftingTable|Armourer|ingredient=Gold}}</pre> | ||
{{GenerateCraftingTable|Armourer|ingredient=Gold}} | |||
</pre> | |||
{{ | |||
}} | |||
</noinclude> | </noinclude> |
Revision as of 00:08, 14 May 2024
Auto creates crafting row
Example
{{GenerateCraftingTable|Alchemist}}
Example
{{GenerateCraftingTable|Alchemist|ingredient=Gold}}
Name | Ingredients | Trader |
---|---|---|
Alchemist | ||
Alchemist | ||
Alchemist |
Example
{{GenerateCraftingTable|Weaponsmith|ingredient=Gold}}
Name | Ingredients | Trader |
---|---|---|
Weaponsmith | ||
Weaponsmith | ||
Weaponsmith | ||
Weaponsmith | ||
Weaponsmith | ||
Weaponsmith | ||
Weaponsmith | ||
Weaponsmith | ||
Weaponsmith | ||
Weaponsmith | ||
Weaponsmith | ||
Weaponsmith | ||
Weaponsmith |
Example
{{GenerateCraftingTable|Armourer|ingredient=Gold}}
Name | Ingredients | Trader |
---|---|---|
Armourer | ||
Armourer | ||
Armourer | ||
Armourer | ||
Armourer | ||
Armourer | ||
Armourer | ||
Armourer |