The weird wood turns out to be a lever. The cave roof collapses on the dragon. And now the dragon is dead. The dragon is most definitely, undeniably dead. Its big, red body is lying there like a big, blue worm catching some beauty sleep, with only the small fact that it is not a big, blue worm catching some beauty sleep but is a big, dead, red dragon to ruin the image. But, other than that, you are perfectly happy about the way things turned out. The dragon's bones shall lie there with the bones of its victims. Now, without its guardian, the treasure is yours to do with as you please. You win!