FANDOM


local p = {}
 
function round(n)
    return n % 1 >= 0.5 and math.ceil(n) or math.floor(n)
 
end
 
function p.calculator(frame)
    ----------------------------------
    ----Initialise Stats/Variables----
    ----------------------------------
    local grades = mw.loadData( 'Module:Stat calculator/Grades' )
    local unawk_grade = grades[frame.args[1]]
    local awk_grade = unawk_grade + 1
    local can_awk = frame.args[2]
 
    local unawk_hp = tonumber(frame.args[3])
    if unawk_hp == nil then
        unawk_hp = 0
    end
 
    local unawk_atk = tonumber(frame.args[4])
    if unawk_atk == nil then
        unawk_atk = 0
    end
 
    local unawk_def = tonumber(frame.args[5])
    if unawk_def == nil then
        unawk_def = 0
    end
 
    local awk_hp = tonumber(frame.args[6])
    if awk_hp == nil then
        awk_hp = 0
    end
 
    local awk_atk = tonumber(frame.args[7])
    if awk_atk == nil then
        awk_atk = 0
    end
 
    local awk_def = tonumber(frame.args[8])
    if awk_def == nil then
        awk_def = 0
    end
    --------------------------
    ----End Initialization----
    --------------------------
    --Weighted Stats and firstTermValues for unawakened:--
    local unawk_wstat = unawk_hp / 15 + unawk_atk + unawk_def
    local unawk_hpFrac = unawk_hp / 15 * (105 + (15 * unawk_grade))
    local unawk_atkFrac = unawk_atk * (105 + (15 * unawk_grade))
    local unawk_defFrac = unawk_def * (105 + (15 * unawk_grade))
 
    local unawk_hpBase = round(unawk_hpFrac / unawk_wstat)
    local unawk_atkBase = round(unawk_atkFrac / unawk_wstat)
    local unawk_defBase = round(unawk_defFrac / unawk_wstat)
 
    --Weighted Stats and firstTermValues for awakened:--
    local awk_wstat = awk_hp / 15 + awk_atk + awk_def
    local awk_hpFrac = awk_hp / 15 * (105 + (15 * awk_grade))
    local awk_atkFrac = awk_atk * (105 + (15 * awk_grade))
    local awk_defFrac = awk_def * (105 + (15* awk_grade))
 
    local awk_hpBase = round(awk_hpFrac / awk_wstat)
    local awk_atkBase = round(awk_atkFrac / awk_wstat)
    local awk_defBase = round(awk_defFrac / awk_wstat)
 
    -------------------
    ----Multipliers----
    -------------------
    local maxStarMtp = {1, 1.5966, 2.4242774, 3.4914444, 4.7529032, 6.4582449}
    local levelMtp = {1.9958, 1.8981, 1.8003, 1.7017, 1.6984, 1.7000}
 
    local min1 = 1
    local max1 = min1 * 1.9958 
    local min2 = 1.5966   
    local max2 = min2 * 1.8981 
    local min3 = 2.4242774 
    local max3 = min3 * 1.8003 
    local min4 = 3.4914444  
    local max4 = min4 * 1.7017 
    local min5 = 4.7529032
    local max5 = min5 * 1.6984
    local min6 = 6.4582449 
    local max6 = min6 * 1.7000  
 
    ----------------------
    ---- Stat Results ----
    ----------------------
 
    --Unawakened HP--
    local unawk_HP1min = frame.args[9]
    if unawk_HP1min == '' then
        unawk_HP1min = 15 * round(unawk_hpBase * min1)
    end
 
    local unawk_HP1max = frame.args[10]
    if unawk_HP1max == '' then
        unawk_HP1max = 15 * round(unawk_hpBase * max1)
    end
 
    local unawk_HP2min = frame.args[11]
    if unawk_HP2min == '' then
        unawk_HP2min = 15 * round(unawk_hpBase * min2)
    end
 
    local unawk_HP2max = frame.args[12]
    if unawk_HP2max == '' then
        unawk_HP2max = 15 * round(unawk_hpBase * max2)
    end
 
    local unawk_HP3min = frame.args[13]
    if unawk_HP3min == '' then
        unawk_HP3min = 15 * round(unawk_hpBase * min3)
    end
 
    local unawk_HP3max = frame.args[14]
    if unawk_HP3max == '' then
        unawk_HP3max = 15 * round(unawk_hpBase * max3)
    end
 
    local unawk_HP4min = frame.args[15]
    if unawk_HP4min == '' then
        unawk_HP4min = 15 * round(unawk_hpBase * min4)
    end
 
    local unawk_HP4max = frame.args[16]
    if unawk_HP4max == '' then
        unawk_HP4max = 15 * round(unawk_hpBase * max4)
    end
 
    local unawk_HP5min = frame.args[17]
    if unawk_HP5min == '' then
        unawk_HP5min = 15 * round(unawk_hpBase * min5)
    end
 
    local unawk_HP5max = frame.args[18]
    if unawk_HP5max == '' then
        unawk_HP5max = 15 * round(unawk_hpBase * max5)
    end
 
    local unawk_HP6min = frame.args[19]
    if unawk_HP6min == '' then
        unawk_HP6min = 15 * round(unawk_hpBase * min6)
    end
 
    local unawk_HP6max = frame.args[20]
    if unawk_HP6max == '' then
        unawk_HP6max = 15 * round(unawk_hpBase * max6)
    end
 
    --Unawakened ATK--
    local unawk_ATK1min = frame.args[21]
    if unawk_ATK1min == '' then
        unawk_ATK1min = round(unawk_atkBase * min1)
    end
 
    local unawk_ATK1max = frame.args[22]
    if unawk_ATK1max == '' then
        unawk_ATK1max = round(unawk_atkBase * max1)
    end
 
    local unawk_ATK2min = frame.args[23]
    if unawk_ATK2min == '' then
        unawk_ATK2min = round(unawk_atkBase * min2)
    end
 
    local unawk_ATK2max = frame.args[24]
    if unawk_ATK2max == '' then
        unawk_ATK2max = round(unawk_atkBase * max2)
    end
 
    local unawk_ATK3min = frame.args[25]
    if unawk_ATK3min == '' then
        unawk_ATK3min = round(unawk_atkBase * min3)
    end
 
    local unawk_ATK3max = frame.args[26]
    if unawk_ATK3max == '' then
        unawk_ATK3max = round(unawk_atkBase * max3)
    end
 
    local unawk_ATK4min = frame.args[27]
    if unawk_ATK4min == '' then
        unawk_ATK4min = round(unawk_atkBase * min4)
    end
 
    local unawk_ATK4max = frame.args[28]
    if unawk_ATK4max == '' then
        unawk_ATK4max = round(unawk_atkBase * max4)
    end
 
    local unawk_ATK5min = frame.args[29]
    if unawk_ATK5min == '' then
        unawk_ATK5min = round(unawk_atkBase * min5)
    end
 
    local unawk_ATK5max = frame.args[30]
    if unawk_ATK5max == '' then
        unawk_ATK5max = round(unawk_atkBase * max5)
    end
 
    local unawk_ATK6min = frame.args[31]
    if unawk_ATK6min == '' then
        unawk_ATK6min = round(unawk_atkBase * min6)
    end
 
    local unawk_ATK6max = frame.args[32]
    if unawk_ATK6max == '' then
        unawk_ATK6max = round(unawk_atkBase * max6)
    end
 
 
    --Unawakened DEF--
    local unawk_DEF1min = frame.args[33]
    if unawk_DEF1min == '' then
        unawk_DEF1min = round(unawk_defBase * min1)
    end
 
    local unawk_DEF1max = frame.args[34]
    if unawk_DEF1max == '' then
        unawk_DEF1max = round(unawk_defBase * max1)
    end
 
    local unawk_DEF2min = frame.args[35]
    if unawk_DEF2min == '' then
        unawk_DEF2min = round(unawk_defBase * min2)
    end
 
    local unawk_DEF2max = frame.args[36]
    if unawk_DEF2max == '' then
        unawk_DEF2max = round(unawk_defBase * max2)
    end
 
    local unawk_DEF3min = frame.args[37]
    if unawk_DEF3min == '' then
        unawk_DEF3min = round(unawk_defBase * min3)
    end
 
    local unawk_DEF3max = frame.args[38]
    if unawk_DEF3max == '' then
        unawk_DEF3max = round(unawk_defBase * max3)
    end
 
    local unawk_DEF4min = frame.args[39]
    if unawk_DEF4min == '' then
        unawk_DEF4min = round(unawk_defBase * min4)
    end
 
    local unawk_DEF4max = frame.args[40]
    if unawk_DEF4max == '' then
        unawk_DEF4max = round(unawk_defBase * max4)
    end
 
    local unawk_DEF5min = frame.args[41]
    if unawk_DEF5min == '' then
        unawk_DEF5min = round(unawk_defBase * min5)
    end
 
    local unawk_DEF5max = frame.args[42]
    if unawk_DEF5max == '' then
        unawk_DEF5max = round(unawk_defBase * max5)
    end
 
    local unawk_DEF6min = frame.args[43]
    if unawk_DEF6min == '' then
        unawk_DEF6min = round(unawk_defBase * min6)
    end
 
    local unawk_DEF6max = frame.args[44]
    if unawk_DEF6max == '' then
        unawk_DEF6max = round(unawk_defBase * max6)
    end
 
    --Awakened HP--
    local awk_HP1min = frame.args[45]
    if awk_HP1min == '' then
        awk_HP1min = 15 * round(awk_hpBase * min1)
    end
 
    local awk_HP1max = frame.args[46]
    if awk_HP1max == '' then
        awk_HP1max = 15 * round(awk_hpBase * max1)
    end
 
    local awk_HP2min = frame.args[47]
    if awk_HP2min == '' then
        awk_HP2min = 15 * round(awk_hpBase * min2)
    end
 
    local awk_HP2max = frame.args[48]
    if awk_HP2max == '' then
        awk_HP2max = 15 * round(awk_hpBase * max2)
    end
 
    local awk_HP3min = frame.args[49]
    if awk_HP3min == '' then
        awk_HP3min = 15 * round(awk_hpBase * min3)
    end
 
    local awk_HP3max = frame.args[50]
    if awk_HP3max == '' then
        awk_HP3max = 15 * round(awk_hpBase * max3)
    end
 
    local awk_HP4min = frame.args[51]
    if awk_HP4min == '' then
        awk_HP4min = 15 * round(awk_hpBase * min4)
    end
 
    local awk_HP4max = frame.args[52]
    if awk_HP4max == '' then
        awk_HP4max = 15 * round(awk_hpBase * max4)
    end
 
    local awk_HP5min = frame.args[53]
    if awk_HP5min == '' then
        awk_HP5min = 15 * round(awk_hpBase * min5)
    end
 
    local awk_HP5max = frame.args[54]
    if awk_HP5max == '' then
        awk_HP5max = 15 * round(awk_hpBase * max5)
    end
 
    local awk_HP6min = frame.args[55]
    if awk_HP6min == '' then
        awk_HP6min = 15 * round(awk_hpBase * min6)
    end
 
    local awk_HP6max = frame.args[56]
    if awk_HP6max == '' then
        awk_HP6max = 15 * round(awk_hpBase * max6)
    end
 
    --Awakened ATK--
    local awk_ATK1min = frame.args[57]
    if awk_ATK1min == '' then
        awk_ATK1min = round(awk_atkBase * min1)
    end
 
    local awk_ATK1max = frame.args[58]
    if awk_ATK1max == '' then
        awk_ATK1max = round(awk_atkBase * max1)
    end
 
    local awk_ATK2min = frame.args[59]
    if awk_ATK2min == '' then
        awk_ATK2min = round(awk_atkBase * min2)
    end
 
    local awk_ATK2max = frame.args[60]
    if awk_ATK2max == '' then
        awk_ATK2max = round(awk_atkBase * max2)
    end
 
    local awk_ATK3min = frame.args[61]
    if awk_ATK3min == '' then
        awk_ATK3min = round(awk_atkBase * min3)
    end
 
    local awk_ATK3max = frame.args[62]
    if awk_ATK3max == '' then
        awk_ATK3max = round(awk_atkBase * max3)
    end
 
    local awk_ATK4min = frame.args[63]
    if awk_ATK4min == '' then
        awk_ATK4min = round(awk_atkBase * min4)
    end
 
    local awk_ATK4max = frame.args[64]
    if awk_ATK4max == '' then
        awk_ATK4max = round(awk_atkBase * max4)
    end
 
    local awk_ATK5min = frame.args[65]
    if awk_ATK5min == '' then
        awk_ATK5min = round(awk_atkBase * min5)
    end
 
    local awk_ATK5max = frame.args[66]
    if awk_ATK5max == '' then
        awk_ATK5max = round(awk_atkBase * max5)
    end
 
    local awk_ATK6min = frame.args[67]
    if awk_ATK6min == '' then
        awk_ATK6min = round(awk_atkBase * min6)
    end
 
    local awk_ATK6max = frame.args[68]
    if awk_ATK6max == '' then
        awk_ATK6max = round(awk_atkBase * max6)
    end
 
    --Awakened DEF--
    local awk_DEF1min = frame.args[69]
    if awk_DEF1min == '' then
        awk_DEF1min = round(awk_defBase * min1)
    end
 
    local awk_DEF1max = frame.args[70]
    if awk_DEF1max == '' then
        awk_DEF1max = round(awk_defBase * max1)
    end
 
    local awk_DEF2min = frame.args[71]
    if awk_DEF2min == '' then
        awk_DEF2min = round(awk_defBase * min2)
    end
 
    local awk_DEF2max = frame.args[72]
    if awk_DEF2max == '' then
        awk_DEF2max = round(awk_defBase * max2)
    end
 
    local awk_DEF3min = frame.args[73]
    if awk_DEF3min == '' then
        awk_DEF3min = round(awk_defBase * min3)
    end
 
    local awk_DEF3max = frame.args[74]
    if awk_DEF3max == '' then
        awk_DEF3max = round(awk_defBase * max3)
    end
 
    local awk_DEF4min = frame.args[75]
    if awk_DEF4min == '' then
        awk_DEF4min = round(awk_defBase * min4)
    end
 
    local awk_DEF4max = frame.args[76]
    if awk_DEF4max == '' then
        awk_DEF4max = round(awk_defBase * max4)
    end
 
    local awk_DEF5min = frame.args[77]
    if awk_DEF5min == '' then
        awk_DEF5min = round(awk_defBase * min5)
    end
 
    local awk_DEF5max = frame.args[78]
    if awk_DEF5max == '' then
        awk_DEF5max = round(awk_defBase * max5)
    end
 
    local awk_DEF6min = frame.args[79]
    if awk_DEF6min == '' then
        awk_DEF6min = round(awk_defBase * min6)
    end
 
    local awk_DEF6max = frame.args[80]
    if awk_DEF6max == '' then
        awk_DEF6max = round(awk_defBase * max6)
    end
 
    ---------------------------------
    ----Variables End/Table Begin----
    ---------------------------------
    local not_obtainable = frame.args[81]
 
    if not_obtainable ~= 'Y' and not_obtainable ~= 'y' then
        result = 
        '{|width=100% data-portable="true"\n' ..
        '|id="header" style="text-align:center;"|<b><font size="5">Evolution Stats</font></b>\n' ..
        '|}\n' ..
        '<div style="height:10px;"></div>\n' ..
        '<div class="boxborder">\n' .. 
        '{|cellpadding="2" style="border-collapse:collapse; border-radius:10px; background:#EDF3FB; width:100%; border:1px solid #000000;"         data-portable="true"\n' ..
        '|-\n' ..
        '! scope="col" colspan="2" style="border:1px solid #2D3EFA;"|Grade\n'
 
        if unawk_grade == 1 then
            result = result .. '! scope="col" colspan="2" style="border:1px solid #2D3EFA;"|★\n'
        end
        if unawk_grade <=2 then
            result = result .. '! scope="col" colspan="2" style="border:1px solid #2D3EFA;"|★★\n'
        end
        if unawk_grade <=3 then
            result = result .. '! scope="col" colspan="2" style="border:1px solid #2D3EFA;"|★★★\n'
        end
        if unawk_grade <=4 then
            result = result .. '! scope="col" colspan="2" style="border:1px solid #2D3EFA;"|★★★★\n'
        end
 
        result = result .. 
        '! scope="col" colspan="2" style="border:1px solid #2D3EFA;"|★★★★★\n' ..
        '! scope="col" colspan="2" style="border:1px solid #2D3EFA;"|★★★★★★\n' ..
        '|-\n' .. 
        '! scope="col" colspan="2" style="border:1px solid #2D3EFA;"|Level\n'
 
        if unawk_grade == 1 then
            result = result .. 
            '! scope="col" style="border:1px solid #2D3EFA;"|Min\n' ..
            '! scope="col" style="border:1px solid #2D3EFA;"|Lv. 15\n'
        end
        if unawk_grade <=2 then
            result = result .. 
            '! scope="col" style="border:1px solid #2D3EFA;"|Min\n'  ..
            '! scope="col" style="border:1px solid #2D3EFA;"|Lv. 20\n'
        end
        if unawk_grade <=3 then
            result = result .. 
            '! scope="col" style="border:1px solid #2D3EFA;"|Min\n' .. 
            '! scope="col" style="border:1px solid #2D3EFA;"|Lv. 25\n'
        end
        if unawk_grade <=4 then
            result = result .. 
            '! scope="col" style="border:1px solid #2D3EFA;"|Min\n' .. 
            '! scope="col" style="border:1px solid #2D3EFA;"|Lv. 30\n'
        end
        result = result .. 
        '! scope="col" style="border:1px solid #2D3EFA;"|Min\n' ..
        '! scope="col" style="border:1px solid #2D3EFA;"|Lv. 35\n' ..
        '! scope="col" style="border:1px solid #2D3EFA;"|Min\n' ..
        '! scope="col" style="border:1px solid #2D3EFA;"|Lv. 40\n'
 
        if can_awk ~= '' then
            result = result .. 
            '|- style="background:#E1E7F0;"\n' ..
            '! scope="col" rowspan="4" style="text-align:center; border:1px solid #2D3EFA; width:10%; border-bottom:2px solid #2D3EFA;"|Normal\n' ..
            '|- style="background:#E1E7F0;"\n' ..
            '|class="monstercell" style="width:7%;"|<b>HP</b>\n'
        else
            result = result .. 
            '|- style="background:#EDF3FB;"\n' ..
            '|class="monstercell" style="width:7%;" colspan="2"|<b>HP</b>\n'
        end
 
        if unawk_grade == 1 then
            result = result ..
            '|class="monstercell"|' .. unawk_HP1min .. '\n' ..
            '|class="monstercell"|' .. unawk_HP1max .. '\n'
        end
        if unawk_grade <=2 then
            result = result ..
            '|class="monstercell"|' .. unawk_HP2min .. '\n' ..
            '|class="monstercell"|' .. unawk_HP2max .. '\n'
        end
        if unawk_grade <=3 then
            result = result .. 
            '|class="monstercell"|' .. unawk_HP3min .. '\n' ..
            '|class="monstercell"|' .. unawk_HP3max .. '\n'
        end
        if unawk_grade <=4 then
            result = result ..
            '|class="monstercell"|' .. unawk_HP4min .. '\n' ..
            '|class="monstercell"|' .. unawk_HP4max .. '\n'
        end
 
        result = result ..
        '|class="monstercell"|' .. unawk_HP5min .. '\n' ..
        '|class="monstercell"|' .. unawk_HP5max .. '\n' ..
        '|class="monstercell"|' .. unawk_HP6min .. '\n' ..
        '|class="monstercell"|' .. unawk_HP6max .. '\n'
 
        if can_awk ~= '' then
            result = result .. 
            '|- style="background:#E1E7F0;"\n' .. 
            '|class="monstercell"|<b>ATK</b>\n'
        else
            result = result .. 
            '|- style="background:#EDF3FB;"\n' .. 
            '|class="monstercell" colspan="2"|<b>ATK</b>\n'
        end
 
        if unawk_grade == 1 then
            result = result ..
            '|class="monstercell"|' .. unawk_ATK1min .. '\n' ..
            '|class="monstercell"|' .. unawk_ATK1max .. '\n'
        end
        if unawk_grade <=2 then
            result = result ..
            '|class="monstercell"|' .. unawk_ATK2min .. '\n' ..
            '|class="monstercell"|' .. unawk_ATK2max .. '\n'
        end
        if unawk_grade <=3 then
            result = result .. 
            '|class="monstercell"|' .. unawk_ATK3min .. '\n' ..
            '|class="monstercell"|' .. unawk_ATK3max .. '\n'
        end
        if unawk_grade <=4 then
            result = result ..
            '|class="monstercell"|' .. unawk_ATK4min .. '\n' ..
            '|class="monstercell"|' .. unawk_ATK4max .. '\n'
        end
 
        result = result ..
        '|class="monstercell"|' .. unawk_ATK5min .. '\n' ..
        '|class="monstercell"|' .. unawk_ATK5max .. '\n' ..
        '|class="monstercell"|' .. unawk_ATK6min .. '\n' ..
        '|class="monstercell"|' .. unawk_ATK6max .. '\n'
 
        if can_awk ~= '' then
            result = result .. 
            '|- style="background:#E1E7F0; border-bottom:2px solid #2D3EFA;"\n' .. 
            '|class="monstercell"|<b>DEF</b>\n'
        else
            result = result .. 
            '|- style="background:#EDF3FB;"\n' .. 
            '|class="monstercell" colspan="2"|<b>DEF</b>\n'
        end
 
        if unawk_grade == 1 then
            result = result ..
            '|class="monstercell"|' .. unawk_DEF1min .. '\n' ..
            '|class="monstercell"|' .. unawk_DEF1max .. '\n'
        end
        if unawk_grade <=2 then
            result = result ..
            '|class="monstercell"|' .. unawk_DEF2min .. '\n' ..
            '|class="monstercell"|' .. unawk_DEF2max .. '\n'
        end
        if unawk_grade <=3 then
            result = result .. 
            '|class="monstercell"|' .. unawk_DEF3min .. '\n' ..
            '|class="monstercell"|' .. unawk_DEF3max .. '\n'
        end
        if unawk_grade <=4 then
            result = result ..
            '|class="monstercell"|' .. unawk_DEF4min .. '\n' ..
            '|class="monstercell"|' .. unawk_DEF4max .. '\n'
        end
 
            result = result ..
        '|class="monstercell"|' .. unawk_DEF5min .. '\n' ..
        '|class="monstercell"|' .. unawk_DEF5max .. '\n' ..
        '|class="monstercell"|' .. unawk_DEF6min .. '\n' ..
        '|class="monstercell"|' .. unawk_DEF6max .. '\n'
 
 
        if can_awk ~= '' then
            result = result .. 
            '|-\n' .. 
            '! scope="col" rowspan="4" style="text-align:center; border:1px solid #246BB2; width:10%;"|Awakened\n' ..
            '|-\n' ..
            '|class="monstercell" style="width:7%;"|<b>HP</b>\n'
 
            if unawk_grade == 1 then
                result = result ..
                '|class="monstercell"|' .. awk_HP1min .. '\n' ..
                '|class="monstercell"|' .. awk_HP1max .. '\n'
            end
            if unawk_grade <=2 then
                result = result ..
                '|class="monstercell"|' .. awk_HP2min .. '\n' ..
                '|class="monstercell"|' .. awk_HP2max .. '\n'
            end
            if unawk_grade <=3 then
                result = result .. 
                '|class="monstercell"|' .. awk_HP3min .. '\n' ..
                '|class="monstercell"|' .. awk_HP3max .. '\n'
            end
            if unawk_grade <=4 then
                result = result ..
                '|class="monstercell"|' .. awk_HP4min .. '\n' ..
                '|class="monstercell"|' .. awk_HP4max .. '\n'
            end
 
            result = result ..
            '|class="monstercell"|' .. awk_HP5min .. '\n' ..
            '|class="monstercell"|' .. awk_HP5max .. '\n' ..
            '|class="monstercell"|' .. awk_HP6min .. '\n' ..
            '|class="monstercell"|' .. awk_HP6max .. '\n' ..
            '|-\n' ..
            '|class="monstercell"|<b>ATK</b>\n'
 
            if unawk_grade == 1 then
                result = result ..
                '|class="monstercell"|' .. awk_ATK1min .. '\n' ..
                '|class="monstercell"|' .. awk_ATK1max .. '\n'
            end
            if unawk_grade <=2 then
                result = result ..
                '|class="monstercell"|' .. awk_ATK2min .. '\n' ..
                '|class="monstercell"|' .. awk_ATK2max .. '\n'
            end
            if unawk_grade <=3 then
                result = result .. 
                '|class="monstercell"|' .. awk_ATK3min .. '\n' ..
                '|class="monstercell"|' .. awk_ATK3max .. '\n'
            end
            if unawk_grade <=4 then
                result = result ..
                '|class="monstercell"|' .. awk_ATK4min .. '\n' ..
                '|class="monstercell"|' .. awk_ATK4max .. '\n'
            end
 
            result = result ..
            '|class="monstercell"|' .. awk_ATK5min .. '\n' ..
            '|class="monstercell"|' .. awk_ATK5max .. '\n' ..
            '|class="monstercell"|' .. awk_ATK6min .. '\n' ..
            '|class="monstercell"|' .. awk_ATK6max .. '\n' ..
            '|-\n' ..
            '|class="monstercell"|<b>DEF</b>\n'
 
            if unawk_grade == 1 then
                result = result ..
                '|class="monstercell"|' .. awk_DEF1min .. '\n' ..
                '|class="monstercell"|' .. awk_DEF1max .. '\n'
            end
            if unawk_grade <=2 then
                result = result ..
                '|class="monstercell"|' .. awk_DEF2min .. '\n' ..
                '|class="monstercell"|' .. awk_DEF2max .. '\n'
            end
            if unawk_grade <=3 then
                result = result .. 
                '|class="monstercell"|' .. awk_DEF3min .. '\n' ..
                '|class="monstercell"|' .. awk_DEF3max .. '\n'
            end
            if unawk_grade <=4 then
                result = result ..
                '|class="monstercell"|' .. awk_DEF4min .. '\n' ..
                '|class="monstercell"|' .. awk_DEF4max .. '\n'
            end
 
            result = result ..
            '|class="monstercell"|' .. awk_DEF5min .. '\n' ..
            '|class="monstercell"|' .. awk_DEF5max .. '\n' ..
            '|class="monstercell"|' .. awk_DEF6min .. '\n' ..
            '|class="monstercell"|' .. awk_DEF6max .. '\n' 
 
        end
 
        result = result .. 
        '|}</div>'
 
 
        return result
 
    end
 
 
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.