ON INIT {
  IF (§res == 1) { //attention : feinte de pute...
    SET £type "human_guard_kingdom"
    SET §refuse 0
    ACCEPT
  }
 SET £type "human_guard_kingdom"
 SET §dead 0
 SET £voice "_vc"
 SET_SPEAK_PITCH 1.1
 ACCEPT
}

ON INITEND {
 IF (§res == 1) { //attention : feinte de pute...
   SETEVENT CHAT ON
   SET §dead 0
   SETWEAPON LONG_SWORD
   DESTROY SEAT_STOOL1_0007
   SET_NPC_STAT life 25
   SET §reflection_mode 1
   BEHAVIOR WANDER_AROUND 300
   SETTARGET NONE
   ACCEPT
  }
 SETWEAPON NONE
 TWEAK SKIN "npc_human_chainmail_body" "npc_human_jailmail_guard_body"
 TWEAK SKIN "npc_human_chainmail_hero_head" "npc_human_chainmail_guard_head2"
 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 (§dead == 0) ACCEPT
    SET §dead 0
    SET §res 1
    REVIVE -i
    ACCEPT
  }
  IF (#PLAYER_ON_QUEST == 0) {
    IF (§dead == 1) ACCEPT
    IF (£friend != "NONE") SETGROUP -r £friend
    SET £friend "NONE"
    TIMERkill 0 16 FORCEDEATH SELF
    ACCEPT
  }
 ACCEPT
}

ON REACHEDTARGET {
  IF (^TARGET == MARKER_0934) {
    BEHAVIOR WANDER_AROUND 300
    SETTARGET NONE
    ACCEPT
  }
 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_0934
    ACCEPT
  }
 ACCEPT
}

ON DIE {
 SET §dead 1
 ACCEPT
}