From Dark and Darker Wiki
(Created script that extracts and adds quest items values.) |
(Some visual touchups) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
{{#arraydefine:array_item_names}} | {{#arraydefine:array_item_names}}<!-- | ||
<!--{{#arraydefine:extracted_quantity_array}}--> | --><!--{{#arraydefine:extracted_quantity_array}}--><!-- | ||
--><!-- | |||
<!-- Loop order -> Trader -> Chapter -> Quests -> Task: Checking params --> | --><!-- Loop order -> Trader -> Chapter -> Quests -> Task: Checking params --><!-- | ||
{{#arraydefine:traders_arr|{{Merchant Data|All}}}} | -->{{#arraydefine:traders_arr|{{Merchant Data|All}}}}<!-- | ||
<!--Loop Over Traders--> | --><!--Loop Over Traders--><!-- | ||
{{#loop: loopTr|0|{{#arraysize:traders_arr}}|<!-- | -->{{#loop: loopTr|0|{{#arraysize:traders_arr}}|<!-- | ||
--> | --><!-- | ||
{{# | -->{{#vardefine:cur_trader|[[{{#arrayindex:traders_arr|{{#var:loopTr}}}}]]}}<!-- | ||
-->{{#arraydefine:chapters_array|<!-- | |||
-->{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|All}}<!-- | |||
<!-- | -->}}<!-- | ||
{{# | --><!--Loop Over Chapters--><!-- | ||
-->{{#loop: loopC|0|{{#arraysize:chapters_array}}|<!-- | |||
-->{{#arraydefine:quest_array|<!-- | |||
-->{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|All}}<!-- | |||
<!-- | -->}}<!-- | ||
{{#loop: | --><!--Loop Over Quests--><!-- | ||
{{#arraydefine: | -->{{#loop: loopQ|0|{{#arraysize:quest_array}}|<!-- | ||
{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}| | -->{{#arraydefine:tasks_array|<!-- | ||
}} | -->{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|all}}<!-- | ||
-->}}<!-- | |||
<!-- | --><!-- | ||
<!-- | --><!--Loop Over Tasks--><!-- | ||
<!-- | --><!-- TOO MANY LOOOOOPS, COPY PASTE CODE FOR TASKS --><!-- | ||
{{# | --><!-- Check if Its fetch 1--><!-- | ||
-->{{#vardefine:cond1|{{#arraysearch:tasks_array|1}}}}<!-- | |||
|<!-- | -->{{#if:cond1<!-- | ||
{{# | -->|<!-- True: Task array has task: 1 --><!-- | ||
-->{{#ifeq: {{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|1|type}}<!-- | |||
-->|Fetch|<!-- | |||
<!-- | --><!-- | ||
{{# | --><!-- FETCH TASK Checking --><!-- | ||
}} | -->{{#vardefine:current_item|{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|1|fetch}}<!-- | ||
{{# | -->}}<!-- | ||
-->{{#vardefine:current_quantity|{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|1|quantity}}<!-- | |||
{{#vardefine: | -->}}<!-- | ||
{{# | -->{{#vardefine:isItemInArray|{{#arraysearch:array_item_names|{{#var:current_item}}}}}}<!-- | ||
| | -->{{#if:{{#var:isItemInArray}}<!-- | ||
{{# | -->|<!--True--><!-- | ||
| | -->{{#vardefine:{{#var:current_item}}|{{#expr:{{#var:current_quantity}}+{{#var:{{#var:current_item}}}}}}}}<!-- | ||
{{# | -->{{#arraydefine:quest_giver{{#var:current_item}}|{{#arrayprint:quest_giver{{#var:current_item}}|,}},{{#var:cur_trader}} (x{{#var:current_quantity}})}}<!-- | ||
{{# | -->|<!--False--><!-- | ||
-->{{#arraydefine:array_item_names|{{#arrayprint:array_item_names|,}},{{#var:current_item}}}}<!-- | |||
-->{{#vardefine:{{#var:current_item}}|{{#var:current_quantity}}}}<!-- | |||
}}<!-- | -->{{#arraydefine:quest_giver{{#var:current_item}}|{{#var:cur_trader}} (x{{#var:current_quantity}})}}<!-- | ||
-->}}<!-- | |||
--><!-- | |||
-->}}<!--end is eq: fetch type --><!-- | |||
{{# | -->|}}<!-- end if: is Task N --><!-- | ||
{{#if: | --><!-- | ||
--><!-- Check if Its fetch 2--><!-- | |||
{{# | -->{{#vardefine:cond2|{{#arraysearch:tasks_array|2}}}}<!-- | ||
-->{{#if:cond2<!-- | |||
-->|<!-- True: Task array has task: 2 --><!-- | |||
-->{{#ifeq: {{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|2|type}}<!-- | |||
{{# | -->|Fetch|<!-- | ||
--><!-- | |||
{{#vardefine: | --><!-- FETCH TASK Checking --><!-- | ||
}} | -->{{#vardefine:current_item|{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|2|fetch}}<!-- | ||
-->}}<!-- | |||
-->{{#vardefine:current_quantity|{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|2|quantity}}<!-- | |||
-->}}<!-- | |||
{ | -->{{#vardefine:isItemInArray|{{#arraysearch:array_item_names|{{#var:current_item}}}}}}<!-- | ||
-->{{#if:{{#var:isItemInArray}}<!-- | |||
{{# | -->|<!--True--><!-- | ||
{{# | -->{{#vardefine:{{#var:current_item}}|{{#expr:{{#var:current_quantity}}+{{#var:{{#var:current_item}}}}}}}}<!-- | ||
-->{{#arraydefine:quest_giver{{#var:current_item}}|{{#arrayprint:quest_giver{{#var:current_item}}|,}},{{#var:cur_trader}} (x{{#var:current_quantity}})}}<!-- | |||
-->|<!--False--><!-- | |||
}}<!-- | -->{{#arraydefine:array_item_names|{{#arrayprint:array_item_names|,}},{{#var:current_item}}}}<!-- | ||
| | -->{{#vardefine:{{#var:current_item}}|{{#var:current_quantity}}}}<!-- | ||
-->{{#arraydefine:quest_giver{{#var:current_item}}|{{#var:cur_trader}} (x{{#var:current_quantity}})}}<!-- | |||
<!-- | -->}}<!-- | ||
{{#vardefine: | --><!-- | ||
{{# | -->}}<!--end is eq: fetch type --><!-- | ||
-->|}}<!-- end if: is Task N --><!-- | |||
--><!-- | |||
--><!-- Check if Its fetch 3--><!-- | |||
-->{{#vardefine:cond3|{{#arraysearch:tasks_array|3}}}}<!-- | |||
<!-- | -->{{#if:cond3<!-- | ||
{{#vardefine: | -->|<!-- True: Task array has task: 3 --><!-- | ||
}} | -->{{#ifeq: {{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|3|type}}<!-- | ||
{{#vardefine: | -->|Fetch|<!-- | ||
--><!-- | |||
{{#vardefine: | --><!-- FETCH TASK Checking --><!-- | ||
{{# | -->{{#vardefine:current_item|{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|3|fetch}}<!-- | ||
-->}}<!-- | |||
{{# | -->{{#vardefine:current_quantity|{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|3|quantity}}<!-- | ||
|<!--False--> | -->}}<!-- | ||
{{#arraydefine:array_item_names|{{#arrayprint:array_item_names|,}},{{#var:current_item}}}} | -->{{#vardefine:isItemInArray|{{#arraysearch:array_item_names|{{#var:current_item}}}}}}<!-- | ||
{{#vardefine:{{#var:current_item}}|{{#var:current_quantity}} | -->{{#if:{{#var:isItemInArray}}<!-- | ||
-->|<!--True--><!-- | |||
-->{{#vardefine:{{#var:current_item}}|{{#expr:{{#var:current_quantity}}+{{#var:{{#var:current_item}}}}}}}}<!-- | |||
}}<!-- | -->{{#arraydefine:quest_giver{{#var:current_item}}|{{#arrayprint:quest_giver{{#var:current_item}}|,}},{{#var:cur_trader}} (x{{#var:current_quantity}})}}<!-- | ||
|}}<!-- | -->|<!--False--><!-- | ||
-->{{#arraydefine:array_item_names|{{#arrayprint:array_item_names|,}},{{#var:current_item}}}}<!-- | |||
<!-- | -->{{#vardefine:{{#var:current_item}}|{{#var:current_quantity}}}}<!-- | ||
-->{{#arraydefine:quest_giver{{#var:current_item}}|{{#var:cur_trader}} (x{{#var:current_quantity}})}}<!-- | |||
-->}}<!-- | |||
--><!-- | |||
-->}}<!--end is eq: fetch type --><!-- | |||
| | -->|}}<!-- end if: is Task N --><!-- | ||
--><!-- | |||
<!-- | --><!-- Check if Its fetch 4--><!-- | ||
-->{{#vardefine:cond4|{{#arraysearch:tasks_array|4}}}}<!-- | |||
-->{{#if:cond4<!-- | |||
-->|<!-- True: Task array has task: 4 --><!-- | |||
}} | -->{{#ifeq: {{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|4|type}}<!-- | ||
{{#vardefine: | -->|Fetch|<!-- | ||
{{# | --><!-- | ||
| | --><!-- FETCH TASK Checking --><!-- | ||
{{# | -->{{#vardefine:current_item|{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|4|fetch}}<!-- | ||
|<!-- | -->}}<!-- | ||
{{# | -->{{#vardefine:current_quantity|{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|4|quantity}}<!-- | ||
{{# | -->}}<!-- | ||
}} | -->{{#vardefine:isItemInArray|{{#arraysearch:array_item_names|{{#var:current_item}}}}}}<!-- | ||
-->{{#if:{{#var:isItemInArray}}<!-- | |||
}}<!-- | -->|<!--True--><!-- | ||
| | -->{{#vardefine:{{#var:current_item}}|{{#expr:{{#var:current_quantity}}+{{#var:{{#var:current_item}}}}}}}}<!-- | ||
-->{{#arraydefine:quest_giver{{#var:current_item}}|{{#arrayprint:quest_giver{{#var:current_item}}|,}},{{#var:cur_trader}} (x{{#var:current_quantity}})}}<!-- | |||
<!-- | -->|<!--False--><!-- | ||
{{# | -->{{#arraydefine:array_item_names|{{#arrayprint:array_item_names|,}},{{#var:current_item}}}}<!-- | ||
{{# | -->{{#vardefine:{{#var:current_item}}|{{#var:current_quantity}}}}<!-- | ||
-->{{#arraydefine:quest_giver{{#var:current_item}}|{{#var:cur_trader}} (x{{#var:current_quantity}})}}<!-- | |||
{{# | -->}}<!-- | ||
--><!-- | |||
-->}}<!--end is eq: fetch type --><!-- | |||
<!-- | -->|}}<!-- end if: is Task N --><!-- | ||
--><!-- | |||
--><!-- Check if Its fetch 5--><!-- | |||
{{# | -->{{#vardefine:cond5|{{#arraysearch:tasks_array|5}}}}<!-- | ||
}} | -->{{#if:cond5<!-- | ||
-->|<!-- True: Task array has task: 5 --><!-- | |||
-->{{#ifeq: {{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|5|type}}<!-- | |||
-->|Fetch|<!-- | |||
{{#vardefine:{{ | --><!-- | ||
|<!-- | --><!-- FETCH TASK Checking --><!-- | ||
{{# | -->{{#vardefine:current_item|{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|5|fetch}}<!-- | ||
{{# | -->}}<!-- | ||
-->{{#vardefine:current_quantity|{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|5|quantity}}<!-- | |||
-->}}<!-- | |||
}}<!-- | -->{{#vardefine:isItemInArray|{{#arraysearch:array_item_names|{{#var:current_item}}}}}}<!-- | ||
-->{{#if:{{#var:isItemInArray}}<!-- | |||
-->|<!--True--><!-- | |||
-->{{#vardefine:{{#var:current_item}}|{{#expr:{{#var:current_quantity}}+{{#var:{{#var:current_item}}}}}}}}<!-- | |||
{{#vardefine: | -->{{#arraydefine:quest_giver{{#var:current_item}}|{{#arrayprint:quest_giver{{#var:current_item}}|,}},{{#var:cur_trader}} (x{{#var:current_quantity}})}}<!-- | ||
{{#if: | -->|<!--False--><!-- | ||
|<!-- True | -->{{#arraydefine:array_item_names|{{#arrayprint:array_item_names|,}},{{#var:current_item}}}}<!-- | ||
-->{{#vardefine:{{#var:current_item}}|{{#var:current_quantity}}}}<!-- | |||
-->{{#arraydefine:quest_giver{{#var:current_item}}|{{#var:cur_trader}} (x{{#var:current_quantity}})}}<!-- | |||
-->}}<!-- | |||
<!-- | --><!-- | ||
{{# | -->}}<!--end is eq: fetch type --><!-- | ||
}} | -->|}}<!-- end if: is Task N --><!-- | ||
{{#vardefine: | --><!-- | ||
}} | --><!-- Check if Its fetch 6--><!-- | ||
-->{{#vardefine:cond6|{{#arraysearch:tasks_array|6}}}}<!-- | |||
-->{{#if:cond6<!-- | |||
-->|<!-- True: Task array has task: 6 --><!-- | |||
-->{{#ifeq: {{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|6|type}}<!-- | |||
-->|Fetch|<!-- | |||
{ | --><!-- | ||
{{# | --><!-- FETCH TASK Checking --><!-- | ||
}} | -->{{#vardefine:current_item|{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|6|fetch}}<!-- | ||
-->}}<!-- | |||
}}<!-- | -->{{#vardefine:current_quantity|{{Merchant Data|{{#arrayindex:traders_arr|{{#var:loopTr}}}}|QuestChapters|{{#arrayindex:chapters_array|{{#var:loopC}}}}|{{#arrayindex:quest_array|{{#var:loopQ}}}}|objectives|6|quantity}}<!-- | ||
| | -->}}<!-- | ||
-->{{#vardefine:isItemInArray|{{#arraysearch:array_item_names|{{#var:current_item}}}}}}<!-- | |||
<!-- | -->{{#if:{{#var:isItemInArray}}<!-- | ||
<!-- | -->|<!--True--><!-- | ||
-->{{#vardefine:{{#var:current_item}}|{{#expr:{{#var:current_quantity}}+{{#var:{{#var:current_item}}}}}}}}<!-- | |||
-->{{#arraydefine:quest_giver{{#var:current_item}}|{{#arrayprint:quest_giver{{#var:current_item}}|,}},{{#var:cur_trader}} (x{{#var:current_quantity}})}}<!-- | |||
-->|<!--False--><!-- | |||
-->{{#arraydefine:array_item_names|{{#arrayprint:array_item_names|,}},{{#var:current_item}}}}<!-- | |||
{{# | -->{{#vardefine:{{#var:current_item}}|{{#var:current_quantity}}}}<!-- | ||
-->{{#arraydefine:quest_giver{{#var:current_item}}|{{#var:cur_trader}} (x{{#var:current_quantity}})}}<!-- | |||
-->}}<!-- | |||
--><!-- | |||
-->}}<!--end is eq: fetch type --><!-- | |||
-->|}}<!-- end if: is Task N --><!-- | |||
--><!-- | |||
--><!--}}--><!-- | |||
--><!--End loop over tasks--><!-- | |||
-->}}<!-- | |||
-->}}<!-- | |||
-->}}<!-- | |||
--><!-- Remove first empty element --><!-- | |||
-->{{#arrayslice:array_item_names|array_item_names|1|9999}}<!-- | |||
<!-- Result Table --><!-- | |||
--><table id="SumQuestItemsTable" cellspacing="0" class="wikitable sortable stripedtable jquery-tablesorter" style="width:70%; border-collapse:collapse; background:transparent; text-align:center"><!-- | |||
--><tr><!-- | --><tr><!-- | ||
--><th style="width: | --><th style="width:40%" class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending">Item name</th><!-- | ||
--><th style="width: | --><th style="width:15%" class="headerSort" tabindex="1" role="columnheader button" title="Quantity">Quantity</th><!-- | ||
-->{{#loop:LoopTest|0|{{#arraysize:array_item_names}} | --><th style="width:50%" class="headerSort" tabindex="2" role="columnheader button" title="Traders">Traders</th></tr><!-- | ||
|<!-- Loop --> | -->{{#loop:LoopTest|0|{{#arraysize:array_item_names}}<!-- | ||
{{#vardefine:name|{{#arrayindex:array_item_names|{{#var:LoopTest}}}}}} | -->|<!-- Loop --><!-- | ||
<tr><td>{{#var:name}}</td><td>{{#var:{{#var:name}}}}</td></tr> | -->{{#vardefine:name|{{#arrayindex:array_item_names|{{#var:LoopTest}}}}}}<!-- | ||
}}<!-- | --><tr><td>{{#var:name}}</td><td>{{#var:{{#var:name}}}}</td><td>{{#arrayprint:quest_giver{{#var:name}}|, }}</td></tr><!-- | ||
-->}}<!-- | |||
--></table><!-- | --></table><!-- | ||
--></includeonly><!-- | |||
</includeonly> | --><noinclude><!-- | ||
<noinclude> | -->{{Template:SumQuestItems}} | ||
{{ |