Formula

CommonFun.CalcRiftBaseExp

function CommonFun.CalcRiftBaseExp(lv, maxlv, difficulty, speed_per)
  local Baseparam = {
    [170] = 45083341,
    [169] = 44817198,
    [168] = 44557245,
    [167] = 44291102,
    [166] = 44024959,
    [165] = 43758817,
    [164] = 43492674,
    [163] = 43226531,
    [162] = 42960388,
    [161] = 42700435,
    [160] = 45533571,
    [159] = 45247990,
    [158] = 44962409,
    [157] = 44676828,
    [156] = 44391247,
    [155] = 44105666,
    [154] = 43826726,
    [153] = 43541145,
    [152] = 43255564,
    [151] = 42969983,
    [150] = 42684402,
    [149] = 42398821,
    [148] = 42119882,
    [147] = 41834301,
    [146] = 41548719,
    [145] = 41263138,
    [144] = 40977557,
    [143] = 40691976,
    [142] = 40406395,
    [141] = 33439546,
    [140] = 33201562,
    [139] = 32963578,
    [138] = 32725594,
    [137] = 32487610,
    [136] = 32249625,
    [135] = 32017176,
    [134] = 31779192,
    [133] = 31541207,
    [132] = 31303223,
    [131] = 31065239,
    [130] = 30827255,
    [129] = 30275123,
    [128] = 29443327,
    [127] = 28620869,
    [126] = 27807746,
    [125] = 27003961,
    [124] = 26209512,
    [123] = 25424400,
    [122] = 24648624,
    [121] = 23882185,
    [120] = 23125082,
    [119] = 23049911,
    [118] = 22855997,
    [117] = 22662083,
    [116] = 22468169,
    [115] = 22274255,
    [114] = 22080341,
    [113] = 21886427,
    [112] = 21692513,
    [111] = 21498599,
    [110] = 21304685,
    [109] = 20993489,
    [108] = 20684447,
    [107] = 20377560,
    [106] = 20072828,
    [105] = 19770251,
    [104] = 19022245,
    [103] = 18285013,
    [102] = 17558554,
    [101] = 16842867,
    [100] = 16137954,
    [99] = 15076949,
    [98] = 14432436,
    [97] = 13797979,
    [96] = 13173576,
    [95] = 12559227,
    [94] = 11797632,
    [93] = 10893817,
    [92] = 10006760,
    [91] = 9517148,
    [90] = 8659417,
    [89] = 8004598,
    [88] = 7362348,
    [87] = 6732666,
    [86] = 6115553,
    [85] = 5333234,
    [84] = 4567672,
    [83] = 3992454,
    [82] = 3432597,
    [81] = 2882097,
    [80] = 2344165,
    [79] = 1653456,
    [78] = 1632509,
    [77] = 1611561,
    [76] = 1590614,
    [75] = 1569666,
    [74] = 1486770,
    [73] = 1405549,
    [72] = 1326005,
    [71] = 1248136,
    [70] = 1171943,
    [69] = 1031415,
    [68] = 1016453,
    [67] = 1001490,
    [66] = 986528,
    [65] = 971565,
    [64] = 956603,
    [63] = 941640,
    [62] = 926678,
    [61] = 911715,
    [60] = 896753,
    [59] = 881790,
    [58] = 866828,
    [57] = 851865,
    [56] = 836903,
    [55] = 821940,
    [54] = 806978,
    [53] = 792015,
    [52] = 777053,
    [51] = 762090,
    [50] = 717242,
    [49] = 673592,
    [48] = 631138,
    [47] = 589882,
    [46] = 549822,
    [45] = 510959,
    [44] = 473294,
    [43] = 436825,
    [42] = 401554,
    [41] = 367479,
    [40] = 334601,
    [39] = 242337,
    [38] = 217950,
    [37] = 194520,
    [36] = 172049,
    [35] = 150535,
    [34] = 129978,
    [33] = 110379,
    [32] = 91738,
    [31] = 74054,
    [30] = 71660,
    [29] = 69266,
    [28] = 66872,
    [27] = 64638,
    [26] = 62244,
    [25] = 59850,
    [24] = 57456,
    [23] = 55062,
    [22] = 52668,
    [21] = 50274,
    [20] = 47880
  }
  local calclv = lv
  if maxlv < calclv then
    calclv = maxlv
  end
  if calclv < 20 then
    return 0
  end
  local monthpara = 1
  if monthcard == true then
    monthpara = 1.33
  end
  local diffpara = 1
  if difficulty == 2 then
    diffpara = 1.1
  end
  if difficulty == 3 or difficulty == 4 then
    diffpara = 1.2
  end
  local BaseExp = math.floor(Baseparam[calclv] * speed_per * diffpara)
  if BaseExp < 0 then
    return 0
  end
  return BaseExp
end