CommonFun

calcDamage / calcBuff explorer

1 formulas listed.

CommonFun.calcBuff_805060 mapped buffs · 2 skills
function CommonFun.calcBuff_8050(srcUser, targetUser, a, b, c, d, lv)
  if srcUser == nil or targetUser == nil then
    return 0
  end
  local Odds1 = 0
  local Odds2 = 0
  local Hp = targetUser:GetProperty("Hp")
  local MaxHp = targetUser:GetProperty("MaxHp")
  local Num = math.min(targetUser:GetBuffLayer(137000), 5)
  local Fifth = 0
  if srcUser:HasBuffID(90004814) then
    Fifth = Fifth + 0.05
  end
  if targetUser:GetNpcID() == 0 and Hp <= MaxHp * (0.1 + 0.03 * Num + Fifth) then
    Odds1 = 100
  end
  if targetUser:GetNpcID() == 0 and Hp > MaxHp * (0.1 + 0.03 * Num + Fifth) then
    Odds2 = 100
  end
  local KillHp = -MaxHp * (0.1 + 0.03 * Num + Fifth)
  local A = Odds1 * a + Odds2 * b + KillHp * c
  return A
end