'Called repeatedly during patrolling mode.  In this mode, the
mob scans its surroundings and randomly chooses a viable exit.
One should lock exits with the traverse:has_player() lock in
order to block the mob from moving outside its area while
allowing player-controlled characters to move normally.'

def do_patrol(self, *args, **kwargs):

    if ((random.random() < 0.01) and self.db.irregular_msgs):
        self.location.msg_contents(random.choice(self.db.irregular_msgs))
    if self.db.aggressive:
        target = self._find_target(self.location)
        if target:
            self.start_attacking()
            return
    exits = [exi for exi in self.location.exits if exi.access(self, 'traverse')]
    if exits:
        exit = random.choice(exits)
        self.move_to(exit.destination)
    else:
        self.move_to(self.home)
