30 December, 1999. While Mel attends a tenth anniversary reunion at the University of West London, the Doctor visits his old friend Dame Anne Travers, only to find her bitter and withdrawn following the death of her father. She has become obsessed by her fear of Yog-Sothoth, the Great Intelligence, and believes that millionaire Ashley Chapel -- who designed the micromonolithic circuits used by Tobias Vaughn during the Cyberman invasion -- is somehow involved in a conspiracy to bring the Intelligence back to Earth. She blames Chapel for her father’s ruin and death, believing that Chapel used his influence to discredit Travers when he tried to use the Library of St John the Beheaded to research past appearances of the Intelligence in Earth’s history.
At the reunion, Mel is approached by a former classmate, Julia Prince, who used to work for Ashley Chapel Logistics before Chapel declared near-total redundancies to go into effect today. She also believes that Chapel is involved in something nefarious involving his new programme, the Millennium Codex, and she asks Mel to hack into the ACL systems and investigate. The Doctor asks Mel not to get involved, but his own curiosity has been piqued, and he secretly allows her to leave the TARDIS that night, knowing that she thinks she’s slipping away without his knowledge. He soon realises, however, that by manipulating Mel into placing herself in possible danger for his own reasons, he’s taken the first steps on the path which will lead him to become the Valeyard. Concerned, he decides to investigate himself by using the TARDIS to scan the area for anything unusual -- and a powerful blast from the telepathic circuits knocks him unconscious...
Almost everyone is laid off from ACL, apart from a select staff of programmers who are working to get the Millennium Codex ready in time for New Years’. Former employee Barry Brown stumbles across the opportunity to steal a copy of the Codex from James Campling’s unguarded desk before he leaves, and that night, he and his friend and fellow former employee Louise Mason try running the programme on Louise’s home computer. An image of Hell appears on the monitor screen -- but the resolution is impossibly clear, and the picture then spreads beyond the confines of the screen before the computer goes up in a puff of smoke. When Barry takes the computer apart, he finds that the inner circuitry has been replaced by fabric inscribed with magical runes. Barry and Louise call Campling to find out more, unaware that Barry’s theft has been discovered and his phone lines tapped. Chapel thus concludes that Campling has deliberately betrayed him, and he transforms his employee Derek Peartree into a monstrous “cybrid” and sends him to kill Campling and frighten Barry and Louise into abandoning their investigation. Despite their terror, and despite Louise’s fear for her crippled daughter Cassie’s safety, Campling’s death only makes them more determined to confront Chapel and find out what’s really going on.
Thanks to the TARDIS library, Mel is able to hack into Chapel’s systems by using a book which has yet to be written. The Codex is written in a language which she doesn’t understand, and while trying to piece it together she finds inconsistencies which she realises must be bugs in the programme. Already feeling guilty about hacking into the systems, she begins to debug the Codex, unaware that Chapel is aware of her illegal entry and is allowing her to continue out of curiosity. She works through the night and falls asleep at her desk, and when she wakes, Chapel’s head of security, David Harker, is waiting to collect her. He arranged through Julia for Mel to hack into Chapel’s systems, in order to confirm his own suspicions; he believes that Chapel intends to use the Codex in a scheme to take advantage of the Y2K bug to defraud the world’s banking systems, and he wants in.
Inspired by her meeting with the Doctor, Anne Travers uses her father’s research ticket to visit the Library of St John the Beheaded and resume her father’s investigations; however, she is forced to leave when Chapel himself arrives, as Chapel has purchased the entire library just to get access to the books he requires. Meanwhile, the Doctor awakens with little memory of what happened to him, and meets Anne near the ACL building. There, he uses a computer in the sales display room to hack into the security systems and grant himself unlimited access. He and Anne then see Harker leading Mel into the offices, and manage to separate them; in the process, they meet Barry and Louise, who tell the Doctor their odd story. When Barry shows them a portion of the Codex language, the Doctor recognises it and orders Mel to join Barry and Louise for their New Year’s celebrations; things are more dangerous than he’d imagined, and he wants her to stay safely out of harm’s way. He is beginning to remember the events of the previous night, and when he returns to the TARDIS to check, his suspicions are confirmed; a vast energy field is hovering over London at the cusp of the millennium. It seems that Chapel is trying to summon Yog-Sothoth after all...
The Doctor visits the Library to conduct his own research, only to find that Anne has beaten him there and found several significant books missing. Convinced that Chapel is trying to use quantum mnemonics, the language of the Old Ones, to summon Yog-Sothoth to London, Anne prepares a counter-spell to stop him. The Doctor warns her that quantum mnemonics represent the physical laws of the Universe that preceded this one, and can rewrite reality on the most fundamental of levels; interference with a mnemonic could have unpredictable side effects. Anne, however, refuses to listen to him, and has him expelled from the Library when he protests. Meanwhile, Chapel is inspired by Mel’s debugging attempts and completes her work; the Codex will be ready on schedule. His master apparently orders him to destroy the cybrids he has created, but he is unwilling to reward their loyalty with death and instead sets them free to do as they wish before midnight. This causes the cybrids to feel abandoned, however, and Peartree in particular blames Barry and Louise for apparently losing Chapel’s favour.
That night, the Doctor breaks into Chapel’s offices, but Harker finds him and brings him before Chapel to explain himself. Chapel reveals that he serves not Yog-Sothoth, but Saraquazel -- not an inhabitant of the Universe which preceded this one, but of the Universe to come. The Codex is intended to create a bubble of space-time which obeys the physical laws of Saraquazel’s universe, freeing him to bring a new age of peace and prosperity to the planet. The Doctor tries to warn Chapel of the danger now posed by Anne, but again, his warnings fall on deaf ears. As the New Year approaches, the cybrids attack Mel, Barry and Louise, who flee to the Millennium Hall; there, just at the stroke of midnight, Mel accidentally impales the attacking Peartree on a piece of abandoned scaffolding. At the very same moment, Chapel activates the Codex, and Anne casts the counter-mnemonic which she believes will expel Yog-Sothoth from the Earth, unaware that it was in fact nowhere near at the time. Reality changes in London -- and thanks to the interference from Anne and the dying cybrid, things go terribly wrong...
The Doctor flees from Chapel’s offices as they alter around him, to find that a triangular area of London, one mile on each side, is now bound behind a force field barrier and subject to entirely alien laws of physics. This Great Kingdom is divided into three regions; the Ziggarut is ruled by the Technomancer Melaphyre and her cybrid army, the Labyrinth is ruled by the Hierophant Anastasia and her thaumaturges, and the Tower of Abraxas is the home of Archmage Ashmel and his auriks. The Doctor is attacked by rogue cybrids while trying to get to the TARDIS, but the TARDIS dematerialises without letting him in -- and the cybrids explode for no apparent reason. He is then confronted by Melaphyre and her advisors Louella and Bartholomew, who have sensed a disturbance in the Kingdom and recognise the Doctor from ancient legends as He Whose Name Dare Not Be Mentioned. Despite the warnings of legend, Melaphyre senses something trustworthy about the Doctor, and she dismisses Louella and Bartholomew and takes the Doctor to the Labyrinth for an unprecedented meeting with her rival Anastasia. Louella and Bartholomew return home to their daughter Cassie, but realise that they’re beginning to experience memories which aren’t their own. Worried, they take Cassie and seek out Melaphyre to ask her advice, but while trying to reach the Labyrinth they are ambushed by auriks and taken to the Tower of Abraxas.
Ashmael, sensing the same disturbance in the Kingdom, goes to the Temple to seek answers from his god, only to find that Saraquazel and Yog-Sothoth have merged together into a single insane entity. Horrified, Ashmael decides to seek an unprecedented alliance with Melaphyre and Anastasia in order to save their gods, but first he must deal with his ambitious adjutant Harklaane, who seeks Ashmael’s power for himself. While Ashmael had found Harklaane’s ambition useful in the past as a driving force, he can no longer afford this distraction, and he thus kills Harklaane and absorbs his life-force into himself. While doing so, however, he unexpectedly acquires Harklaane’s ambition and deviousness. Rather than seek an alliance with his enemies, Ashmael now decides to take advantage of the situation to seize total power over the Kingdom for himself...
The Doctor recognises Anastasia’s Labyrinth as all that remains of the Library of St John the Beheaded, and realises what has happened. The cybrids created by Chapel were embodiments of the physical forces of Earth’s universe, given form by quantum mnemonics and released when Mel accidentally killed Peartree; the Codex was intended to recreate the physical laws of Saraquazel’s Universe; and Anne Travers’ counter-mnemonic was based on the physical laws of Yog-Sothoth’s universe. The interaction of the laws of three incompatible Universes has created the Great Kingdom, an unstable domain with contradictory laws of physics which will soon tear it apart. Already, Anastasia and Melaphyre are beginning to recall memories from their old lives as Anne and Mel. The Doctor sets about investigating the effects of the rogue mnemonic, unaware that he’s starting to grow more irritable and snappish -- until it’s too late. Ashmael arrives in the Labyrinth, overpowers Melaphyre and Anastasia, and forms an alliance with the Doctor, who has now succumbed to the changes imposed upon him by the mnemonic and has transformed into the Valeyard.
Ashmael and the Valeyard return to the Tower, where they take Cassie from Bartholomew and Louella, intending to sacrifice her; by shedding the life-force of an innocent, they will be able to penetrate the barrier around the Kingdom, and conquer the world beyond. Fortunately, the Doctor snaps back to normal when he realises he’s about to murder an innocent child, and he, Bartholomew and Louella overpower Ashmael and escape with Cassie. The shock restores Barry and Louise’s memories of their real life, and Louise finally admits to Barry that he is Cassie’s father; she never told him, as she didn’t want to burden him with the effort of raising a crippled child and was determined to prove she could make it on her own. She now accepts that she loves Barry, however, and agrees to marry him when this is all over... but before they can escape, Ashmael tracks them down, kills Barry and kidnaps Cassie, intending to complete the ceremony alone. The Doctor returns to the Labyrinth, where he and Melaphyre -- who is beginning to regain her memories of being Mel -- research the texts on magic and quantum mnemonics, and find a way to reverse the damage to London. They must form a chain of cybrids to link the three key structures of the domain -- Melaphyre’s Ziggurat, the Labyrinth, and the Tower. This will short out the connection between the three universes, and restore the world to normal. But Melaphyre must stand at the head of the cybrid chain to complete the link, and the release of power is likely to kill her.
The Doctor transports himself and his companions to the Temple in order to get there ahead of Ashmael, despite the risk that further use of quantum mnemonics will cause him to transform into the Valeyard again. Upon their arrival, however, they find that Yog-Sothoth has generated an army of Yeti to protect itself, and by the time they get into the Temple Ashmael is waiting for them. Ashmael forces the Doctor to defend himself from a magical attack, pushing him over the edge and transforming him into the Valeyard again. The Valeyard leads Ashmael into the TARDIS and sets the controls to an isomorphic configuration to prevent Ashmael from betraying him -- but the TARDIS telepathic circuits help the Doctor to overcome his dark side and restore him to normal. Unfortunately, since the controls are now keyed to obey only the Valeyard, the Doctor can’t use them to help Mel. He must either transform himself into the Valeyard willingly to operate the TARDIS and save Mel’s life, or stand by and let her die for the “greater good” -- an act of betrayal which will eventually result in his becoming the Valeyard in any case.
The Doctor allows part of his dark nature to surface within his mind, just enough to let him operate the TARDIS controls and provide enough artron energy to help Melaphyre complete the chain. As he had hoped, the cybrid chain shorts out the difference between the three domains, freeing Saraquazal and expelling Yog-Sothoth from Earth yet again. Saraquazel turns out to be a benevolent entity who became trapped in this Universe accidentally, and who sought only to find a way home peacefully. Just as the Doctor has feared, the release of power has killed the figure at the head of the cybrid chain -- but it’s Anne, who had accepted her responsibility for the situation and thus knocked Mel out and took her place. Before leaving, Saraquazel diverts just enough of its power to repair the damage it has caused; instead of hundreds of deaths, only a few people will stay dead when London returns to normal. Saraquazel absorbs Chapel into itself to teach him the error of his ways, and departs into the Universe with a Codex-created bubble of its own physical laws to seek a way home. London has been restored to normal, and Barry is restored to life and reunited with Louise. But the Doctor knows that he manipulated Mel into placing herself in a situation where she could have been killed; how long can he hold out before he succumbs to the darkness inside him and becomes the Valeyard of his own accord?
Source: Cameron Dixon