Formula

CommonFun.calcBuff_8050

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_BOTTLED_GHOST_FRUSTRATED_:MAX_STACK_15), 5)
  local Fifth = 0
  if srcUser:HasBuffID(90004814_HELA_S_EQUIPMENT_HAMMER_INFUSION_1_T5_:MAX_STACK_0) 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