First let me say: Great work so far guys; AI programming is the holy grail of gaming.
Let me add, there is always room for improvement

.
Most important to least important:
1. Are my targets immune to this damage type? (if yes ignore this spell)
2. Do I have any spells I can cast that my targets are especially vulnerable to? (examine these first)
3. Do I have any AOE spells I am immune/resistant to but my enemies are succeptible to? (this should be chosen over AOE spells that I am not immune/resistant to)
4. How many IMMEDATE threats can potentially be eliminated with this casting.
4.1. Area of the spell
4.2. Damage potential
4.3. Armor penetration potential
(focus on damage/AOE for light armor enemies)
5.Consider fatigue impact. By this I mean you can come up with a fatigue to damage potential ratio.... The most efficient spell should be used.
Discount any spell that will make me go unconcious.
6. Will friendlies be hurt?
This is where things start getting recursive; and very difficult to weight. I don't envy your task at all

.
7. Will the potential number of surviving enemies attacking me be capable of killing me next round?
7.1 Can I remove myself from danger without fleeing the battle? (hard to calculate I guess)
7.2 Can I protect myself from the ensuing potential damage?
8. Can I cast 2 spells a turn? Can I augment my abilities before considering which offensive spell to cast?
Thanks for reading, considering and communicating with your customers.
[ January 27, 2004, 17:06: Message edited by: Strages Sanctus ]