Template:RegionalNPCs: Difference between revisions

From IdleOn MMO Wiki
m (Removed an empty row)
m (Template now uses array maps to allow for like query and remove necessity of quotation marks in parameters)
Line 2: Line 2:
{{#cargo_query:tables=NPCs
{{#cargo_query:tables=NPCs
|fields=_pageName=%PAGE%,MapLocation=location,QuestCount=noquest
|fields=_pageName=%PAGE%,MapLocation=location,QuestCount=noquest
|where=MapLocation IN ({{{areas|"Blunder Hills"}}}) AND (NPCType IN ({{{npctypes|"NPC"}}}))
|where=({{#arraymap:{{{areas|Blunder Hills}}}|,|x|MapLocation LIKE "%x%"|\sOR\s}}) AND (NPCType IN ({{#arraymap:{{{npctypes|NPC}}}|,|x|"x"}}))
|format=template
|format=template
|template=Npc/row
|template=Npc/row
Line 12: Line 12:
Renders name, icon, location and amount of quests as taken from the "NPCs" Cargo table, filtered by certain parameters listed below.
Renders name, icon, location and amount of quests as taken from the "NPCs" Cargo table, filtered by certain parameters listed below.


Note: Areas and NPC types have to be wrapped with quotation marks, due to their usage in a cargo query, where missing quoation marks would otherwise break said query
Notes: Both Areas and NPC types have to be separated by comma and '''not''' use quotation marks.


Usage:
Usage:
Line 18: Line 18:
{{RegionalNPCs
{{RegionalNPCs
|region=example  
|region=example  
|areas="example","example"
|areas=example,example
|npctypes="example","example" (If ommited, defaults to just "NPC")
|npctypes=example,example (If ommited, defaults to just "NPC")
}}
}}
</pre>
</pre>
[[Category:Table templates]]
[[Category:Table templates]]
</noinclude>
</noinclude>

Revision as of 17:05, 18 May 2023

Renders name, icon, location and amount of quests as taken from the "NPCs" Cargo table, filtered by certain parameters listed below.

Notes: Both Areas and NPC types have to be separated by comma and not use quotation marks.

Usage:

{{RegionalNPCs
|region=example 
|areas=example,example
|npctypes=example,example (If ommited, defaults to just "NPC")
}}