Fortunately, i tackled and solved this problem a few days ago, just attach a script like this to one of your actors:
Scriptname ActorCombatScript extends Actor;This script will cast the spell 'SpellOfDoom' whenever; this actor enters combatSPELL Property SpellOfDoom AutoEvent OnCombatStateChanged(Actor akTarget, int aeCombatState) ;we have entered combat with actor akTarget if (aeCombatState == 1) ;equip the spell in your hand first, AI will equip spell in both hands if it has to ;but otherwise a value of 0 = lefthand, 1= righthand, 2=voice (use this for powers) EquipSpell(SpellOfDoom,0) ;now cast Spell of doom on enemy akTarget. Pass 'self' as the second param to this function if you ;want to cast a spell like healing or invisibility DoCombatSpellApply(SpellOfDoom, akTarget) elseif (aeCombatState == 2) Debug.Trace("We are searching for the enemy...") ;AI enters this state at the beginning of combat (before it has Line-of-Sight to enemy) also when an enemy runs away or turns a corner ;So this spot would be a good place to cast 'power up' or 'protective' spells endIfendEvent