Precipitation of ions induced by magnetotail collapse