ON INIT {
 SET £helping_buddy "HUMAN_BASE_0048"
 SET £flee_marker "FLEE_MARKER_0002"
 SET £type "human_guard_kingdom"
 SET £friend "kingdom"
 SET_GROUP ANTI_THIEF
 ACCEPT
}

ON INITEND {
 SENDEVENT -ir DURABILITY 100 "85"
 TWEAK SKIN "npc_human_chainmail_hero_head" "npc_human_chainmail_guard_head2"
 BEHAVIOR MOVE_TO
 SETTARGET MARKER_0047
 ACCEPT
}

ON REACHEDTARGET {
  IF (^TARGET == MARKER_0047) {
    BEHAVIOR NONE
    SETTARGET NONE
    TIMERpatrol01 1 2 GOTO NEXT_STEP
    ACCEPT
  }
  IF (^TARGET == MARKER_0045) {
    BEHAVIOR NONE
    SETTARGET NONE
    TIMERpatrol02 1 2 GOTO NEXT_STEP02
    ACCEPT
  }
 ACCEPT
}

ON PLAYER_IN_SHOP {
 IF (§player_in_sight == 0) ACCEPT
 SPEAK -a ~£thief~ NOP
 SENDEVENT ATTACK_PLAYER SELF ""
 ACCEPT
}

>>NEXT_STEP
  IF (§main_behavior_stacked != 0) {
    TIMERpatrol01 1 2 GOTO NEXT_STEP
  }
  ELSE {
    BEHAVIOR MOVE_TO
    SETTARGET MARKER_0045
  }
 ACCEPT

>>NEXT_STEP01
  IF (§main_behavior_stacked != 0) {
    TIMERpatrol02 1 2 GOTO NEXT_STEP01
  }
  ELSE {
    BEHAVIOR MOVE_TO
    SETTARGET MARKER_0047
  }
 ACCEPT

ON RELOAD {
 IF (§enemy == 1) ACCEPT
 IF (#PLAYER_ON_QUEST == 6) ACCEPT
 TIMERpatrol01 OFF
 TIMERpatrol02 OFF
 TELEPORT -i
 BEHAVIOR MOVE_TO
 SETTARGET MARKER_0047
 ACCEPT
}