Spawned dragons are detected via animation events, which should allow for completely reliable detection even if the dragon never lands on something. Farm animals will not run either, because they're stupid. Guards, members of The Companions, Vigilants of Stendarr, and the player's followers/teammates will not run, they will stand and fight. The NPCs chosen are first come, first serve by the game engine. This should work for any NPCs added by mods as well, up to a limit of 150 in the area. If no inn is present the game picks a random interior from the surrounding area and those NPCs will flee there instead. 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. NPCs who live in the attack location who own a home there will retreat to it. Instead, the citizens will run to safety like smart people should when faced with the horrors of giant flying fire breathing lizards (or bloodthirsty undead). This was born out of frustration at seeing the citizens all trying to be a hero and rushing headlong to their doom attacking dragons and vampires. A small mod that makes citizens in a village or city run indoors during a dragon or vampire attack.