void main()
{
  if (GetLocked(OBJECT_SELF) == FALSE)
  {
    object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC);
    float fDist = GetDistanceBetween(OBJECT_SELF,oPC);
    if (fDist >= 20.0f)
      SetLocked(OBJECT_SELF,TRUE);
  }
}
