I'm trying to make a new spell that sort of manually does a chain spell, but only affects hostile characters. Here's what I have so far:
Scriptname CastOnHostileScript extends activemagiceffect SPELL Property aaMagicToCast AutoActor Property aaPlayer AutoEvent OnEffectStart(Actor akTarget, Actor akCaster) aaPlayer = Game.GetPlayer() as Actor while(akTarget != aaPlayer) if(akTarget.IsHostileToActor(aaPlayer)) ; cast magic to the target endif endwhileEndEvent
The script is attached to a cloak type magic effect and is supposed to "tag" an actor as a target if he/she/it is hostile to the player, and if so, the caster will cast magic at the tagged actor. I've gotten everything down except for the actual casting of the spell. I'm aware of the