At Avalor Castle, Mateo is practicing his spell casting when Elena and Naomi come into his study. Mateo is stepping into the late Alakazar's shoes and becoming the Kingdom of Avalor's new Royal Sorcerer. Outside, Gabe is welcoming the guests on the guest list into the palace. Suddenly, a man in a wizard's robe appears at the gate and tells Gabe his name is Fiero. Gabe tells him his name is not on the list but Fiero adds his name to the list with a spell. Not realizing what happened, Gabe lets Fiero in. In the Throne Room and before a crowd which includes Mateo's mother, Elena appoints Mateo Avalor's new Royal Sorcerer and gives him his late grandfather's wizard robes. Later, Mateo confides in Elena his doubts that he's Royal Sorcerer material both because he believes Royal Sorcerers are supposed to be wise old men with long white beards and because most people such as Naomi and Gabe do not believe in him. Elena assures him he is Royal Sorcerer material and tells him to believe in himself.
Meanwhile, Fiero is searching the castle for something but cannot find it. A guard comes by and Fiero turns him to stone. He then decides to change his plans. Elena, Naomi, Gabe, and Mateo are on their way to the Throne Room when Mateo spots Fiero who he recognizes as a malvago, an evil wizard. Fiero casts a spell at them but Mateo protects them with a spell. When they get out of the dome that protected them they find everyone in the Throne Room has been turned to stone. Elena asks Mateo to turn everyone back to normal but he cannot, Mateo and the others don't know fiero was spying on them and He also tells them that the magic they need to undo this can only be found in the Maru Codex, an ancient Maruvian magic book that contains the most ancient and powerful magic in Avalor and which has been passed from one Royal Sorcerer to the next. According to Alakazar's notebook, the Codex is hidden somewhere in Avalor Castle. Alakazar's notebook also contains clues that lead to it. Fiero falls into their line of sight and Mateo tells them that he is the malvago. Shocked, Gabe tells them that Fiero said he was an old friend of Alakazar's but Mateo reveals that Fireo is really one of his grandfather's old enemies: During the reign of King Raul, Fiero was in line to become Avalor's Royal Sorcerer but the King appointed Alakazar instead. Angered, Fiero left vowing to return as a malvago for revenge. Mateo then reads the first clue: If you wish to complete this task, a wizard most Royal must simply ask. Elena deduces that a Royal Sorcerer must ask the book where it is. Mateo asks it and it actually works causing the book to reveal the first riddle needed to find the keys to the secret chamber where the Codex is kept: To find the book of which you speak, there are three keys which you must seek. Time will tell how much you know, you'll find key one three hours ago. The quartet deduce that the answer is a clock. They go to the grandfather clock and set it back three hours ago. It works and they get the first key. This causes the book to reveal the next clue: When you play this melody, the second key is way off-key. They head to the music room and and get the second key by pressing a broken piano key. This causes the book to reveal the final clue to solve: In the proper frame of mind, the third key you will surely find. Once you've gotten all three keys, unlock the three mysteries.
They find the final key in the frame of a painting of The Three Mysteries of Avalor Bay, which is also the entrance to the Codex chamber. They read the Codex and discover they have to return everyone to normal by sunrise with a potion or Fiero's spell will become permanent. Mateo makes the potion but they discover that Fiero is after the Codex and followed them there. A battle erupts between them that Mateo wins when he turns Fiero to stone with his own spell. Mateo then returns everyone to normal. After the guests are informed of what has transpired, Mateo shows his skills.
- Aimee Carrero as Princess Elena
- Joseph Haro as Mateo
- Héctor Elizondo as Fiero
- Ana Ortiz as Rafa
- Jorge Diaz as Gabe
- Jillian Rose Reed as Naomi
- Christian Lanz as Chancellor Esteban
- Joe Nunez as Armando
- Mateo becomes Avalor's new Royal Wizard in this episode.
- Mateo's mother appears in this episode.
- Alakazar is revealed to have passed away in this episode.