IsValidTarget
When the player or the engine considers possible targets, each possible target is searched for special abilities with a script named IsValidTarget. If any script returns a value containing 'Y' then we stop running scripts and consider the target valid. If any script returns a value containing 'N' we stop running scripts and skip over this combatant as a possible target. If no script returns any such values then the target is considered valid by default.
Parameters
Parameter [5] = X coordinate of target
Parameter [6] = Y Coordinate of target
Context
Combatant - the target combatant
Target - the target combatant
Attacker - the attacking combatant
Spell - if a spell is being cast