Formula

CommonFun.calcBuff_3152

function CommonFun.calcBuff_3152(srcUser, targetUser, a, b, c, d, lv)
  if srcUser == nil or targetUser == nil then
    return 0
  end
  local off2 = targetUser:IsEquipForceOff(2)
  local off4 = targetUser:IsEquipForceOff(4)
  local equiped2 = targetUser:GetEquipedID(2) ~= 0
  local equiped4 = targetUser:GetEquipedID(4) ~= 0
  local list = {}
  if off2 == false and equiped2 == true then
    table.insert(list, 2)
  end
  if off4 == false and equiped4 == true then
    table.insert(list, 4)
  end
  if #list <= 0 then
    return 0
  end
  local random = srcUser:GetRandom()
  return list[random % #list + 1]
end