Ali Baba lives in Baghdad with his son Rhum. His brother Kazim, disguised as the Cobra, steals from the citizens with the help of his select band of thieves. Kazim is the wicked Sultan of Baghdad - and what he doesn't steal in his disguise, he takes from the townsfolk by way of extortionate rents and taxes.
Amber, the spirit of the cave (where the Cobra hides his stolen goods) tells Ali where to find the cave. Ali, Rhum and Fatima set out in search of the cave, secretly followed by Zafira.
Meanwhile, two of the thieves, Bubble and Squeak, who are unaware that Kazim is the Cobra, kidnap his wife Olive for him to hold to ransom.
With the help of the information they have been given by Amber, Ali and his friends quickly find the cave, but once inside, the door closes behind them and they are trapped. Zafira then helps them to escape with the treasure. Olive is delivered to the Cobra and taken to the dungeons. Soon, the Cobra discovers that the treasure is missing. After Olive is returned to the palace, Ali is forewarned of a plan by the Cobra to kill all the guests at the Sultan's party, and the plot is foiled.