Above, there's a mention that "Tweakmod" gives promos based on crime rate... I'm not familiar with it,
I did a few things with Esus's mechanics, but the religious promos were probably the biggest. I'm at work right now, so I can't open up the file and look at the exact code, but the formula for promotions looked something like this:
max promotions a unit can receive = (city pop)/5
attempts to apply a promotion = (crime rate)/10
chance for a promotion = 7/15, (it choose a random number between 0 and 14, with 7 valids)
So if a city has a population of 15, and a crime rate of 60, then a unit could be born with at most 3 promotions (pop/5). The chance for a promotion would be 7/15 (~46%), and it will try to apply promotions 6 times (crime/10). The possible promotions were:
1) (Esus set to Unit's religion)
2) Hidden Nationality
3) Hidden
4) Poisoned Blade
5) Flanking I
6) Poison Resistance
7) Bounty Hunter
Every promotion granted stayed on the list, but reapplying it did nothing. So the chance for one promotion is 7/15, a second 6/15, a third 5/15, etc..., all relative to how many attempts at promotions you have. Note, for purposes of this example, a large city with a high crime rate was given. In game, most cities will never see more than one or two promotions per unit.
Then there was Aeron's Bounty, a new wonder added to Esus. It increased the maximum number of promotions units in that city could get by one. It also gave a chance for
greater Esus Promotions, which were:
1) Aeron's Chosen
2) Sinister
3) Flanking I and Flanking II
The chance for one of these being applied was 3/10, and only one attempt was allowed on them.