ON INIT {
 SET £type "human_guard_ss"
 SET §infront 0
 SET §moving 0
 SET §athome 1
 SET £voice "_vb"
 INVENTORY ADDFROMSCENE "KEY_BASE_0080"
 SET £dying_marker MARKER_0336
 ACCEPT
}
ON COLLIDE_NPC {
 REFUSE
}
ON INITEND {
 SENDEVENT -ir DURABILITY 100 "59"
 SET £flee_marker "FLEE_MARKER_0033"
 SET £helping_buddy "Human_base_0086"
 BEHAVIOR NONE
 SETTARGET NONE
 ACCEPT
}

//ON CONTROLLEDZONE_ENTER {
// IF (^$PARAM1 == PLAYER) ACCEPT
// IF (^$PARAM1 == "HUMAN_BASE_0110") ACCEPT
// ACCEPT
//}

>>LEAVE_DUTY
 BEHAVIOR MOVE_TO
 SETTARGET MARKER_0333
 ACCEPT

ON CONTROLLEDZONE_ENTER {
 IF (^$PARAM1 != PLAYER) ACCEPT
 IF (^PLAYERSPELL_INVISIBILITY == 1) ACCEPT
 IF (§moving == 1) ACCEPT
 IF (§infront == 0) ACCEPT
 //SET §infront 0
 UNSET_CONTROLLED_ZONE GUARDING_ALIA
 HEROSAY -d "BACK TO DUTY"
 TIMERguarding2 1 1 GOTO BACK_DUTY
 ACCEPT
}
 
>>BACK_DUTY
 BEHAVIOR MOVE_TO
 SETTARGET MARKER_0333
 ACCEPT

ON CHAT {
 IF (#krahoz_stolen == 1) REFUSE
 IF (§moving == 1) REFUSE
 IF (§infront == 1) REFUSE
 IF (§athome == 1) REFUSE
 IF (#DISSIDENT == 3) {
  SPEAK -p [player_misc_hi_there] nop
  REFUSE
 }
// SET §infront 1
// HEROSAY -d "LET ME PASS !"
// TIMERguarding1 1 1 GOTO LEAVE_DUTY
 ACCEPT
}


ON REACHEDTARGET {
///////////////////////////////////////simule le go home a upgrader
  IF (^TARGET == "MARKER_0336") {
    BEHAVIOR MOVE_TO
    SETTARGET MARKER_0337
    ACCEPT
  }
  IF (^TARGET == "MARKER_0337") {
    BEHAVIOR NONE
    SETTARGET NONE
    TELEPORT -i
    ACCEPT
  }
//////////////////////////////////////////////////////////
  IF (^TARGET == "MARKER_0333") {
    BEHAVIOR FRIENDLY
    SETTARGET PLAYER
    SET §moving 0
    SET §infront 0
    ACCEPT
  }
  IF (^TARGET == "MARKER_0331"){
    IF (§takekra == 1) {
     SETTARGET HUMAN_BASE_0111
     ACCEPT
    }
    BEHAVIOR FRIENDLY
    SETTARGET MARKER_0336
    SET §moving 0
    SET §infront 0
    ACCEPT
  }
 IF (^TARGET == "HUMAN_BASE_0111"){
  BEHAVIOR FRIENDLY
  SETTARGET HUMAN_BASE_0111
  SENDEVENT LOOKATME HUMAN_BASE_0111 ""
  TIMERleave 1 1 GOTO GOHOME 
  ACCEPT
 }
 ACCEPT
} 


ON CHANGESTATUS {
  IF (^$param1 == "1") {
    SET §reflection_mode 0
    TELEPORT MARKER_0331
    SET §athome 0
    //BEHAVIOR FRIENDLY
    //SETTARGET PLAYER
    SET_CONTROLLED_ZONE GUARDING_ALIA
    ACCEPT 
  }
 ACCEPT
}

ON GOHOME {
>>GOHOME 
 SET §reflection_mode 1
 UNSET_CONTROLLED_ZONE GUARDING_ALIA
 BEHAVIOR MOVE_TO
 SETTARGET marker_0336
 ACCEPT
}

//ON LETPASS {
// GOTO LEAVE_DUTY
// ACCEPT
//}

ON TAKE_KRAHOZ {
 SET §takekra 1
 BEHAVIOR MOVE_TO
 SETTARGET MARKER_0331
 ACCEPT
}