Config = {}
Config.Skill = {
    ['mining'] = {
        label = "Extraction Minière",
        maxLevel = 100,
        baseNeedExp = 20,
        baseAdd = 0.05,
        addPourcentage = 0.0005,
        boost = {
            speedBreaking = 10, 
            chanceFindPierre = 1, 
            chanceFindFer = 0.25, 
            bonusEarnPierre = { 0, 0 }, 
            bonusEarnFer = { 0, 0 },
        },
        specialBoost = {},
        info = {
            ['pierre'] = {
                ['dropChance'] = 'chanceFindPierre',
                ['lootBonus'] = 'bonusEarnPierre'
            }
        }
    },
    ['axing'] = {
        label = "Abattage Bois",
        maxLevel = 100,
        baseNeedExp = 20,
        baseAdd = 0.05,
        addPourcentage = 0.0005,
        boost = {
            speedBreaking = 10, 
            chanceFindBois = 1, 
            bonusEarnBois = { 0, 0 },
        },
        specialBoost = {}
    },
}

function addSpecialBoost(skill, allXlevel, table)
    for i = 1, Config.Skill[skill].maxLevel do
        local isGoodLevel = i / allXlevel
        if isGoodLevel == math.floor(isGoodLevel + 0.5) then
            local level = i
            if Config.Skill[skill].specialBoost[level] == nil then
                Config.Skill[skill].specialBoost[level] = {}
            end
            for boost, value in pairs(table) do
                if Config.Skill[skill].specialBoost[level][boost] then
                    if type(Config.Skill[skill].specialBoost[level][boost]) ~= "table" then
                        Config.Skill[skill].specialBoost[level][boost] = Config.Skill[skill].specialBoost[level][boost] + value
                    end
                    if type(Config.Skill[skill].specialBoost[level][boost]) == "table" then
                        for key, add in pairs(value) do
                            Config.Skill[skill].specialBoost[level][boost][key] = Config.Skill[skill].specialBoost[level][boost][key] + add
                        end
                    end
                else
                    if (type(value) ~= "table") then
                        Config.Skill[skill].specialBoost[level][boost] = value
                    end
                    if (type(value) == "table") then
                        Config.Skill[skill].specialBoost[level][boost] = {}
                        for key, add in pairs(value) do
                            Config.Skill[skill].specialBoost[level][boost][key] = add
                        end                        
                    end
                end
            end
        end
    end
end

addSpecialBoost('mining', 10, { bonusEarnPierre = { 0, 1 } })
addSpecialBoost('mining', 25, { bonusEarnFer = { 0, 1 } })
addSpecialBoost('mining', 50, { bonusEarnPierre = { 1, 0 } })
addSpecialBoost('mining', 100, { bonusEarnFer = { 1, 1 } })

addSpecialBoost('axing', 25, { bonusEarnBois = { 0, 2 } })
addSpecialBoost('axing', 50, { bonusEarnBois = { 2, 1 } })