Editing Module:QuestList

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
require('strict')
require('strict')
require('Module:Mw.html extension')
require('Module:Mw.html extension')
local purge = require('Module:Purge')._purge
local parse = require('Module:Param Parse')
local parse = require('Module:Param Parse')


Line 24: Line 23:
local table = mw.html.create('table')
local table = mw.html.create('table')
:addClass('wikitable quest-table align-center-2 align-center-3 align-left-4')
if (episodes == nil) then
:css{
table:wikitext("No quests available for " .. args.episode .. " " .. purge('source-'..mw.uri.anchorEncode(args.episode), '(update)', 'span'))
['width'] = '55%'
else
table
}
:attr{ cellspacing = '3' }
:addClass('wikitable quest-table align-center-2 align-center-3 align-left-4')
:css{
for _, episode in ipairs(episodes) do
['width'] = '65%'
}
table
:tag('tr')
:attr{ cellspacing = '3' }
:tag('th')
:attr('colspan', 4)
for _, episode in ipairs(episodes) do
:wikitextIf(episode.Premium == true, '[[File:Premium Pass icon.png|16px]] ')
table
:wikitext('[[File:'.. episode.Name ..' episode icon.png|16px]] ' .. episode[1])
:tag('tr')
:tag('th')
:attr('colspan', 4)
:wikitextIf(episode.Premium == true, '[[File:Premium Pass icon.png|16px]] ')
:wikitext('[[File:'.. episode.Name ..' episode icon.png|16px]] ' .. episode[1])
:done()
:done()
:done()
:tag('tr')
:done()
:tag('th')
:tag('tr')
:wikitext('Quest')
:tag('th')
:done()
:wikitext('Quest')
:tag('th')
:wikitext('Type')
:done()
:tag('th')
:wikitext('Difficulty')
:done()
:tag('th')
:wikitext('Requirements')
:done()
:done()
:done()
:tag('th')
:wikitext('Type')
:done()
:tag('th')
:wikitext('Difficulty')
:done()
:tag('th')
:wikitext('Requirements')
:done()
:done()
if ( episode ) then
-- get all quests for episode --
local quests = mw.smw.ask{
'[[Category:Quests]]',
'[[Name::+]]',
('[[Episode::%s]]'):format( episode.Name ),
'?Quest type',
'?Difficulty',
'?Requirements',
'order=asc',
'sort=Quest type,override_seq,Difficulty'
}
if ( episode ) then
if ( quests ) then
-- get all quests for episode --
-- get quests for episode --
for _, quest in ipairs( quests ) do
local quests = mw.smw.ask{
'[[Category:Quests]]',
table
'[[Name::+]]',
:tag('tr')
:tag('td')
('[[Episode::%s]]'):format( episode.Name ),
'?Quest type',
:wikitext( quest[1] )
'?Difficulty',
:done()
'?Requirements',
:tag('td')
'order=asc',
:css {
['width'] = '50px'
'sort=Quest type,override_seq,Difficulty'
}
}
:wikitext( quest['Quest type'] )
if ( quests ) then
:done()
:tag('td')
-- get quests for episode --
:wikitext( parse.difficulty_func( tostring(quest.Difficulty ) ) )
for _, quest in ipairs( quests ) do
table
:done()
:tag('tr')
:tag('td')
:tag('td')
:css {
:wikitext( quest[1] )
['width'] = '55%'
:done()
}
:tag('td')
:tag('div')
:css {
:addClass('lighttable checklist')
['width'] = '50px'
:newline()
}
:wikitext( quest.Requirements )
:wikitext( quest['Quest type'] )
:newline()
:done()
:tag('td')
:wikitext( parse.difficulty_func( tostring(quest.Difficulty ) ) )
:done()
:tag('td')
:css {
['width'] = '55%'
}
:tag('div')
:addClass('lighttable checklist')
:newline()
:wikitext( quest.Requirements )
:newline()
:done()
:done()
:done()
:done()
:done()
end
:done()
end
end
end
end
end
end
end
table:done()
table:done()
end
return table


return table
end
end


Please note that all contributions to Brighter Shores Wiki are considered to be released under the CC BY-NC-SA 3.0 (see Brighter Shores:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template

Template used on this page: