Here's a DF trap that should work perfectly against live players AI (or against a lone adventurer in adventurer mode). It won't work against goblins because goblins simply won't path into this dead-end. It might work against lever-pullers though.
#######
#77777#
#77777# <- magma reservoir, 14+ units of magma
#77777#
###-### <- Floor Hatch A
# #
# #
##### #
l>## ############### <- Lever A
##< lX_X <- Lever B, Floodgate A, Pressure Plate A, Floodgate B
######-#-########### <- Floor Hatch B, Floor Hatch C
# # #
# # #
# # #
# # #
# # #
# # #
####### # #
# _ # <- Pressure Plate B
###########
Legend.Adventurers come from the west and must proceed to the east.
Floor hatches A and C are remotely controlled and locked.
Floor hatch B is remotely controlled and open.
Pulling the Lever A opens and closes Floor Hatch B.
Pulling the Lever B opens floodgate A and floor hatch A.
Pressure Plate A is activated by magma 1+ and opens Floor Hatch C.
Pressure Plate B is activated by magma 1+ and opens Floodgate B.
How players are caught.Players see hatches A, B and C, levers A and B, and floodgate A.
They can easily and without any risk to their health find out that Lever A controls Floor Hatch B.
Floor Hatch A is quite high above, so they cannot check it's temperature.
Floor Hatch B is open and must be closed using Lever A if they want to cross it.
Hatch C is remotely controlled and cannot be opened by players.
When players pull the Lever B, two things happen.
First, the Floodgate A opens (but Floodgate B remains closed).
Second, Floor Hatch A opens and a stream of magma pours down the corridor, cutting the players' only way of escape.
What happens next depends on whether or not Floor Hatch B is closed. Note that the players must split the group and cut the retreat for the advance group in order for the plate to be open at this moment. So most likely it will be closed and the players will be burned to crisp. :-)
However after the corridor is filled with magma, Pressure Plate A activates and the floor hatch C opens, releasing magma down the reserve chute and draining the main corridor.
Once there's magma in the bottom chamber, Pressure Plate B activates and the Floodgate B is opened, finally opening the way to the treasure (or a group of hungry goblins).
How players can pass through.Someone must stay behind at Lever A and open the Floor Hatch B once the rest of the group crosses it.
Then the players can safely pull the Lever B and all magma will pour down the left chute without any risk for the players.
Floor Hatch B can then be closed and the group reunited.
The idea of the trap is that in order to proceed the players must make two highly uncomfortable decisions - to split the group and to cut the retreat for a part of the group while pushing a lever with unknown effects.
A subtle hint: if the players know a bit of geology, they might recognize that everything except Lever A is made from bauxite. If anyone of them knows a bit about Dwarf Fortress, that might help.
Note that the trap only works once so after activation the passage will remain open forever. It is possible to make a self-reloading version but it will take more time than I presently have.