Anonymous

Module:Sandbox/GauTest/Township: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 781: Line 781:
table.insert(ret, '<ul>')
table.insert(ret, '<ul>')
for _, item in ipairs(task.goals.items) do
for _, item in ipairs(task.goals.items) do
table.insert(ret, '<li>'..Shared.formatnum(item.quantity)..' '..Icons.Icon({Items.getItemByID(item.id), type='item'})..'</li>')
local itemname = Items.getItemByID(item.id).name
table.insert(ret, '<li>'..Shared.formatnum(item.quantity)..' '..Icons.Icon({itemname, type='item'})..'</li>')
end
end
for _, monster in ipairs(task.goals.monsters) do
for _, monster in ipairs(task.goals.monsters) do
table.insert(ret, '<li>'..Shared.formatnum(monster.quantity)..' '..Icons.Icon({Monsters.getMonsterByID(monster.id), type='monster'})..'</li>')
local monstername = Monsters.getMonsterByID(monster.id).name
table.insert(ret, '<li>'..Shared.formatnum(monster.quantity)..' '..Icons.Icon({monstername, type='monster'})..'</li>')
end
end
for _, skill in ipairs(task.goals.skillXP) do
for _, skill in ipairs(task.goals.skillXP) do
local skillname = GameData.getSkillData(skill.id).name
local skillname = GameData.getSkillData(skill.id).name
table.insert(ret, '<li>'..Shared.formatnum(skill.quantity)..' '..Icons.Icon({skillname, type='skill'})..'XP </li>')
table.insert(ret, '<li>'..Shared.formatnum(skill.quantity)..' '..Icons.Icon({skillname, type='skill'})..' XP</li>')
end
end
for _, building in ipairs(task.goals.buildings) do
for _, building in ipairs(task.goals.buildings) do
Line 799: Line 801:
table.insert(ret, '\r\n|<ul>')
table.insert(ret, '\r\n|<ul>')
if task.rewards.gp ~= 0 then
if task.rewards.gp ~= 0 then
table.insert(ret, '<li>'..Shared.formatnum(item.quantity)..' '..Icons.GP(task.rewards.gp)..'</li>')
table.insert(ret, '<li>'..Icons.GP(task.rewards.gp)..'</li>')
end
end
if task.rewards.slayerCoins ~= 0 then
if task.rewards.slayerCoins ~= 0 then
table.insert(ret, '<li>'..Shared.formatnum(item.quantity)..' '..Icons.SC(task.rewards.slayerCoins)..'</li>')
table.insert(ret, '<li>'..Icons.SC(task.rewards.slayerCoins)..'</li>')
end
end
for _, item in ipairs(task.rewards.items) do
for _, item in ipairs(task.rewards.items) do
table.insert(ret, '<li>'..Shared.formatnum(item.quantity)..' '..Icons.Icon({Items.getItemByID(item.id), type='item'})..'</li>')
local itemname = Items.getItemByID(item.id).name
table.insert(ret, '<li>'..Shared.formatnum(item.quantity)..' '..Icons.Icon({itemname, type='item'})..'</li>')
end
end
for _, skill in ipairs(task.rewards.skillXP) do
for _, skill in ipairs(task.rewards.skillXP) do
local skillname = GameData.getSkillData(skill.id).name
local skillname = GameData.getSkillData(skill.id).name
table.insert(ret, '<li>'..Shared.formatnum(skill.quantity)..' '..Icons.Icon({skillname, type='skill'})..'XP </li>')
table.insert(ret, '<li>'..Shared.formatnum(skill.quantity)..' '..Icons.Icon({skillname, type='skill'})..' XP</li>')
end
end
for _, townshipResource in ipairs(task.rewards.townshipResources) do
for _, townshipResource in ipairs(task.rewards.townshipResources) do
572

edits