An attack of opportunity (AoO) is a single (per round) free attack that is automatically taken when an enemy makes themselves vulnerable, such as moving in combat or casting a spell. This can only be made when the attacker is unarmed or wielding a melee weapon. Making an attack of opportunity will cancel other actions, such as casting a spell (making these attacks a potential nuisance for spell casters who do not have a ranged weapon equipped).
The situations that provoke an attack of opportunity are
- drinking a potion,
- casting a spell,
- firing a ranged weapon in melee,
- running while in melee,
- a disarm attempt without the improved disarm feat, and
- fighting unarmed without the improved unarmed strike feat (and nothing equipped in the gloves or bracers slot).
Some of these can be negated by special abilities (e.g. tumble or spring attack), while others might be turned off by the difficulty setting. Running can be avoided by holding down the "shift" key when clicking the spot to which to move.