sound.choir = data/sound/choir.wav
sound.daemon_talk = data/sound/daemon_talk.wav
sound.npc_monk = data/sound/npc/npc-vztekloun.wav
sound.digger = data/sound/npc/npc-posmevacek.wav
sound.igor = data/sound/npc/npc-igor.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=RESPAWN-torso]
  <on_enter = 0, 1>
    check_global.253=0,0
  <on_check=0,0,1>
    enemy.torso_respawn=0,0
    change_global.253=-1

[behavior=broken_tstone]
  <on_click=0>
    text_id=something's_missing
    use_offer=0
  <on_use.runic_stones=0,0>
    text_id=nothing_happened
  <on_use.runic_stones=0,1>
    play_sound.move_stone =0
    object.tstone=3,0,0,14,5
    change_global.250=1
    remove_party_item.runic_stones=1
    state=255

[behavior=tstone]
  <on_click=0>
    flash_view=0,250,250,100
    play_sound.skill_ancestor =0
    teleport=-1,0,0

[behavior=tstone_tomb]
  <on_click=0>
    flash_view=0,250,250,100
    play_sound.skill_ancestor =0
    teleport.kings_tomb_2=-1,23,7

[behavior=tstone_cata]
  <on_click=0>
    flash_view=0,250,250,100
    play_sound.skill_ancestor =0
    teleport.upper_catacombs=-1,33,19

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

[behavior = grave_unknown]
  <on_click=0>
    text_id = unknown_grave

[behavior = grave_roland]
  <on_click=0>
    text_id = grave_roland

[behavior = grave_iggy]
  <on_click=0>
    text_id = grave_iggy


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


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


[behavior = door_cellar]
  <on_move = 0,2>
    do_click=1
  <on_click = 0>
    check_item.cellar_key = 0
  <on_check = 0,0,0>
    text_id = locked_door
    play_sound.locked_door=0
  <on_check = 0,0,1>
    remove_party_item.cellar_key = 1
    play_sound.unlock=0
    state=1
    text_id=action_used_key

  <on_move = 1,2>
    do_click=1
  <on_click = 1>
    play_sound.door = 0
    teleport.DIGGERS_CELLAR = -1,5,6


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


[behavior = t_small_tomb]
  <on_move = 0,0>
    do_click=1
  <on_click = 0>
    play_sound.ladder=0
    teleport.SMALL_TOMB = -1,1,6

[behavior = t_edward]
  <on_move = 0,0>
    do_click=1
  <on_click = 0>
    play_sound.ladder=0
    teleport.SMALL_TOMB = -1,4,18
    
[behavior = t_vigus]
  <on_move = 0,0>
    do_click=1
  <on_click = 0>
    play_sound.ladder=0
    teleport.TOMB_VIGUS = 2,8,1

[behavior = t_ambrius]
  <on_move = 0,0>
    do_click=1
  <on_click = 0>
    play_sound.ladder=0
    teleport.TOMB_AMBRIUS_1 = -1,7,1

[behavior = t_catacombs]
  <on_move = 0,0>
    do_click=1
  <on_click = 0>
    play_sound.ladder=0
    teleport.UPPER_CATACOMBS = -1,12,16

[behavior = t_catacombs2]
  <on_move = 0,0>
    do_click=1
  <on_click = 0>
    play_sound.ladder=0
    teleport.UPPER_CATACOMBS = -1,16,15

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

[behavior = hole_spider]
  <on_enter = 0,1>
    do_click=1
  <on_click = 0>
    remove_party_item.severed_skull=99
    remove_party_item.left_hand=99
    remove_party_item.right_hand=99
    remove_party_item.mentor_sandals=99
    remove_party_item.paper_with_runes=99
    remove_party_item.flute=99
    remove_party_item.thief's_log=99
    remove_party_item.digger's_note=99
    remove_party_item.ruby=99
    remove_party_item.paper_fragment=99
    remove_party_item.rusty_key=99
    remove_party_item.iron_key=99
    remove_party_item.golden_key=99
    remove_party_item.runic_stones=99
    remove_party_item.bodypart=99
    stop_all_sounds = 1
    #reset respawnu
    set_global.255 = 0
    set_global.254 = 0
    set_global.253 = 0
    set_global.252 = 0
    set_global.251 = 0
    teleport.SPIDER_TUNNEL,cloister = -1,29,34


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

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

  <on_click = 0>
    check_item.rusty_key = 0
  <on_check = 0,0,0>
    text_id = locked_gate
    play_sound.LOCKED_DOOR=0
  <on_check = 0,0,1>
    state = 1
    animate = -1, 1, 0, 1
    block = 0
    text_id = action_used_key
    remove_party_item.rusty_key = 1
    play_sound.unlock=0
    play_sound.RUSTY_GATE=0
    end_round=1
  <on_click = 1>
    state = 2
    animate = 0, 0, 0, 1
    block = 1
    play_sound.RUSTY_GATE=0
  <on_click = 2>
    state = 1
    animate = -1, 1, 0, 1
    block = 0
    play_sound.RUSTY_GATE=0
    end_round=1


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

  <on_click = 0>
    check_item.iron_key = 0
  <on_check = 0,0,0>
    text_id = locked_gate
    play_sound.LOCKED_DOOR=0
  <on_check = 0,0,1>
    state = 1
    animate = -1, 1, 0, 1
    block = 0
    text_id = action_used_key
    remove_party_item.iron_key = 1
    play_sound.unlock=0
    play_sound.RUSTY_GATE=0
    end_round=1
  <on_click = 1>
    state = 2
    animate = 0, 0, 0, 1
    block = 1
    play_sound.RUSTY_GATE=0
  <on_click = 2>
    state = 1
    animate = -1, 1, 0, 1
    block = 0
    play_sound.RUSTY_GATE=0
    end_round=1

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

  <on_click = 0>
    check_item.golden_key = 0
  <on_check = 0,0,0>
    text_id = locked_gate
    play_sound.LOCKED_DOOR=0
  <on_check = 0,0,1>
    state = 1
    animate = -1, 1, 0, 1
    block = 0
    text_id = action_used_key
    remove_party_item.golden_key = 1
    play_sound.unlock=0
    play_sound.RUSTY_GATE=0
    end_round=1
  <on_click = 1>
    state = 2
    animate = 0, 0, 0, 1
    block = 1
    play_sound.RUSTY_GATE=0
  <on_click = 2>
    state = 1
    animate = -1, 1, 0, 1
    block = 0
    play_sound.RUSTY_GATE=0
    end_round=1

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


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

  <on_click = 0>
    text_id = jammed
    play_sound.LOCKED_DOOR=0
  <on_activate=0,1>
    state=2
  <on_click = 1>
    state = 2
    animate = 0, 0, 0, 1
    block = 1
    play_sound.RUSTY_GATE=0
    end_round=1
  <on_click = 2>
    state = 1
    animate = -1, 1, 0, 1
    block = 0
    play_sound.RUSTY_GATE=0

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

[behavior = zombie_dummy]
  <on_click=0>
    picture = data\scene\zombie.jpg
    text_id = gy_zombie1
    quest.lost_necklace = 1
    play_sound.SKILL_BEAST =0
    state=1
  <on_click=1>
    check_item.ancient_necklace = 0
  <on_check=1,0,0>
    picture = data\scene\zombie.jpg
    text_id = gy_zombie1
    play_sound.SKILL_BEAST =0
  <on_check=1,0,1>
    picture = data\scene\zombie.jpg
    text_id = gy_zombie2
    button_id = b_yes
    button_id = b_no
    picture = data\scene\zombie.jpg
    play_sound.SKILL_BEAST =0
  <on_button=1,0>
    text_id = gy_zombie3
    remove_party_item.ancient_necklace=1
    remove_enemy.h_zombie = 0,0
    item.golden_key=0,0
    quest.lost_necklace = 2
    state=1
    picture = data\scene\zombie.jpg
    play_sound.SKILL_BEAST =0
    exp = 1000

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



[behavior=digging_dummy]
  <on_enter=0,1>
    play_sound.choir = 0
    text_id = gy_no_room1
    enemy.livingdead=0,-1
    enemy.livingdead=1,0
    enemy.fatdead=1,0
    enemy.zombie=0,1
    enemy.torso=-1,0
    enemy.livingdead=-1,0
    
    remove_object.coffin1=1,1
    remove_object.coffin1=1,1
    remove_object.coffin1=1,0
    object.coffin_dig=0,1,1
    object.coffin_dig=3,1,1
    object.coffin_dig=3,1,0
    
    button_id=b_ok
    
  <on_button=0,0>
    state=255

[behavior=coffin_dig]
  <on_click=0>
    check_item.shovel = 1,1
  <on_check=0,1,0>
    text_id = no_tools_to_dig
  <on_check=0,1,1>
    check_item.pick = 2,1
  <on_check=0,2,0>
    text_id = no_tools_to_dig
  <on_check=0,2,1>

    text_id = gy_no_room2

    remove_object.coffin_dig=0,-1
    remove_object.coffin_dig=0,0
    remove_object.coffin_dig=0,0
    remove_object.coffin_dig=0,1
    remove_object.coffin_dig=0,1

    object.grave1=0,-1,0
    object.grave2=0,0,0
    object.grave1=0,1,0
    remove_object.digging_dummy=0,0
    set_global.7=1
    state=255


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


[behavior = break_spec_vase]
  <on_click=0>
    item.rusty_key = 0,0
    play_sound.break_vase=0
    state=255

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


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

[behavior = door_digger]

  <on_move = 0,2>
    do_click=0
  <on_click=0>
    play_sound.door = 0
    play_sound.digger =0
    picture = data\scene\digger.jpg
    text_id = gy_digger_0_welcome
    button_id.250 = b_digger_tombs
    button_id.250 = b_digger_advs
    button_layout = 1

  <on_button = 0,1>
    picture = data\scene\digger.jpg
    text_id = gy_digger_0_advs
    button_id = b_digger_tombs
  <on_button = 0,0>
    picture = data\scene\digger.jpg
    text_id = gy_digger_0_tomb1
    button_id = b_go_on
    state=1
  <on_button = 1,0>
    picture = data\scene\digger.jpg
    text_id = gy_digger_0_tomb2
    button_id = b_digger_waddya
    state=2
  <on_button = 2,0>
    picture = data\scene\digger.jpg
    text_id = gy_digger_1_start
    quest.kings_seal = 1
    quest.diggers_job1=1
    item.cellar_key = 255,255
    state=3
    button_id = b_trade
    button_id = b_leave

  <on_move = 3,2>
    do_click=0
  <on_click=3>
    play_sound.door = 0
    play_sound.digger =0
    check_global.6 = 10,0
  <on_check = 3,0,-1>
    picture = data\scene\digger.jpg
    text_id = gy_digger_1_undone
    button_id = b_trade
    button_id = b_leave
  <on_button = 3,0>
    item_offer=1,12
  <on_check = 3,0,0>
    picture = data\scene\digger.jpg
    text_id = gy_digger_2_start
    quest.diggers_job1=2
    exp = 1000
    quest.diggers_job2=1
    state=4
    button_id = b_digger_nochoice
  <on_button = 4,0>
    picture = data\scene\digger.jpg
    text_id = gy_digger_2_start2
    state = 5
    button_id = b_trade
    button_id = b_leave
  <on_button = 4,0>
    item_offer=1,12

  <on_move = 5,2>
    do_click=0
  <on_click=5>
    check_item.chateau_de_carcass = 0
    play_sound.door = 0
    play_sound.digger =0
  <on_check = 5,0,0>
    picture = data\scene\digger.jpg
    text_id = gy_digger_2_undone
    button_id = b_trade
    button_id = b_leave
  <on_button = 5,0>
    item_offer=1,12
  <on_check = 5,0,1>
    picture = data\scene\digger.jpg
    text_id = gy_digger_3_start
    quest.diggers_job2=2
    exp = 1000
    quest.diggers_job3=1
    remove_party_item.chateau_de_carcass=1
    state=6
    button_id = b_go_on
  <on_button = 6,0>
    picture = data\scene\digger.jpg
    text_id = gy_digger_3_start2
    object.digging_dummy=0,0,0
    item.shovel=0,0
    item.pick=0,0
    state = 7
    button_id = b_trade
    button_id = b_leave
  <on_button = 7,0>
    item_offer=1,12

  <on_move = 7,2>
    do_click=0
  <on_click=7>
    play_sound.door = 0
    play_sound.digger =0
    check_global.7 = 1,0
  <on_check = 7,0,-1>
    picture = data\scene\digger.jpg
    text_id = gy_digger_3_undone
    button_id = b_trade
    button_id = b_leave
  <on_check = 7,0,0>
    picture = data\scene\digger.jpg
    text_id = gy_digger_3_done
    quest.diggers_job3=2
    state=8
    button_id = b_next
    exp = 1000
  <on_button = 8,0>
    picture = data\scene\digger.jpg
    text_id = gy_digger_4
    item.seal = 255,255
    state=9

  <on_move = 9,2>
    do_click=0
  <on_click=9>
    play_sound.door = 0
    play_sound.digger =0
    item_offer=1,12


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

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



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


[behavior = king_seal]
<on_click=0>
	text_id=gy_seal1
	check_item.seal = 0,4
<on_check = 0,0,1>
	text_id=gy_seal2
	remove_party_item.seal = 4
	object.t_king = 0,0,0
	quest.kings_seal=2
	remove_object.king_seal = 0,0
	exp = 5000
    
-------------------------------------------------------------------------------

[behavior = respawn_king]
  <on_init=0>
    check_global.12=1,0
  <on_check=0,0,0>
    state=1
    enemy_forced.undeadking=0,0
    object.king_dummy=0,0,0

[behavior=king_dummy]
  <on_click=0>
    text_id = gy_king1
    button_id = b_ok
    play_sound.daemon_talk=0
  <on_button=0,0>
    flash_view=0,200,250,255
    teleport=0,0,1
    object.king_dummy2=0,0,1
    object.lightning=0,1,-1
    activate=1,1,-1
    state=1
  <on_click=1>
    text_id = kt3_king1
    play_sound.daemon_talk=0

[behavior=king_dummy2]
  <on_move=0,-1>
    play_sound.daemon_talk=0
    text_id = gy_king2
    button_id = b_ok
    state=255
   
[behavior=lightning]
  <on_activate=0,1>
    animate=0,5,0,2
    object.hole_spider=0,0,0
    play_sound.WEATHER_FLASH = 0


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

[behavior = hole]
  <on_enter=0,1>
    play_sound.ladder=0
    teleport=-1,0,0
    
[behavior = ladder]
  <on_move = 0,2>
    do_click=0
  <on_click=0>
    play_sound.ladder=0
    teleport=-1,0,0
    
-------------------------------------------------------------------------------
[behavior=mumble]
  <on_enter=0,1>
    text_id=gy_mumble
    play_sound.choir = 0
    state=1
    button_id=b_ok
    
--------------------------------------------------------------------------------
[behavior = button]
  <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_forest1=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=leonard_dummy]
  <on_click=0>
    text_id=leonard1
    button_id=b_work
    button_id=b_trade
    button_id=b_leave
    play_sound.npc_monk = 0
  <on_button=0,1>
    item_offer = 1,12
  <on_button=0,0>
    text_id=leonard2
    quest.creating_life=1
    state=1
    button_id=b_trade
    button_id=b_leave
    
  <on_button=1,0>
    item_offer = 1,12

  #po zadani ukolu
  <on_click=1>
    check_item.bodypart=0,5
  <on_check=1,0,0>
    text_id=leonard3
    button_id=b_trade
    button_id=b_leave
    play_sound.npc_monk = 0
  <on_check=1,0,1>
    text_id=leonard4
    quest.creating_life=2
    remove_party_item.bodypart=5
    exp=1000
    state=2
    button_id=b_ok
    play_sound.npc_monk = 0

  # pred bojem
  <on_click=2>
    text_id=leonard5
    state=3
    button_id=b_next
    play_sound.npc_monk = 0
  <on_button=3,0>
    flash_view=0,100,250,250
    object.lightning=0,1,-1
    play_sound.WEATHER_FLASH = 0
    text_id=leonard6
    state=4
    button_id=leo_attack1
    button_id=leo_attack2
  <on_button=4,0>
    enemy_type.leonard = leonard_attack, 0, 0
    flash_view=0,100,250,250
    play_sound.WEATHER_FLASH = 0
    state=5
  <on_button=4,1>
    enemy_type.leonard = creature_attack, 0, 0
    flash_view=0,100,250,250
    play_sound.WEATHER_FLASH = 0
    state=5

  # po boji
  <on_activate=5,1>
    enemy_forced.creature=0,0
    state=10
  <on_activate=5,2>
    enemy_forced.leonard=0,0
    state=20
    
  # creature
  <on_click=10>
    play_sound.igor =0
    text_id=leonard7
    button_id=b_trade
    button_id=b_leave
  <on_button=10,0>
    state=11
    item_offer = 1,12
  <on_click=11>
    play_sound.igor =0
    item_offer = 1,12
  # leo
  <on_click=20>
    text_id=leonard8
    button_id=b_trade
    button_id=b_leave
    play_sound.npc_monk = 0
  <on_button=20,0>
    state=21
    item_offer = 1,12
  <on_click=21>
    item_offer = 1,12
