Jump to content

Cast a spell in a target's direction?


leron9999

Recommended Posts

Hello all!

 

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 Auto
Actor Property aaPlayer Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
aaPlayer = Game.GetPlayer() as Actor

while(akTarget != aaPlayer)
	if(akTarget.IsHostileToActor(aaPlayer))
	   ; cast magic to the target
	endif
endwhile
EndEvent

 

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 <spell>.cast(akSource, akTarget), unfortunately akTarget seems to only apply to "target" delivery spells and most offensive magic are "aimed". So is there a way to get the caster to cast an aimed spell at the intended target? Any help would be much appreciated.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...