The trap I'm thinking of would change depending on the type of enemy that stumbles across it.
There are two main ways of doing this that I could see. The first would be to add a potion dispenser. The dispenser produces a potion every time 15 enemies pass or every 30 seconds, being activated upon whatever happens first. Each type of enemy that consumes that potion will have different corresponding effects. For example, if large enemies such as ogres and large orcs consume the potion, they will explode and deal damage to the surrounding enemies. Fire and water ogres will have their temperature neutralized, turning them into normal ogres. It could give ogres gas which would then enrage surrounding monsters, causing them to attack the ogre.
Another trap idea I have would be poisonous bird seed. This would upset the flying monster's stomach, causing them to unload their cloaca's over their fellow minions, leading to the monsters underneath them becoming poisoned. Fire and frost flyers would have different effects, i.e the fire flyers would burn the enemies with their excrement, and the frost ones would eject shards of ice which pierce the enemies down below.