// Player dragger Warden

ON INIT {
 SET £helping_buddy "GOBLIN_BASE_0012"
 SET £flee_marker "FLEE_MARKER_0050"
 INVENTORY ADD "PROVISIONS\\TORCH\\TORCH"
 SET §reflection_mode 0
 ACCEPT
}

ON INITEND {
 SET_NPC_STAT life 10
 SET_NPC_STAT damages 4
 SETWEAPON NONE
 LOADANIM ACTION1 "Goblin_misc_drag_player"
 SET £key_carried "KEY_BASE_0005portcullis"
 SENDEVENT -ir DURABILITY 100 "43"
 ACCEPT
}

ON RELOAD {
 SET §enemy 1
 BEHAVIOR MOVE_TO
 SETTARGET MARKER_0110
 ACCEPT
}

ON REACHEDTARGET {
  IF (^TARGET == MARKER_0110) {
    BEHAVIOR FRIENDLY
    SETTARGET MARKER_0028
    TIMERpatrol02 1 2 GOTO NEXT_STEP 
    ACCEPT
  }
  IF (^TARGET == MARKER_0028) {
    BEHAVIOR FRIENDLY
    SETTARGET MARKER_0110
    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_0028
  }
 ACCEPT

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

ON CUSTOM {
  IF (^$PARAM1 == "CINEMATIC") {
    OBJECT_HIDE SELF NO
    TELEPORT MARKER_0028
    PLAYANIM -L ACTION1
    PLAY "drag"
    SET §frozen 1
    ACCEPT
  }
  IF (^$PARAM1 == "gotojail") {
    TELEPORT MARKER_0111
 //   PLAYANIM NONE
 //   PLAYANIM -L ACTION1
    ACCEPT
  }
  IF (^$PARAM1 == "hide" ) {
    TELEPORT MARKER_0028
    PLAYANIM NONE
    SET §reflection_mode 1
    SET_WEAPON CLUB
    ACCEPT
  }
 ACCEPT
}