WTASIGHT is a standard combat script and used by many creatures in the games. It's slightly expanded and refined throughout the course of the Baldur's Gate series; here, it is listed in its chronology of changes.
Baldur's Gate and Tales of the Sword Coast[]
IF AttackedBy([GOODCUTOFF],DEFAULT) Allegiance(Myself,NEUTRAL) THEN RESPONSE #100 Enemy() END IF See(NearestEnemyOf(Myself)) THEN RESPONSE #100 AttackReevaluate(NearestEnemyOf(Myself),30) END IF AttackedBy([ANYONE],DEFAULT) THEN RESPONSE #100 Attack(LastAttackerOf(Myself)) END
Shadows of Amn and Throne of Bhaal[]
IF Heard([ANYONE],111) THEN RESPONSE #100 MoveToObject(NearestEnemyOf(Myself)) END IF AttackedBy([GOODCUTOFF],DEFAULT) !Allegiance(Myself,ENEMY) THEN RESPONSE #100 Enemy() END IF See(NearestEnemyOf(Myself)) THEN RESPONSE #100 AttackReevaluate(NearestEnemyOf(Myself),30) END IF AttackedBy([ANYONE],DEFAULT) THEN RESPONSE #100 Attack(LastAttackerOf(Myself)) END
Baldur's Gate II: Enhanced Edition[]
IF Heard([ANYONE],111) THEN RESPONSE #100 MoveToObject(NearestEnemyOf(Myself)) END IF AttackedBy([GOODCUTOFF],DEFAULT) !Allegiance(Myself,ENEMY) THEN RESPONSE #100 Enemy() END IF ActionListEmpty() See(NearestEnemyOf(Myself)) THEN RESPONSE #100 AttackReevaluate(NearestEnemyOf(Myself),30) END IF ActionListEmpty() AttackedBy([ANYONE],DEFAULT) THEN RESPONSE #100 Attack(LastAttackerOf(Myself)) END
Baldur's Gate: Enhanced Edition and Siege of Dragonspear[]
IF StateCheck(Myself,STATE_PANIC) THEN RESPONSE #100 RandomWalkContinuous() END IF Heard([ANYONE],111) THEN RESPONSE #100 MoveToObject(NearestEnemyOf(Myself)) END IF AttackedBy([GOODCUTOFF],DEFAULT) !Allegiance(Myself,ENEMY) THEN RESPONSE #100 Enemy() END IF See(NearestEnemyOf(Myself)) InWeaponRange(LastSeenBy(Myself)) THEN RESPONSE #100 AttackReevaluate(NearestEnemyOf(Myself),30) END IF AttackedBy([ANYONE],DEFAULT) InWeaponRange(LastAttackerOf(Myself)) THEN RESPONSE #100 Attack(LastAttackerOf(Myself)) END IF See(NearestEnemyOf(Myself)) THEN RESPONSE #100 MoveToObject(LastSeenBy(Myself)) END