// Erzog as a city guard

ON INIT {
 SET £helping_buddy "HUMAN_BASE_0046"
 SET £flee_marker "FLEE_MARKER_0012"
 SET £type "human_guard_kingdom"
 SET £friend "kingdom"
 SET £voice "_vb"
 SET_GROUP ANTI_THIEF
 ACCEPT
}

ON INITEND {
 SENDEVENT -ir DURABILITY 100 "85"
 BEHAVIOR MOVE_TO
 SETTARGET MARKER_0044
 ACCEPT
}

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

ON PLAYER_IN_SHOP {
 IF (§player_in_sight == 0) ACCEPT
 SPEAK -a ~£thief~ NOP
 SENDEVENT ATTACK_PLAYER SELF ""
 ACCEPT
}

>>NEXT_STEP
  IF (§main_behavior_stacked != 0) 
  {
    TIMERpatrol011 1 2 GOTO NEXT_STEP
  }
  ELSE 
  {
    BEHAVIOR MOVE_TO
    SETTARGET MARKER_0042
    SETMOVEMODE WALK
  }
 ACCEPT

>>NEXT_STEP01
  IF (§main_behavior_stacked != 0) 
  {
    TIMERpatrol021 1 2 GOTO NEXT_STEP01
  }
  ELSE 
  {
    BEHAVIOR MOVE_TO
    SETTARGET MARKER_0044
    SETMOVEMODE WALK
  }
 ACCEPT
 
ON RELOAD {
  SETWEAPON LONG_SWORD
  IF (#PLAYER_ON_QUEST < 2) {
	TWEAK ALL "human_chainmail"
    TWEAK SKIN "npc_human_chainmail_hero_head" "npc_human_chainmail_erzog_head"
	TWEAK SKIN "npc_human_chainmail_body" "npc_human_chainmail_guard_body"
    ACCEPT
  }  
  IF (#PLAYER_ON_QUEST > 2) {
    TWEAK ALL "human_chainmail"
	TWEAK SKIN "npc_human_chainmail_body" "npc_human_chainmail_guard_body"
    ACCEPT
  }
 ACCEPT
}