Template:FollowerList
local p = {}
function p.singleCreature(frame)
local creatureName = frame.args[1] local creatureType = frame.args[2] local imageOverride = frame.args[3] local namespace = frame.args[4] local iconImage = ""
local wikiTable = "" local array -- Change the array being pulled from if a valid creatureType is provided, also formats the creatureType to be used in Err messages and sets an iconImage if string.find(string.lower(creatureType),"strangeland") then array = mw.loadData("Module:StrangelandsCreatureData") creatureType = " " .. creatureType .. ""
iconImage = "

"
elseif string.find(string.lower(creatureType),"ship") then array = mw.loadData("Module:ShipCreatureData") creatureType = " " .. creatureType .. ""
iconImage = "

"
else array = mw.loadData("Module:WildCreatureData") -- Array containing wild creature data from another module creatureType = " wild " end
local creature = array[creatureName]
if creature then local formmatedName = string.gsub(string.lower(creatureName), "%s+", "") local imageName = string.gsub(formmatedName, "%p+", "") .. ".jpg"
if imageOverride and imageOverride ~= "" then imageName = imageOverride end
-- Automaticly add categories if namespace == "" or namespace == nil then wikiTable = wikiTable .. "" wikiTable = wikiTable .. ""
if creature.bosstype ~= "" then wikiTable = wikiTable .. "" end end
wikiTable = [=[
[[File:]=] ..
imageName .. [=[|link=]] | ]=] ..
iconImage .. [=[ | |||||||
---|---|---|---|---|---|---|---|---|
[[]=] .. creatureName .. [=[]] | ||||||||
Slayer | Difficulty | Gold Value | Hits | Melee Damage | Wrestling | Armor | Magic Resist | |
]=] .. creature.slayer .. [=[ | ]=] .. creature.difficulty .. [=[ | ]=] .. creature.goldvalue .. [=[ | ]=] .. creature.hits .. [=[ | ]=] .. creature.minmeleedmg .. creature.maxmeleedmg .. [=[ | ]=] .. creature.wrestling .. [=[ | ]=] .. creature.armor .. creature.armormin .. [=[ | ]=] .. creature.magicresist .. creature.magicresistmin .. [=[ | |
Parry | Attack Speed | Magery | Spell Damage | Poison | Poison Resist | Stealth | AI | |
]=] .. creature.parry .. [=[ | ]=] .. creature.atkspd .. [=[ | ]=] .. creature.magery .. [=[ | ]=] .. creature.minspelldmg .. creature.maxspelldmg .. [=[ | ]=] .. creature.poisontype .. [=[ | ]=] .. creature.poisonresist .. creature.poisonresistmin .. [=[ | ]=] .. creature.stealth .. [=[ | ]=] .. creature.ai .. " |
"
return wikiTable else
return '
Creature Table Template Error: No' .. creatureType .. 'creature by the name "' .. creatureName .. '" was found (Case-sensitive)
'
end
end
function p.singleFollower(frame)
local creatureArray = mw.loadData("Module:WildCreatureData") local tameableArray = mw.loadData("Module:TameableCreatureData") local summonArray = mw.loadData("Module:SummonableCreatureData")
-- Parameters passed when the function is invoked local followerName = frame.args[1] -- Sun Wyrm local followerType = frame.args[2] -- tame/summon local imageOverride = frame.args[3] -- sunwyrm.png local namespace = frame.args[4] -- Template
local wikiTable = ""
local creature = creatureArray[followerName] local tameable = tameableArray[followerName] local summon = summonArray[followerName]
if not string.find(string.lower(followerType),"summon") and tameable then local formmatedName = string.gsub(string.lower(followerName), "%s+", "") local imageName = string.gsub(formmatedName, "%p+", "") .. ".jpg"
if imageOverride and imageOverride ~= "" then imageName = imageOverride end
-- Automaticlly add categories if namespace == "" or namespace == nil then if creature then wikiTable = wikiTable .. "" wikiTable = wikiTable .. "" end wikiTable = wikiTable .. "" wikiTable = wikiTable .. "" wikiTable = wikiTable .. "" end
wikiTable = [=[
[[File:]=] ..
imageName .. [=[|link=]] | [[File:icon-]=] ..
string.lower(tameable.class) .. [=[class.png|link=Animal_Taming#Tamed_Classes|]=] .. tameable.class .. [=[ Class|right]] | ||||||
---|---|---|---|---|---|---|---|
[[]=] .. followerName .. [=[]] | |||||||
Min Taming | Control Slots | Hits | Class | ]=] .. tameable.combat .. [=[ Damage | Armor | Wrestling | |
]=] .. tameable.taming .. [=[ | ]=] .. tameable.slots .. [=[ | ]=] .. tameable.hits .. [=[ | ]=] .. tameable.class .. [=[ | ]=] .. tameable.mindmg .. " - " .. tameable.maxdmg .. [=[ | ]=] .. tameable.armor .. tameable.armormin .. [=[ | ]=] .. tameable.wrestling .. [=[ | |
Attack Speed | Magic Resist | Poison Resist | Special Resist | Poison | Poisoning | Stealth | Underdog Scalar |
]=] .. tameable.atkspd .. [=[ | ]=] .. tameable.magicresist .. tameable.magicresistmin .. [=[ | ]=] .. tameable.poisonresist .. tameable.poisonresistmin .. [=[ | ]=] .. tameable.specialresist .. [=[ | ]=] .. tameable.poisontype .. [=[ | ]=] .. tameable.poisoning .. [=[ | ]=] .. tameable.stealth .. [=[ | ]=] .. tameable.underdogscalar .. " |
"
return wikiTable elseif not string.find(string.lower(followerType),"tame") and summon then local formmatedName = string.gsub(string.lower(followerName), "%s+", "") local imageName = string.gsub(formmatedName, "%p+", "") .. ".jpg" local spelliconImage = "[[File:" .. summon.spellicon .. ".png|44px|link=Spirit Speak#" .. summon.spellname .. "|" .. summon.spellname .. summon.tometier .. "|right]]"
if summon.necro == true then spelliconImage = spelliconImage ..
"


"
end
if imageOverride and imageOverride ~= "" then imageName = imageOverride end
-- Automaticlly add categories if namespace == "" or namespace == nil then if creature then wikiTable = wikiTable .. "" wikiTable = wikiTable .. "" end wikiTable = wikiTable .. "" end
wikiTable = [=[
[[File:]=] ..
imageName .. [=[|link=]] | ]=] ..
spelliconImage .. [=[ | |||||
---|---|---|---|---|---|---|
[[]=] .. followerName .. [=[]] | ||||||
Spell | Control Slots | Hits | ]=] .. summon.combat .. [=[ Damage | Armor | Wrestling | |
]=] .. summon.spellname .. summon.tometier .. [=[ | ]=] .. summon.slots .. [=[ | ]=] .. summon.hits .. [=[ | ]=] .. summon.mindmg .. " - " .. summon.maxdmg .. [=[ | ]=] .. summon.armor .. summon.armormin .. [=[ | ]=] .. summon.wrestling .. [=[ | |
Attack Speed | Magic Resist | Poison Resist | Special Resist | Poison | Poisoning | Stealth |
]=] .. summon.atkspd .. [=[ | ]=] .. summon.magicresist .. summon.magicresistmin .. [=[ | ]=] .. summon.poisonresist .. summon.poisonresistmin .. [=[ | ]=] .. summon.specialresist .. [=[ | ]=] .. summon.poisontype .. [=[ | ]=] .. summon.poisoning .. [=[ | ]=] .. summon.stealth .. " |
"
return wikiTable else
return '
FollowerTable Template Error: No tamed/summoned follower found by the name "' .. followerName .. '" (Case-sensitive)
'
end
end
function p.listSlayerGroup(frame)
local creatureArray = mw.loadData("Module:WildCreatureData")
local slayerGroup = frame.args[1] local position = frame.args[2] local wikiTable = ""
if position and string.find(string.lower(position), "start") then
wikiTable = [[
Name | Location | Slayer | Difficulty | Gold Value | Hits | Melee Dmg | Wrestling | Armor | Magic Resist | Parry | AtkSpd | Magery | Spell Dmg | Poison | Poisoning | Poison Resist | Stealth | AI | Speed | Unique Scalar]]
else wikiTable = "" end for creatureName, creature in pairs(creatureArray) do if creature.slayer == slayerGroup thenwikiTable = wikiTable .. [=[ | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
[[]=] .. creatureName .. [=[]] | ]=] .. creature.location .. [=[ | ]=] .. creature.slayer .. [[ | ]] .. creature.difficulty .. [[ | ]] .. creature.goldvalue .. [[ | ]] .. creature.hits .. [[ | ]] .. creature.minmeleedmg .. creature.maxmeleedmg .. [[ | ]] .. creature.wrestling .. [[ | ]] .. creature.armor .. creature.armormin .. [[ | ]] .. creature.magicresist .. creature.magicresistmin .. [[ | ]] .. creature.parry .. [[ | ]] .. creature.atkspd .. [[ | ]] .. creature.magery .. [[ | ]] .. creature.minspelldmg .. creature.maxspelldmg .. [[ | ]] .. creature.poisontype .. [[ | ]] .. creature.poisoning .. [[ | ]] .. creature.poisonresist .. creature.poisonresistmin .. [[ | ]] .. creature.stealth .. [[ | ]] .. creature.ai .. [[ | ]] .. creature.speed .. [[ | ]] .. creature.uniquescalar
end end if position and position and string.find(string.lower(position), "end") thenwikiTable = wikiTable .. " |
"
end return wikiTable
end
function p.listLocationGroup(frame)
local locationGroup = frame.args[1] local position = frame.args[2] local wikiTable = ""
local array -- Change the array being pulled from if a valid creatureType is provided, also formats the creatureType to be used in Err messages and sets an iconImage if string.find(string.lower(locationGroup),"strangeland") then array = mw.loadData("Module:StrangelandsCreatureData") elseif string.find(string.lower(locationGroup),"ship") then array = mw.loadData("Module:ShipCreatureData") else array = mw.loadData("Module:WildCreatureData") end
if position and string.find(string.lower(position), "start") then
wikiTable = [[
Name | Slayer | Difficulty | Gold Value | Hits | Melee Dmg | Wrestling | Armor | Magic Resist | Parry | AtkSpd | Magery | Spell Dmg | Poison | Poisoning | Poison Resist | Stealth | AI | Speed | Unique Scalar]]
end for creatureName, creature in pairs(array) do if string.find(creature.location, "" .. locationGroup .. "") thenwikiTable = wikiTable .. [=[ | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
[[]=] .. creatureName .. [=[]] | ]=] .. creature.slayer .. [[ | ]] .. creature.difficulty .. [[ | ]] .. creature.goldvalue .. [[ | ]] .. creature.hits .. [[ | ]] .. creature.minmeleedmg .. creature.maxmeleedmg .. [[ | ]] .. creature.wrestling .. [[ | ]] .. creature.armor .. creature.armormin .. [[ | ]] .. creature.magicresist .. creature.magicresistmin .. [[ | ]] .. creature.parry .. [[ | ]] .. creature.atkspd .. [[ | ]] .. creature.magery .. [[ | ]] .. creature.minspelldmg .. creature.maxspelldmg .. [[ | ]] .. creature.poisontype .. [[ | ]] .. creature.poisoning .. [[ | ]] .. creature.poisonresist .. creature.poisonresistmin .. [[ | ]] .. creature.stealth .. [[ | ]] .. creature.ai .. [[ | ]] .. creature.speed .. [[ | ]] .. creature.uniquescalar
end end if position and position and string.find(string.lower(position), "end") thenwikiTable = wikiTable .. " |
"
end
return wikiTable
end
function p.listFollowerGroup(frame)
local followerArray
local followerGroup = frame.args["group"] local wikiTable = ""
if string.find(string.lower(followerGroup),"tame") then followerArray = mw.loadData("Module:TameableCreatureData") local creatureArray = mw.loadData("Module:WildCreatureData")
wikiTable = [[
Name | Location | Slots | Taming | Class | Hits | Combat | Damage | Wrestling | Armor | Magic Resist | AtkSpd | Poison | Poisoning | Poison Resist | Special Resist | Stealth | Cooldown Ability | Innate Ability | Passive Ability | Underdog Scalar]]
for followerName, follower in pairs(followerArray) do local creature = creatureArray[followerName] local cooldownability = follower.cooldownability local innateability = follower.innateability local passiveability = follower.passiveability if type(follower.cooldownability) == "table" then cooldownability = "" for i, ability in ipairs(follower.cooldownability) do if i > 1 then cooldownability = cooldownability.."," end cooldownability = cooldownability..ability end end if type(follower.innateability) == "table" then innateability = "" for i, ability in ipairs(follower.innateability) do if i > 1 then innateability = innateability.."," end innateability = innateability..ability end end if type(follower.passiveability) == "table" then passiveability = "" for i, ability in ipairs(follower.passiveability) do if i > 1 then passiveability = passiveability.."," end passiveability = passiveability..ability end endwikiTable = wikiTable .. [=[ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
[[]=] .. followerName .. [=[]] | ]=] .. creature.location .. [=[ | ]=] .. follower.slots .. [[ | ]] .. follower.taming .. [[ | ]] .. follower.class .. [[ | ]] .. follower.hits .. [[ | ]] .. follower.combat .. [[ | ]] .. follower.mindmg .. follower.maxdmg .. [[ | ]] .. follower.wrestling .. [[ | ]] .. follower.armor .. [[ | ]] .. follower.magicresist .. [[ | ]] .. follower.atkspd .. [[ | ]] .. follower.poisontype .. [[ | ]] .. follower.poisoning .. [[ | ]] .. follower.poisonresist .. [[ | ]] .. follower.specialresist .. [[ | ]] .. follower.stealth .. [[ | ]] .. cooldownability .. [[ | ]] .. innateability .. [[ | ]] .. passiveability .. [[ | ]] .. follower.underdogscalar
end elseif string.find(string.lower(followerGroup),"summon") then followerArray = mw.loadData("Module:SummonableCreatureData")wikiTable = [[
return wikiTable end function p.listBosses(frame) local creatureArray = mw.loadData("Module:WildCreatureData") local bossesToList = frame.args[1] -- Main Boss local typeOfBoss = string.lower(bossesToList)local wikiTable = [[
return wikiTable end function p.listAbilities(frame) local tameableArray = mw.loadData("Module:TameableCreatureData") local summonArray = mw.loadData("Module:SummonableCreatureData") local abilityArray = mw.loadData("Module:FollowerAbilityData") local creature = frame.args[1] -- Warpig local followerType = frame.args[2] -- Tameable/Summon local follower = "" if string.lower(followerType) ~= "summon" and tameableArray[creature] then follower = tameableArray[creature] elseif string.lower(followerType) ~= "tameable" and summonArray[creature] then follower = summonArray[creature] else follower = "undefined" end local wikiTable = "" if follower and follower ~= "undefined" then -- List a follower's abilities if a follower is givenwikiTable = [[
|