ON INIT {
  IF (§res == 1) { //attention : feinte de pute...
    SET £type "human_guard_kingdom"
    SET §refuse 0
    ACCEPT
  }
 SET £type "human_guard_kingdom"
 ACCEPT
}
ON INITEND {
 IF (§res == 1) { //attention : feinte de pute...
   SETEVENT CHAT ON
   SET #CARLO_INTRODUCED 1   //le faire que dans un script
   SET §dead 0
   SETWEAPON LONG_SWORD
   SET_NPC_STAT life 25
   SET §reflection_mode 1
   TELEPORT MARKER_0581
   BEHAVIOR MOVE_TO
   SETTARGET MARKER_0582
   ACCEPT
  }
 SETWEAPON NONE
 TWEAK SKIN "npc_human_chainmail_body" "npc_human_chainmail_guard_body_dirty"
 TWEAK SKIN "npc_human_chainmail_guard_head" "npc_human_chainmail_guard_head3"
 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"
	TIMERkill 0 6 FORCEDEATH SELF
    ACCEPT
  }
 ACCEPT
}
ON REACHEDTARGET {
  IF (^TARGET == MARKER_0582) {
    BEHAVIOR FRIENDLY
    SETTARGET NONE
    TIMERpatrol01 1 2 GOTO NEXT_STEP
    ACCEPT
  }
  IF (^TARGET == MARKER_0581) {
    BEHAVIOR FRIENDLY
    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_0581
  }
 ACCEPT
>>NEXT_STEP01
  IF (§main_behavior_stacked != 0) {
    TIMERpatrol02 1 2 GOTO NEXT_STEP01
  }
  ELSE {
    BEHAVIOR MOVE_TO
    SETTARGET MARKER_0582
  }
 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_0582
    ACCEPT
  }
 ACCEPT
}
ON DIE {
 SET §dead 1
 ACCEPT
}