Only skills and town planing(levels make it a bit harder).But considering that AI has infinite money,it copes with town planing very well.With skills,however,it doesnt.
As for all of the AI running away from player when it should attack,its just poor prioritising.Same would happen with HIII AI if youd tell it to prioritize staying in town at the end of turn.It would simply sit there unless you came at half its alking range.Now Im not defending it,it is a bad decision,yes.What I am saying is that theres nothing wrong with the design of the AI,but with its valuables.Ok,theres nothing wrong with the design of the AI if it was used in a simpler game,like doomIII
But seriously,if I knew where the values for the AI are stashed Id easily make it do some smarter things.For combat I know what it is(the threat of the creature),and I can mod it.For the adventure map,however,I have no idea where it draws those values from.