CommonFun

CommonFun.CalcBossSceneEquipRefineLv

Dataset · 20251127_update

Formula Source

function CommonFun.CalcBossSceneEquipRefineLv()
  local a = {
    [0] = 10000,
    [5] = 0,
    [6] = 0,
    [7] = 0,
    [8] = 0
  }
  local weight = 0
  for k, v in pairs(a) do
    weight = weight + v
    a[k] = weight
  end
  local randnum = math.random(1, weight)
  for k, v in pairs(a) do
    if v >= randnum then
      return k
    end
  end
  return 0
end
No formula links

Version History

Loading dependencies...
Loading usage...