This looks for me as a kind of "radius of awareness" which seems to only take into account NPCs which will directly interact with the fight, but maybe the game need to have a second radius which would gather:
- NPCs who won't participate in the fight but who will be aware it had taken place and have a bad POV of the PCs
- guards who will participate in the fight even if they are farthest away that the standard NPCs, because it is their duty to protect the city
A simpler but easier solution would be if you could assign NPC's to certain factions, and in case a CITIZEN sees you commit a crime, it propagates to the GUARD faction and a response is given in various reaction levels. (ie, send guard 2 and guard 3 there). The first trigger of the script can always check for distances to make sure the reaction makes sense.
If Guard 2 and Guard 3 are dead and any civilian or guard sees it, escalate to reaction level 2 = Guards form up in full force trying to corner you, commander and all, and lock the city gates, and aim the ballistas at you. Give you a chance to surrender once, and then murder you ;p
And if you survive *that* a script could trigger the "Butcher of Cydalis" flag, and you'd be scorned across the world for this horrible mass murder. Which would lead to bounty hunters, and any guard that sees you being openly hostile. (And yes, if I were scripter, I'd lock you out of the good and neutral path of the main quest too, obviously not in a "you are not allowed to choose this" kind of way, but rather in a you don't get the choice at all anymore kind of way because the situations changed......
Either way, there needs to be a high-level reaction to massive death and carnage caused by the player.
No idea how vandalism or stealing could be coped with though. As I understand scripting in these games, you'd need to attach a ton of scripts on each "pickable" object.. and that's an insane number!
Ps.: A script could also handle NPC's not being suicidal, but rather fleeing towards guards, and if guards are all dead, barricade in some (together) building. ;P