2,875
edits
(Fixed level/abyssal level stuff; Added Fortification requirements) |
No edit summary |
||
Line 279: | Line 279: | ||
local tierText = Icons._SkillReq('Township', tierData.abyssalLevel or tierData.level, false, realmID) | local tierText = Icons._SkillReq('Township', tierData.abyssalLevel or tierData.level, false, realmID) | ||
if tierData.population ~= nil and tierData.population > 0 then | if tierData.population ~= nil and tierData.population > 0 then | ||
tierText = tierText .. '<br/>' .. Icons.Icon({'Population', type='township', notext=true}) .. ' ' .. | tierText = tierText .. '<br/>' .. Icons.Icon({'Population', type='township', notext=true}) .. ' ' .. Num.formatnum(tierData.population) | ||
end | end | ||
if tierData.fortification ~= nil and tierData.fortification > 0 then | if tierData.fortification ~= nil and tierData.fortification > 0 then | ||
tierText = tierText .. '<br/>' .. Icons.Icon({'Fortification', type='township', notext=true}) .. ' ' .. | tierText = tierText .. '<br/>' .. Icons.Icon({'Fortification', type='township', notext=true}) .. ' ' .. Num.formatnum(tierData.fortification) .. '%' | ||
end | end | ||
return tierText | return tierText | ||
Line 340: | Line 340: | ||
table.insert(resultPart, '\n| ' .. biome.name) | table.insert(resultPart, '\n| ' .. biome.name) | ||
table.insert(resultPart, '\n|style="text-align:right"| ' .. (reqs.abyssalLevel or reqs.level)) | table.insert(resultPart, '\n|style="text-align:right"| ' .. (reqs.abyssalLevel or reqs.level)) | ||
table.insert(resultPart, '\n|style="text-align:right" data-sort-value="' .. reqs.population .. '"| ' .. | table.insert(resultPart, '\n|style="text-align:right" data-sort-value="' .. reqs.population .. '"| ' .. Num.formatnum(reqs.population)) | ||
table.insert(resultPart, '\n|style="text-align:right" data-sort-value="' .. fortification .. '"| ' .. | table.insert(resultPart, '\n|style="text-align:right" data-sort-value="' .. fortification .. '"| ' .. Num.formatnum(fortification)) | ||
end | end | ||
table.insert(resultPart, '\n|}') | table.insert(resultPart, '\n|}') | ||
Line 516: | Line 516: | ||
function p.getWorshipTable() | function p.getWorshipTable() | ||
local function getCheckpointCell(checkpoint) | local function getCheckpointCell(checkpoint) | ||
return '\n|-\n!' .. checkpoint .. '%<br/>' .. | return '\n|-\n!' .. checkpoint .. '%<br/>' .. Num.formatnum(checkpoint * Township.maxWorship / 100) .. '/' .. Num.formatnum(Township.maxWorship) | ||
end | end | ||
Line 660: | Line 660: | ||
-- Maximum built | -- Maximum built | ||
local biomeCount = Shared.tableCount(building.biomes) | local biomeCount = Shared.tableCount(building.biomes) | ||
local maxText = | local maxText = Num.formatnum(building.maxUpgrades) | ||
if biomeCount > 1 then | if biomeCount > 1 then | ||
maxText = maxText .. ' per biome, ' .. | maxText = maxText .. ' per biome, ' .. Num.formatnum(biomeCount * building.maxUpgrades) .. ' total' | ||
end | end | ||
table.insert(ret, '\n|-\n| <b>Maximum Built:</b><br/>' .. maxText) | table.insert(ret, '\n|-\n| <b>Maximum Built:</b><br/>' .. maxText) | ||
Line 833: | Line 833: | ||
for goalIdx, goalObj in ipairs(goalData) do | for goalIdx, goalObj in ipairs(goalData) do | ||
if goalType == 'items' then | if goalType == 'items' then | ||
goalText = | goalText = Num.formatnum(goalObj.quantity) .. ' ' .. getItemText(goalObj.id) | ||
elseif goalType == 'monsters' then | elseif goalType == 'monsters' then | ||
goalText = | goalText = Num.formatnum(goalObj.quantity) .. ' ' .. getMonsterText(goalObj.id) | ||
elseif goalType == 'monsterWithItems' then | elseif goalType == 'monsterWithItems' then | ||
local itemsText = {} | local itemsText = {} | ||
Line 841: | Line 841: | ||
table.insert(itemsText, getItemText(itemID)) | table.insert(itemsText, getItemText(itemID)) | ||
end | end | ||
goalText = | goalText = Num.formatnum(goalObj.quantity) .. ' ' .. getMonsterText(goalObj.monsterID) .. ' with ' .. table.concat(itemsText, ', ') .. ' equipped' | ||
elseif goalType == 'skillXP' then | elseif goalType == 'skillXP' then | ||
local skillName = GameData.getSkillData(goalObj.id).name | local skillName = GameData.getSkillData(goalObj.id).name | ||
goalText = | goalText = Num.formatnum(goalObj.quantity) .. ' ' .. Icons.Icon({skillName, type='skill'}) .. ' XP' | ||
elseif goalType == 'buildings' then | elseif goalType == 'buildings' then | ||
local buildingName = p._GetBuildingByID(goalObj.id).name | local buildingName = p._GetBuildingByID(goalObj.id).name | ||
goalText = | goalText = Num.formatnum(goalObj.quantity) .. ' ' .. Icons.Icon({buildingName, type='building'}) | ||
elseif goalType == 'numPOIs' then | elseif goalType == 'numPOIs' then | ||
local mapName = GameData.getEntityByID(GameData.skillData.Cartography.worldMaps, goalObj.worldMapID).name | local mapName = GameData.getEntityByID(GameData.skillData.Cartography.worldMaps, goalObj.worldMapID).name | ||
goalText = 'Discover ' .. | goalText = 'Discover ' .. Num.formatnum(goalObj.quantity) .. ' Points of Interest in ' .. Icons.Icon({'Cartography', type='skill'}) .. ' world map of ' .. mapName | ||
else | else | ||
goalText = Shared.printError('Unknown goal type: ' .. (goalType or 'nil')) | goalText = Shared.printError('Unknown goal type: ' .. (goalType or 'nil')) | ||
Line 863: | Line 863: | ||
-- Goal data is another value of some type | -- Goal data is another value of some type | ||
if goalType == 'numRefinements' then | if goalType == 'numRefinements' then | ||
goalText = 'Refine dig site maps in ' .. Icons.Icon({'Cartography', type='skill'}) .. ' ' .. | goalText = 'Refine dig site maps in ' .. Icons.Icon({'Cartography', type='skill'}) .. ' ' .. Num.formatnum(goalData) .. ' times' | ||
else | else | ||
goalText = Shared.printError('Unknown goal type: ' .. (goalType or 'nil')) | goalText = Shared.printError('Unknown goal type: ' .. (goalType or 'nil')) | ||
Line 906: | Line 906: | ||
for _, item in ipairs(task.rewards.items) do | for _, item in ipairs(task.rewards.items) do | ||
local itemname = GameData.getEntityByID('items', item.id).name | local itemname = GameData.getEntityByID('items', item.id).name | ||
table.insert(rewards, | table.insert(rewards, Num.formatnum(item.quantity)..' '..Icons.Icon({itemname, type='item'})) | ||
end | end | ||
for _, skill in ipairs(task.rewards.skillXP) do | for _, skill in ipairs(task.rewards.skillXP) do | ||
if not (isDailyTask and skill.id == 'melvorD:Township') then | if not (isDailyTask and skill.id == 'melvorD:Township') then | ||
local skillname = GameData.getSkillData(skill.id).name | local skillname = GameData.getSkillData(skill.id).name | ||
table.insert(rewards, | table.insert(rewards, Num.formatnum(skill.quantity)..' '..Icons.Icon({skillname, type='skill'})..' XP') | ||
end | end | ||
end | end | ||
for _, townshipResource in ipairs(task.rewards.townshipResources) do | for _, townshipResource in ipairs(task.rewards.townshipResources) do | ||
local resourcename = p._getResourceByID(townshipResource.id).name | local resourcename = p._getResourceByID(townshipResource.id).name | ||
table.insert(rewards, | table.insert(rewards, Num.formatnum(townshipResource.quantity)..' '..Icons.Icon({resourcename, type='resource'})) | ||
end | end | ||
if not Shared.tableIsEmpty(rewardsVariableQty) then | if not Shared.tableIsEmpty(rewardsVariableQty) then |
edits