Conditional Encounter?

So I have this idea of certain monsters appearing only when you have a certain equipment equipped, how?

example: I equip sword only slimes will appear and when I equip bow only bats will appear
There is a conditional branch to check if an armor or weapon is equipped on a character. Using that as a base you can change the troop with this code:

BattleManager.setup(troopId, true/false, true/false);

Replace TroopID with the battle team you want to show up and First true/false is for allowing to Escape, 2nd true/false is for allowing the player to lose

Messing around with that will allow you to control what troops show up...in theory.
Okay thanks! Will try that after my exams

Original thread: https://forums.rpgmakerweb.com/threads/conditional-encounter.103065/