About This File
A small mod that makes citizens in a village or city run indoors during a dragon attack.
This was born out of frustration at seeing the citizens all trying to be a hero and rushing headlong to their doom attacking dragons. Instead, the citizens will run to safety like smart people should when faced with the horrors of giant flying fire breathing lizards. NPCs who live in the attack location who own a home there will retreat to it. If the attack location has an inn, NPCs who don't live there will flee to the inn, along with any NPCs who live outdoors. If no inn is present the game picks a random interior from the surrounding area and those NPCs will flee there instead.
This should work for any NPCs added by mods as well, up to a limit of 150 in the area. After that, they're on their own. The NPCs chosen are first come, first serve by the game engine.
Guards, members of The Companions, Vigilants of Stendaar, and the player's followers/teammates will not run, they will stand and fight. Farm animals will not run either, because they're stupid. That includes your horse.
Spawned dragons are detected via animation events, which should allow for completely reliable detection even if the dragon never lands on something.
Hand placed dragons are detected when their combat state changes* as well as when they land on any available perch objects in the area.
* [Only after they land on the ground]
What's New in Version 2.0.7
Added an extra failsafe in case the protection quest somehow starts but the aliases for tracking dragons are not filled. If the initial alias fails, an error will be logged. Citizens will be vulnerable to attack if this happens. It is not currently know why the alias fails to fill but chances are it's induced by mods which alter how dragons work.