[behavior = tomb_entrance]
  <on_enter=0,1>
    do_click=1
  <on_click=0>
    teleport.cloister_udg3=0,4,16

--------------------------------------------------------------------------------
[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
    block = 1
    play_sound.rail_open =0
    end_round=1

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

  <on_click=0>
    play_sound.locked_door =0
    text_id=locked_door

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


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

  <on_activate=0,1>
    state = 1
    animate = -1, 3, 0, 1
    change_global.18=1
    block = 0
    play_sound.rail_open =0
  <on_activate=0,2>
    state = 0
    animate = -1, 0, 0, 1
    change_global.18=-1
    block = 1
    play_sound.rail_open =0
  <on_activate=1,1>
    state = 0
    animate = -1, 0, 0, 1
    change_global.18=-1
    block = 1
    play_sound.rail_open =0
  <on_activate=1,2>
    state = 1
    animate = -1, 3, 0, 1
    change_global.18=1
    block = 0
    play_sound.rail_open =0


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

[behavior=door_combo_main]
  <on_init = 0>
    animate = 0, 0, 0, 1
    block = 1
  <on_init = 1>
    animate = 3, 3, 0, 1
    block = 0
  <on_click=0>
    play_sound.locked_door =0
    text_id=locked_door
  <on_global=0,18,4>
    animate = -1, 3, 0, 1
    block = 0
    state=1
    play_sound.rail_open =0
    text_id=cudg2_trapdoor


[behavior=door_armory]
  <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.armory_key = 0
  <on_check=0,0,0>
    play_sound.locked_door =0
    text_id = locked_door
  <on_check=0,0,1>
    state=1
    do_click=0
    text_id=action_used_key
    play_sound.unlock=0
    remove_party_item.armory_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
    block = 1
    play_sound.rail_open =0
    end_round=1

[behavior=door_jail]
  <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.bronze_key = 0
  <on_check=0,0,0>
    play_sound.locked_door =0
    text_id = locked_door
  <on_check=0,0,1>
    state=1
    do_click=0
    text_id=action_used_key
    play_sound.unlock=0
    remove_party_item.bronze_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
    block = 1
    play_sound.rail_open =0
    end_round=1



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

-------------------------------------------------------------------------------
[behavior=up]
  <on_move=0,2>
    do_click=0
  <on_click=0>
    play_sound.ladder=0
    teleport.cloister_udg1=-1,8,10

[behavior=ladder]
  <on_move=0,2>
    do_click=0
  <on_click=0>
    play_sound.ladder=0
    teleport.cloister_udg1=1,2,21


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


[behavior=trap]
  <on_enter=0,1>
    teleport=-1,0,0
    text_id=cudg_trap1
    hit=102,0,10,30,1,1
  <on_activate=0,1>
    state=1
  <on_enter=1,1>
    text_id=cudg_trap3
    button_id=b_ok
  <on_button=1,0>
    state=255


--------------------------------------------------------------------------------
[behavior = lever_trap]
  <on_init = 0>
    animate = 0, 0, 0, 1
  <on_init = 1>
    animate = 1, 1, 0, 1
  <on_click = 0>
    state = 1
    animate = -1, 1, 0, 1
    activate = 1,0,0
    text_id=cudg_trap2
    play_sound.switch=0
  <on_click=1>
  	play_sound.switch =0

[behavior = lever_door]
  <on_init = 0>
    animate = 0, 0, 0, 1
  <on_init = 1>
    animate = 1, 1, 0, 1
  <on_click = 0>
    state = 1
    animate = -1, 1, 0, 1
    activate = 1,0,0
    play_sound.switch=0
  <on_click = 1>
    state = 0
    animate = 0, 0, 0, 1
    activate = 2,0,0
    play_sound.switch=0


--------------------------------------------------------------------------------
[behavior=create_monks]
  <on_enter=0,1>
    enemy.monk=0,0
    enemy.monk=0,0
    state=1
[behavior=remove_monks]
  <on_enter=0,1>
    remove_enemy.monk=0,0
    remove_enemy.monk=0,0
    state=1
[behavior = call_monks]
  <on_enter=0,1>
    text_id=cudg_gotcha1
    button_id=b_next
  <on_button=0,0>
    flash_view=0,0,0,100
    change_hp=0,100,2
    change_stamina=0,100,2
    teleport=-1,0,0
    end_round=1
    rob_party=7,6
    text_id=cudg_gotcha2
    state=1
    button_id=b_next
  <on_button=1,0>
    text_id=cudg_gotcha3
    enemy.monk_special=0,1
    xenemy.igor=0,1
    xenemy.igor=-1,0
    xenemy.igor=1,0

--------------------------------------------------------------------------------
[behavior=call_for_help]
  <on_enter=0,1>
    text_id=cudg_call_for_help
    quest.call_for_help=1
    button_id=b_ok
    state=1

--------------------------------------------------------------------------------
[behavior=prisoner1]
  <on_click=0>
    check_global.19=3,0
  <on_check=0,0,-1>
    change_global.19=1
    text_id=cudg_thank_you1
    button_id=b_ok
  <on_check=0,0,0>
    text_id=cudg_thank_you2
    quest.call_for_help=2
    exp=10000
    button_id=b_ok
  <on_button=0,0>
    remove_enemy.townsman=0,0
    remove_enemy.townswoman=0,0
    remove_enemy.nobleman=0,0
    state=255

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

[behavior = teleport]
  <on_enter = 0,1>
    play_sound.teleport=0
	flash_view = 100,200,255,200
    teleport = -1,0,0

--------------------------------------------------------------------------------
[behavior = lever]
  <on_init = 0>
    animate = 0, 0, 0, 1
  <on_init = 1>
    animate = 1, 1, 0, 1
  <on_click = 0>
    state = 1
    animate = 1, 1, 0, 1
    cube.g_cloister1=0,0,0
    play_sound.move_stone=0
  	play_sound.switch =0
  <on_click = 1>
    state = 0
    animate = 0, 0, 0, 1
    cube.w_gravewall1=0,0,0
    play_sound.move_stone=0
  	play_sound.switch =0

--------------------------------------------------------------------------------
[behavior=door_bone_key]
  <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.bone_key = 0
  <on_check=0,0,0>
    play_sound.locked_door =0
    text_id = locked_door
  <on_check=0,0,1>
    state=1
    do_click=0
    play_sound.unlock=0
    text_id=action_used_key
    remove_party_item.bone_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
    block = 1
    play_sound.rail_open =0
    end_round=1



