// Outpost Guard (Bridge)
ON INIT {
 IF (§res == 1) {				//attention : feinte de pute...
  SET §refuse 0
  SET £type "human_guard_kingdom"
  ACCEPT
 }
 SET £type "human_guard_kingdom"
 INVENTORY ADD "\\PROVISIONS\\CHEESE\CHEESE"
 SET £voice "_vc"
 SET_SPEAK_PITCH 0.9
 ACCEPT
}

ON INITEND {
 IF (§res == 1) {				//attention : feinte de pute...
   SETEVENT CHAT ON
   SET §dead 0
   SETWEAPON LONG_SWORD
   SET_NPC_STAT life 25
   SET §reflection_mode 1
   TELEPORT MARKER_0330
   TIMERgopatrol 1 2 GOTO GO_PATROL
   ACCEPT
  }
 SETWEAPON NONE
 TWEAK SKIN "npc_human_chainmail_hero_head" "npc_human_chainmail_guard_head2"
 TWEAK SKIN "npc_human_chainmail_body" "npc_human_chainmail_guard_body_dirty"
 ACCEPT
}

>>GO_PATROL
 BEHAVIOR MOVE_TO
 SETTARGET MARKER_0589
 ACCEPT

ON RELOAD {
  IF (#PLAYER_ON_QUEST > 4) {
    IF (§dead == 1) ACCEPT
    IF (£friend != "NONE") SETGROUP -r £friend
    SET £friend "NONE"
    DESTROY SELF
    ACCEPT
  }
  IF (#TROLL_QUEST > 1) {
    IF (§res == 1) ACCEPT
    SET §res 1
    REVIVE
    ACCEPT
  }
  IF (#PLAYER_ON_QUEST == 0) {
    IF (§dead == 1) ACCEPT
    IF (£friend != "NONE") SETGROUP -r £friend
    SET £friend "NONE"
    FORCEDEATH SELF
    ACCEPT
  }
 ACCEPT
}

ON REACHEDTARGET {
  IF (^TARGET == MARKER_0589) {
    BEHAVIOR NONE
    SETTARGET NONE
    TIMERpatrol01 1 2 GOTO NEXT_STEP
    ACCEPT
  }
  IF (^TARGET == MARKER_0330) {
    BEHAVIOR NONE
    SETTARGET NONE
    TIMERpatrol02 1 2 GOTO NEXT_STEP01
    ACCEPT
  }
 ACCEPT
}

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

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

ON CUSTOM {
  IF (^$PARAM1 == "ATTACK_YLSIDE") {
    SET §refuse 1
    SETEVENT CHAT OFF
    WEAPON ON
    BEHAVIOR -f MOVE_TO
    SETTARGET -a HUMAN_BASE_0069
    SETMOVEMODE RUN
    ACCEPT
  }
 ACCEPT
}

ON COLLIDE_NPC {
 IF (§refuse == 1) REFUSE
 ACCEPT
}

ON TARGET_DEATH {
  IF (^SENDER == "HUMAN_BASE_0069") {
    SET §refuse 0
    SETEVENT CHAT ON
    BEHAVIOR MOVE_TO
    SETTARGET MARKER_0330
    ACCEPT
  }
 ACCEPT
}

ON DIE {
 SET §dead 1
 ACCEPT
}