Pokémon trainer AI?

I’m making my first game and for battles I plan on using something similar to how battles are started in Pokémon
(Trainer Sees player and initiates Battle)
I’m not making a Pokémon game
But would like to know how to do this
Moved to: RPG Maker MV
Put a row of below player - player touch trigger events that call a common event that initiates battle in front of the NPC. Use a switch per unique encounter to disable the event from repeating itself after player victory.
There are two ways I would go about this: If they're going to be stationary and facing one direction then use Yanfly's Event Hitbox Resize plugin to extend their hitbox range to the direction they're facing and it'll handle like a regular event. If you want the event to turn direction or move around, you'll need something like Yanfly's Event Chase Player plugin.
Thanks so much

Original thread: https://forums.rpgmakerweb.com/threads/pokemon-trainer-ai.114254/