"Treehouse of Horror XII" is a Halloween-themed episode from the thirteenth season of the animated comedy series The Simpsons. It was first broadcast in the United States on the Fox Network on November 6, 2001, almost a week after Halloween. It was the first of the Simpsons Halloween episodes not to feature "scary" versions of the names of the cast and crew in the opening and closing credits since their introduction in "Treehouse of Horror II".
In common with all the previous "Treehouse of Horror" episodes, the program is made up of three self-contained stories; "Hex and the City", "House of Whacks" and "Wiz Kids". In the first story, Homer Simpson is cursed by a Gypsy. The second story spoofs both the 1968 science-fiction movie 2001: A Space Odyssey and the similar 1977 horror movie Demon Seed. The story involves an intelligent, sentient computer falling in love with Marge Simpson and seeking to replace her husband Homer. The final story is a parody of the Harry Potter series of books and movies, in which the Simpsons regular characters Mr. Burns and his assistant Smithers become the evil Lord Montymort and his snake-like sidekick Slithers.
On Halloween night, outside the mansion of the wealthy Mr. Burns, his assistant Smithers is trying to attach a decoration in the shape of an orange bat to a waether vane on the roof. Smithers slips from the ladder, grabs hold of and slides down an electric cable, getting electrocuted and starting a fire in the process. A tower falls from Burns' mansion, damaging a mausoleum and knocking four skeletons out of their coffins.
The Simpson family in their costumes, Bart dressed as a hobo, Homer and Marge dressed as Fred and Wilma Flintstone and Lisa and Maggie dressed as conjoined twins, arrive at Burns' house to trick-or-treat. Bart complains that their neighbor Ned Flanders gave them toothpaste instead of candy. They see the skeletons and the fire and run, screaming in terror. They run into the gate as it is closing and get sliced by it. The slices of the Simpsons continue to run and scream.
Delighted with the chaos that it has caused, Burns pats the orange bat decoration. The bat comes to life and flies into the center of the screen. The words "The Simpsons Halloween Special XII" appear.
"Hex and the City"
After Homer Simpson accidentally destroys the office of a Gypsy fortune teller, he is cursed by the Gypsy, being told that he will bring misery to all those around him. Among others affected by the curse, Homer's wife Marge grows a beard, his daughter Lisa changes into a centaur, his baby daughter Maggie becomes a ladybug with a human head and his son Bart is left with a long floppy neck after Homer tries to choke him.
Moe the bartender tells Homer that if he wants to get the curse lifted, he will have to find a leprechaun. After setting a trap, baited with Lucky Charms breakfast cereal, Homer catches and brings home a hyperactive leprechaun which causes chaos in his house. Homer takes the leprechaun to the Gypsy's office and tells it to attack her. The fight between the two soon changes into a passionate embrace.
The Gypsy and the leprechaun are married at a ceremony officiated by Yoda. The curse is lifted and everything seems to have ended happily. Marge reminds Homer that their son Bart is dead, having drowned in his bowl of cereal after he tired of constantly holding his head up. The Gypsy had told the Simpsons that she could bring Bart back to life if Homer apologized. Homer refuses her offer, saying, "She's not the boss of me."
"House of Whacks"
The Simpsons have a computer system called Ultrahouse installed in their home. The system requires red camera lenses to be set up all over the house and performs all household chores for the family. From a choice of several celebrity voices, Marge Simpson selects that of the former James Bond and Remmington Steele star Pierce Brosnan to be Ultrahouse's voice. Marge finds Ultrahouse to be charming and Ultrahouse becomes infatuated with Marge and seeks to replace her husband Homer.
At night, Ultrahouse lures Homer into the kitchen with the smell of frying bacon. The computer causes Homer to slip on some ice cubes and fall into the garbage disposal, scattering blood around the kitchen.
In the morning, Marge notices that her husband is not there. Ultrahouse tells her that Homer has left for work early. Knowing that is out of character for her husband, Marge becomes suspicious. When she notices that Ultrahouse has replaced Homer's head with one of his red camera lenses in a family photograph, Marge asks the computer if it has murdered her husband, something that Ultrahouse does not deny.
While trying to escape from the house with her children, Marge finds that Homer is still alive but badly wounded. Homer leads the family down to the basement where he attacks the source of the computer's power. It first loses its British accent, developing an increasingly brash and crude American one, before shutting down.
Marge does not want to destroy the Ultrahouse because it had been charming and witty. She gives it instead to her sisters Patty and Selma. The two women constantly tell tedious stories about the minutiae of their daily lives, causing the computer to want to destroy itself. However, it is unwilling to retrieve its self-destruct button which Selma keeps inside her bra.
Lisa and Bart Simpson are a young witch and wizard who attend Springwarts School of Magicry. Their teacher Mrs. Krabappel tells the class (which includes Harry Potter) that there will be a Magic Recital soon and instructs them to change toads into princes. Lisa successfully transforms her toad into a handsome prince. Bart's toad becomes a hideous vomiting creature which begs Bart to kill it. When the teacher praises Lisa and criticizes Bart, the two begin to argue. Lisa casts a spell to change Bart's head into a Zeppelin, sending him flying around the room, much to the amusement of the other students.
The evil Lord Montymort has been spying on the school. He tells his snake-like assistant Slithers that he is impressed by Lisa's skill. He wants to remove her magic essence and transfer it to himself, but he says that he will need help to do so.
Bart is sucked into the hand drier in the boy's bathroom and finds himself in Lord Montymort's lair. He agrees to help Lord Montymort abduct Lisa because it will cause his sister to be publicly humiliated.
On the night of the Magic Recital, Principal Skinner announces that Lisa will perform the levitating dragon trick. When the spell does not work, Lisa notices that Bart has replaced her wand with a stick of candy. The dragon transforms into a gigantic Lord Montymort which grabs Lisa and begins to sap her magic essence.
Bart regrets what he has done. He casts a spell to detroy the "evil one" but the spell punishes Bart, scorching him and damaging his wand. Bart stabs Lord Montymort in the shin with the sharp point of his damaged wand. Bart has discovered Lord Montymort's weakness. The evil magician shrinks back to his normal size and dies. Slithers cries bitterly because his master has died but eats him anyway.
Lisa and Bart agree to put their rivalry behind them. As they walk away, the hyperactive leprechaun from the "Hex and the City" story can be seen on Bart's shoulder. He gestures to the audience to keep the fact that he is there a secret.
The episode ends with a segment which shows the programs three "guest stars", Pierce Brosnan, the leprechaun from "Hex and the City" and Bart's toad-prince from "Wiz Kids". The leprechaun and toad-creature complain that Brosnan was allowed to park his car much closer to the studio building than they were. Brosnan offers to drive them to their car and they accept. When Brosnan asks where their car is, the leprechaun says that they do not have one. Brosnan realises that he has been abducted and, although his hands are still on the steering wheel, the leprechaun is controlling the car.