Teleport to another room after all enemies are defeated / Teleport to prison if Player is defeated

Hello!

I'm writing this topic because I need some help in making two separate Scenarios in my game.

Scenario 1:
Let's say we are on MAP1 and there are 3 different enemies which can be attacked. After all of them are defeated by the Player, there is a quick dialogue box and afterwards Player gets teleported to MAP2.

What's the easiest way to do it? I know how to make an event when a Player defeats one enemy and then gets teleported but it's too complicated for me when there are 3 separate enemies.

Scenario 2:
Player is on MAP1 and there are 3 different enemies which can be attacked. Player loses a fight against one of them but instead of a GAME OVER screen, Player gets teleported to a different map let's say called PRISON.

What's the easiest way to do it?

Thank you very much for help!
This should answer both scenarios, assuming your encounters are not random encounters.
1733085781507.png

Original thread: https://forums.rpgmakerweb.com/threads/teleport-to-another-room-after-all-enemies-are-defeated-teleport-to-prison-if-player-is-defeated.173601/