  Aims. The connection between initial disc conditions and final orbital and
physical properties of planets is not well-understood. In this paper, we
numerically study the formation of planetary systems via pebble accretion and
investigate the effects of disc properties such as masses, dissipation
timescales, and metallicities on planet formation outcomes. Methods. We
improved the N-body code SyMBA that was modified by taking account of new
planet-disc interaction models and type II migration. We adopted the 'two-alpha
disc' model to mimic the effects of both the standard disc turbulence and the
mass accretion driven by the magnetic disc wind. Results. We successfully
reproduced the overall distribution trends of semi-major axes, eccentricities,
and planetary masses of extrasolar giant planets. We find that, when planet
formation happens fast enough, giant planets are fully grown (Jupiter mass or
higher) and are distributed widely across the disc. On the other hand, when
planet formation is limited by the disc's dissipation, discs generally form
low-mass cold Jupiters (CJs). Our simulations also naturally explain why hot
Jupiters (HJs) tend to be alone and how the observed eccentricity-metallicity
trends arise. The low-metallicity discs tend to form nearly circular and
coplanar HJs in situ, because planet formation is slower than high-metallicity
discs, and thus protoplanetary cores migrate significantly before gas
accretion. The high-metallicity discs, on the other hand, generate HJs in situ
or via tidal circularisation of eccentric orbits. Both pathways usually involve
dynamical instabilities, and thus HJs tend to have broader eccentricity and
inclination distributions. When giant planets with very wide orbits
('super-cold Jupiters') are formed, we find that they often belong to
metal-rich stars, have eccentric orbits, and tend to have (~80%) companions
interior to their orbits.
