The TARDIS materialises in what appears to be a medieval English forest, but as the Doctor and his companions explore, they come across the remains of a village which has been burnt to the ground -- and amongst the charred bodies they find the footprints of an enormous lizard. Trying to take a shortcut through the woods, the travellers find the remains of an Earth spaceship from the 30th century, but before they can investigate further they are spotted and pursued back to the TARDIS by a fire-breathing dragon. Upon reaching the TARDIS, the Doctor finds that it has locked them out and activated its defences, but just as the dragon sets upon them it is attacked by a knight in shining armour. Ian steps in to save the knight when the battle turns against him, and reinforcements then arrive and kill the dragon. The grateful Sir Bron takes the new arrivals back to Fluxford Castle to explain their presence, telling them that they are in the land of Elbyon -- on the world of Avalon, where Merlin’s skyboat brought Arthur to rest over 800 years ago.
The travellers are welcomed as friends, although some tension develops between the Doctor and the court magician Gramling when the Doctor claims not to believe in magic. Gramling proves his power by casting an illusion spell, causing the image of a snake to appear from thin air, but the Doctor then pretends to pluck a whole egg from behind Gramling’s ear, and the two agree to disagree. The travellers explain their situation, and are invited to attend the feast to celebrate the forthcoming marriage of the Baron’s son Edmund and the Princess Mellisa. There, they meet and befriend a cheery leprechaun named Kildenny Odoyle, but as they speak with him the feast is interrupted by the sudden manifestation of the evil wizard Marton Dhal. Dhal is here to deliver a threat -- if the King continues to resist him, he will take whatever steps are necessary to secure his goal. Dhal was once Gramling’s apprentice until his greed and ambition got the better of him; he now seeks to become the Wizard Royal, and it is widely believed that he killed the former Wizard Royal’s apprentice to further his aims. Nothing could be proven, and the former Wizard Royal was fatally injured challenging Dhal, who retreated to his castle on the moors to plot his next move. Although the other wizards of the land could defeat Dhal by combining their efforts, they choose not to do so, fearing the precedent this would set.
As the travellers return to their guest quarters to ponder what they have learned, the Doctor notes strange and beautiful sights in the night sky; a blazing, colourful nebula, and six equidistantly positioned moons of equal size. Before he can come to any conclusions, however, the castle is attacked by Dhal’s winged apes, who fight their way past the surprised defenders and kidnap Mellisa -- and Susan. The next day, the Doctor and Ian attend a war council, at which Gramling reluctantly reveals that he may have found the one thing that can defeat Dhal -- Merlin’s Helm, a magical artefact of great power which enables its wearer to achieve anything at all, in the brief time available before the power burns out his mind. Gramling blames himself for failing to recognise his apprentice’s corruption, and volunteers to give his life to stop him. The Doctor and Ian will accompany the expedition, while Barbara, injured during the ape attack, remains in the castle. The Doctor advises her to study the history of Avalon, where there may be some clue as to why the TARDIS has locked them out, and how magic works on this world. He also warns her to remain alert; Dhal no doubt kidnapped Susan out of curiosity at the strangers’ arrival, but the fact that he knew of them so quickly -- and was so well prepared for the attack -- suggests that there is a spy somewhere within the castle.
Susan and Mellisa are held prisoner inside Dhal’s fortress, where he keeps an army of magical beasts -- including the dragons he has been using to terrorise the people of Fluxford, to force the King to accede to his demands. As Susan tries to keep Mellisa’s spirits up, Dhal detects another potential disruption to his plans -- a fleet of spaceships from Earth have arrived in orbit, bringing secret agent Captain Shannon on a mission which could save the falling Earth Empire. The planet’s moons are radioactive, and are directing power towards the planet’s surface -- but any probe sent into the atmosphere shuts down and crashes within moments. Shannon reviews the evidence and orders that a lander be specially modified to make planetfall without electronic assistance. He will be accompanied to the planet by Lieutenant Modando, and the scientists Ivanov and Jen Komati -- but while Ivanov eagerly anticipates the discoveries he will make, Komati fears that nobody can be trusted with what they expect to find…
Dhal continues sending dragons and winged apes to terrify the people of Elbyon, and more and more refugees are driven into the castle -- not just humans, but dwarves, elves and cephlies as well. The castle’s defenders are at a loss until Barbara suggests stringing wires across the turrets around the courtyard, and as the delighted defenders prepare to do so, she realises that the people of Avalon are unused to change and innovation -- it is as if some force is holding back their natural progress. She discovers that there is no religion on Avalon, and that there apparently never was; she is also unable to locate any references to Merlin’s Helm in the castle library, and when she asks Gramling where he conducted his research, he claims to have destroyed all of the books that mentioned the Helm. The scribe Harding admits that Gramling is often distracted these days; he was never quite himself after Dhal betrayed him. As she begins to recover from her injuries, Barbara risks taking a walk outside the castle -- and sees Susan standing in the distance. Susan flees into the forest, and Barbara pursues her, never pausing to wonder why she is behaving so strangely -- until the image of Susan vanishes, and the glamour that Dhal had cast over Barbara dissipates, leaving her stranded, exhausted, and hopelessly lost in the woods…
Sir Bron’s party sets off on the ship Merrow, and on their way they pass a mountainous sculpture known as the Seven Companions, which has eroded with time so that the figures appear unclear and somewhat inhuman. The Doctor and Ian learn of other wonders of the world, including a forest of glass and a river that flows uphill, and many others which seem to utterly defy the laws of physics. Meanwhile, Shannon and his team enter the planet’s atmosphere and set course for the heaviest concentration of electromagnetic force on the surface -- Dhal’s fortress. Unwilling to entertain such a distraction at this time, Dhal spellcasts a storm which forces the lander to crash in the ocean, near the Merrow. The crew of the Merrow rescue Shannon and his team, who claim to be on a mission to investigate the disappearance of numerous spaceships in the area. The Doctor, however, notes Shannon’s interest when Bron explains that they are searching for an artefact of great magical power, and decides to keep an eye on Shannon, certain that he is not telling them the whole truth.
Dhal, still concerned by the presence of the Earth fleet, begins casting spells to harass and drive them away. Even at this distance he is able to influence the minds of the ship’s crew, and create hallucinations and electromagnetic manifestations. The ships are forced to retreat to a higher orbit, but they continue to observe the planet and monitor the signals that Shannon is sending by means of pulses from a shielded radioactive wand. Meanwhile, Susan questions Mellisa’s description of magical powers, and decides that if magic works on this world, then she can make it work for her. By focussing her willpower, she finds that she is able to cast a spell to fumigate their bedding. Dhal summons her to explain the presence of the Earth fleet, and is furious when she is unable to do so -- but she takes advantage of his distraction to steal two vials of acid from his workshop table. Using these vials and the combs given to them as a mocking gesture of hospitality, she and Mellisa plan to escape. But they are unaware that Dhal has been drugging their food and secretly conditioning them as they sleep…
The Merrow reaches its destination -- the Shadow Isles, where the Doctor predicts correctly that there will be three challenges to overcome, as seems appropriate for this type of quest. Finally, they arrive on an island where a flight of stairs carved from solid glass climbs up the side of a mountain -- but as they sleep, planning to resume their quest once fully rested, Shannon and the Imperial team set off to claim the prize for themselves. The others follow to find that Komati has been turned back by a psychic barrier, as only she doubts the ethics of the Imperial team’s mission. Modando holds the others back with a projectile weapon, which is not affected by the forces which destroy electronic devices; they eventually overcome and kill him, and proceed onwards to a caldera in which rests the colony ship which first brought humans to Avalon. Merlin’s Helm rests here, on the head of a wizened, centuries-old corpse, but before anyone can stop him Ivanov impulsively seizes it and places it on his own head. He finds that it gives him the power to move mountains with a mere thought -- and he inadvertently does so, burning out his mind and bringing the entire mountain down on top of them. Shannon is buried in the rubble, and the others flee, taking the Helm while the Doctor salvages a microscope and the dead man’s journal from the wreckage.
Komati accompanies the crew of the Merrow back to Fluxford, and explains that a study of the nearby nebula proved that it was the result of a stellar explosion -- which was triggered by a weapon fired from this planet. The Earth Empire is collapsing, and to protect it, Shannon has come here in search of a weapon capable of destroying a star. The Doctor uses the microscope to confirm what he had come to suspect -- this planet is saturated with nanotechnological units, the true source of Avalon’s “magic”. They are keyed to respond to the brains of the alien race that created them, which is why it takes such effort for humans to cast spells with them; they are also programmed to shut down all exterior sources of electromagnetic interference which may otherwise damage them, which is why any spaceship which enters the atmosphere crashes. This is why the TARDIS has locked the Doctor and his companions out; after spending time outside, their clothing would have been riddled with the nanomachines, and if they enter the TARDIS it will be destroyed. According to the dead man’s journal, the colonists’ thoughts were made manifest as the system tried to acclimatise itself to the new arrivals, and he was forced to use the Helm to recreate Avalon as it is today, in order to save his people from the warring gods which had been brought into existence. Now that he understands the truth, the Doctor retreats to his cabin with Odoyle, who will tutor him in the use of magic for the final confrontation which the Doctor feels sure is soon to come…
Barbara, lost in the forest, is driven from shelter by a group of cephlies, and is then attacked by a pack of wolves -- but she is saved by the intervention of a black cat which leads her to a cottage in the woods. There, she finds an old woman trapped in an enchanted sleep by a poisoned slice of apple, and once Barbara removes it from her mouth the old woman falls into a natural sleep. Barbara sets off to find help, but forest spirits divert her into a fairy ring where living plants wind themselves about her sleeping form and try to drink her blood. She is saved once again by the old witch, Anni Glassfeather, who has fully recovered. When Barbara explains how she came to be here, Anni realises that Dhal must have poisoned her to keep her out of the way, and, angered, she agrees to help rescue Susan and Mellisa from Dhal’s fortress.
The Imperial fleet continues to experiment with staged landers and mechanical propulsion units, but when one ship successfully uses a tractor beam to pull a probe out of Avalon’s atmosphere, it inadvertently draws some of the nanobots with it. The nanobots multiply within the ship, and proceed to shut down its power systems until the warp engines’ containment fields fail and the ship explodes. The other ships analyse the tragic incident and soon determine the truth about Avalon. Alerted by Shannon -- who has survived the destruction of the Shadow Isle -- they plan to rescue him and continue on to Fluxford to seize Merlin’s Helm. On the way, they will destroy the castle from which the earlier attacks on the fleet originated.
Dhal, realising that the final confrontation will occur tonight, sends for Susan and Mellisa -- only to find that they have escaped. Susan has burned away the bars of her cell window with the acid she stole from him, and cast a spell to convert the hair and teeth from their combs into a rope ladder. Furious, he sends his winged apes after them, but Barbara and Anni arrive on a pair of broomsticks and rescue them. As they fly back to Fluxford, Dhal pursues them with his army of apes and dragons -- but in the confusion he has forgotten to keep an eye on the Imperial fleet, and before he realises what is happening, the landers make a bombing run and destroy his castle behind him.
The Merrow returns to Fluxford with little time to spare, as both the Imperial forces and Dhal’s army are on their way. As Gramling begins the ceremony which will enable him to control the power of the Helm, the Doctor sends Ian to the courtyard, telling him to find a cephlie amongst the refugees and bring it to the Hall. A fierce battle breaks out between the castle’s defenders, the Imperial soldiers, and Dhal’s beasts, but it comes to a halt when Gramling places the Helm on his head. At that moment, Dhal arrives and reveals that he has been controlling the mind of his former teacher all along -- and that Susan and Mellisa are under his spell as well. Gramling was his spy and agent in the castle, and through him Dhal has acquired his true goal -- Merlin’s Helm. When Gramling’s mind is exhausted, Dhal will pass the Helm over to Susan and then to Mellisa, until his hold over the Kingdom is secure. But then, to Dhal’s shock, Gramling suddenly switches bodies with his apprentice, leaving Dhal trapped in the dying old body connected to the Helm. Gramling was aware of Dhal’s intentions all along, and used him to gain ultimate power, just as Dhal thought he was using Gramling.
Dhal dies, his mind burnt out by the power of the Helm, but just as Gramling is about to place the Helm on Susan’s head, the Doctor, Anni and Odoyle join forces and attack him with all of the magical forces at their disposal. While Gramling is distracted, his hold over the other battle wavers, and Shannon fights his way into the castle to get the Helm -- which Ian is trying to pass to the cephlie. Komati defies Shannon and throws the Helm to Ian, and Shannon shoots her, only to be killed himself by Sir Bron. Gramling kills Odoyle, and the Doctor blasts Gramling into oblivion with the sheer concentrated power of his magic -- and Ian then places the Helm on the cephlie’s head, bringing the battle to an end. Restored to a sense of self, the cephlie plants the knowledge of his species’ past in the Doctor’s mind, and uses its new power to destroy the nanobot network and put an end to his race, giving them the peace they have long sought. As the Doctor had suspected, the cephlies -- the only race on Avalon which did not originate on Earth or from its mythology -- are the natives of this world, the ones who developed the nanobots and who were represented by the inhuman figures of the Seven Companions.
Shaken by the cephlies’ sacrifice, Admiral Nyborg of the Imperial fleet agrees to ensure that the people of Avalon make peaceful diplomatic contact with the rest of the Empire and survive the loss of their magic. As the Doctor and his companions return to the TARDIS, the Doctor explains that the development of the nanobots lulled the cephlies into a state of complacency, in which their every wish was granted instantly. Eventually they forgot the limitations of their technology, and when one of their kind idly ordered the system to put some more colour into the night sky, it destroyed a nearby star to create the nebula -- and in so doing drained the system of power for several years, giving the cephlies a cultural shock from which they never recovered. Now, at last, they are free -- as are the people of Avalon, who are no longer enslaved to the system which influenced all events on their world to follow their unconscious expectations of an adventure narrative.
Source: Cameron Dixon