Want an event to happen right after a battle

I hope there isn't already a thread on this (as this particular issue is quite hard to search for), but is there a way to make an event happens directly after a battle ends?

Essentially, I talk to an NPC who challenges me to fight, then half way through the fight he chickens out and aborts the battle.

It want it so that directly afterwards, there's some dialogue, I receive a new item and the NPC disappears.

I tried a few different methods to do this: I tried a separate event triggered by autorun that checked for a switch (which turns on the battle is ending), and if the switch was on it would go to the dialogue, but for some reason the event being on autorun means that my players couldn't move.

rpg separate event.JPG

I tried having the event as a separate page of the NPC's event, also on autorun, but the characters still couldn't move.

I tried having four events surrounding the NPC that are triggered as 'player touch', but they were only triggered if you moved onto them, rather than standing on them.

rpg 4 events.JPG

Currently i have it so that you have to talk to him after the battle (triggered by action button) but this is a bit annoying, I'd much prefer if it happened automatically after the battle.

rpg action button event.JPG

Can anyone help me out with this? Thanks in advance for you help.
All you need to do is to include all of that stuff after the command that triggers the battle in the NPC's event contents. Once the battle ends, the rest of the commands will play. Then turn on a self-switch on the event for the next page of the event so that it doesn't repeat the same thing if you interact with the NPC again.
It now does what I want it to do, thanks for your help and for the quick response, lilyWhite!

Although this doesn't apply to this particular situation, could you please elaborate on the self switch thing? When i turned on a self switch in a new page on the event, the NPC didn't appear on the map at all to start with.

If I wanted him to say something different the second time, should I put in all the new dialogue after the self switch on the same page or a different page?
Whichever page of an event is active is based on the highest-number page with all of its conditions active.

To have someone say something the second time around, turn on the self-switch on Page 1. Then set the condition for Page 2 being that self-switch being turned on, and have the dialogue for the subsequent interaction on Page 2. Remember to set the image for each page of the event as well, or else the NPC will vanish when the self-switch is turned on.
Thanks again, I've managed to get it to work, but when I put the second dialogue on a separate page, the NPC would just twitch towards me when i clicked on him and then do nothing. 

Right now I have the 2nd bit of dialogue at the very start of the first page (with a condition that the selfswitch is on), then the first bit of dialogue, which ends in a self switch being turned on. It works just the way I wanted it to, where for some reason the 2nd page doesnt work.

Thanks for all your help!

Original thread: https://forums.rpgmakerweb.com/threads/want-an-event-to-happen-right-after-a-battle.49452/