I have finished making the magic mod but I currently have no AI for it, and don't really know how to do this. TGA, theLopez if you read this please help me. Right now the plan is this:
1) Have a new UNIT_AI called WIZARD
2) All the spells have a 'strengh' tag, and the spell the wizard casts is random, but weight towards spells with higher strenghts.
3) The AI checks every plot in which the spell can be cast and chooses the best one (depending on whether the spell is an attack spell, a collateral spell, a heal spell, ect...)
4) If there are no 'decent' places to cast a spell the wizard moves to a better place.
This will, obviously, produce a rather bad AI. 2 and 3 could be merged so that it checks every plot for every spell, and then chooses the best spell to cast. I have no idea on how to make step 4. Should I just copy the UNITAI_ATTACK and UNITAI_DEFENCE?