SetActivLeaf("KoridorBratyev");
fb={0,0,0,1,1,1,1,0}
CreatePolygon(904,4,"fb")
AddEmiter(904,"light_15_0",nil,nil,nil,true);
StartEmiter("light_15_0");
MoveEmiter("light_15_0",547,396)

CreatePolygon(905,4,"fb")
AddEmiter(905,"dust_15_0",nil,nil,nil,true);
StartEmiter("dust_15_0");
MoveEmiter("dust_15_0",547,396)

add_animation(121,true)
add_animation_frame(121,"kor_anim",-1000,84 ,961,126,36,38,3);
add_animation_frame(121,"kor_anim",546,536,575,0,23,10,0.17);
add_animation_frame(121,"kor_anim",504,551,598,0,28,11,0.17);
add_animation_frame(121,"kor_anim",444,565,626,0,35,11,0.17);
add_animation_frame(121,"kor_anim",388,575,661,0,33,13,0.17);
add_animation_frame(121,"kor_anim",335,600,694,0,34,26,0.17);
add_animation_frame(121,"kor_anim",277,630,728,0,37,18,0.17);
add_animation_frame(121,"kor_anim",213,633,765,0,37,15,0.17);
add_animation_frame(121,"kor_anim",-1000,84 ,961,126,36,38,8);
StartAnimation(121)      

addstaticobjecttogame(124,"kor_anim",385,201,"",0,0,111,146);
addstaticobjecttogame(125,"kor_anim",386,201,"",111,0,110,142);

addstaticobjecttogame(126,"kor_anim",583,123,"",221,0,164,150);
addstaticobjecttogame(127,"kor_anim",557,108,"",385,0,190,173);
-- for_sunduk={
-- 456,472,
-- 563,472,
-- 563,550,
-- 456,550
-- }

-- CreatePolygon(1,4,"for_sunduk")
NewObj("masl_cor","BigTexture133",570,572,"20011",0,0,0,0,74,25);
addstaticobjecttogame(14,"BigTexture133",579,582,"",74,0,78,60);
if obj.masl_cor.is_collapsed then
  speciale_action(2,14)
else
  AddEmiter(obj.masl_cor.id,"Inv_15_5",false,633,570);
  StartEmiter("Inv_15_5");  
end;
addactivobjecttogame(2,"BigTexture133",254,504,"","",0,0,152,0,109,131); --sunduk close
addactivobjecttogame(1,"BigTexture133",255,518,"","",0,0,261,0,108,117); --sunduk
speciale_action(2,2)
if flags.sundukopenM then
  speciale_action(2,1)
  speciale_action(2,2)  
  if not flags.Sundukfinish then
    AddEmiter(2,"Standart_15_4",false,336,539);
    StartEmiter("Standart_15_4");    
  end;  
else
  if not flags.Sundukfinish then
    AddEmiter(1,"Standart_15_4",false,336,539);
    StartEmiter("Standart_15_4");    
  end;
end; 
if flags.Sundukfinish then
  ActivateObject(2,false)    
end;

door_ZalBratyev_15_0_table={0,642,1024,642,1024,768,0,768};
CreatePolygon(NewId("door_ZalBratyev_15_0"),4,"door_ZalBratyev_15_0_table");

door_Mid_15_0_table={680,401,744,401,744,533,680,533};
CreatePolygon(NewId("door_Mid_15_0"),4,"door_Mid_15_0_table");
if not flags.MiddleOpen then
  AddEmiter(obj.door_Mid_15_0.id,"Standart_15_1");
  StartEmiter("Standart_15_1");
end;

door_Older_15_0_table={324,402,324+25,402,324+25,402+120,324,402+120};
CreatePolygon(NewId("door_Older_15_0"),4,"door_Older_15_0_table");
if not flags.OlderOpen then
  AddEmiter(obj.door_Older_15_0.id,"Standart_15_2");
  StartEmiter("Standart_15_2");
end;
door_Guest_15_0_table={146,298,200,298,200,575,146,575};
CreatePolygon(NewId("door_Guest_15_0"),4,"door_Guest_15_0_table");
AddEmiter(obj.door_Guest_15_0.id,"Standart_15_3");
StartEmiter("Standart_15_3");

door_Younger_15_0_table={840,310,910,310,929,520,850,520};
CreatePolygon(NewId("door_Younger_15_0"),4,"door_Younger_15_0_table");

door_KoridorBratyevHidden_15_0_table={420,360,620,360,620,510,420,510};
CreatePolygon(NewId("door_KoridorBratyevHidden_15_0"),4,"door_KoridorBratyevHidden_15_0_table");
AddEmiter(obj.door_KoridorBratyevHidden_15_0.id,"Hidden_15_1",true,nil,nil,true);
StartEmiter("Hidden_15_1");

addstaticobjecttogame(112,"BigTexture133",704,362,"",0,25,35,209);  --open r --middle
addstaticobjecttogame(111,"BigTexture133",314,362,"",369,0,35,209);  --close l2 --older
addstaticobjecttogame(110,"BigTexture133",94,221,"",152,131,191,544); -- close l1 younger
  
NewObj("bg_15_0","bg_15_0",0,0,"");
ActivateObject(obj.bg_15_0.id,false);

