Auto-translated
Your function isn't described in the manual, so I don't know how it's activated: before the battle or during reconnaissance :(. I would do it this way: before the battle starts, use GetObjectPosition, so we know where the battle is taking place: in a Dungeon or not. Then, if your function is activated before the battle, everything is simple. If not, you can run two different StartCombat functions depending on the situation.