Determines the current foe under attack by the specified creature.
- Creature currently involved in combat. (Default: OBJECT_SELF)
Get the attack target of oCreature.
It gets cleared when the attack action is removed or you lose your target (if they die or go invisible) or the round ends.
In other uses it can be good to see what a creature is intentionally targeting for the purposes of, for instance, knowing if you can parry them or sneak attack them.
It is not set when a creature is casting a spell at something, only when ActionAttack or similar actions are used. To know if they're casting a spell use GetCurrentAction. Since casting a spell can be on the ground you won't be able to tell what they're directly casting against.
author: Jody Fletcher, editor: Charles Feduke, additional contributor(s): Jon McCarty, Noel Borstad