If you make an NPC cast a ranged spell using ExplodeSpell, they shoot the spell in the direction they were targeting before rather than casting it at their feet.