function AttachSpiderManFleeingAnimation()

    local state = GetGameManager():GetCurrPlayer().m_gameState;
    if (state:HasState('SpiderManVanished') and state:GetState('SpiderManVanished'):HasValue('28'))
    then
        return false;
    end
    LoadSound('28_SpiderFleeing', 'data/Sound/28_Master_Room/28_Spider.ogg')
    
    zone_table.spiderCompos = BuildSpiderFleeingComposition();
    zone_table.spiderCompos:SetHotSpot(512, 384);
    zone_table.spiderCompos:AttachTo(play_field:GetObject('BG_Zoom_Table'));
    zone_table.spiderCompos:SetDestroysOnEnd(false);
    zone_table.spiderCompos:SetZ(8);

    return true;
end

--------------------------------------------------------------------------------
function BuildSpiderFleeingComposition()

    createCompositionBG_Zoom_Table = function()
    
        local compositionBG_Zoom_Table = CreateCompositionSequence();
        local compositionDuration = 5.83333333333333;
        compositionBG_Zoom_Table:SetDuration(compositionDuration);
    
    
        -- Layer Lazer
        local element = CreateCompositionElement("data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Animations/lazer.png");
        element:SetName("Lazer");
        compositionBG_Zoom_Table:AddElement(element);
        element:SetHotSpot(24, 278);
        element:SetParentElement(compositionBG_Zoom_Table);
        element:SetScaleX(1);
        element:SetScaleY(1);
        element:SetAngle(0);
    
        effector = element:GetEffector();
        effector:SetLifeTime(2.66666666666667, 3.66666666666667);
    
        effector:SetKey(_TRACK_X, 2.66666666666667, 706);
        effector:SetKey(_TRACK_Y, 2.66666666666667, 482);
        effector:SetKey(_TRACK_X, 3.08333333333333, 718);
        effector:SetKey(_TRACK_Y, 3.08333333333333, 493);
        effector:SetKey(_TRACK_X, 3.25, 717);
        effector:SetKey(_TRACK_Y, 3.25, 492);
        effector:SetKey(_TRACK_X, 3.5, 715.252812852046);
        effector:SetKey(_TRACK_Y, 3.5, 491.964040737114);
        effector:SetKey(_TRACK_X, 3.58333333333333, 716);
        effector:SetKey(_TRACK_Y, 3.58333333333333, 492);
        effector:SetKey(_TRACK_O, 2.66666666666667, 1);
        effector:SetKey(_TRACK_O, 2.83333333333333, 0);
        effector:SetKey(_TRACK_O, 2.91666666666667, 0.1);
        effector:SetKey(_TRACK_O, 3.08333333333333, 1);
    
        effector:Play();
    
    
        -- Layer SpiderFleeing
        local element = CreateCompositionElement("data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Animations/SpiderFleeing.png");
        element:SetName("SpiderFleeing");
        compositionBG_Zoom_Table:AddElement(element);
        element:SetHotSpot(150, 308.5);
        element:SetParentElement(compositionBG_Zoom_Table);
        element:SetXY(875, 462);
        
            anim = element:GetTexture();
			anim:SetSpeed(20);
			anim:SetFrames(11);
			anim:SetFrame(0);
			anim:SetTextureRect(0, 0, 300, 617);
			anim:SetMode(HGEANIM_FWD);
			anim:Play();
    
        element:SetScaleX(1);
        element:SetScaleY(1);
        element:SetAngle(0);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(4.16666666666667, 4.77777777777778);
    
    
        effector:Play();
    
    
        -- Layer SpiderTurning
        local element = CreateCompositionElement("data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Animations/SpiderTurnsAround.png");
        element:SetName("SpiderTurning");
        compositionBG_Zoom_Table:AddElement(element);
        element:SetHotSpot(126.5, 119.5);
        element:SetParentElement(compositionBG_Zoom_Table);
        element:SetXY(659, 292);
        
            anim = element:GetTexture();
			anim:SetSpeed(12);
			anim:SetFrames(24);
			anim:SetFrame(0);
			anim:SetTextureRect(0, 0, 253, 239);
			anim:SetMode(HGEANIM_FWD);
			anim:Play();
    
        element:SetScaleX(1);
        element:SetScaleY(1);
        element:SetAngle(0);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(2.16666666666667, 4.16666666666667);
    
    
        effector:Play();
    
    
        -- Layer SpiderTrashingBook
        local element = CreateCompositionElement("data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Animations/SpiderTrashesBook.png");
        element:SetName("SpiderTrashingBook");
        compositionBG_Zoom_Table:AddElement(element);
        element:SetHotSpot(126.5, 118);
        element:SetParentElement(compositionBG_Zoom_Table);
        element:SetXY(642, 300);
        
            anim = element:GetTexture();
			anim:SetSpeed(6);
			anim:SetFrames(13);
			anim:SetFrame(0);
			anim:SetTextureRect(0, 0, 253, 236);
			anim:SetMode(HGEANIM_FWD);
			anim:Play();
    
        element:SetScaleX(1);
        element:SetScaleY(1);
        element:SetAngle(0);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(0, 2.16666666666667);
    
    
        effector:Play();
    
    
        -- Layer Lysteg
        local element = CreateCompositionElement("data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Animations/page.png");
        element:SetName("Lysteg");
        compositionBG_Zoom_Table:AddElement(element);
        element:SetHotSpot(148.5, 124.5);
        element:SetParentElement(compositionBG_Zoom_Table);
        element:SetScaleX(1);
        element:SetScaleY(1);
        element:SetOpacity(1);
        
            anim = element:GetTexture();
			anim:SetSpeed(18);
			anim:SetFrames(14);
			anim:SetFrame(0);
			anim:SetTextureRect(0, 0, 297, 249);
			anim:SetMode(HGEANIM_FWD);
			anim:Play();
    
        effector = element:GetEffector();
        effector:SetLifeTime(1, 1.77777777777778);
    
        effector:SetKey(_TRACK_X, 1, 683);
        effector:SetKey(_TRACK_Y, 1, 192);
        effector:SetKey(_TRACK_X, 1.25, 551.662986405728);
        effector:SetKey(_TRACK_Y, 1.25, 181.668175183518);
        effector:SetKey(_TRACK_X, 1.75, 414);
        effector:SetKey(_TRACK_Y, 1.75, 665);
        effector:SetKey(_TRACK_A, 1.5, 0);
        effector:SetKey(_TRACK_A, 1.75, 0.20943951);
    
        effector:Play();
    --[[
        -- Layer Lysteg_static
        local element = CreateCompositionElement("data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Animations/page.png");
        element:SetName("Yescho_lysteg");
        compositionBG_Zoom_Table:AddElement(element);
        element:SetHotSpot(148.5, 124.5);
        element:SetParentElement(compositionBG_Zoom_Table);
        element:SetScaleX(1);
        element:SetScaleY(1);
        element:SetAngle(0);
        element:SetOpacity(1);
        
            anim = element:GetTexture();
			anim:SetSpeed(12);
			anim:SetFrames(14);
			anim:SetTextureRect(0, 0, 297, 249);
			anim:SetMode(HGEANIM_FWD);
			anim:SetFrame(13);
			
			--anim:Play();
    
        effector = element:GetEffector();
        effector:SetLifeTime(1.25, 15.0833333333333);
    
        effector:SetKey(_TRACK_X, 0.25, 683);
        effector:SetKey(_TRACK_Y, 0.25, 192);
        effector:SetKey(_TRACK_X, 0.5, 551.662986405728);
        effector:SetKey(_TRACK_Y, 0.5, 181.668175183518);
        effector:SetKey(_TRACK_X, 1, 400);
        effector:SetKey(_TRACK_Y, 1, 308);
    
        effector:Play();
    
    
        -- Layer Opyat_lysteg
        local element = CreateCompositionElement("data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Animations/page.png");
        element:SetName("Opyat_lysteg");
        compositionBG_Zoom_Table:AddElement(element);
        element:SetHotSpot(148.5, 124.5);
        element:SetParentElement(compositionBG_Zoom_Table);
        element:SetScaleX(1);
        element:SetScaleY(1);
        element:SetAngle(0);
        element:SetOpacity(1);
        
            anim = element:GetTexture();
			anim:SetSpeed(18);
			anim:SetFrames(14);
			anim:SetFrame(0);
			anim:SetTextureRect(0, 0, 297, 249);
			anim:SetMode(HGEANIM_FWD);
			anim:Play();
    
        effector = element:GetEffector();
        effector:SetLifeTime(0.5, 1.27777777777778);
    
        effector:SetKey(_TRACK_X, 0.5, 683);
        effector:SetKey(_TRACK_Y, 0.5, 192);
        effector:SetKey(_TRACK_X, 0.75, 551.662986405728);
        effector:SetKey(_TRACK_Y, 0.75, 181.668175183518);
        effector:SetKey(_TRACK_X, 1.25, 400);
        effector:SetKey(_TRACK_Y, 1.25, 308);
    
        effector:Play();
    --]]
    
        -- Layer Lysteg_static_2
        local element = CreateCompositionElement("data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Animations/page.png");
        element:SetName("Snova_lysteg");
        compositionBG_Zoom_Table:AddElement(element);
        element:SetHotSpot(148.5, 124.5);
        element:SetParentElement(compositionBG_Zoom_Table);
        element:SetXY(683, 192);
        
            anim = element:GetTexture();
			anim:SetSpeed(12);
			anim:SetFrames(14);
			anim:SetTextureRect(0, 0, 297, 249);
			anim:SetMode(HGEANIM_FWD);
			anim:SetFrame(13);
			--anim:Play();
    
        element:SetScaleX(1);
        element:SetScaleY(1);
        element:SetAngle(0);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(1, 15.5833333333333);
    
    
        effector:Play();
    
    
        -- Layer Vse_yeshce_lysteg
        local element = CreateCompositionElement("data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Animations/page.png");
        element:SetName("Vse_yeshce_lysteg");
        compositionBG_Zoom_Table:AddElement(element);
        element:SetHotSpot(148.5, 124.5);
        element:SetParentElement(compositionBG_Zoom_Table);
        element:SetXY(683, 192);
        
            anim = element:GetTexture();
			anim:SetSpeed(18);
			anim:SetFrames(14);
			anim:SetFrame(0);
			anim:SetTextureRect(0, 0, 297, 249);
			anim:SetMode(HGEANIM_FWD);
			anim:Play();
    
        element:SetScaleX(1);
        element:SetScaleY(1);
        element:SetAngle(0);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(0.25, 1.02777777777778);
    
    
        effector:Play();
    
    
        return compositionBG_Zoom_Table;
    end
    
    local result = createCompositionBG_Zoom_Table();
    
    return result;
    
end

--------------------------------------------------------------------------------
-- CLEAR_ON_SAVE_BEGIN
-- Do not edit code listed below (generated by the editor on each save)
function LoadData(screen)
	local anim = CreateAnimation('data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Layers/BG_Zoom_Table.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Zoom_Table',anim,512,384,150,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_table_book',anim,657,313,155,0,20,10)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_table_case',anim,856,447,155,0,15,25)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_table_drawings',anim,155,155,155,0,25,33)
	local anim = CreateAnimation('data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Layers/Layer_Perforator.png',0,0,172,143,1,0)
	anim:SetHotSpot(86,71)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Perforator',anim,486,397,155,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Layers/Layer_Case_Open.png',0,0,153,128,1,0)
	anim:SetHotSpot(76,64)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Case_Open',anim,853,471,152,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Layers/no_button_small.png',0,0,49,27,1,0)
	anim:SetHotSpot(24,13)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('no_button_11',anim,486,372,156,2,0.85,0.85)
	local anim = CreateAnimation('data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Layers/no_button_small.png',0,0,49,27,1,0)
	anim:SetHotSpot(24,13)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('no_button_2',anim,468,366,156,3,0.75,0.75)
	local anim = CreateAnimation('data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Layers/handle.jpg',0,0,13,11,1,0)
	anim:SetHotSpot(6,5)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('handle',anim,841,461,151,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/28_Master_Room/Zone_Main/Zoom_Table/Animations/page.png',891,498,297,249,1,0)
	anim:SetHotSpot(148,126)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('ripped_page',anim,683,192,152,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
