Anonymous

Module:Skills/Gathering: Difference between revisions

From Melvor Idle
m
added xp per second and time to next constellation to the table
(_getThievingNPCLootTables: Format quantity for area unique drops)
m (added xp per second and time to next constellation to the table)
Line 703: Line 703:
result = result..'\r\n|- class="headerRow-0"'
result = result..'\r\n|- class="headerRow-0"'
result = result..'\r\n!colspan="2"|Constellation!!'..Icons.Icon({"Astrology", type='skill', notext='true'})..' Level'
result = result..'\r\n!colspan="2"|Constellation!!'..Icons.Icon({"Astrology", type='skill', notext='true'})..' Level'
result = result..'!!XP!!Skills!!Standard Modifiers!!Unique Modifiers'
result = result..'!!XP!!Skills!!Standard Modifiers!!Unique Modifiers!!XP/s!!Time to next constellation'
    local xpByThreshold = {1154, 4470, 13363, 37224, 101333, 273742, 737627, 1986068, 5346332}
 
    function SecondsToClock(seconds)
        local seconds = tonumber(seconds)
     
        if seconds <= 0 then
            return "00:00:00";
        else
            hours = string.format("%02.f", math.floor(seconds/3600));
            mins = string.format("%02.f", math.floor(seconds/60 - (hours*60)));
            secs = string.format("%02.f", math.floor(seconds - hours*3600 - mins *60));
            return hours..":"..mins..":"..secs
        end
    end


for i, cons in ipairs(SkillData.Astrology.Constellations) do
for i, cons in ipairs(SkillData.Astrology.Constellations) do
Line 732: Line 746:
end
end
result = result..'||'..table.concat(uMods, '<br/>')
result = result..'||'..table.concat(uMods, '<br/>')
        local xpPs = cons.provides.xp/3
        result = result..'||'..xpPs
        if i == 1 then
            local seconds = xpByThreshold[i] / xpPs
            result = result..'||'..SecondsToClock(seconds)
        else
            local seconds = (xpByThreshold[i] - xpByThreshold[i-1]) / xpPs
            result = result..'||'..SecondsToClock(seconds)
        end
end
end
result = result..'\r\n|}'
result = result..'\r\n|}'
8

edits