Metallofullerene and fullerene formation from condensing carbon gas under conditions of stellar outflows and implication to stardust