(Open on the Flynn-Fletcher house at night decorated for Halloween. Cut to inside where Lawrence, dressed in a gorilla suit, is carving a jack-o-lantern. His sons approach him.)
Phineas: Wow! Looks great, Dad!
Lawrence: Thank you, boys.
Phineas: Come on, Ferb! We have work to do!
Candace: (walking in the background carrying her costume) Nice costume, Dad! See ya after the party!
Lawrence: Oh, yes, you have fun at the castle party tonight. (putting the mask on his head) If you need anything, your mother and I will be here scaring the sugar out of the little trick or treaters.
(Linda comes in dressed as a nurse.)
Linda: Well, how do I look, dear? (Lawrence makes gorilla sounds and bangs his hands on his chest.) Oh, no, a gorilla!

(Cut to the backyard. Agent P puts on his fedora and jumps into a pile of leaves. A leaf blower makes the leaves disappear and we don't see Perry. Cut to Perry's lair, all decorated for Halloween. Major Monogram is onscreen dressed as screen legend Carmen Miranda.)
Major Monogram: Okay, Agent P, who do I look like? Huh, whadaya think? (Perry simply stares) C'mon! Carmen Miranda! Y'know, you really should watch more old movies.
Carl: (entering, also dressed as Carmen Miranda) Sir, I found your dosimeter. It was—What are you doing?!
Major Monogram: Great googly moogly! Is that what I look like?! Wow, suddenly I feel ridiculous. Nevermind, Carl, you can have it.
Carl: (exiting) Sheesh.
Major Monogram: Moving right along: Sorry you have to work on Halloween, but just get out there and see what Doof has planned. I'd give you more information, but, obviously, I've got to find a new costume. Thanks a lot, Carl!

(Cut to Vanessa on the phone with Monty.)
Monty: (on phone) Well, hello, Vanessa.
Vanessa: Hey, Monty, what are you up to?
(Split screen to Monty at a black tie event.)
Monty: I'm just doing a little freelance for my dad. What's up?
Vanessa: I happen to be throwing the biggest, baddest, Halloweeniest bash ever! It's tonight and I think you should come.
Monty: A costume party? Hey, that means we can actually be seen in public together and no one will know.
Vanessa: That's the plan! I'm checking out my Queen of the Vampires costume even as we speak.
Monty: Oooh...
Vanessa: It's pretty cute.
Monty: Great, I'll be there! I'll be dressed as the Scarlet Pimpernel.
Vanessa: The Scarlet what?
Monty: You know, he wears a big red hat with a feather in it. You should watch more old movies.
Vanessa: Well, you know, it's a little known fact that vampire queens love Pumpernels.
Monty: Pimpernel.
Vanessa: Yeah, whatever, OWCA boy.
Monty: See ya tonight.
(They hang up. The split screen widens to reveal Monty standing next to Agent M.)
Monty: Sorry, Agent M. You're on your own from here on out.
Agent M: Ohhhh....

(Cut to Doofenshmirtz's apartment. The doorbell plays the Evil Jingle. Doofenshmirtz approaches the door.)
Doofenshmirtz: Oh, goody, trick or treaters.
Trick or Treaters: Trick or treat!
Doofenshmirtz: Okay, lessee, what do we have here? Class dunce with a fake scar, and you must be the Princess of Meatland...and...uh, oh, uh, Upset Rooster Head. And what are you supposed to be, a kid in a sheet? (The "kid in the sheet" takes off the sheet to reveal:) A platypus in a sheet? (He puts on the fedora) Perry the Platypus in a sheet?! Do I -- well, uh, that's perfect! Wait, wait, I was hoping you would— (Perry twists Doofenshmirtz's arm) Ow!! Whoa whoa whoa whoa, I'm being sincere! There's no trap, no inator, just come over here, you gotta see this. It was delivered today. (They walk to the balcony to reveal a castle turret outside.) I had to sign for it and everything! (Cut to outside to reveal a rather ancient castle next to the D.E.I. building.) It's a real castle with...with a moat! Who delivers a moat?! How'd they even get that on the plane? It's from my Great Aunt Henrietta Hawkenschpit. She left it to me in her will. L-Listen to this. (reading the will) "To Heinz Doofenshmirtz, You are my only nephew, except for Roger and I hated him." See? See why I liked her? "Therefore, I leave you my castle and hidden inside is a very large treasure!" Huh? (puts on reading glasses) And look! There's a little treasure map with clues! Wanna help me? (no response) Oh, come on! It'll be fun! Take off your secret agent hat just for tonight and put on your adventure hat! (Perry takes off his fedora and puts on a similar looking fedora.) That's my guy! Treasure ho! This is gonna be fun!

(Cut to the party.)
(Song: "Vampire Queens Love Pimpernels" (instrumental))
Vanessa: (offscreen) Welcome to my castle party! Here's a mask. Lacie, wow, great costume!
Lacie: This is a...costume party?
Knight: Sir Grant of the Goth Table has arrived.
Vanessa: You look great, Sir Grant. (gives him a mask) Dragons beware!
Candace: (also dressed as a vampire queen) Vanessa?
Vanessa: Candace!
Candace: Whoops! I guess your party's gonna have two vampire queens! What are the chances, right?
(Stacy enters also wearing an identical costume.)
Stacy: (leaves) I'm gonna go change.
Candace: How did you ever pull this off?
Vanessa: Well, my dad gave me permission to use his castle and then all I had to do was call the best party planners in town.
(Phineas and Ferb walk through the doors.)
Phineas: Ferb, you go get the 4:40 junction box hooked up behind the riser, and I'll check up on the pumpkin crudities.
Candace: Et tu, Vanessa?
Vanessa: I had to. This is a big night for me, my boyfriend's coming. Oh, here he is right now.
(A Scarlet Pimpernel enters.)
Scarlet Pimpernel: Ooh, a vampire! It's a good thing I have my neck covered.
Vanessa: You're not my boyfriend!
Scarlet Pimpernel: Whoops. Heh heh. Sorry, I thought you were my—
Candace: Jeremy, it's me, Candace!
Jeremy: Ooh, a vampire! It's a good thing I have my—
Candace: Yeah, heard you the first time.

(Cut to Doofenshmirtz and Perry.)
Doofenshmirtz: Alright, the first clue is in the letter. Let's see here:
"My treasure awaits you, keep on the trail.
A ride up the stairs from under a veil."
What kind of twisted gibberish is this? (Perry approaches a chair under a veil and uncovers it.) That's it! Henrietta's chairlift! Oh yeah! Here, (patting his knee) you can sit here, Perry the Platypus. (Perry shakes his head.) No? Alright, suit yourself. (He activates the chairlift.) We're comin' for your treasure, HenriettAAAAAAAAAAAAAAAAA!!!! (The chairlift speeds up and flings Doofenshmirtz into the red stained glass window. It seems like he's about to crash and break it, but doesn't. Instead, the window flips over and Doofenshmirtz lands in the moat and takes out a piece of paper.) Ha! I got it! (An alligator arises from the moat.) Yaaaah!! They shipped the alligator, too? Get away from me, Susan! We talked about this!

(Cut back to the party.)
Phineas: These scalloped cheese slices should be staged directly across from the crackers. But overall, nice work. (He approaches Isabella dressed as Cinderella.) Hey, look at you! You're Isabellarella.
Isabella: If I lose a slipper tonight, you know where to find me.
Phineas: (walking away, pointing at something) Ooh, that reminds me...
Isabella: ("accidentally" losing a slipper) Whoops!
Phineas: (offscreen) ...there's some water on the floor over by the sally port.
(The "lost" slipper lands in the punch. Isabella angrily takes the shoe out. Cut to Buford and Baljeet dressed as the front and back end, respectively, of a dragon.)
Baljeet: Buford, it is so hot in here! Can I please have some punch?
Isabella: (saunters past) You don't wanna drink that.
Buford: Y'know, I think we have the best castle party costume.
Irving: (offscreen) Hey, Buford, look at me - (he is dressed as a castle) I'm a a castle party! Get it? Heh? Heh?
Buford: Yeah. Hey, Windsor, your drawbridge is down!
Irving: Oh, my. (raising his drawbridge) How embarrassing.

(Cut to Vanessa)
Vanessa: Monty should've been here by now. (Another Scarlet Pimpernel approaches her.) Finally...wait, who are you?
Scarlet Pimpernel 1: I'm the Scarlet Pimpernel.
Scarlet Pimpernel 2: As am I!
Scarlet Pimpernel 3: Same here.
All Scarlet Pimpernels: We are all here!
Vanessa: Ugh!
Stacy: (also dressed as the Scarlet Pimpernel) Hey, what's going—Oh, for crying out loud.

(Cut to Phineas.)
Phineas: Okay, Ferb, let's kick this biggest, baddest, Halloweeniest bash into high gear!
(All cheer. Ferb rises onto a DJ's stage and spins a megamix of some of the greatest hits on the show.)
(Song: "Foot Stomp Mash Up")'
I got squirrels in my pants! pants! pants!
Look at them, they're stompin' their feet!
Look, Look at them, they're stompin' their feet!
Look at them, they're stompin' their feet!
stompin' their feet! They're stompin' their They're stompin' their They're stompin' their
It's a spa day
Thank you very much,
We got a salt scrub, a mud tub; what's it gonna be?
A foot bath, a facial, aromatherapy!
It's a spa day!
I got squirrels in my pants!
I got squirrels in my pants!
I'm Lindana and I wanna wanna wanna have fun
I got I got I got squirrels in my pants!

(Cut to Doofenshmirtz and Perry.)
Doofenshmirtz: "In the dungeon, you will find
An elevator out of time."
I really don't remember an elevator down here. (An elevator bell dings.) Well, whadaya know? How could I have missed it? (A couple of Shining twins walk out of the elevator.)
"In the elevator, to the top you go,
The next clue is down below."
(The elevator goes up.) Well, that doesn't really make a lot of sense. (The elevator reaches the top floor, which is just a view.) Why did she make us come all the way up here if the clue is all the way down— (The elevator drops like the Tower of Terror ride and drops back into the moat. A hippopotamus rises from the moat.) Wait a second! (Approaching the hippo, which has another clue in its mouth.) Gimme that thing!

(Cut back to the party. Vanessa finally recognizes Monty.)
Vanessa: Now, that is my boyfriend.
(Monty winks at her. They walk up to each other to dance. Cut to Ferb, who takes off his DJ hat to reveal his hair is now gelled. He takes off his black turtleneck to reveal his dapper singer outfit from "De Plane! De Plane!" and puts on a fake mustache and replaces his microphone with a 1940s style version and sings.)
(Song: "Vampire Queens Love Pimpernels")
Ferb: When a vampire queen locks her thirsty eyes on a Pimpernel,
(Baljeet: Woooooooooooooooooo... )
And the music casts its ghostly spell,
(Baljeet: Woooooooooooooooooo... )
It's like waving a blood-red cape in front of a vampire bull
(Baljeet: Woooooooooooooooooo... )
And that's a feeling we all know so well.

I find that I am haunted by you
And you are haunted by me, too.
It's a story as old as time
Vampire queens dig Pimpernels.
(Baljeet: Woooooooooooooooooo... )

Vanessa: Nice of you to finally show up.
Monty: Yeah, you're not gonna believe this, but all the costume shops were out of Pimpernel outfits.
Vanessa: Oh, I believe it.

(Song: "Foot Stomp Mash Up")
(The song has dialogue under)
Look at them, they're stompin' their feet!
Look, Look at them, they're stompin' their feet!
Look at them, they're stompin' their feet!
Stompin' their feet! they're stompin' their they're stompin' their they're stompin' their
You keep saying that you don't have rhythm
Don't have rhythm, don't have rhythm
You keep saying that you don't have rhythm
That's wings, you turkey!
You keep saying that you don't have rhythm
Don't have rhythm, don't have rhythm
You keep saying that you don't have rhythm
Squ-squirrels in my pants! pants! pants!
You keep saying that you squirrels in my pants!

(Cut to Phineas walking up to a sad Isabellarella.)
Phineas: What's wrong, Isabella?
Isabella: I ran out of shoes. (lifts up her gown to reveal she is now barefoot)
Phineas: Oh, that's okay. (throws off his shoes) It's more fun to dance barefoot anyway. (Phineas and Isabella begin dancing with each other)

(Cuts back to Monty and Vanessa. Monty accidentally bumps into his father, who is now dressed like a knight in shining armor.)
Monty: Oops, sorry.
Major Monogram: It's alright. (His visor drops on his eyes and he pushes it back up.) Monty, is that you?! With the daughter of my sworn enemy?! It can't be!! (Walks up to the Pimpernel next to Vanessa.) Alright, Monty, you've got a lot of explaining to— (the Pimpernel that is talking to Vanessa reveals herself to be Stacy)
Stacy: Oh, hello, Mr. Water and Power Guy.
Major Monogram: I, uh, better check the...uh...thing. Yes. (leaves)
Vanessa: Thanks, Stacy! I owe you!
Stacy: No thanks are necessary for that darned elusive Pimpernel.
Vanessa: Hey, where did Monty go?
Stacy: Oh, he's up there on that window ledge.
(Cut to Monty.)
Monty: (tipping his hat) Until next time, my queen! (He exits dramatically.)
Vanessa: Wow! That was really kind of swashbuckle-y!

(Cuts to outside the castle where it's revealed that Monty landed in the moat.)
Monty: Let's hope she didn't see that.

(Cut back to the party.)
Doofenshmirtz: (offscreen) "By luck or by chance, you found your last clue.
Turn the corner, favorite nephew."
Well, uh, what does she mean, "turn the corner"? It's just a flat wall, it's a— What are you doing, Perry the Platypus? (Perry shows a combination lock near the corner of a picture frame.) Oh, the corner of her picture! Give it a turn with your little platypus hands there! (Perry turns the lock and an unlocking noise is heard and bags of cash drop out.) At last!! Wahoo!! I'm rich! I am rich! I am comfortably well off! Don't worry, Perry the Platypus, I won't forget about you. You'll be the next person I invite to my first piñata party!
Man 1: Uh, excuse me, sir, are you the owner of this here building?
Doofenshmirtz: Yes.
Man 1: This area's not zoned for medieval castles. You're gonna have to pay a penalty fee.
Doofenshmirtz: Penalty fee? How much?
Man 1: One canvas bag with a huge dollar sign on it. (Doofenshmirtz gives the man a bag.) Thank you. Here's your receipt.
Doofenshmirtz: At least I still have all this loot.
Man 2: Danville Water Management Department. Can I see your permit for that moat? (Doofenshmirtz gives him a bag.)
Man 3: Bureau of Castle Conservation.
Doofenshmirtz: All right. (gives him a bag)
(Cut to outside the castle.)
Woman 1: (offscreen) Parking fines.
Doofenshmirtz: (offscreen) Here you go.
Man 4: (offscreen) Castle Relocation Authority.
Doofenshmirtz: (offscreen) Yeah, yeah, one for you, too.
Man 5: (offscreen) Ways and Means.
Doofenshmirtz: (offscreen) Yeah.
Woman 2: (offscreen) Means and Ways.
Doofenshmirtz: (offscreen) Take it. Here, just....
Man 6: (offscreen) Tri-State HOA.
Doofenshmirtz: (offscreen) Sure, why not?
Man 7: (offscreen) Department of bureaucracy.
(Doofenshmirtz groans offscreen.)

(Cut to the Flynn-Fletcher house. Some trick or treaters ring the doorbell. Nurse Linda answers.)
Trick or Treaters: Trick or treat!
Linda: Oh, my! Look at all the fun costumes! (passing out candy) Here you go. And here's one for you. And here's one for the little princess. And one for you. Oh, but wait! Don't go away! (singsongy) We have a little surprise for you! (leaves)
(Lawrence jumps behind the door in his gorilla costume scaring the children out of their candy. He takes off his mask.)
Lawrence: Oh, I do so love Halloween!
Linda: We're gonna save a ton of money on candy this year!

End credits

Ferb: When a vampire queen locks her thirsty eyes on a Pimpernel,
(Baljeet:' Woooooooooooooooooo... )
And the music casts its ghostly spell,
(Baljeet: Woooooooooooooooooo... )
It's like waving a blood-red cape in front of a vampire bull
(Baljeet: Woooooooooooooooooo... )
And that's a feeling we all know so well.