This script allows you to specify custom troop surprise conditions. The condition must evaluate to true or false, but you are not limited to using probability-based conditions.
The condition is specified as a ruby formula, which allows you to create any kind of condition you want once you figure out how to write it.