Our heroes reach Olivine City and make a beeline for the Gym, where Gym Leader Jasmine accepts Ash's challenge. Jasmine sends out a gleaming Onix that easily defeats Ash's Totodile, even though Onix should be vulnerable to Totodile's Water-type attacks. But then the real Jasmine enters the room—the "Jasmine" that Ash battled is really Janina, Jasmine's apprentice! And as Janina later reveals to Jasmine, she coated her Onix in waterproof wax, a misguided cheat that earns Janina a time-out from the Gym.
Jasmine herself is too worried about "Sparkle" to deal with a Gym challenge. This leaves Ash to wander the city, wondering what to do next. He runs into Janina, who apologizes to him and says that Jasmine is at the Shining Lighthouse on the wharf; since Ash wants to ask Jasmine when she'll be ready for a battle, he heads there right away. Inside the lighthouse are Jasmine, her grandpa Myron, and Jasmine's Ampharos, Sparkle, who provides the light for the lighthouse. Sparkle isn't feeling well and Janina's still on a time-out, so it's up to Ash and the gang to pick up Sparkle's medicine from Cianwood City.
Before they can leave, Team Rocket attacks the lighthouse, catching Sparkle and Brock in a cage. Janina sees the commotion and comes to the rescue; without the wax coating, Onix can't pursue Team Rocket across the water, but it can certainly snag the cage and halt Team Rocket's getaway. Janina climbs up Onix to free Brock and Ampharos, then orders Onix to send Team Rocket for a loop. Janina is now back in Jasmine's good graces, and she gladly accompanies our heroes to Cianwood City!
As Ash and his friends reach Olivine City, Team Rocket spies on them using trash cans as a disguise. The reflected light from a large office building catches the trio's attention, and Jessie suggests they could be hired and earn lots of money. With that, Team Rocket rushes to the building, but they are stopped at the entrance by two security guards, who ask the trio to show their Badges. James shows his prized bottle caps, but the guards clarify that they need to see Gym Badges, revealing the building is the Battle Tower. The news leaves Team Rocket downtrodden.
Ash reaches the Olivine Gym and enters it, hoping to just breeze through this battle. When he approaches the Trainer box, a girl comes out, claiming herself to be the Gym Leader, Jasmine. Ash seems to believe her and challenges "Jasmine" to a fight. "Jasmine" declares that the match will a three-on-three and she selects an Onix which seems to be coated with something. On impulse, Ash calls out Totodile to make short work of the Rock-type. Ash commands Totodile to use Water Gun. The attack is effective at first but somehow, the Onix breaks through and knocks Totodile out with a single Tackle. Ash selects Pikachu who begins the round with a Quick Attack. A voice calls for the match to stop, and it is revealed to the real Jasmine, much to everyone's surprise. Jasmine reveals that the girl is her apprentice, Janina, and calls for her young apprentice to pay a visit to her office immediately. Janina apologizes to Ash for the false match before explaining her conduct to Jasmine. Janina admits that she covered her Onix in water-repellent wax. Jasmine is deeply disappointed and expels her young apprentice to allow her time to learn to truly communicate with her Pokemon. Janina leaves the Gym feeling upset. Meanwhile, inside the Gym, Jasmine offers Ash her sincerest apologies. She admits that she would gladly battle him, though she is too exhausted from being concerned about Sparkle. Jasmine suddenly receives a call and leaves the Gym to immediately attend to the urgent matter.
Ash and his friends venture over to a park to discuss what they should do now and are still unsure who "Sparkle" is or when Jasmine might battle Ash. They spot Janina in a sandbox, and she admits that she is scrubbing off the water-repellent wax that she used on Onix. The revelation explains why Totodile lost earlier. Brock is initially disappointed, but he informs Janina that she has to focus on building up her Pokemon’s natural strengths. Janina is encouraged by the advice, admitting that Jasmine said something similar before. Ash is suddenly reminded about Jasmine and asks where she might be, and Janina explains that Jasmine has been up to something at the Shining Lighthouse. Ash decides they should go check it out.
They get to the pier and spot two lighthouses. Brock reads his guidebook which reveals that the smaller lighthouse is the oldest of the pair, and is known as the Shining Lighthouse. Upon reaching the top, they find Jasmine, her grandfather Myron, and an Ampharos that seems to be ill. Ash challenges Jasmine to a Gym match, but she clarifies that Sparkle, her ill Ampharos, needs time to recover. Myron explains that this Ampharos is the light source for the lighthouse because its tail creates quite a glow. The Shining Lighthouse used to be the main lighthouse, but an electric lighthouse has since taken over. He says that he ordered a cure from the pharmacy in Cianwood City, but neither he nor Jasmine has any time to get it. Ash tells them that he'll go get the medicine.
Team Rocket spies from the outside glass and set their sights on the Ampharos. Jasmine spots them and they quickly get into their balloon. Meowth launches a "mystery missile" which smashes through the lighthouse's roof and lands inside. The missile doesn't detonate, but as Ash cautiously approaches it, Weezing pops out and uses Smokescreen. Brock gets Ampharos and carries it downstairs to escape. Just as Brock gets towards the entrance, a cage forms around him and Sparkle. Soon he is trailed off by Team Rocket. Brock tries to kick his way out, but no luck.
Meanwhile, Janina, who was walking near the port, is alerted to the chaos by the plume of Smokescreen from the Glittering Lighthouse. She interrupts Team Rocket's seemingly clean getaway and orders her Onix to retrieve the cage. Jessie calls on Arbok, and it wraps its tail around the cage in preparation for a counterattack. Onix deflects the Poison Sting, shielding Janina in the process. Meowth moves the balloon over the ocean, and they are just out of Onix's reach. When the situation seems hopeless, Janina notices Arbok dangling and gets an idea. She hops off Onix, then Onix bites onto a tsunami barrier and swings its tail to grab a hold of Arbok. Team Rocket tries to get away, but Onix pulls harder than the balloon can get away, which puts Arbok under more strain. Soon, Janina grabs a chipped-off piece of rock and climbs up to the cage. She gives the cage a few hits and the lock breaks open, freeing Brock. When they get down, Janina says Pikachu can use any Electric attack because Onix isn't going to be affected. Ash has Pikachu use Thunderbolt, which electrocutes Team Rocket, and then Onix tosses them out into the sky.
Jasmine is happily reunited with Sparkle and is also quite impressed with Janina. However, Janina is still sad about being expelled earlier, but Jasmine assures her that there is still a place for her at the Olivine Gym. Myron notices the ferry service to Cianwood City is about to leave. Jasmine asks Janina to retrieve the medicine from the Cianwood pharmacy, and the young apprentice happily accepts the favor. Ash, however, is now wondering what he will do while he waits to battle Jasmine. Myron informs him that Cianwood has a Gym, so Ash and his friends accompany Janina on the ship bound for Cianwood City. The ship leaves the Olivine port, and at its anchor lifts from the seafloor, the Rocket trio is also pulled up.