exec DATA\AREAS\drm25\Scripts\action2.cfg
exec DATA\AREAS\drm25\Scripts\gameplay.cfg


action vint(ventilyaciya:vint)
{
  -started -looped
 {
  time 12
  trans_type 1
  vector 0, 0, 0
  rotate 0,-360,0
  trans_type 0  
 }
}


action vint2(ventil_2:vint2)
{
  -started -looped
 {
  time 9
  trans_type 1
  vector 0, 0, 0
  rotate 0, 360,0
  trans_type 0  
 }
}


action vint_1(ventilyaciya:vint_1)
{
  -started -looped
 {
  time 9
  trans_type 1
  vector 0, 0, 0
  rotate 0,-1440,0
  trans_type 0  
 }
}


action vint_2(ventilyaciya:vint_2)
{
  -started -looped
 {
  time 9
  trans_type 1
  vector 0, 0, 0
  rotate 0,-1440,0
  trans_type 0  
 }
}


action Lift_down()
{
-noreturn
 {
  time 40
  trans_type 1
  accel_wave
  move 0, -7936, 0
  vectorr 0,0,0
  intime 0, 39
  sound Sound_Large_Lift_Move_4s_Loop1
 }
 {
  time 1
  ontime 39
  command "call shake_0"
//  ontime 40.2
//  command "t.unlock r_lift_door_T"
 }
}


action gruz()
{
-noreturn
 {
  time 40
  trans_type 1
  accel_wave
  move 0, 7936, 0
 }
}


procedure right_lift
{
 command "a.start Lift_down Lift_shahta:right_lift"
 command "a.start Lift_down Lift_shahta:right_lift_door"
 command "a.start gruz Lift_shahta:gruz_right"
 delayedcommand_name = "call shake_low"
 delayedcommand_delay = 4
}


action lift_door_open()
{
-noreturn
 { 
  time 0.2
 }
 {
  time 1.6
  trans_type 1
  move 0, 300, 0
  vectorr 0,0,0
  ontime_local 0
  sound Sound_Door_Elevator_Rattle_OpenClose_1_6s
 }
}


action lift_door_close()
{
-noreturn
 {
  time 1.6
  trans_type 1
  move 0, -300, 0
  vectorr 0,0,0
  ontime_local 0
  sound Sound_Door_Elevator_Rattle_OpenClose_1_6s
 }
 {
  time 1
  ontime_local 0.5
  command "call right_lift"
 }
}


action lift_door_close2(Lift_shahta:right_lift_door)
{
-noreturn
 {
  time 1.6
  trans_type 1
  move 0, -300, 0
  vectorr 0,0,0
  ontime_local 0
  sound Sound_Door_Elevator_Rattle_OpenClose_1_6s
 }
 {
  time 1
  ontime_local 0.2
  command "call right_lift_up; call message_late"
 } 
}


trigger r_lift_door_T(Lift_shahta:)
{
 center 320.0, -7744.0, 2624.0
 radius 208.0
 auto_lock
 command "call id_6; a.start lift_door_open Lift_shahta:right_lift_door" 
}


action tkan(zal:tkan)
{
-started -vactive  -looped
 {
 time 6
//   zwave 8 24 32 0.1
   ywave 8 24 32 0.1
 }
}


action rub_lift(Lift_shahta:rub_lift)
{
 {
  time 0.5
  trans_type 1
  vectorr 0, 0, 0
  rotate 130, 0, 0
  vector 0,0,0
  ontime 0
  sound sound_lever_1
 }
}


trigger rub_lift_T(Lift_shahta:)
{
 act_by_use 
 center   544, 560, 3152
 radius 48
 auto_lock
 command "call callLift" 
}


trigger r_door_close_T(Lift_shahta:)
{
 center  660, 185, 2944
 radius 180
 command "a.start lift_door_close Lift_shahta:right_lift_door; t.lock r_door_close_T" 
}


procedure door_timer
{
 delayedcommand_name = "a.start lift_door_open Lift_shahta:right_lift_door"
 delayedcommand_delay = 2
}


action s_door_1(bunker:s_door_1)
{
-noreturn
 {
  time 7
  vector 1664, 192, 3776
  accel_wave
  rotate 0, 6, 0
 }
}


action s_door_2(bunker:s_door_2)
{
-noreturn
 {
  time 0.3
 }
 {
  time 7
  vector 1664, 192, 3776
  accel _wave
  rotate 0, 3, 0
 }
}


action s_door_3(bunker:s_door_3)
{
-noreturn
 {
  time 7
  vector 1664, 192, 3776
  accel _wave
  rotate 0, -6, 0
 }
}


action s_door_4(bunker:s_door_4)
{
-noreturn
 {
  time 0.3
 }
 {
  time 7
  vector 1664, 192, 3776
  accel _wave
  rotate 0, -3, 0
 }
}


trigger s_doorT(bunker:Group_6)
{
 auto_lock
 command "call s_door" 
}


procedure s_door
{
 command "a.start s_door_1;a.start s_door_2;a.start s_door_3;a.start s_door_4"
 command "param1=101;call ga_setattack2" 
 command "em.unlock bunker:s_door_l"
 command "em.unlock bunker:s_door_r"
}


procedure left_lift_b
{
 command "a.start Lift_down Lift_shahta:left_lift"
 command "a.start Lift_down Lift_shahta:left_lift_door"
 command "a.start gruz Lift_shahta:gruz_left"
 command "a.start lift_break"
}


action lift_break(Lift_shahta:)
{
 {
 time 6
 ontime 5
 command "call lift_stop"
 }
}


procedure lift_stop
{
 command "a.pause Lift_down Lift_shahta:left_lift"
 command "a.pause Lift_down Lift_shahta:left_lift_door"
 command "a.pause gruz Lift_shahta:gruz_left"
}


action Lift_up()
{
-noreturn
 {
  time 40
  trans_type 1
  accel_wave
  move 0, 7936, 0
  vectorr 0,0,0
  intime 0, 39
  sound Sound_Large_Lift_Move_4s_Loop1
 }
 {
  time 1
  ontime 40.5
  command "t.unlock r_door_close_T"
 }
}


action gruz_d()
{
-noreturn
 {
  time 40
  trans_type 1
  accel_wave
  move 0, -7936, 0
 }
}


procedure r_lift_up
{
 command "a.start Lift_up Lift_shahta:right_lift"
 command "a.start Lift_up Lift_shahta:right_lift_door"
 command "a.start gruz_d Lift_shahta:gruz_right"
 delayedcommand_name = "a.start lift_door_open Lift_shahta:right_lift_door"
 delayedcommand_delay = 40
}


action koleso(Lift_shahta:koleso)
{
 {
  time 40
  trans_type 1
  accel_wave
  vectorr 0, 0, 0
  rotate 0, -1800, 0
  intime 0, 39
   sound Sound_Large_Lift_Motor_1_2s_Loop1
 }
}


action door()
{
-noreturn
 {
  time 1.3
  trans_type 1
  accel 1
  move 192, 0, 0
  vector 0,0,0
  ontime 0
  sound Sound_Door_Mechanical_OpenClose_Large2_1_3s
 }
}


action door_close()
{
-noreturn
 {
  time 1.3
  trans_type 1
  accel 1
  move -192, 0, 0
  vector 0,0,0
  ontime 0
  sound Sound_Door_Mechanical_OpenClose_Large2_1_3s
 }
}


trigger door_1_T(0_level:)
{
 autorize 1
 act_by_use
 center -1768.0, -7808.0, 276.0
 box_size 80.0, 128.0, 24.0
 auto_lock
 command "call door_1;call id_1" 
 command_auto        "door1_param=1;param1=door1_param;call proc_message_lock" 
 command_nonauto "door1_param=0;param1=door1_param;call proc_message_lock"

}


procedure door_1
{
command "a.start door 0_level:door_r_1"
command "a.start door 0_level:door_l_1"
}


trigger door_2_T(kor:)
{
 autorize 1
 act_by_use
 center -1388.0, -7784.0, -248.0
 box_size 80.0, 128.0, 24.0
 auto_lock
 command "call door_2"
 command_auto        "door2_param=1;param1=door2_param;call proc_message_lock" 
 command_nonauto "door2_param=0;param1=door2_param;call proc_message_lock"
 
}


procedure door_2
{
command "a.start door kor:door_r_4"
command "a.start door kor:door_l_4"
}


procedure top_door
{
 command "a.start door ventilyaciya:top_door_r"
 command "a.start door ventilyaciya:top_door_l"
 command "g.start id_2_mozg:2"
}


trigger top_door_T(lestnica:)
{
 center -2072.0, -7736.0, 3072.0
 box_size 592.0, 432.0, 64.0
 command "call top_door; t.lock top_door_T" 
}


procedure door_3
{
command "a.start door 0_level:door_r_3"
command "a.start door 0_level:door_l_3"
}


trigger door_3_T(0_level:)
{
 act_by_use
 autorize 2 
 center -1768.0, -7808.0, 2796.0
 box_size 80.0, 128.0, 24.0
 auto_lock
 command                   "call door_3" 
 command_auto        "door3_param=1;param1=door3_param;call proc_message_lock" 
 command_nonauto "door3_param=0;param1=door3_param;call proc_message_lock"
}


procedure door_4
{
command "a.start door 0_level:door_r_2"
command "a.start door 0_level:door_l_2"
command "g.start fire:10"
}


procedure door_4_close
{
command "a.start door_close 0_level:door_r_2"
command "a.start door_close 0_level:door_l_2"
}


trigger rescue(zal:)
{
 center -1120.0, -7624.0, -480.0
 box_size 160.0, 848.0, 1472.0
 auto_lock
 command "call door_4; call message_rescue; t.unlock id_3_and_4" 
}


trigger go_to_room(0_level:)
{
 center 448.0, -7776.0, 2736.0
 radius 192.0
 command "t.unlock open_room; call message_lift; t.lock go_to_room" 
}


trigger open_room(0_level:)
{
 center -700.5, -7680.0, 1638.5
 box_size 128.0, 512.0, 1280.0
 auto_lock
 command "call door_4; call id_5; gr.lock door_lock" 
}


action richag_alarm(room:richag_alarm)
{
 {
 time 0.5
 trans_type 1
 vectorr 0, 0, 0
 rotate -130, 0, 0 
  vector 0,0,0
  ontime 0
  sound sound_lever_1
  ontime 0.3
  command "call alarm_off"
 }
}


trigger richag_T(room:)
{
 act_by_use
 center -5872.0, -7800.0, 1392.0
 radius 32.0
 auto_lock
 command "a.start richag_alarm;call message_alarm_off;t.unlock naebka_T" 
}


trigger naebka_T(0_level:)
{
 center -2416.0, -7680.0, 1540.0
 box_size 196.0, 512.0, 2556.0
 auto_lock 
 command "call perci_3;call left_lift_down_2" 
}


procedure left_lift_down
{
 command "g.start Freeze:7"
 command "a.continue Lift_down Lift_shahta:left_lift"
 command "a.continue Lift_down Lift_shahta:left_lift_door"
 command "a.continue gruz Lift_shahta:gruz_left"
 delayedcommand_name = "call lift_stop"
 delayedcommand_delay = 29
}


procedure left_lift_down_2
{
 command "a.start Lift_down2 Lift_shahta:left_lift"
 command "a.start Lift_down2 Lift_shahta:left_lift_door"
 command "a.continue gruz Lift_shahta:gruz_left"
 command "a.start lift_door_open Lift_shahta:left_lift_door;g.start id_7_mozg:7"


 command "gr.unlock lift_shahta:wall"
 command "a.start wall" 
}


procedure right_lift_up
{
 command "a.start Lift_up Lift_shahta:right_lift"
 command "a.start Lift_up Lift_shahta:right_lift_door"
 command "a.start gruz_d Lift_shahta:gruz_right"
}


procedure callLift
{
 command "a.start rub_lift;a.start koleso;call r_lift_up; call lift_guards"
 command "g.start idle40sec:106" 
 command "g.start idle40sec:107" 
 command "a.start idle40sec"
}


gameaction idle40sec()
{
 {
   time 41
   keep_angle
   attack_player
   ani ani_Sleep
   ani_fire            ani_Fire
   ani_loop 1
 }
}


action idle40sec(bunker_in:)
{
 {
 time 40
 ontime 39
 command "g.start id_106_mozg:106; g.start id_107_mozg:107"
 }
}


trigger deadly_top(Lift_shahta:Group_11)
{
 command "param1=10;call makeplayerdamage" 
}


procedure alarm_on
{
  command "em.unlock 0_level:alarm"
  command "em.unlock 0_level:alarm_light"
  command "em.unlock room:alarm_light"
}


procedure alarm_off
{
  command "em.lock 0_level:alarm"
  command "em.lock 0_level:alarm_light"
  command "em.lock room:alarm_light"
}


action Lift_down2()
{
-noreturn
 {
  time 2
  trans_type 1
  accel -1
  move 0, -522, 0
  vectorr 0,0,0
  intime 0, 0.5
  sound Sound_Large_Lift_Move_4s_Loop1
 }
}


action wall(Lift_shahta:)
{
 {
   time 5
   ontime 4
   command "gr.lock Lift_shahta:wall"
 }
}

