Formula

CommonFun.CalcRiftJobExp

function CommonFun.CalcRiftJobExp(lv, maxlv, difficulty, speed_per)
  local Jobparam = {
    [170] = 26519612,
    [169] = 26363058,
    [168] = 26210144,
    [167] = 26053589,
    [166] = 25897035,
    [165] = 25740480,
    [164] = 25583926,
    [163] = 25427371,
    [162] = 25270817,
    [161] = 25117903,
    [160] = 26784454,
    [159] = 26616465,
    [158] = 26448476,
    [157] = 26280487,
    [156] = 26112498,
    [155] = 25944509,
    [154] = 25780427,
    [153] = 25612438,
    [152] = 25444450,
    [151] = 25276461,
    [150] = 25108472,
    [149] = 24940483,
    [148] = 24776401,
    [147] = 24608412,
    [146] = 24440423,
    [145] = 24272434,
    [144] = 24104446,
    [143] = 23936457,
    [142] = 23768468,
    [141] = 19670321,
    [140] = 19530331,
    [139] = 19390340,
    [138] = 19250349,
    [137] = 19110359,
    [136] = 18970368,
    [135] = 18833633,
    [134] = 18693642,
    [133] = 18553651,
    [132] = 18413661,
    [131] = 18273670,
    [130] = 18133679,
    [129] = 17808896,
    [128] = 17319604,
    [127] = 16835805,
    [126] = 16357498,
    [125] = 15884683,
    [124] = 15417360,
    [123] = 14955529,
    [122] = 14499191,
    [121] = 14048344,
    [120] = 13602990,
    [119] = 13558771,
    [118] = 13444704,
    [117] = 13330637,
    [116] = 13216570,
    [115] = 13102503,
    [114] = 12988436,
    [113] = 12874369,
    [112] = 12760302,
    [111] = 12646235,
    [110] = 12532168,
    [109] = 12349111,
    [108] = 12167322,
    [107] = 11986800,
    [106] = 11807546,
    [105] = 11629559,
    [104] = 11189556,
    [103] = 10755890,
    [102] = 10328561,
    [101] = 9907569,
    [100] = 9492914,
    [99] = 8868794,
    [98] = 8489669,
    [97] = 8116458,
    [96] = 7749162,
    [95] = 7387781,
    [94] = 6939784,
    [93] = 6408128,
    [92] = 5886330,
    [91] = 5598322,
    [90] = 5093775,
    [89] = 4708587,
    [88] = 4330793,
    [87] = 3960392,
    [86] = 3597384,
    [85] = 3137196,
    [84] = 2686866,
    [83] = 2348502,
    [82] = 2019175,
    [81] = 1695351,
    [80] = 1378921,
    [79] = 972621,
    [78] = 960299,
    [77] = 947977,
    [76] = 935655,
    [75] = 923333,
    [74] = 874571,
    [73] = 826794,
    [72] = 780003,
    [71] = 734198,
    [70] = 689378,
    [69] = 606715,
    [68] = 597914,
    [67] = 589112,
    [66] = 580311,
    [65] = 571509,
    [64] = 562708,
    [63] = 553906,
    [62] = 545105,
    [61] = 536303,
    [60] = 527502,
    [59] = 518700,
    [58] = 509899,
    [57] = 501097,
    [56] = 492296,
    [55] = 483494,
    [54] = 474693,
    [53] = 465891,
    [52] = 457090,
    [51] = 448288,
    [50] = 421907,
    [49] = 396231,
    [48] = 371258,
    [47] = 346989,
    [46] = 323425,
    [45] = 300564,
    [44] = 278408,
    [43] = 256956,
    [42] = 236208,
    [41] = 216164,
    [40] = 196824,
    [39] = 142551,
    [38] = 128206,
    [37] = 114424,
    [36] = 101205,
    [35] = 88550,
    [34] = 76458,
    [33] = 64929,
    [32] = 53964,
    [31] = 43561,
    [30] = 42153,
    [29] = 40745,
    [28] = 39336,
    [27] = 38022,
    [26] = 36614,
    [25] = 35206,
    [24] = 33798,
    [23] = 32389,
    [22] = 30981,
    [21] = 29573,
    [20] = 28165
  }
  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 JobExp = math.floor(Jobparam[calclv] * speed_per * diffpara)
  if JobExp < 0 then
    return 0
  end
  return JobExp
end