Template:Quest/template

 {{#ifeq: | 1 |{{#vardefine:QuestNPC|{{#cargo_query:tables=Data_NPC=DN,Data_Quests=DQ|join on=DN.QuestsKeyword HOLDS DQ.Keyword|fields=DN.Namekey|where=DQ.Keyword=""|limit=1|more results text=|default=|no html}} }}{{#vardefine:QuestLocation|{{#cargo_query:tables=Data_Levels=DL,Data_NPC=DN|join on=DL.NpcsKeyword HOLDS DN.Keyword|fields=DL.Namekey|where=DN.QuestsKeyword HOLDS ""|limit=1|more results text=|default=|no html}} }}{{#vardefine:QuestWorld|{{#cargo_query:tables=Data_Levels=DL,Data_NPC=DN|join on=DL.NpcsKeyword HOLDS DN.Keyword|fields=DL.World|where=DN.QuestsKeyword HOLDS ""|default=|no html}} }}{{#vardefine:QuestType|{{#cargo_query:tables=Data_Levels=DL,Data_NPC=DN|join on=DL.NpcsKeyword HOLDS DN.Keyword|fields=DN.EventTag|where=DN.QuestsKeyword HOLDS ""|limit=1|more results text=|default=|no html}} }}{{#vardefine: i | 0 }}{{Quest Infobox }}
 * Image=New Quest.png
 * Keyword=
 * lang=
 * Start={{#var:QuestNPC}}
 * Location=
 * Type=
 * Type2=
 * VIP={{{VIP|}}}
 * Repeatable={{{Repeatable|}}}
 * ParentsKeyword={{{ParentsKeyword|}}}
 * ChildrenKeyword={{{ChildrenKeyword|}}}
 * RewardsExperience={{{RewardsExperience|}}}
 * RewardsGems={{{RewardsGems|}}}
 * RewardsCoins={{{RewardsCoins|}}}
 * RewardsItems0Keyword={{{RewardsItems0Keyword|}}}
 * RewardsItems0Quantity={{{RewardsItems0Quantity|}}}
 * RewardsItems1Keyword={{{RewardsItems1Keyword|}}}
 * RewardsItems1Quantity={{{RewardsItems1Quantity|}}}

{{#if: {{{OfferMessagekey|}}}| {{TT|QuestPage_Introduction|lang=}} {{QuoteNPC|{{LinkNPC|{{{Keyword|}}}|type=quest|lang=}}: {{#arraymap:{{{OfferMessagekey|}}}|,|@@@@|{{GameText|@@@@|y_0= {{LinkNPC|{{{Keyword|}}}|type=quest|lang=}}: |y_1= {{LinkNPC|{{{Keyword|}}}|alt=yes|type=quest|lang=}}: |y_2= {{LinkNPC|{{{Keyword|}}}|alt2=yes|type=quest|lang=}}: |y_3= {{LinkNPC|{{{Keyword|}}}|alt3=yes|type=quest|lang=}}: |lang=}}| }} }}}}{{#if: {{{Descriptionkey|}}}| {{TT|QuestPage_Objective|lang=}} {{GameText|{{{Descriptionkey|}}}|lang=}} }} {{TT|QuestPage_Conditions|lang=}}

{{#switch:{{#explode: {{{Objective0|}}}| |1}} | 1 | 18 |{{#switch:{{#explode:{{{Objective{{#var: i}}|}}}| |1}}|=|TalkTo=|#default= *{{#explode:{{{Objective{{#var: i}}|}}}| |0}} {{Link|{{#explode:{{{Objective{{#var: i}}|}}}| |1}}|lang=}}}} }} }}}}{{#loop: i | 0 | 18 | {{#switch:{{#explode:{{{Objective{{#var: i}}|}}}| |1}}|Fetch|Collected=*{{GameText|lang=|QuestLog_9351|x_0={{#explode:{{{Objective{{#var: i}}|}}}| |2}}|x_1={{Link|lang=|{{#explode:{{{Objective{{#var: i}}|}}}| |3}}}}}}}} }}{{#ifeq:{{#explode:{{{Objective0|}}}| |1}}|TalkToAny|*{{GameText|QuestLog_9356|lang=|x_0= {{#loop: i | 1 | 18 | {{#ifeq:{{{Objective{{#var: i}}|}}}|End| |*{{LinkNPC|type=location|{{#explode:{{{Objective{{#var: i}}|}}}| |0}}}}}} }} }}}}{{#ifeq:{{#explode:{{{Objective1|}}}| |1}}|TalkToAny|*{{GameText|QuestLog_9356|lang=|x_0= {{#loop: i | 1 | 18 | {{#ifeq:{{{Objective{{#var: i}}|}}}|End| |*{{LinkNPC|type=location|{{#explode:{{{Objective{{#var: i}}|}}}| |0}}}}}} }} }}}}{{#ifeq:{{#explode:{{{Objective0|}}}| |1}}|ArrivesAtAny|*{{GameText|QuestLog_9350|lang=|x_0= {{#loop: i | 1 | 18 | {{#ifeq:{{{Objective{{#var: i}}|}}}|End| |*{{GameText|lang=|{{#explode:{{{Objective{{#var: i}}|}}}| |1}}}}}} }} }}}}{{#loop: i | 0 | 18 | {{#ifeq:{{#explode:{{{Objective{{#var: i}}|}}}| |1}}|ArrivesAt|*{{GameText|QuestLog_9349|lang=|x_0={{GameText|lang={{{lang|}}}|{{#explode:{{{Objective{{#var: i}}|}}}| |3}}}}}}}} }}{{#loop: i | 0 | 18 | {{#ifeq:{{#explode:{{{Objective{{#var: i}}|}}}| |1}}|Killed|*{{GameText|QuestLog_9354|x_0={{#explode:{{{Objective{{#var: i}}|}}}| |2}}|x_1={{Link|type=creature|lang={{{lang|}}}|{{#explode:{{{Objective{{#var: i}}|}}}| |3}}}}}}}} }}{{#ifeq:{{#explode:{{{Objective2|}}}| |1}}|KilledAny|{{#switch:{{#explode:{{{Objective3|}}}| |0}}|If|And|Then|End=|#default=*{{GameText|QuestLog_9354|x_0={{#explode:{{{Objective3|}}}| |0}}|x_1={{Link|type=creature|lang={{{lang|}}}|{{#explode:{{{Objective3|}}}| |1}}}}}}}}}}{{#loop: i | 0 | 18 | {{#ifeq:{{#explode:{{{Objective{{#var: i}}|}}}| |1}}|Wear|*{{GameText|QuestLog_9503|x_0={{#switch:{{#explode:{{{Objective{{#var: i}}|}}}| |2}}|Boy|Girl={{Link|{{#explode:{{{Objective{{#var: i}}|}}}| |3}}|lang={{{lang|}}}}}|#default={{Link|{{#explode:{{{Objective{{#var: i}}|}}}| |2}}|lang={{{lang|}}}}}}}}}}} }}{{#loop: i | 0 | 18 | {{#ifeq:{{#explode:{{{Objective{{#var: i}}|}}}| |1}}|TalkTo|*{{GameText|QuestLog_9355|x_0={{LinkNPC|type=location|lang=|{{#explode:{{{Objective{{#var: i}}|}}}| |2}}}}|lang={{{lang|}}}}}}} }} {{#if: {{{ActiveMessagekey|}}}| {{TT|QuestPage_Reminder|lang={{{lang|}}}}} {{QuoteNPC|{{LinkNPC|{{{Keyword|}}}|type=quest|lang={{{lang|}}}}}: {{#arraymap: {{{ActiveMessagekey|}}}|,|@@@@|{{GameText|@@@@|y_0= {{LinkNPC|{{{Keyword|}}}|type=quest|lang={{{lang|}}}}}: |y_1= {{LinkNPC|{{{Keyword|}}}|alt=yes|type=quest|lang={{{lang|}}}}}: |y_2= {{LinkNPC|{{{Keyword|}}}|alt2=yes|type=quest|lang={{{lang|}}}}}: |y_3= {{LinkNPC|{{{Keyword|}}}|alt3=yes|type=quest|lang={{{lang|}}}}}: |lang={{{lang|}}}}}| }} }}}} {{TT|QuestPage_Progress|lang={{{lang|}}}}}/{{TT|QuestPage_Thoughts|lang={{{lang|}}}}} {{#loop: i }}{{#loop: i | 0 | 18 | {{#ifeq:{{#explode:{{{Objective{{#var: i}}|}}}| |1}}|ArrivesAt|*{{GameText|lang={{{lang|}}}|{{#explode:{{{Objective{{#var: i}}|}}}| |3}}}}: {{GameText|lang={{{lang|}}}|{{#explode:{{{Objective{{#var: i}}|}}}| |5}}}}}} }}{{#loop: i | 0 | 18 | {{#ifeq:{{#explode:{{{Objective{{#var: i}}|}}}| |1}}|Killed|*{{Link|type=creature|lang={{{lang|}}}|{{#explode:{{{Objective{{#var: i}}|}}}| |3}}}}: {{GameText|lang={{{lang|}}}|{{#explode:{{{Objective{{#var: i}}|}}}| |5}} }}}} }}{{#loop: i | 0 | 18 | {{#switch:{{#explode:{{{Objective{{#var: i}}|}}}| |1}}|Fetch|Collected={{#ifeq:{{#explode:{{{Objective{{#var: i}}|}}}| |4}}|Think|*{{Link|lang={{{lang|}}}|{{#explode:{{{Objective{{#var: i}}|}}}| |3}}}}: {{GameText|lang={{{lang|}}}|{{#explode:{{{Objective{{#var: i}}|}}}| |5}} }}}}}} }}{{#loop: i | 0 | 18 | {{#ifeq:{{#explode:{{{Objective{{#var: i}}|}}}| |1}}|Wear|{{#ifeq:{{#explode:{{{Objective{{#var: i}}|}}}| |3}}|Think|*{{Link|lang={{{lang|}}}|{{#explode:{{{Objective{{#var: i}}|}}}| |2}}}}: {{GameText|lang={{{lang|}}}|{{#explode:{{{Objective{{#var: i}}|}}}| |4}} }}}}}} }}{{#loop: i | 0 | 18 | {{#if:{{#explode:{{{Objective{{#var: i}}|}}}| |3}}|{{#ifeq:{{#explode:{{{Objective{{#var: i}}|}}}| |1}}|TalkTo|*{{LinkNPC|type=location|lang={{{lang|}}}|{{#explode:{{{Objective{{#var: i}}|}}}| |2}}}}: {{GameText|lang={{{lang|}}}|{{#ifeq:{{#explode:{{{Objective{{#var: i}}|}}}| |3}}|Think|{{#explode:{{{Objective{{#var: i}}|}}}| |4}}|{{#explode:{{{Objective{{#var: i}}|}}}| |3}} }}}}}}}} }}{{#ifeq:{{#explode:{{{Objective2|}}}| |1}}|KilledAny|*{{Link|type=creature|lang={{{lang|}}}|{{#explode:{{{Objective3|}}}| |1}}}}}}: {{GameText|{{#explode:{{{Objective2|}}}}| |4}}|lang={{{lang|}}}}}
 * FetchAny={{GameText|lang=|QuestLog_9352|x_0={{#loop: i
 * 0
 * 19
 * {{#ifeq:{{{Objective{{#var: i}}|}}}|End||*{{LinkNPC|type=location|{{#explode:{{{Objective{{#var: i}}|}}}| |0}}}}}} {{GameText|lang={{{lang|}}}|{{#explode:{{{Objective{{#var: i}}|}}}| |1}}}}

{{#if:| {{TT|QuestPage_Completion|lang={{{lang|}}}}} {{QuoteNPC|{{LinkNPC|{{{Keyword|}}}|type=quest|lang={{{lang|}}}}}: {{#arraymap: |,|@@@@|{{GameText|@@@@|y_0= {{LinkNPC|{{{Keyword|}}}|type=quest|lang={{{lang|}}}}}: |y_1= {{LinkNPC|{{{Keyword|}}}|alt=yes|type=quest|lang={{{lang|}}}}}: |y_2= {{LinkNPC|{{{Keyword|}}}|alt2=yes|type=quest|lang={{{lang|}}}}}: |y_3= {{LinkNPC|{{{Keyword|}}}|alt3=yes|type=quest|lang={{{lang|}}}}}: |lang={{{lang|}}}}}| }} }}}}

{{TT|Quest_Tabber_Desc|lang={{{lang|}}}}} {{#tag:tabber| {{#cargo_query:tables=Data_Quests }} }} }}
 * fields=Keyword,Namekey,Namevalue,Descriptionkey,Repeatable,VIP,RewardsCoins,RewardsExperience,RewardsGems,RewardsItems0Keyword,RewardsItems0Quantity,RewardsItems1Keyword,RewardsItems1Quantity,ParentsKeyword,ChildrenKeyword,OfferMessagekey,Objective0,Objective1,Objective2,Objective3,Objective4,Objective5,Objective6,Objective7,Objective8,Objective9,Objective10,Objective11,Objective12,Objective13,Objective14,Objective15,Objective16,Objective17,Objective18,ActiveMessagekey,CompletedMessagekey
 * where=Namekey=""
 * format=template
 * template=Quest tabber|lang={{{lang|}}}
 * named args=yes

{{#if:| {{TT|Notes|lang={{{lang|}}}}} }}

{{TT|Other_Languages|lang={{{lang|}}}}} {{OtherLanguages|name=|lang={{{lang|}}}}}

{{#ifeq: {{{Type|}}}|Hidden||{{#ifeq: {{#cargo_query:tables=Data_Quests|where=Namekey=""|fields=COUNT(*)|no html|group by=Keyword}} | 1 | {{Weapons Nav }} }}}}
 * title= Link_Quests|lang={{{lang|}}}}}
 * subtitle= {{#if:|{{TT|Category_Quests|x_0={{TT|Event_|lang={{{lang|}}}}}|lang={{{lang|}}}}}|{{TT|NPCPage_Navbox|x_0={{Link||24|lang={{{lang|}}}}}|x_1={{TT|Link_Quests|lang={{{lang|}}}}}|lang={{{lang|}}}}} }}
 * list= {{#if:|{{#cargo_query:tables=Data_Levels=DL,Data_NPC=DN,Data_Quests=DQ|join on=DL.NpcsKeyword HOLDS DN.Keyword,DN.QuestsKeyword HOLDS DQ.Keyword|fields=CONCAT('*$($QL|',DQ.Namekey,'|lang={{{lang|}}}$)$')|where=DN.EventTag="{{#var:QuestType}}"|group by=DQ.Namekey,DQ.Namevalue|order by=DQ.Namevalue|delimiter=|no html}}|{{#cargo_query:tables=Data_Levels=DL,Data_NPC=DN,Data_Quests=DQ|join on=DL.NpcsKeyword HOLDS DN.Keyword,DN.QuestsKeyword HOLDS DQ.Keyword|fields=CONCAT('{{*}}{QL|',DQ.Namekey,'|lang={{{lang|}}}}')|where=DL.Namekey="{{#var:QuestLocation}}" AND DN.EventTag IS NULL|group by=DQ.Namekey,DQ.Namevalue|order by=DQ.Namevalue|delimiter=}} }}

{{Interwiki|{{{Namekey|}}}}}