Trying to set up an automated castle defense system that will fire at anything undead in it's range. The meat of the problem is that the spell doesn't fire as it is supposed to.
Code snippet (in the heartbeat event of the ORB_WARD):
object oCaster = GetObjectByTag("ORB_WARD");
object oTarget = GetNearestCreature(CREATURE_TYPE_RACIAL_TYPE, RACIAL_TYPE_UNDEAD);
float fDist = GetDistanceBetween(oCaster, oTarget);
if (fDist < 12.0)
AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_RAY_OF_FROST, oTarget, METAMAGIC_ANY, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT));
I've verified that the GetNearestCreature line is acquiring a valid target, and it's in range. I hear the audible ray of frost sound, but I get no visual beam effect, and the target (a zombie in this instance) is never damaged. At this point the oCaster is an invisible placeable suspended 3m off the floor. My brain is more than a little fried today, so any help would be appreciated.
Edit: There is an impact visual from the ray of frost, but no beam, and no damage. My PC can cast the ray of frost spell with the appropriate visual and damage.