I dont know where the script for this is, but one thing that affects this is the descr_strat.txt when you go down about 3 dozen lines you will see some lines like this:

rebelling_characters_active
night_battles_enabled
brigand_spawn_value 30
pirate_spawn_value 10