sound.npc-hvizd = data/sound/npc/npc-hvizd.wav
sound.tree = data/sound/enemy/tree.wav
sound.ghost = data/sound/npc/npc-ghost.wav

[behavior=RESPAWN-zombie]
  <on_enter = 0, 1>
    check_global.255=0,0
  <on_check=0,0,1>
    enemy.zombie_respawn=0,0
    change_global.255=-1

[behavior=RESPAWN-fatdead]
  <on_enter = 0, 1>
    check_global.254=0,0
  <on_check=0,0,1>
    enemy.fatdead_respawn=0,0
    change_global.254=-1

--------------------------------------------------------------------------------

[behavior = timber]
  <on_click=0>
    text_id = remove_timber
    activate = 1,0,0
    remove_object.timber = 0,0
    play_sound.MOVE_STONE = 0

-------------------------------------------------------------------------------
[behavior = wall_sign]
  <on_click=0>
    text_id=cloister_library

-------------------------------------------------------------------------------
[behavior = cloister_gate]
  <on_click=0>
    text_id = cloister_gate


-------------------------------------------------------------------------------
[behavior = library_door]
  <on_enter=0,1>
    do_click=0
  <on_click=0>
    play_sound.ladder=0
    teleport.library=-1,6,19
    
-------------------------------------------------------------------------------
[behavior = well_dummy]
  <on_click=0>
    play_sound.ladder=0
    teleport.spider_tunnel=-1,1,1


-------------------------------------------------------------------------------
[behavior = hangman]
  <on_click=0>
    activate=1,0,0
    play_sound.tree =0
    text_id=hangman1
    button_layout=1
    button_id.310=b_hangman1a
    button_id.310=b_hangman1b
    button_id.310=b_hangman1c
  <on_button=0,0>
    text_id=hangman_a
    button_id=b_hangman3
    state=1
  <on_button=0,1>
    text_id=hangman_b
    button_id=b_hangman3
    state=1
  <on_button=0,2>
    text_id=hangman_c
    button_id=b_hangman3
    state=1
  <on_button=1,0>
    text_id=hangman2
    button_id=b_hangman4
    state=2
  <on_button=2,0>
    state=3
    text_id=hangman3
    button_id=b_ok
    x button_id=b_hangman5
    x quest.helping_hangman=1
    x enemy.fatdead_hangman=35,3
  <on_button=3,1>
    x state=4
    x text_id=hangman4
    x button_id=b_next
    
  <on_button=3,0>
    state=7
    quest.helping_hangman=1
    enemy_forced.fatdead_hangman=35,3
    text_id = hangman_bored
    button_id=b_trade
    button_id=b_leave
  <on_button=4,0>
    state=7
    text_id = hangman_bored
    button_id=b_trade
    button_id=b_leave
  <on_button=7,0>
    item_offer=1,12

  <on_click=7>
    play_sound.tree =0
    text_id=hangman_unfinished
    button_id=b_trade
    button_id=b_leave

  <on_activate=7,1>
    state=6

  <on_click=6>
    play_sound.tree =0
    text_id=hangman_finished
    state=5
    quest.helping_hangman=2
    exp = 10000
    quest.bell_tower=1
    object.red_book=2,20,12
    
  <on_click=5>
    play_sound.tree =0
    text_id = hangman_bored
    button_id=b_trade
    button_id=b_leave
  <on_button=5,0>
    item_offer=1,12
    
  #tyto 2 eventy jsou pridany kvuli kompatibilite se starou verzi bez shopu:
  <on_click=3>
    state=7
    do_click=1
  <on_click=4>
    state=6
    do_click=1

[behavior=hangman_wait]
  <on_enter=0,1>
    text_width=310
    play_sound.npc-hvizd =0
    text_id=hangman_wait
    button_id=b_ok
    state=1


-------------------------------------------------------------------------------
[behavior = ladder_up]
  <on_move = 0,2>
    do_click=0
  <on_click=0>
    play_sound.ladder =0
    teleport.cloister_tower=-1,3,1

[behavior = ladder_down]
  <on_enter=0,1>
    do_click=0
  <on_click=0>
    quest.the_crypt=2
    exp=10000
    play_sound.ladder =0
    state=1
    teleport.cloister_udg1=-1,19,5
  <on_enter=1,1>
    do_click=0
  <on_click=1>
    play_sound.ladder =0
    teleport.cloister_udg1=-1,19,5

--------------------------------------------------------------------------------
[behavior = cloister_door]
  <on_init = 0>
  	animate = 0, 0, 0, 1
  	block = 1
  <on_init = 1>
  	animate = 3, 3, 0, 1
  	block = 0
  <on_click = 0>
  	state = 1
	  animate = -1, 3, 0, 1
  	block = 0
	  play_sound.rail_open=0
  	end_round=1
  <on_click = 1>
  	state = 0
  	animate = -1, 0, 0, 1
	  play_sound.rail_open=0
  	block = 1
  	end_round=1

[behavior = tower_door]
  <on_init = 0>
  	animate = 0, 0, 0, 1
  	block = 1
  <on_init = 1>
  	animate = 0, 0, 0, 1
  	block = 1
  <on_init = 2>
  	animate = 3, 3, 0, 1
  	block = 0
  	
  <on_click = 0>
    check_item.tower_key = 0
  <on_check=0,0,0>
    text_id = locked_door
    play_sound.locked_door=0
  <on_check=0,0,1>
    state=1
    play_sound.unlock=0
    do_click=0
    text_id=action_used_key
    remove_party_item.tower_key=1

  <on_click = 1>
  	state = 2
	  animate = -1, 3, 0, 1
	  play_sound.rail_open=0
  	block = 0
  	end_round=1
  <on_click = 2>
  	state = 1
  	animate = -1, 0, 0, 1
	  play_sound.rail_open=0
  	block = 1
  	end_round=1

[behavior = prior_door]
  <on_init = 0>
  	animate = 0, 0, 0, 1
  	block = 1
  <on_init = 1>
  	animate = 0, 0, 0, 1
  	block = 1
  <on_init = 2>
  	animate = 3, 3, 0, 1
  	block = 0

  <on_click = 0>
    check_item.prior's_key = 0
  <on_check=0,0,0>
    play_sound.locked_door=0
    text_id = locked_door
  <on_check=0,0,1>
    state=1
    play_sound.unlock=0
    do_click=0
    text_id=action_used_key
    remove_party_item.prior's_key=1

  <on_click = 1>
  	state = 2
	  animate = -1, 3, 0, 1
  	block = 0
	  play_sound.rail_open=0
	  end_round=1
  <on_click = 2>
  	state = 1
  	animate = -1, 0, 0, 1
	  play_sound.rail_open=0
  	block = 1
  	end_round=1

--------------------------------------------------------------------------------
[behavior=libwraith]
  <on_init=0>
    check_global.15=12,0
  <on_check=0,0,0>
    remove_enemy.libwraith=0,0
    remove_object.libwraith=0,0
  <on_click=0>
    play_sound.ghost =0
    text_id = cloister_libwraith
    
    
--------------------------------------------------------------------------------
[behavior=finish_bell_tower]
  <on_enter=0,1>
    quest.bell_tower=2
    exp=10000
    state=255
    
[behavior=red_book]
  <on_click=0>
    text_id=found_tower_key
    item.tower_key=255,255
    state=1
    
    
--------------------------------------------------------------------------------

[behavior=turn_monk]
  <on_click=0>
    check_global.17=1,0
  <on_check=0,0,0>
    remove_object.monk_statue_center=0,0
    object.monk_statue_center=0,0,0
    play_sound.MOVE_STONE = 0
    state=2
  <on_click=2>
    remove_object.monk_statue_center=0,0
    object.monk_statue_center=1,0,0
    play_sound.MOVE_STONE = 0
    state=3
  <on_click=3>
    remove_object.monk_statue_center=0,0
    object.monk_statue_center=2,0,0
    play_sound.MOVE_STONE = 0
    state=4
    cube.g_cloister1=0,-1,-1

--------------------------------------------------------------------------------

[behavior=tstone]
  <on_click=0>
    text_id=travelstone
    button_id=b_tstone1
    button_id=b_tstone2
    button_id=b_tstone3
    button_id=b_tstone4
    button_id=b_tstone5
  <on_button=0,0>
    flash_view=0,250,250,100
    play_sound.skill_ancestor =0
    teleport=-1,20,2
  <on_button=0,1>
    flash_view=0,250,250,100
    play_sound.skill_ancestor =0
    teleport=-1,4,8
  <on_button=0,2>
    flash_view=0,250,250,100
    play_sound.skill_ancestor =0
    teleport=-1,39,16
  <on_button=0,3>
    flash_view=0,250,250,100
    play_sound.skill_ancestor =0
    teleport=-1,17,18

-------------------------------------------------------------------------------
[behavior = apple_tree]
  <on_click=0>
    item.apple = -1,0
    item.apple = 1,0
    item.apple = 0,1
    item.apple = 0,-1
    state = 1
  <on_click=1>
    item.apple = -1,0
    item.apple = 1,0
    item.apple = 0,1
    item.apple = 0,-1
    state = 2
  <on_click=2>
    text_id = dh_no_apple


-------------------------------------------------------------------------------
[behavior=zombie_attack]
  <on_enter=0,1>
    text_id=zombie_attack
    check_random=3,0
    button_id=b_ok
  <on_check=0,0,0>
    enemy.livingdead=0,1
    enemy.fatdead=-1,0
    enemy.zombie=1,0
  <on_check=0,0,1>
    enemy.zombie=0,-1
    enemy.livingdead=-1,0
    enemy.livingdead=1,0
  <on_check=0,0,2>
    enemy.zombie=0,-1
    enemy.headless=0,1
    enemy.fatdead=1,0
  <on_check=0,0,3>
    enemy.zombie=0,-1
    enemy.fatdead=0,1
    enemy.zombie=-1,0
  <on_button=0,0>
    state=255
    
    
[behavior = sign_prior]
  <on_click=0>
    text_id = cloister_prior

