FANDOM


--start
 
--variables
local p = {}
local modu = require('Module:Experience'); 
 
function p.wb_calc (frame)
 
    local args = frame:getParent().args
    local current_xp = args[1]; --Taken from user
    local desired_lv = args[2]; --Taken from user
    local cur_level = modu.level_at_xp({args = {current_xp}});
    local des_xp = modu.xp_at_level({args = {desired_lv}});    
    local required_xp = current_xp - des_xp 
    local total_wbs = 0; 
 
    local req_lvs = desired_lv - cur_level
    local next_level = cur_level + 1 
 
 
    while (req_lvs > 1) do
        next_level = next_level + 1     
        local gained_xp = exp_per_run((next_level - 1 ))
        local next_exp = modu.xp_at_level({args = {next_level}})
        local next_wbs = next_exp / gained_xp
        total_wbs = total_wbs + next_wbs
        req_lvs = req_lvs - 1
    end
 
    --calculate the amount of supplies needed for the next level, recalculate xp gained and keep going
 
    return  total_wbs
 
end
 
function exp_per_run(level)
 
    local exp_per_run1 = ( ( ( level * (level - 2) )  / 2 ) + 50 ) * 25
 
    return exp_per_run1
 
end
 
return p;

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.