These events take place in the latest release of the 2012 version of Dwarf Fortress.
The Dwarven Fortress of Merchantwar was settled near a bridge. The Elven and Human merchants, of course, never used this bridge. They thought it was far more economical to meander through trees and try to cross the shallow water at the waterfall, which inevitably pushed them off and drowned them. Also, due to fear of immigrating vampires and a resultant tantrum spiral, the fortress became a segregated one, with a well fed and serviced population below, which never once saw sunlight, and a shifting population above that was often in a state of (hilarious) trouble. This fortress has a long and amusing history, but that is for another time and place. Let's just say that there were 9 Fel moods and a vampire king who killed most of his own guard who were the only military dwarves.
The constant deaths on the surface, almost all of which were due to civil war, resulted in every migrant given the carpentry and masonry labors to constantly churn out coffins to keep up with demand. The dead had to be recovered because the memorials could not be engraved fast enough by the one craftsman inside, and engravings couldn't be made for the dead merchants. The bodies were recovered from the frozen river during winter. Originally a 15x14 tomb was made, filled with 210 coffins. More layers were added with staircases to the side. Eventually, the 7 underground layers were filled and more were added on top. The constant wealth from adamantine and gold inside the fortress kept migrants coming by the truckloads. At about this point, the edges were channeled away, and 4 pillars were built underneath this tomb-structure before it was cut away completely underneath.
The point was that there now were over 2,000 dead bodies in coffins resting on pillars that would collapse if 2 levers (behind raised bridges) were pulled. Should the fortress be overrun, then this doomsday device would be unleashed. If the Dwarves couldn't have it, then no one could.
I took over a year off to get married, during which my hard drive crashed and the fortress was lost. I never got to unleash my weapon and see if those disturbed corpses turned into a legion of angry ghosts. If anyone else has built something like this and used it, please let me know how it went.