Pretty sure that can be done, but it might be unpredictable in non dungeon maps.
Also I second GetDMapOffset
Most of this stuff should be found in maps.cpp IIRC.