Complex sentence: According to the Celadon City episode, Erika met Gloom when she was being pursued by a nasty Grimer, who sprayed icky stuff in Grimer's face, thus dissuading the Pokémon from chasing her further.
Split into simpler sentences: According to the Celadon City episode, Erika met Gloom when she was being pursued by a nasty Grimer. Gloom sprayed icky stuff in Grimer's face, thus dissuading the Pokémon from chasing her further.