NPC that fights in the map

Hello, i wanted to create a game where the player will travel through a large map full of enemies, but i also want some NPC that aren't in the party, like soldiers, to look for the events that trigger a battle with the enemies, walk to that events, blocking them, and then there will be a 60/40 chance that or the guard or the monster get killed and disapears after a while, and then respawn.
It would be great if the guard could collect XP and loot that the player can obtain later.

Is there a Plug-in or a vanilla way to do this?
You can do this vanilla way, but it will be a lot of repetitive work.

I suggest you check Yanfly's event scripts (search for event). They add a ton of time saving functions and ways of doing several gameplay wise actions.

The part where an event triggers another event, i just got a reply by @ImaginaryVillain on an issue of mine which may just do the trick:

Create an if statement, and in the script section of it put...

JavaScript:
$gameMap.distance($gamePlayer.x, $gamePlayer.y, $gameMap.event(this._eventId).x, $gameMap.event(this._eventId).y) === 0;

Then put whatever you want it to do when it touches the player inside of the if statement. You'll need to set this event as a parallel, so you'll probably want a wait command in there so the player can respond. If you wish to use another event to do the checking, replace "this._eventId" which the eventId you want to check.
That... doesn't help at all... because i don't know anything about scripting
That... doesn't help at all
sorry that you feel that way, but your request is too far outside the engine's default (which have no event-to-event-triggers at all).
And plugins are not wonder-machines. They can add functionality, but the more complex they are the more configuration they need. And that configuration will often require at least some basic knowledge of computer logic or direct javascript knowledge in the more extreme cases.

at this moment your choices are to either start learning how to use scripts and plugins, or to reduce the scope of your idea to something lesser. Or you could try to find someone you pay for writing such a specific plugin, because that is too much work to be requested for free and very unlikely to be done that way without some payment.
It really depends on your plan here. If you just want the two to meet up the same way every time. You could just move them both via move commands and have a random number decide the outcome. Then increment a treasure variable every time the guard wins a fight, and at the end give rewards based on the treasure variable.

This method could even start with a random chance to pick from multiple pre-programmed routes. So it doesn't always look exactly the same. Of course the downsides to this are you'll have to manually make all of the move routes, and it won't look very random. But it's definitely the easiest way, since you don't need any scripting.

If you wish to create a whole event interaction system so it can be truly random. Well, that's going to take scripting. Though you might be able to repurpose one of the ABS systems like Chrono Engine, Alpha ABS or QABS.... But make no mistake about it, event interaction in MV is no cakewalk.
You could just move them both via move commands and have a random number decide the outcome. Then increment a treasure variable every time the guard wins a fight, and at the end give rewards based on the treasure variable.

This method could even start with a random chance to pick from multiple pre-programmed routes. So it doesn't always look exactly the same.
Thanks, i will try that way

Original thread: https://forums.rpgmakerweb.com/threads/npc-that-fights-in-the-map.119698/