Module:Monsters: Difference between revisions

have i mentioned i'm super lazy?
(added a function for generating the text for Template:MonsterLootTables because I am unfathomably lazy)
(have i mentioned i'm super lazy?)
Line 1,490: Line 1,490:
end
end


--NOTE: This is not a function that should be called directly
--NOTE: This is not a function that should be called directly. It generates text to be pasted into Chest Loot TablesTemplate:MonsterLootTables
--It exists because I'm too lazy to manually type up all the new monsters - User:Falterfire
--It exists because I'm too lazy to manually type up all the new monsters - User:Falterfire
function p.getMonsterLootTableText()
function p.getMonsterLootTableText()
Line 1,517: Line 1,517:
return table.concat(fullArray, "\r\n\r\n----\r\n")
return table.concat(fullArray, "\r\n\r\n----\r\n")
end
--NOTE: This is not a function that should be called directly. It generates text to be pasted into Chest Loot Tables
--It exists because I'm too lazy to manually type up all the new chests - User:Falterfire
function p.getChestLootTables()
local items = Items.getItems(function(item) return item.dropTable ~= nil end)
local outArray = {}
for i, item in ipairs(items) do
table.insert(outArray, "==={{ItemIcon|"..item.name.."|size=30}}===")
table.insert(outArray, "{{ChestDrops|"..item.name.."}}")
end
return table.concat(outArray, "\r\n")
end
end


return p
return p