Warzone Mechanics (5e Variant Rule)
From D&D Wiki
Sometimes players have to wander through a raging battlefield and reach the other side. When this happens, it's very difficult for the DM to create a standard encounter using every creature in the battle. The purpose of warzone mechanics is to allow players to wander through a major battle without the complexities of a massive encounter.
When players are in a warzone, the DM rolls 1d20 to hit each player character on each of their turns, taking the following modifiers depending on the size of the battle:
- Battle Size Effects
- Gang Fight: Disadvantage and -2.
- Light Skirmish: Disadvantage and -1.
- Standard Battle: Disadvantage.
- Major Conflict: Disadvantage and +1.
- War of Empires: 50% chance of disadvantage with +2.
If the roll beats the PC's armor class, the DM randomly selects (with a die roll or otherwise) any ranged weapon or spell in use on the battlefield that the PC will be hit by, who takes the standard damage for that weapon or spell. If the DM rolls a Natural 20, the PC is hit by two weapons/spells.
Attacking NPCs: If a PC attacks an NPC that is in battle, the NPC will pursue and target that PC until or unless there is a different enemy closer to the NPC than the PC that targeted them.
Melee Battle: If the battle is being fought without spells or ranged weapons, the DM ignores the battle size effects and only rolls for a PC if they start their turn adjacent to one of the NPCs in the battle. Additionally, the die roll has disadvantage and a modifier of the number of NPCs the PC is adjacent to minus 4. The PC will only be hit by a weapon carried by an adjacent NPC.