Module:SkillDetails: Difference between revisions
From Eco - English Wiki
[unchecked revision] | [unchecked revision] |
Adding Credit |
Testing 9.0 data |
||
Line 19: | Line 19: | ||
end | end | ||
function p.benefits( benTable ) | -- function p.benefits( benTable ) | ||
local function istable(t) return type(t) == 'table' end | -- local function istable(t) return type(t) == 'table' end | ||
local builder = '<div style=\"column-count:2;-moz-column-count:2;-webkit-column-count:2\"><small>' | -- local builder = '<div style=\"column-count:2;-moz-column-count:2;-webkit-column-count:2\"><small>' | ||
-- for i,v in pairs(benTable) do | |||
end | -- builder = builder .. '\n* \'\'\'[[' .. i .. ']]\'\'\': ' | ||
-- local count = 1 | |||
-- for a,b in ipairs(v) do | |||
-- if istable(b) then | |||
-- for c,d in ipairs(b) do | |||
-- if c == 1 then | |||
-- builder = builder .. '\'\'[[' .. d .. ']]\'\'' | |||
-- if count ~= #v then | |||
-- builder = builder .. ' and ' | |||
-- end | |||
-- if count == #v then | |||
-- builder = builder .. ' cost and craft time ' .. b[2]:lower() | |||
-- if b[3] ~= nil then | |||
-- builder = builder .. ' by ' .. b[3] | |||
-- end | |||
-- end | |||
-- count = count + 1 | |||
-- end | |||
-- end | |||
-- else | |||
-- if a == 1 then | |||
-- builder = builder .. b | |||
-- end | |||
-- if a == 2 then | |||
-- builder = builder .. ' ' .. b:lower() | |||
-- if v[3] ~= nil then | |||
-- builder = builder .. ' by ' | |||
-- end | |||
-- end | |||
-- if a == 3 then | |||
-- builder = builder .. b .. '. <br />' | |||
-- end | |||
-- end | |||
-- end | |||
-- end | |||
-- Main entry point for the Module | -- Main entry point for the Module | ||
Line 76: | Line 75: | ||
-- load list of recipes | -- load list of recipes | ||
local skillData = require( "Module: | local skillData = require( "Module:TestSkills" ) | ||
local skillTable = skillData.skills[skill] | local skillTable = skillData.skills[skill] | ||
if skillTable == nil then | if skillTable == nil then | ||
Line 92: | Line 91: | ||
wikibox = wikibox .. '| 0 \n' | wikibox = wikibox .. '| 0 \n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | if skillTable.childSkills ~= nil then | ||
for i,v in pairs(skillTable. | for i,v in pairs(skillTable.childSkills) do | ||
wikibox = wikibox .. skillTable. | wikibox = wikibox .. skillTable.childSkills[i] .. '<br />' | ||
end | end | ||
end | end | ||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
wikibox = wikibox .. '|}\n\n' | wikibox = wikibox .. '|}\n\n' | ||
end | end | ||
-- Specialty | -- Specialty | ||
if skillTable.root ~= true and skillTable.specialty == true then | if skillTable.root ~= true and skillTable.specialty == true then | ||
local anyBenefits = skillTable. | local anyBenefits = nil | ||
-- local anyBenefits = skillTable.benefits.level1 ~= nil or skillTable.benefits.level2 ~= nil or skillTable.benefits.level3 ~= nil or skillTable.benefits.level4 ~= nil or skillTable.benefits.level5 ~= nil or skillTable.benefits.level6 ~= nil or skillTable.benefits.level7 nil | |||
local anyTalents = skillTable.talents.level0 ~= nil or skillTable.talents.level1 ~= nil or skillTable.talents.level2 ~= nil or skillTable.talents.level3 ~= nil or skillTable.talents.level4 ~= nil or skillTable.talents.level5 ~= nil or skillTable.talents.level6 ~= nil or skillTable.talents.level7 ~= nil | |||
--Headings | |||
wikibox = wikibox .. '==Unlocks==\n' | wikibox = wikibox .. '==Unlocks==\n' | ||
wikibox = wikibox .. '{| class=\"wikitable\" \n' | wikibox = wikibox .. '{| class=\"wikitable\" \n' | ||
wikibox = wikibox .. '! Level \n' | wikibox = wikibox .. '! Level \n' | ||
wikibox = wikibox .. '! Crafting Unlocks \n' | wikibox = wikibox .. '! Crafting Unlocks \n' | ||
wikibox = wikibox .. '! Talent Unlocks \n' | |||
if anyBenefits then | if anyBenefits then | ||
wikibox = wikibox .. '! Benefits \n' | wikibox = wikibox .. '! Benefits \n' | ||
end | end | ||
--Level 0 | |||
wikibox = wikibox .. '|- \n' | wikibox = wikibox .. '|- \n' | ||
wikibox = wikibox .. '| 0\n' | wikibox = wikibox .. '| 0\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | --Crafting 0 | ||
if skillTable. | if skillTable.recipes.level0 ~= nil then | ||
for i,v in pairs(skillTable. | if skillTable.recipes.level0 ~= nil then | ||
wikibox = wikibox .. skillTable. | for i,v in pairs(skillTable.recipes.level0) do | ||
end | wikibox = wikibox .. skillTable.recipes.level0[i] .. '<br />' | ||
end | |||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
Line 129: | Line 134: | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
end | end | ||
--Talent 0 | |||
if anyTalents then | |||
if skillTable.talents.level0 ~= nil then | |||
if skillTable.talents.level0 ~= nil then | |||
for i,v in pairs(skillTable.talents.level0) do | |||
wikibox = wikibox .. skillTable.talents.level0[i] .. '<br />' | |||
end | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
else | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
end | |||
--Benefits 0 | |||
if anyBenefits then | if anyBenefits then | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | if skillTable.benefits.level0 ~= nil then | ||
wikibox = wikibox .. p.benefits( skillTable. | wikibox = wikibox .. p.benefits( skillTable.benefits.level0 ) | ||
end | end | ||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
end | end | ||
--Level 1 | |||
wikibox = wikibox .. '|- \n' | wikibox = wikibox .. '|- \n' | ||
wikibox = wikibox .. '| 1\n' | wikibox = wikibox .. '| 1\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | --Crafting 1 | ||
if skillTable. | if skillTable.recipes.level1 ~= nil then | ||
for i,v in pairs(skillTable. | if skillTable.recipes.level1 ~= nil then | ||
wikibox = wikibox .. skillTable. | for i,v in pairs(skillTable.recipes.level1) do | ||
end | wikibox = wikibox .. skillTable.recipes.level1[i] .. '<br />' | ||
end | |||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
Line 153: | Line 175: | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
end | end | ||
--Talent 1 | |||
if anyTalents then | |||
if skillTable.talents.level1 ~= nil then | |||
if skillTable.talents.level1 ~= nil then | |||
for i,v in pairs(skillTable.talents.level1) do | |||
wikibox = wikibox .. skillTable.talents.level1[i] .. '<br />' | |||
end | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
else | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
end | |||
--Benefits 1 | |||
if anyBenefits then | if anyBenefits then | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | if skillTable.benefits.level1 ~= nil then | ||
wikibox = wikibox .. p.benefits( skillTable. | wikibox = wikibox .. p.benefits( skillTable.benefits.level1 ) | ||
end | end | ||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
end | end | ||
wikibox = wikibox .. '|- \n' | --Level 2 | ||
wikibox = wikibox .. '|- \n' | |||
wikibox = wikibox .. '| 2\n' | wikibox = wikibox .. '| 2\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | --Crafting 2 | ||
if skillTable. | if skillTable.recipes.level2 ~= nil then | ||
for i,v in pairs(skillTable. | if skillTable.recipes.level2 ~= nil then | ||
wikibox = wikibox .. skillTable. | for i,v in pairs(skillTable.recipes.level2) do | ||
end | wikibox = wikibox .. skillTable.recipes.level2[i] .. '<br />' | ||
end | |||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
Line 176: | Line 216: | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
end | end | ||
--Talent 2 | |||
if anyTalents then | |||
if skillTable.talents.level2 ~= nil then | |||
if skillTable.talents.level2 ~= nil then | |||
for i,v in pairs(skillTable.talents.level2) do | |||
wikibox = wikibox .. skillTable.talents.level2[i] .. '<br />' | |||
end | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
else | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
end | |||
--Benefits 2 | |||
if anyBenefits then | if anyBenefits then | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | if skillTable.benefits.level2 ~= nil then | ||
wikibox = wikibox .. p.benefits( skillTable. | wikibox = wikibox .. p.benefits( skillTable.benefits.level2 ) | ||
end | end | ||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
end | end | ||
wikibox = wikibox .. '|- \n' | --Level 3 | ||
wikibox = wikibox .. '|- \n' | |||
wikibox = wikibox .. '| 3\n' | wikibox = wikibox .. '| 3\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | --Crafting 3 | ||
if skillTable. | if skillTable.recipes.level3 ~= nil then | ||
for i,v in pairs(skillTable. | if skillTable.recipes.level3 ~= nil then | ||
wikibox = wikibox .. skillTable. | for i,v in pairs(skillTable.recipes.level3) do | ||
end | wikibox = wikibox .. skillTable.recipes.level3[i] .. '<br />' | ||
end | |||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
Line 199: | Line 257: | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
end | end | ||
--Talent 3 | |||
if anyTalents then | |||
if skillTable.talents.level3 ~= nil then | |||
if skillTable.talents.level3 ~= nil then | |||
for i,v in pairs(skillTable.talents.level3) do | |||
wikibox = wikibox .. skillTable.talents.level3[i] .. '<br />' | |||
end | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
else | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
end | |||
--Benefits 3 | |||
if anyBenefits then | if anyBenefits then | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | if skillTable.benefits.level3 ~= nil then | ||
wikibox = wikibox .. p.benefits( skillTable. | wikibox = wikibox .. p.benefits( skillTable.benefits.level3 ) | ||
end | end | ||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
end | end | ||
wikibox = wikibox .. '|- \n' | --Level 4 | ||
wikibox = wikibox .. '|- \n' | |||
wikibox = wikibox .. '| 4\n' | wikibox = wikibox .. '| 4\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | --Crafting 4 | ||
if skillTable. | if skillTable.recipes.level4 ~= nil then | ||
for i,v in pairs(skillTable. | if skillTable.recipes.level4 ~= nil then | ||
wikibox = wikibox .. skillTable. | for i,v in pairs(skillTable.recipes.level4) do | ||
end | wikibox = wikibox .. skillTable.recipes.level4[i] .. '<br />' | ||
end | |||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
Line 222: | Line 298: | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
end | end | ||
--Talent 4 | |||
if anyTalents then | |||
if skillTable.talents.level4 ~= nil then | |||
if skillTable.talents.level4 ~= nil then | |||
for i,v in pairs(skillTable.talents.level4) do | |||
wikibox = wikibox .. skillTable.talents.level4[i] .. '<br />' | |||
end | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
else | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
end | |||
--Benefits 4 | |||
if anyBenefits then | if anyBenefits then | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | if skillTable.benefits.level4 ~= nil then | ||
wikibox = wikibox .. p.benefits( skillTable. | wikibox = wikibox .. p.benefits( skillTable.benefits.level4 ) | ||
end | end | ||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
end | end | ||
wikibox = wikibox .. '|- \n' | --Level 5 | ||
wikibox = wikibox .. '|- \n' | |||
wikibox = wikibox .. '| 5\n' | wikibox = wikibox .. '| 5\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | --Crafting 5 | ||
if skillTable. | if skillTable.recipes.level5 ~= nil then | ||
for i,v in pairs(skillTable. | if skillTable.recipes.level5 ~= nil then | ||
wikibox = wikibox .. skillTable. | for i,v in pairs(skillTable.recipes.level5) do | ||
end | wikibox = wikibox .. skillTable.recipes.level5[i] .. '<br />' | ||
end | |||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
Line 245: | Line 339: | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
end | end | ||
--Talent 5 | |||
if anyTalents then | |||
if skillTable.talents.level5 ~= nil then | |||
if skillTable.talents.level5 ~= nil then | |||
for i,v in pairs(skillTable.talents.level5) do | |||
wikibox = wikibox .. skillTable.talents.level5[i] .. '<br />' | |||
end | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
else | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
end | |||
--Benefits 5 | |||
if anyBenefits then | if anyBenefits then | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | if skillTable.benefits.level5 ~= nil then | ||
wikibox = wikibox .. p.benefits( skillTable. | wikibox = wikibox .. p.benefits( skillTable.benefits.level5 ) | ||
end | end | ||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
end | end | ||
--Level 6 | |||
wikibox = wikibox .. '|- \n' | wikibox = wikibox .. '|- \n' | ||
wikibox = wikibox .. '| 6\n' | wikibox = wikibox .. '| 6\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | --Crafting 6 | ||
if skillTable. | if skillTable.recipes.level6 ~= nil then | ||
for i,v in pairs(skillTable. | if skillTable.recipes.level6 ~= nil then | ||
wikibox = wikibox .. skillTable. | for i,v in pairs(skillTable.recipes.level6) do | ||
end | wikibox = wikibox .. skillTable.recipes.level6[i] .. '<br />' | ||
end | |||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
Line 269: | Line 380: | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
end | end | ||
--Talent 6 | |||
if anyTalents then | |||
if skillTable.talents.level6 ~= nil then | |||
if skillTable.talents.level6 ~= nil then | |||
for i,v in pairs(skillTable.talents.level6) do | |||
wikibox = wikibox .. skillTable.talents.level6[i] .. '<br />' | |||
end | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
else | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
end | |||
--Benefits 6 | |||
if anyBenefits then | if anyBenefits then | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | if skillTable.benefits.level6 ~= nil then | ||
wikibox = wikibox .. p.benefits( skillTable. | wikibox = wikibox .. p.benefits( skillTable.benefits.level6 ) | ||
end | end | ||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
end | end | ||
wikibox = wikibox .. '|- \n' | --Level 7 | ||
wikibox = wikibox .. '|- \n' | |||
wikibox = wikibox .. '| 7\n' | wikibox = wikibox .. '| 7\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | --Crafting 7 | ||
if skillTable. | if skillTable.recipes.level7 ~= nil then | ||
for i,v in pairs(skillTable. | if skillTable.recipes.level7 ~= nil then | ||
wikibox = wikibox .. skillTable. | for i,v in pairs(skillTable.recipes.level7) do | ||
end | wikibox = wikibox .. skillTable.recipes.level7[i] .. '<br />' | ||
end | |||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
Line 292: | Line 421: | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
end | end | ||
--Talent 7 | |||
if anyTalents then | |||
if skillTable.talents.level7 ~= nil then | |||
if skillTable.talents.level7 ~= nil then | |||
for i,v in pairs(skillTable.talents.level7) do | |||
wikibox = wikibox .. skillTable.talents.level7[i] .. '<br />' | |||
end | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
else | |||
wikibox = wikibox .. '\n' | |||
wikibox = wikibox .. '| ' | |||
end | |||
end | |||
--Benefits 7 | |||
if anyBenefits then | if anyBenefits then | ||
wikibox = wikibox .. '| ' | wikibox = wikibox .. '| ' | ||
if skillTable. | if skillTable.benefits.level7 ~= nil then | ||
wikibox = wikibox .. p.benefits( skillTable. | wikibox = wikibox .. p.benefits( skillTable.benefits.level7 ) | ||
end | end | ||
wikibox = wikibox .. '\n' | wikibox = wikibox .. '\n' | ||
end | end | ||
wikibox = wikibox .. '|}\n\n' | wikibox = wikibox .. '|}\n\n' |
Revision as of 04:45, 28 August 2020
This module provides the back end functionality of the Template:SkillDetails.
If the template is passed, this module creates a list using details from the following Modules:
Credit
Original SkillDetails was created by Fyre (FishAus) then edited by Scotty (ZeelNightwolf).
-- Credit: Original SkillDetails was created by Fyre (FishAus) then edited by Scotty (ZeelNightwolf).
local p = {}
-- Grabs args from the parent frame
-- Trims and parses the args into a table, then returns the table
function norm()
local origArgs = mw.getCurrentFrame():getParent().args
local args = {}
for k, v in pairs( origArgs ) do
v = mw.text.trim( tostring( v ) )
if v ~= '' then
args[k] = v
end
end
return args
end
-- function p.benefits( benTable )
-- local function istable(t) return type(t) == 'table' end
-- local builder = '<div style=\"column-count:2;-moz-column-count:2;-webkit-column-count:2\"><small>'
-- for i,v in pairs(benTable) do
-- builder = builder .. '\n* \'\'\'[[' .. i .. ']]\'\'\': '
-- local count = 1
-- for a,b in ipairs(v) do
-- if istable(b) then
-- for c,d in ipairs(b) do
-- if c == 1 then
-- builder = builder .. '\'\'[[' .. d .. ']]\'\''
-- if count ~= #v then
-- builder = builder .. ' and '
-- end
-- if count == #v then
-- builder = builder .. ' cost and craft time ' .. b[2]:lower()
-- if b[3] ~= nil then
-- builder = builder .. ' by ' .. b[3]
-- end
-- end
-- count = count + 1
-- end
-- end
-- else
-- if a == 1 then
-- builder = builder .. b
-- end
-- if a == 2 then
-- builder = builder .. ' ' .. b:lower()
-- if v[3] ~= nil then
-- builder = builder .. ' by '
-- end
-- end
-- if a == 3 then
-- builder = builder .. b .. '. <br />'
-- end
-- end
-- end
-- end
-- Main entry point for the Module
function p.main()
-- get args from the Template
local args = norm()
if args.skill == nil or args.skill == '' then
return '\'skill\' must be specified.'
end
-- assign variables for plant
local skill = args.skill
-- load list of recipes
local skillData = require( "Module:TestSkills" )
local skillTable = skillData.skills[skill]
if skillTable == nil then
return skill .. ' could not be found in Module:Skills.'
end
local wikibox = ''
-- Profession Skill
if skillTable.root == true then
wikibox = wikibox .. '==Unlocks==\n'
wikibox = wikibox .. '{| class=\"wikitable\" \n'
wikibox = wikibox .. '! style="width: 5em; text-align: center;" |Level \n'
wikibox = wikibox .. '! style="width: 10em;" |Skill Unlocks \n'
wikibox = wikibox .. '|- \n'
wikibox = wikibox .. '| 0 \n'
wikibox = wikibox .. '| '
if skillTable.childSkills ~= nil then
for i,v in pairs(skillTable.childSkills) do
wikibox = wikibox .. skillTable.childSkills[i] .. '<br />'
end
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '|}\n\n'
end
-- Specialty
if skillTable.root ~= true and skillTable.specialty == true then
local anyBenefits = nil
-- local anyBenefits = skillTable.benefits.level1 ~= nil or skillTable.benefits.level2 ~= nil or skillTable.benefits.level3 ~= nil or skillTable.benefits.level4 ~= nil or skillTable.benefits.level5 ~= nil or skillTable.benefits.level6 ~= nil or skillTable.benefits.level7 nil
local anyTalents = skillTable.talents.level0 ~= nil or skillTable.talents.level1 ~= nil or skillTable.talents.level2 ~= nil or skillTable.talents.level3 ~= nil or skillTable.talents.level4 ~= nil or skillTable.talents.level5 ~= nil or skillTable.talents.level6 ~= nil or skillTable.talents.level7 ~= nil
--Headings
wikibox = wikibox .. '==Unlocks==\n'
wikibox = wikibox .. '{| class=\"wikitable\" \n'
wikibox = wikibox .. '! Level \n'
wikibox = wikibox .. '! Crafting Unlocks \n'
wikibox = wikibox .. '! Talent Unlocks \n'
if anyBenefits then
wikibox = wikibox .. '! Benefits \n'
end
--Level 0
wikibox = wikibox .. '|- \n'
wikibox = wikibox .. '| 0\n'
wikibox = wikibox .. '| '
--Crafting 0
if skillTable.recipes.level0 ~= nil then
if skillTable.recipes.level0 ~= nil then
for i,v in pairs(skillTable.recipes.level0) do
wikibox = wikibox .. skillTable.recipes.level0[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
--Talent 0
if anyTalents then
if skillTable.talents.level0 ~= nil then
if skillTable.talents.level0 ~= nil then
for i,v in pairs(skillTable.talents.level0) do
wikibox = wikibox .. skillTable.talents.level0[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
end
--Benefits 0
if anyBenefits then
wikibox = wikibox .. '| '
if skillTable.benefits.level0 ~= nil then
wikibox = wikibox .. p.benefits( skillTable.benefits.level0 )
end
wikibox = wikibox .. '\n'
end
--Level 1
wikibox = wikibox .. '|- \n'
wikibox = wikibox .. '| 1\n'
wikibox = wikibox .. '| '
--Crafting 1
if skillTable.recipes.level1 ~= nil then
if skillTable.recipes.level1 ~= nil then
for i,v in pairs(skillTable.recipes.level1) do
wikibox = wikibox .. skillTable.recipes.level1[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
--Talent 1
if anyTalents then
if skillTable.talents.level1 ~= nil then
if skillTable.talents.level1 ~= nil then
for i,v in pairs(skillTable.talents.level1) do
wikibox = wikibox .. skillTable.talents.level1[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
end
--Benefits 1
if anyBenefits then
wikibox = wikibox .. '| '
if skillTable.benefits.level1 ~= nil then
wikibox = wikibox .. p.benefits( skillTable.benefits.level1 )
end
wikibox = wikibox .. '\n'
end
--Level 2
wikibox = wikibox .. '|- \n'
wikibox = wikibox .. '| 2\n'
wikibox = wikibox .. '| '
--Crafting 2
if skillTable.recipes.level2 ~= nil then
if skillTable.recipes.level2 ~= nil then
for i,v in pairs(skillTable.recipes.level2) do
wikibox = wikibox .. skillTable.recipes.level2[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
--Talent 2
if anyTalents then
if skillTable.talents.level2 ~= nil then
if skillTable.talents.level2 ~= nil then
for i,v in pairs(skillTable.talents.level2) do
wikibox = wikibox .. skillTable.talents.level2[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
end
--Benefits 2
if anyBenefits then
wikibox = wikibox .. '| '
if skillTable.benefits.level2 ~= nil then
wikibox = wikibox .. p.benefits( skillTable.benefits.level2 )
end
wikibox = wikibox .. '\n'
end
--Level 3
wikibox = wikibox .. '|- \n'
wikibox = wikibox .. '| 3\n'
wikibox = wikibox .. '| '
--Crafting 3
if skillTable.recipes.level3 ~= nil then
if skillTable.recipes.level3 ~= nil then
for i,v in pairs(skillTable.recipes.level3) do
wikibox = wikibox .. skillTable.recipes.level3[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
--Talent 3
if anyTalents then
if skillTable.talents.level3 ~= nil then
if skillTable.talents.level3 ~= nil then
for i,v in pairs(skillTable.talents.level3) do
wikibox = wikibox .. skillTable.talents.level3[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
end
--Benefits 3
if anyBenefits then
wikibox = wikibox .. '| '
if skillTable.benefits.level3 ~= nil then
wikibox = wikibox .. p.benefits( skillTable.benefits.level3 )
end
wikibox = wikibox .. '\n'
end
--Level 4
wikibox = wikibox .. '|- \n'
wikibox = wikibox .. '| 4\n'
wikibox = wikibox .. '| '
--Crafting 4
if skillTable.recipes.level4 ~= nil then
if skillTable.recipes.level4 ~= nil then
for i,v in pairs(skillTable.recipes.level4) do
wikibox = wikibox .. skillTable.recipes.level4[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
--Talent 4
if anyTalents then
if skillTable.talents.level4 ~= nil then
if skillTable.talents.level4 ~= nil then
for i,v in pairs(skillTable.talents.level4) do
wikibox = wikibox .. skillTable.talents.level4[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
end
--Benefits 4
if anyBenefits then
wikibox = wikibox .. '| '
if skillTable.benefits.level4 ~= nil then
wikibox = wikibox .. p.benefits( skillTable.benefits.level4 )
end
wikibox = wikibox .. '\n'
end
--Level 5
wikibox = wikibox .. '|- \n'
wikibox = wikibox .. '| 5\n'
wikibox = wikibox .. '| '
--Crafting 5
if skillTable.recipes.level5 ~= nil then
if skillTable.recipes.level5 ~= nil then
for i,v in pairs(skillTable.recipes.level5) do
wikibox = wikibox .. skillTable.recipes.level5[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
--Talent 5
if anyTalents then
if skillTable.talents.level5 ~= nil then
if skillTable.talents.level5 ~= nil then
for i,v in pairs(skillTable.talents.level5) do
wikibox = wikibox .. skillTable.talents.level5[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
end
--Benefits 5
if anyBenefits then
wikibox = wikibox .. '| '
if skillTable.benefits.level5 ~= nil then
wikibox = wikibox .. p.benefits( skillTable.benefits.level5 )
end
wikibox = wikibox .. '\n'
end
--Level 6
wikibox = wikibox .. '|- \n'
wikibox = wikibox .. '| 6\n'
wikibox = wikibox .. '| '
--Crafting 6
if skillTable.recipes.level6 ~= nil then
if skillTable.recipes.level6 ~= nil then
for i,v in pairs(skillTable.recipes.level6) do
wikibox = wikibox .. skillTable.recipes.level6[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
--Talent 6
if anyTalents then
if skillTable.talents.level6 ~= nil then
if skillTable.talents.level6 ~= nil then
for i,v in pairs(skillTable.talents.level6) do
wikibox = wikibox .. skillTable.talents.level6[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
end
--Benefits 6
if anyBenefits then
wikibox = wikibox .. '| '
if skillTable.benefits.level6 ~= nil then
wikibox = wikibox .. p.benefits( skillTable.benefits.level6 )
end
wikibox = wikibox .. '\n'
end
--Level 7
wikibox = wikibox .. '|- \n'
wikibox = wikibox .. '| 7\n'
wikibox = wikibox .. '| '
--Crafting 7
if skillTable.recipes.level7 ~= nil then
if skillTable.recipes.level7 ~= nil then
for i,v in pairs(skillTable.recipes.level7) do
wikibox = wikibox .. skillTable.recipes.level7[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
--Talent 7
if anyTalents then
if skillTable.talents.level7 ~= nil then
if skillTable.talents.level7 ~= nil then
for i,v in pairs(skillTable.talents.level7) do
wikibox = wikibox .. skillTable.talents.level7[i] .. '<br />'
end
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
else
wikibox = wikibox .. '\n'
wikibox = wikibox .. '| '
end
end
--Benefits 7
if anyBenefits then
wikibox = wikibox .. '| '
if skillTable.benefits.level7 ~= nil then
wikibox = wikibox .. p.benefits( skillTable.benefits.level7 )
end
wikibox = wikibox .. '\n'
end
wikibox = wikibox .. '|}\n\n'
end
return wikibox
end
return p