Basic spellcasting AI

Added basic AI for casting spells, enchanted items and drinking potions. I've got some ideas for further refinements, but it should be usable enough as is to be included.

Also includes improvements in selecting a weapon to equip, which is now handled by AiCombat. It detects broken weapons and not having the required ammunition for a weapon. It should now also be smarter about selecting the "best" weapon to use.