Al said:
If they choose to attack, play out the combat and let the dice fall where they may. However, maybe, *just* maybe, they'll pull it off. I had a DM way back where the party got in over their heads (we were mainly 3rd/4th level) against a 7th level necro and we came to about 4hps of killing him. In the end, my char ran away and the rest were captured or killed...*sigh*.
Anyway, play out the combat, and if they die, perhaps they won't be as stupid next time. Ensure that they have full warning in advance of his powers- show him animating dead, or using some other 4th level spell. If they still attack, play out the combat like any other.
I would say - give them one last fair warning, may be by having them meet the shattered/broken (and above all memorable !) remnants of some other wiseguys who went up against the BBEG before - and make it obvious what happened to them... If they do not believe in prophetic omens, well, go ahead. Like some beggars who barely made it out but left their limbs behind, or who went insane after having to kill their friends who turned into ghouls, spawns of Kyuss or whatever and went for their brains/juices/marrow.
But, whatever you do - get them with style !
That means : Do the TPK in such a way that they will certainly remember who it was who took them down, and will still recall the gory details years from now. Because a TPK done for 'educational' reasons is no good if it happens and no-one even learns from it.
So go for gruesome AND humilliating - like draining all the STR out of characters with "Rays of Exhaustion", then have them get captured, sorrily abused and finally baked and eaten by Goblins, make individuals run screaming from the fight only to be taken down cornered, alone and weeping in the dark, "Web" them, than have them being attacked by shadows while floundering helpless, drain their levels, paralyse them and get dragged off into the dark by some ghouls while still alive..... and if you kill and finally reanimate them, as well, great ! Even better if you can send them against a possible "follow-up" group or against something/someone they care for. For extra gruesomeness - consult the 'Book of Vile Darkness' and stuff like "liquid pain" etc. Sacrifying (of themselves) the hapless PCs to power some evil spell or appease some entity might just be memorable enough...
If you go for the prisoner approach - make certain to "disarm" casters and disable the characters while they are his prisoners, maybe even by breaking limbs, keeping them drugged/poisoned or doing Stat-damage.
And - by all means drive home the point, that even if you are 'evil', someone else out there can (and will ) match you in depravity each and every step you take - as well as surpass you.
And you knew it - and were so dumb to ignore it ! When you dance with the devil, you dance until the music is _over_ !
So IF you are going to slaughter them, make it a night to remember for everyone.