|
|
| (4 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| <noinclude>'''{{c|+|WORKING: [INCOMPLETE]}}'''<br></noinclude><includeonly><!--
| | <includeonly><!-- |
| --- Define variables, goal is to only load each property from the Data page once. ---
| | --- Loads the parameters from the NPC specified in the parameter --- |
| --- Loads the parameters from the NPC specified in the first parameter --- | | -->{{#vardefine:NPC|{{{1}}}}}<!-- Defines NPC |
| -->{{#vardefine:Location|{{{1}}}}} <!-- Defines Location = first parameter | | -->{{#vardefine:NPCData|{{:Friendly data|{{{1}}}|Ratios}}}}<!-- Fetches only the Ratios parameter for the specified NPC |
| -->{{#vardefine:NPC|{{{2}}}}}<!-- Defines NPC = second parameter | | -->{{#vardefine:RatiosList|{{#explode:{{#var:NPCData}}}}}}<!-- |
| -->{{#vardefine:DataCategories|{{:CommoditiesRatio data|{{{1}}}}}}}<!-- Fetches data for the specified Location | | --- Store Ratio Values --- |
| -->{{#vardefine:NPCData|{{#explode:{{#var:DataCategories}}|{{{2}}}}}}}<!-- Fetches the data (Ratios) for the specified NPC | | -->{{#vardefine:Ratio00|{{#explode:{{#var:RatiosList}}|;|0}}}}<!-- |
| -->{{#vardefine:RatiosList|{{#explode:{{:CommoditiesRatio data|{{{1}}}|{{{2}}}}}}}}} | | -->{{#vardefine:Ratio01|{{#explode:{{#var:RatiosList}}|;|1}}}}<!-- |
| | -->{{#vardefine:Ratio02|{{#explode:{{#var:RatiosList}}|;|2}}}}<!-- |
| | -->{{#vardefine:Ratio03|{{#explode:{{#var:RatiosList}}|;|3}}}}<!-- |
| | -->{{#vardefine:Ratio04|{{#explode:{{#var:RatiosList}}|;|4}}}}<!-- |
| | -->{{#vardefine:Ratio05|{{#explode:{{#var:RatiosList}}|;|5}}}}<!-- |
| | -->{{#vardefine:Ratio06|{{#explode:{{#var:RatiosList}}|;|6}}}} |
| |- | | |- |
| <!-- Display NPC Icon --> | | <!-- Display NPC Icon --> |
| | {{#if:{{#var:NPC}}|[[File:{{#var:NPC}}.png|64px]]|No image found for [[{{#var:NPC}}]].}}<br>'''[[{{#var:NPC}}]]''' | | | {{#if:{{#var:NPC}}|[[File:{{#var:NPC}}.png|64px]]|No image found for [[{{#var:NPC}}]].}}<br>'''[[{{#var:NPC}}]]''' |
| <!--- Third to Last columns: Ratios List --> | | <!--- Second to Last columns: Ratios List --> |
| | '''{{#if:{{#explode:{{#var:RatiosList}}|;|0}}|{{#explode:{{#var:RatiosList}}|;|0}}|No data}}''' | | | '''{{#if:{{#var:Ratio00}}|<!-- Check if Ratio01 is defined and not empty --- |
| | '''{{#if:{{#explode:{{#var:RatiosList}}|;|1}}|{{#explode:{{#var:RatiosList}}|;|1}}|No data}}''' | | -->{{#vardefine:Ratio00Diff|{{#ifexpr:{{#var:Ratio00}} < 1.15 | 2.0 - {{#var:Ratio00}} | {{#var:Ratio00}} - 1.0}}}}<!-- |
| | '''{{#if:{{#explode:{{#var:RatiosList}}|;|2}}|{{#explode:{{#var:RatiosList}}|;|2}}|No data}}''' | | -->{{c|{{#ifexpr:{{#var:Ratio00}} > 1.25 | + |{{#ifexpr:{{#var:Ratio00}} < 1.1 | - | Orange}}}}<!-- |
| | '''{{#if:{{#explode:{{#var:RatiosList}}|;|3}}|{{#explode:{{#var:RatiosList}}|;|3}}|No data}}''' | | -->|{{#var:Ratio00}}}}|-}}'''<!-- Display the value of Ratio00 with color template--> |
| | '''{{#if:{{#explode:{{#var:RatiosList}}|;|4}}|{{#explode:{{#var:RatiosList}}|;|4}}|No data}}''' | | | '''{{#if:{{#var:Ratio01}}|<!-- Check if Ratio01 is defined and not empty --- |
| | '''{{#if:{{#explode:{{#var:RatiosList}}|;|5}}|{{#explode:{{#var:RatiosList}}|;|5}}|No data}}''' | | -->{{#vardefine:Ratio01Diff|{{#ifexpr:{{#var:Ratio01}} < 1.15 | 2.0 - {{#var:Ratio01}} | {{#var:Ratio01}} - 1.0}}}}<!-- |
| | '''{{#if:{{#explode:{{#var:RatiosList}}|;|6}}|{{#explode:{{#var:RatiosList}}|;|6}}|No data}}'''<!-- | | -->{{c|{{#ifexpr:{{#var:Ratio01}} > 1.25 | + |{{#ifexpr:{{#var:Ratio01}} < 1.1 | - | Orange}}}}<!-- |
| | -->|{{#var:Ratio01}}}}|-}}''' |
| | | '''{{#if:{{#var:Ratio02}}|<!-- |
| | -->{{#vardefine:Ratio02Diff|{{#ifexpr:{{#var:Ratio02}} < 1.15 | 2.0 - {{#var:Ratio02}} | {{#var:Ratio02}} - 1.0}}}}<!-- |
| | -->{{c|{{#ifexpr:{{#var:Ratio02}} > 1.25 | + |{{#ifexpr:{{#var:Ratio02}} < 1.1 | - | Orange}}}}<!-- |
| | -->|{{#var:Ratio02}}}}|-}}''' |
| | | '''{{#if:{{#var:Ratio03}}|<!-- |
| | -->{{#vardefine:Ratio03Diff|{{#ifexpr:{{#var:Ratio03}} < 1.15 | 2.0 - {{#var:Ratio03}} | {{#var:Ratio03}} - 1.0}}}}<!-- |
| | -->{{c|{{#ifexpr:{{#var:Ratio03}} > 1.25 | + |{{#ifexpr:{{#var:Ratio03}} < 1.1 | - | Orange}}}}<!-- |
| | -->|{{#var:Ratio03}}}}|-}}''' |
| | | '''{{#if:{{#var:Ratio04}}|<!-- |
| | -->{{#vardefine:Ratio04Diff|{{#ifexpr:{{#var:Ratio04}} < 1.15 | 2.0 - {{#var:Ratio04}} | {{#var:Ratio04}} - 1.0}}}}<!-- |
| | -->{{c|{{#ifexpr:{{#var:Ratio04}} > 1.25 | + |{{#ifexpr:{{#var:Ratio04}} < 1.1 | - | Orange}}}}<!-- |
| | -->|{{#var:Ratio04}}}}|-}}''' |
| | | '''{{#if:{{#var:Ratio05}}|<!-- |
| | -->{{#vardefine:Ratio05Diff|{{#ifexpr:{{#var:Ratio05}} < 1.15 | 2.0 - {{#var:Ratio05}} | {{#var:Ratio05}} - 1.0}}}}<!-- |
| | -->{{c|{{#ifexpr:{{#var:Ratio05}} > 1.25 | + |{{#ifexpr:{{#var:Ratio05}} < 1.1 | - | Orange}}}}<!-- |
| | -->|{{#var:Ratio05}}}}|-}}''' |
| | | '''{{#if:{{#var:Ratio06}}|<!-- |
| | -->{{#vardefine:Ratio06Diff|{{#ifexpr:{{#var:Ratio06}} < 1.15 | 2.0 - {{#var:Ratio06}} | {{#var:Ratio06}} - 1.0}}}}<!-- |
| | -->{{c|{{#ifexpr:{{#var:Ratio06}} > 1.25 | + |{{#ifexpr:{{#var:Ratio06}} < 1.1 | - | Orange}}}}<!-- |
| | -->|{{#var:Ratio06}}}}|-}}'''<!-- |
| --></includeonly><noinclude> | | --></includeonly><noinclude> |
| {{doc|Template:NPCLootTable/row}} | | {{doc|Template:NPCLootTable/row}} |
| [[Category:Templates]] | | [[Category:Templates]] |
| </noinclude> | | </noinclude> |
THIS TEMPLATE HAS BEEN UPDATED TO WORK WITH FRIENDLY DATA.
ALONG WITH THE COMMODITIESRATIO DATA, UPDATED TO THE FRIENDLY DATA PAGE!
This is the template for the Commodities Ratio Table. It is used to generate the table on the Commodities page.
Updates
Firstly, the data found in the old temporary CommoditiesRatio data page, was added to the Friendly data page.
Therefore, NPCs that had the "Trade=1" parameter, and trade commodities received a new parameter: "Ratios".
They were also adjusted from the older order to the new one.
Data Format
The new datastring order has 7 data columns separated by semicolons. Each column represents the Ratio of said commodity for a specific NPC.
Sacks of Grain;Barrel of Beer;Crates of Wine;Pails of Cider;Shipment of Timber;Crates of Charcoal;Sacks of Salt
The columns are in the following order:
OLD ORDER: Grain;Charcoal;Salt;Timber;Beer;Wine;Cider
OLD Base : 280 ;300 ;400 ;240 ;240 ;360 ;300
NEW ORDER: Grain;Beer;Wine;Cider;Timber;Charcoal;Salt
NEW Base : 280 ;240 ;360 ;300 ;240 ;300 ;400
Usage
Before, there was the possibility to have different "head|{x}" usages. But, after the "Tabber" implementation, there was really no need for multiple parameters.
The idea was to simplify the template to simply {{CommoditiesRatioTable}}, and "control" it with "Tabber", to show specific towns NPCs. But tabber would end up requiring repeated code blocks, therefore killing the purpouse of it.
So the {{CommoditiesRatioTable/head}} & {{CommoditiesRatioTable/row}} templates, where kept.
Examples
| NPCs
|
Sacks of Grain
|
Barrel of Beer
|
Crates of Wine
|
Pails of Cider
|
Shipment of Timber
|
Crates of Charcoal
|
Sacks of Salt
|
 Bert
|
-
|
1.21
|
1.21
|
1.21
|
1.16
|
1.16
|
1.32
|
New implementation
The new implementation used in Commodities, do not define 'town' and uses the "tabber" parser tag, in the page itself, instead of the template.
More information on the "tabber" parser tag, can be found in the Community Portal, under "Tabs".
| NPCs
|
Sacks of Grain
|
Barrel of Beer
|
Crates of Wine
|
Pails of Cider
|
Shipment of Timber
|
Crates of Charcoal
|
Sacks of Salt
|
 Bert
|
-
|
1.21
|
1.21
|
1.21
|
1.16
|
1.16
|
1.32
|
With Tabber implementation
| NPCs
|
Sacks of Grain
|
Barrel of Beer
|
Crates of Wine
|
Pails of Cider
|
Shipment of Timber
|
Crates of Charcoal
|
Sacks of Salt
|
 Bert
|
-
|
1.21
|
1.21
|
1.21
|
1.16
|
1.16
|
1.32
|
 Arenn
|
1.1
|
1.26
|
-
|
-
|
-
|
-
|
1.21
|
| NPCs
|
Sacks of Grain
|
Barrel of Beer
|
Crates of Wine
|
Pails of Cider
|
Shipment of Timber
|
Crates of Charcoal
|
Sacks of Salt
|
 Bert
|
-
|
1.21
|
1.21
|
1.21
|
1.16
|
1.16
|
1.32
|
| NPCs
|
Sacks of Grain
|
Barrel of Beer
|
Crates of Wine
|
Pails of Cider
|
Shipment of Timber
|
Crates of Charcoal
|
Sacks of Salt
|
 Arenn
|
1.1
|
1.26
|
-
|
-
|
-
|
-
|
1.21
|