Ash and friends arrive in Lavaridge Town. Ash heads straight for the Gym, where the Gym Leader Flannery is running around on fire. Brock uses Mudkip to douse the flames, and everyone goes inside for the Gym battle. The battlefield is a mess, so they need to clean up first.
They find out Flannery just inherited the Gym Leader position from her grandfather, who left town to write Pokémon poetry. None of the kids know that he's actually spying on them because he's worried about Flannery. He comes back in disguise and offers to help Flannery out.
Team Rocket also shows up in disguise to help clean the field, but instead they steal Flannery's Torkoal. They try to fly away in their balloon, but are stopped by the grandfather, who teams up with Flannery for a Pokémon battle with Jessie and James. May and Max free Torkoal.
During the battle, Flannery's Slugma evolves into Magcargo. Flannery realizes her grandfather is there, and together they defeat Team Rocket. Everyone gets ready for the Gym battle the next day.
Ash and his friends arrive at Lavaridge Town, which is said to be famous for its hot springs. Max observes people being buried in the sand in the dry analogue to hot springs, the sand baths. Ash quickly reminds the team that his Gym battle is the reason they came here in the first place, and the group reluctantly agrees. Team Rocket arrives to the town shortly after, complaining about their troubles following Ash. James reminds them about the hot springs in the town, and the trio is led by Jessie straight to the springs. James and Meowth are worried about their pending mission that they have yet to complete. Ash arrives at the Gym to Flannery running around in panic as she has caught on fire. After Brock extinguishes her with Mudkip, he falls in love, only to be pulled away by Max. Ash informs Flannery that he is looking for a Gym battle, and Flannery becomes excited at the chance to battle. Brock expresses concerns that he believed the Gym Leader of the town was Mr. Moore, not Flannery as she perpetuates. This is re-enforced by Flannery's disregard for protocol when she begins battling Ash on a non-regulation field. It is then discovered that the official field has not been cleaned since her last battle.
The match is put off as Flannery, Ash, and friends take a break. Flannery explains that three days ago her grandfather, Mr. Moore, had left on a poetry writing mission across Hoenn and Johto, and appointed Flannery as the Gym Leader. Ash volunteers the group to help clean up the Gym with Flannery. Mr. Moore is shown to not have gone very far from Lavaridge, expressing concerns for Flannery and the Gym. He sees (in disguise) that Ash is helping Flannery clean up the Gym, and is worried that things are not going as hoped. Team Rocket appears to be watching too, and decides to catch Flannery's Torkoal. Brock brings up that Flannery should have a Heat Badge ready in case Ash does beat her in the match. Flannery is not sure where they are located though, and she has the team help her search for the Badges. Mr. Moore appears in a new disguise to point out the location of the Badges. Flannery admits that she should be more organized. Max points out that Flannery does not have a match judge. Mr. Moore appears in a new disguise, claiming to be from the CPPGJ, or the Committee for Popularizing Pokémon Gym Judging. Brock is suspicious, but the disguised Mr. Moore exclaims that he was sent by Mr. Moore to judge the match. Mr. Moore also volunteers to help fix the field to prepare for the match.
As the field is being repaired, the Team Rocket trio also appears to help repair the Gym. Flannery accepts the aid. Mr. Moore and the trio recognize each other from earlier. When Mr. Moore sees the trio trying to steal Flannery's Torkoal, the trio is discovered and begins the motto. Jessie sends out Seviper to fill the Gym with a Haze attack. As the trio makes a run for it, Mr. Moore sends his Wingull to punch a hole in the trio's balloon. Flannery realizes her grandfather has a Wingull just like it. Wingull bursts Team Rocket's balloon and they fall down. When Mr. Moore sends out Typhlosion to battle the trio, Flannery realizes who the mystery man is. Jessie sends out Seviper while James sends out Cacnea who turns to hug him. Seviper starts off with Poison Tail and hits Typhlosion but Typhlosion strikes back with Tackle. Cacnea uses Pin Missile but Flannery helps in the battle with her Slugma, Mag and uses Ember to block. Typhlosion uses Flame Wheel and it hits Cacnea. Seviper goes for a Wrap but it got hit by Typhlosion's Flamethrower. Cacnea goes for another Pin Missile but got hit by another Flamethrower by Typhlosion.
Max and May sneak around to rescue Torkoal. Meowth sees them and goes to attack them but Flannery stops him with Mag's Flamethrower. Cacnea and Seviper both attack using Needle Arm and Bite but they both got hit by Slugma's Flamethrower. Flannery's Slugma evolves into Magcargo, and when Mr. Moore congratulates her, Flannery refers to him as grandpa, and it is revealed that he is Mr. Moore. Team Rocket comments on the absurdity of Mr. Moore spying on his own house. Cacnea continues the battle using Pin Missile, but Flannery's Magcargo and Mr. Moore's Typhlosion both uses Flamethrower to send them back. The trio is defeated in the battle, and Ash and Pikachu send them flying with a Thunderbolt. The group finishes repairing the Gym, and Mr. Moore suggests they postpone the Gym Battle until tomorrow. Mr. Moore buries Ash and Friends in the sand, and some competitive dialog is exchanged between Ash and Flannery, both excited about their upcoming Gym Battle.