Pokemon Sun and Moon starts with a cinematic of a character named Lillie and her Pokemon, a Cosmog nicknamed Nebby. She’s attempting to flee from guards and the Pokemon uses a bright flash, creating an explosion of sorts while hiding in her bag. The game switches over to the player-character arriving in Alola on the island of Melemele, where they’re introduced to Professor Kukui and his young buddy Hau.
The player-character ends up meeting up with Lillie whose Cosmog is being attacked on a bridge. The player manages to save the Cosmog but the bridge breaks and a legendary Pokemon named the Tapu Koko comes to their rescue. This sets the player-character on a destiny paved in greatness, and they are given one of three starter Pokemon along with the task of completing seven trials across the four islands of Alola, including Melemele, Akala Island, Poni Island and Ula’Ula Island.
Throughout the journey the player-character will interact with Hau and Lillie, as well as battle various thugs and thieves along the way from Team Skull. During the journeys the player-character begins to understand the secrets of Alola, and how instead of having traditional gym battles they have the seven trials across the four isles. Whoever completes all of the trials, defeating the Totem Pokemon after summoning them, will then need to face off against the Elite Four in order to try their hand at becoming the Grand Master Pokemon Trainer of Alola. The player-character will earn Z-Power crystals from the trainers in order to grow strong enough to battle the Totem Pokemon, and possibly even face off against the island’s guardian, Tapu Koko.
Along the way it’s revealed that Lillie is staying with Professor Kukui until she can get back on her feet. Both her and the Cosmog were found on an Alola beach, unconscious and the Professor and his wife took in Lillie and the Cosmog to nurse them back to health.
Lillie is intent on helping the Cosmog get back to its home. This leads her, the player-character and Hau to a secret island between the major four islands called Aether Paradise, where it’s revealed that there special Pokemon known as Ultra Beasts from alternate dimensions. The research facility studies these beasts and the portals that lead to them in order to better understand the Ultra Beasts.
When they eventually end up on Ula’Ula Island, they learn that Solgaleo and Lunala battled ferociously at one point over the Alola isles after Solgaleo terrorized the people. Lunala came to the rescue and eventually they had an heir in the form of Cosmog.
Team Skull’s leader Guzma attempts to subvert Kukui’s quest to build a Pokemon League on Alola, but the Professor uses the player-character to battle Guzma and humiliate him in front of his friends. After the fight Gladion, an emo member of Team Skull, warns Hau and the player-character that they need to protect Cosmog from Team Skull and others trying to get their hands on it because it has the ability to summon legendary monsters. This leads the player-character to take the fight to Team Skull’s home base to wreck them once and for all.
However, while the player-character battles Team Skull at their home base, another member named Plumeria captures Lillie and Cosmog. Gladion leads the group to Aether Paradise to rescue Lillie and Cosmog.
They learn that Cosmog is supposedly an Ultra Beast from another dimension called Ultra Space and that under duress the Cosmog can open Ultra Wormholes to new dimensions. The Aether Paradise attempt to rip and tear at Cosmog in order to use it to open dimensions for their own benefit.
The player-character, and Hau finally get to the main office where they discover that Lillie is the daughter of Lusamine, the head of the Aether Paradise. Lillie attempted to rescue Cosmog from the center after it was captured during a meteor storm one night.
Lusamine reveals that Gladion is her son and that Lillie is Gladion’s brother. She plans on using Cosmog to open the Ultra Wormhole and let the Ultra Beast into the world and wreck havoc on Alola. She plans on allowing Cosmog to die in the process.
During the Poni Island trial the player-character and Lillie end up venturing to the top of the shrine where they use the Sun and Moon Flute to summon the great legendary Pokemon. Cosmog comes out of Lillie’s backpack and evolves into either Solgaleo or Lunala.
Nebby, now a legendary Pokemon, takes the player-character and Lillie to the Ultra Space to find her mother, who ended up teleporting to the Ultra Beasts layer during the wormhole opening.
They eventually find Lusamine who fuses herself with Nihilego to become an ultra-tentacle boss, but luckily she doesn’t try to rape her daughter.
After defeating Lusamine’s final form they exit the Ultra Space and seal up the Ultra Wormholes, saving Alola from complete destruction. The player-character has an opportunity to battle Nebby and become its pimp. After dealing with the Ultra Beasts, capturing Nebby and subduing Lusamine, the journey to becoming a Grand Champion continues.
The final challenge in Pokemon Sun and Moon takes place on Mount Lanakila, where the Grand Champion is crowned after defeating the Elite Four, which consists of previous trial-givers such as Olivia, Aceroyal, Kahilia and Hula. The final battle will crown Alola’s first ever Pokemon League Grand Champion, and attempt to get the region recognized so that they can eventually go on to become a Pokemom World Champion. This last fight sees players battling Professor Kukui in an all out brawl to become the first ever Alola Grand Champion.
Afterwards they hold a big festival celebration, but Lillie and the player-character sneak off to the shrine where she was originally headed at the start of the game with Nebby. They go to the shrine to discover Tapu Koko, engaging in one last battle with the great guardian of the Alola islands. Players have the option of successfully capturing the Pokemon.
Lillie eventually decides to depart to go take care of her bed-ridden mother, Lusamine. Hau promises to write her and the player-character returns home to their mother as the credits roll.