function CreateChapter(f)
    local characters = {
        f.Character("Sherlock", "s01c00_character_Sherlock_name"),
        f.Character("Swifty", "s01c00_character_Swifty_name"),
        f.Character("Lavanda", "s01c00_character_Lavanda_name")
    }
    local locations = {
        f.Location("0000_SherlockApartment", {
            "Assets/Scenes/Locations/s01c00/0000_SherlockApartment.unity"})
    }
    local points = {}
    local notifies = {
        f.ReturningNotificationsKeyPoint(0, {
            f.ReturningNotification("s01c00_keyPoint_0_notification_0_title",
                "s01c00_keyPoint_0_notification_0_desc"),
            f.ReturningNotification("s01c00_keyPoint_0_notification_1_title",
                "s01c00_keyPoint_0_notification_1_desc"),
            f.ReturningNotification("s01c00_keyPoint_0_notification_2_title",
                "s01c00_keyPoint_0_notification_2_desc"),
            f.ReturningNotification("s01c00_keyPoint_0_notification_3_title",
                "s01c00_keyPoint_0_notification_3_desc"),
            f.ReturningNotification("s01c00_keyPoint_0_notification_4_title",
                "s01c00_keyPoint_0_notification_4_desc")
        })
    };

    return f.Chapter(1, 0, "s01c00_chapter_title", characters, locations, points, null, notifies)
end

function CreateInvestigation(f)
    local missions = {
        f.Mission(1, "s01c00_mission_1", {0}, {f.SimpleAction()}, 1),
        f.Mission(2, "s01c00_mission_2", {1}, {f.SimpleAction()}, 1, {
            f.Speech({"s01c00_Sherlock_mission_2_speech_1_phrase_1"}),
            f.Speech({"s01c00_Sherlock_mission_2_speech_2_phrase_1"}),
            f.Speech({"s01c00_Sherlock_mission_2_speech_3_phrase_1"}),
            f.Speech({"s01c00_Sherlock_mission_2_speech_4_phrase_1"}),
            f.Speech({"s01c00_Sherlock_mission_2_speech_5_phrase_1"}),
            f.Speech({"s01c00_Sherlock_mission_2_speech_6_phrase_1"})
        }),
        f.Mission(3, "s01c00_mission_3", {2}, {f.SimpleAction()}, 1, {
            f.Speech({"s01c00_Sherlock_mission_3_speech_1_phrase_1"}),
            f.Speech({"s01c00_Sherlock_mission_3_speech_2_phrase_1"}),
            f.Speech({"s01c00_Sherlock_mission_3_speech_3_phrase_1"}),
            f.Speech({"s01c00_Sherlock_mission_3_speech_4_phrase_1"}),
            f.Speech({"s01c00_Sherlock_mission_3_speech_5_phrase_1"}),
            f.Speech({"s01c00_Sherlock_mission_3_speech_6_phrase_1"})
        }),
        f.Mission(4, "s01c00_mission_4", {3}, {f.SimpleAction()}, 1, {
            f.Speech({"s01c00_Sherlock_mission_4_speech_1_phrase_1"}),
            f.Speech({"s01c00_Sherlock_mission_4_speech_2_phrase_1"}),
            f.Speech({"s01c00_Sherlock_mission_4_speech_3_phrase_1"}),
            f.Speech({"s01c00_Sherlock_mission_4_speech_4_phrase_1"}),
            f.Speech({"s01c00_Sherlock_mission_4_speech_5_phrase_1"}),
            f.Speech({"s01c00_Sherlock_mission_4_speech_6_phrase_1"})
        })
    }

    return f.Investigation(1, missions)
end

function PrepareLocation()
    ChangeLocation('0000_SherlockApartment');
end

function StartInvestigation()
	ShowChapterTitle();
    Parallel(function()
        ShowLocationCaption('s01c00_location_0_caption', 's01c00_location_0_time');
        Walk('Sherlock', 'sherlock_point_0_0');
        MoveCamera('camera_point_0_0', .8)
    end)
    Play('Sherlock', 'LookAround')

    StartDialog();
    --Play('Sherlock', 'Look')
    Say('Sherlock', 'Satisfied', 's01c00_Sherlock_phrase_1');
    SetupAnim('Sherlock', 'Thinking', {notLoop=true})
    Say('Sherlock', 'Upset', 's01c00_Sherlock_phrase_2');
    EndDialog()

    Play('Sherlock', 'SelfPatdown')

    StartDialog()
    SetupAnim('Sherlock', 'Surprised', {notLoop=true})
    Say('Sherlock', 'Anxious', 's01c00_Sherlock_phrase_3');
    SetupAnim('Sherlock', 'InConfusion', {notLoop=true})
    Say('Sherlock', 'Concentrated', 's01c00_Sherlock_phrase_4');
    EndDialog();

    PlayLevel(true)

    Walk('Sherlock', 'sherlock_point_0_1');

    StartDialog();
    SetupAnim('Sherlock', 'TalkToCamera')
    Say('Sherlock', 'Thoughtful', 's01c00_Sherlock_phrase_5');
    EndDialog();
end

function ApplyMission1Action0()

    --CameraTo('camera_point_0_0', 1, 1)


    Parallel(function()
        Walk('Sherlock', 'sherlock_point_1_0')
		CameraTo('camera_point_1_0', 1, 1)
    end)

    StartDialog()
    SetupAnim('Sherlock', 'Thinking', {notLoop=true})
    Say('Sherlock', 'Thoughtful', 's01c00_Sherlock_mission_1_phrase_1')
    SetupAnim('Sherlock', 'Enlightened', {notLoop=true})
    Say('Sherlock', 'Affirmative', 's01c00_Sherlock_mission_1_phrase_2')
    EndDialog()

    -- [Шерлок подходит к столу и осматривает его. Часов естественно там не обнаруживает]

    -- Шерлок подходит к столу и осматривает его

    Parallel(function()
        Walk('Sherlock', 'sherlock_point_1_0')
        CameraTo('camera_point_1_0', 1, 1)
    end)
    Play('Sherlock', 'SearchOnTable')

    StartDialog()
    SetupAnim('Sherlock', 'InConfusion', {notLoop=true})
    Say('Sherlock', 'AtALoss', 's01c00_Sherlock_mission_1_phrase_3')
    SetupAnim('Sherlock', 'Thinking', {notLoop=true})
    Say('Sherlock', 'Thoughtful', 's01c00_Sherlock_mission_1_phrase_4')
    EndDialog()

    --Шерлок подходит к столу в нужную позицию, берет записку, читает и кладет в карман.
    --XXX: По сценарию указано, что Шерлок должен подойти с другой стороны стола, но анимации под одну сторону.

    Walk('Sherlock', 'sherlock_point_1_0_n')

    Parallel(function()
        Play('Sherlock', 'TakeNoteFromTable')
        Sequence(function()
            Delay(2.35)
            SetActive('NoteOnTable', false)
            SetActive('NoteInHand', true)
        end)
    end)

    StartDialog()
    SetupAnim('Sherlock', 'TakeNoteFromTableLoop')
    ApplyAnim('Sherlock')

    Say('Sherlock', 'spec:ScatteredWithNote', 's01c00_Sherlock_mission_1_phrase_5')
    --SetupAnim('Sherlock', 'ReadNote', {notLoop=true})
    Say('Sherlock', 'spec:ScatteredWithNote', 's01c00_Sherlock_mission_1_phrase_6')
    Say('Sherlock', 'spec:ScatteredWithNote', 's01c00_Sherlock_mission_1_phrase_7')
    EndDialog()
    -- [Анимация: Шерлок кладёт лист на место]

    Parallel(function()
        Play('Sherlock', 'PutsClock')
        Sequence(function()
            Delay(1)
            SetActive('NoteInHand', false)
        end)
    end)

    ResetAnim('Sherlock')

    Walk('Sherlock', 'sherlock_point_1_0_n2')

    StartDialog()
    Say('Sherlock', 'Anxious', 's01c00_Sherlock_mission_1_phrase_8')
    SetupAnim('Sherlock', 'OhMyGod', {notLoop=true})
    Say('Sherlock', 'Anxious', 's01c00_Sherlock_mission_1_phrase_9')

    SetupAnim('Sherlock', 'Thinking', {notLoop=true})
    Say('Sherlock', 'Anxious', 's01c00_Sherlock_mission_1_phrase_10')
    EndDialog()

    -- [Шерлок подходит к саквояжу]
    -- [Анимация: Шерлок открывает саквояж и роется в нём, затем закрывает саквояж]
    Parallel(function()
        Walk('Sherlock', 'sherlock_point_0_4')
        MoveCamera('camera_point_0_4', 1)
    end)

    Parallel(function()
        Play('CarpetBag_display', 'Open')
        Play('Sherlock', 'LookingInBag')
        Sequence(function()
            Delay(1.8)
            SetActive('Sock', true)
            Delay(2.2)
            SetActive('Sock', false)
        end)
    end)
    Play('CarpetBag_display', 'Close')

    -- [Шерлок расстроенный отходит на центр комнаты]
    Parallel(function()
        Walk('Sherlock', 'sherlock_point_1_1')
        MoveCamera('camera_point_1_1', 1)
    end)

    StartDialog()
    SetupAnim('Sherlock', 'InConfusion', {notLoop=true})
    Say('Sherlock', 'spec:Scared', 's01c00_Sherlock_mission_1_phrase_11')
    EndDialog()

    SetActive('RustleSwifty', true)
    Play('RustleSwifty')
    SetActive('RustleSwifty', false)

    StartDialog()
    SetupAnim('Sherlock', 'Thinking', {notLoop=true})
    Say('Sherlock', 'Thoughtful', 's01c00_Sherlock_mission_1_phrase_12')
    SetupAnim('Sherlock', 'Enlightened', {notLoop=true})
    Say('Sherlock', 'Affirmative', 's01c00_Sherlock_mission_1_phrase_13')
    EndDialog()

    ActionCompleted()
    Parallel(function()
        Walk('Sherlock', 'sherlock_point_1_1')
		MoveCamera('camera_point_1_1', .8)
    end)
end

function ApplyMission2Action0()

    Parallel(function()
        Walk('Sherlock', 'sherlock_point_1_1')
        CameraTo('camera_point_2_0', 1, 1)
    end)

    -- [Шерлок посреди комнаты]
    --SetupAnim('Sherlock', 'BackAndForth', {notLoop=true})
    StartDialog()

    Parallel(function()
        Say('Sherlock', 'Interested', 's01c00_Sherlock_mission_2_phrase_1')
        Play('Sherlock', 'BackAndForth')
    end)

    SetupAnim('Sherlock', 'Thinking', {notLoop=true})
    Say('Sherlock', 'Thoughtful', 's01c00_Sherlock_mission_2_phrase_2')
    EndDialog()

    -- [Шерлок подходит к клетке]
    Parallel(function()
        Walk('Sherlock', 'sherlock_point_1_2')
        --CameraTo('camera_point_1_2', 1, 1)
        MoveCamera('camera_point_2_0_1', 1)
    end)
    -- [Анимация: Шерлок рассматривает клетку]
    Play('Sherlock', 'InspectCage');

    StartDialog()
    Say('Sherlock', 'Thoughtful', 's01c00_Sherlock_mission_2_phrase_7')
    SetupAnim('Sherlock', 'ShakeHead', {notLoop=true})
    Say('Sherlock', 'Thoughtful', 's01c00_Sherlock_mission_2_phrase_8')
    Say('Sherlock', 'Resolute', 's01c00_Sherlock_mission_2_phrase_9')
    EndDialog()

    Customize('Cage')

    StartDialog()
    Say('Sherlock', 'Smile', 's01c00_Sherlock_mission_2_phrase_9_1')
    EndDialog()

    -- [Шерлок отходит от клетки]
    Parallel(function()
        Walk('Sherlock', 'sherlock_point_1_3')
        MoveCamera('camera_point_2_1', 1)
    end)
    -- [Птица начинает махать крыльями в клетке и пытается указать куда-то за спину Шерлока]
    Parallel(function()
        Sequence(function()
            MoveCamera('camera_point_2_0_2', .7, 1.7)
            CustomizableStatePlay('Cage', 'Wave');
        end)
        Walk('Sherlock', 'sherlock_point_1_4')
    end)
    MoveCamera('camera_point_2_1', 1, 1)

    StartDialog()
    SetupAnim('Sherlock', 'Surprised', {notLoop=true})
    Say('Sherlock', 'Surprised', 's01c00_Sherlock_mission_2_phrase_10')
    EndDialog()
    Walk('Sherlock', 'sherlock_point_1_3')
    -- [Анимация: Шерлок смотрит на пол недалеко от кровати и что-то замечает там]
    Play('Sherlock', 'NoticeClueOnFloor');

    StartDialog()
    Say('Sherlock', 'Excited', 's01c00_Sherlock_mission_2_phrase_4')
    EndDialog()

    -- [Шерлок подходит к отмеченному месту, не доходя до кровати]

    Parallel(function()
        Walk('Sherlock', 'sherlock_point_1_5')
        CameraTo('camera_point_2_2', 1, 1)
    end)
    -- [Анимация: Шерлока достаёт из кармана лупу, наклоняется и рассматривает пол]

    Parallel(function()
        Sequence(function()
            SetupAnim('Sherlock', 'InspectFloorLoop')
            ApplyAnim('Sherlock')
            Play('Sherlock', 'InspectFloorStart')
        end)
        Sequence(function ()
            Delay(1.2)
            SetActive('Magnifier', true)
        end)
    end)

    StartDialog()
    Say('Sherlock', 'spec:InterestedWithMagnifier', 's01c00_Sherlock_mission_2_phrase_5')
    EndDialog()

    -- [Анимация: Шерлок выпрямляется и прячет лупу]

    Parallel(function()
        Sequence(function ()
            Play('Sherlock', 'InspectFloorEnd')
            SetTo('Sherlock', 'sherlock_point_1_6')
        end)
        Sequence(function ()
            Delay(.5)
            SetActive('Magnifier', false)
        end)
    end)
    ResetAnim('Sherlock')

    Walk('Sherlock', 'sherlock_point_1_7')

    SetActive('RustleSwifty', true)
    Play('RustleSwifty')
    SetActive('RustleSwifty', false)
    Play('Sherlock', 'ReactOnNoise')
    -- [Анимация к реплике: Озарение]

    StartDialog()
    SetupAnim('Sherlock', 'Enlightened', {notLoop=true})
    Say('Sherlock', 'Excited', 's01c00_Sherlock_mission_2_phrase_6')
    EndDialog()

    Walk('Sherlock', 'sherlock_point_3_0')

    StartDialog()
    Say('Sherlock', 'Thoughtful', 's01c00_Sherlock_mission_2_phrase_11')
    EndDialog()

    Delay(.8)
    OfferEnableNotifications()
end

function ApplyMission3Action0()
    Parallel(function()
        Walk('Sherlock', 'sherlock_point_3_0')
		CameraTo('camera_point_3_0', 1, 1)
    end)

    StartDialog()
    Say('Sherlock', 'Thoughtful', 's01c00_Sherlock_mission_3_phrase_6', 'Sherlock')
    EndDialog()

    CleanCustomize('Bed')

    StartDialog()
    Say('Sherlock', 'Satisfied', 's01c00_Sherlock_mission_3_phrase_7')
    EndDialog()

    Play('Sherlock', 'SearchUnderBed')

    StartDialog()
    SetupAnim('Sherlock', 'HappySurprised', {notLoop=true})
    Say('Sherlock', 'Cheerful', 's01c00_Sherlock_mission_3_phrase_1')
    EndDialog()

    -- [Анимация: из-под кровати выскакивает мышонок]
    SetActive('Swifty', true)
    Play('Swifty', 'JumpForward')
    SetTo('Swifty', 'swifty_point_3_0')
    --Walk('Swifty',)
    -- [Мышонок замирает недалеко от Шерлока, Шерлок оборачивается к нему]
    Parallel(function()
        Walk('Sherlock', 'sherlock_point_3_1')
        MoveCamera('camera_point_3_1', 1)
    end)

    StartDialog()
    SetupAnim('Sherlock', 'TalkToFloor', {notLoop=true})
    Say('Sherlock', 'Smile', 's01c00_Sherlock_mission_3_phrase_2', nil, nil, 'Crafty')
    Say('Swifty', 'Crafty', 's01c00_Swifty_mission_3_phrase_1', nil, 's01c01_character_Swifty_tmp_name', nil, 'spec:Smile')
    EndDialog()

    -- [Анимация: Шерлок прыгает вперед и пытается схватить мышонка]
    Parallel(function()
        Sequence(function()
            Delay(1.4)
            SetActive('HitTheFloor', true)
            Play('HitTheFloor', 'HitTheFloor')
            SetActive('HitTheFloor', false)
        end)
        Sequence(function()
            Play('Sherlock', 'TryToCatchAndFail')
            -- [Анимация: Шерлок теряет равновесие и падает, приземляясь на пятую точку]
            SetupAnim('Sherlock', 'SitOnFloor')
            ApplyAnim('Sherlock')
        end)
        Sequence(function()
            -- [Анимация: Мышонок выворачивается и отскакивает в сторону]
            Delay(.4)
            Walk('Swifty', 'swifty_point_3_0_1')
            Play('Swifty', 'JumpAside')
            SetTo('Swifty', 'swifty_point_3_1')
            -- [Мышонок убегает на другой конец комнаты, к письменному столу]
            Walk('Swifty', 'swifty_point_3_2')
        end)
        Sequence(function()
            -- [Анимация к реплике: Шерлок сидя потирает спину/голову]
            Delay(2)
            SetActive('Stars', true)
            Play('Stars', 'Idle')
            SetActive('Stars', false)
        end)
        Sequence(function()
            Delay(2.4)
            MoveCamera('camera_point_3_2', 1)
        end)
    end)

    StartDialog()
    -- SetupAnim('Sherlock', 'Reproach', {notLoop=true})
    Say('Sherlock', 'Amiable', 's01c00_Sherlock_mission_3_phrase_3')
    EndDialog()

    -- [Анимация: Шерлок поднимается]

    Play('Sherlock', 'GetUpFromFloor')

    ResetAnim('Sherlock')

    -- [Шерлок подходит к мышонку]
    Parallel(function()
        Walk('Sherlock', 'sherlock_point_4_0')
        CameraTo('camera_point_3_4', 1, 1)
    end)

    StartDialog()
    SetupAnim('Sherlock', 'Reproach', {notLoop=true})
    Say('Sherlock', 'Serious', 's01c00_Sherlock_mission_3_phrase_4')

    -- [Эмоция к реплике: Восклицание]
    Say('Swifty', 'Dissatisfied', 's01c00_Swifty_mission_3_phrase_2', nil, 's01c01_character_Swifty_tmp_name', nil, 'Exclamation')

    ActionCompleted()
    Say('Sherlock', 'Crafty', 's01c00_Sherlock_mission_3_phrase_5')

    EndDialog();
end

function ApplyMission4Action0()
    Parallel(function()
        CameraTo('camera_point_3_4', 1, 1)
        Walk('Sherlock', 'sherlock_point_4_0')
    end)

    StartDialog()
    -- тут вроде хотели менять на "вопросительно"
    SetupAnim('Sherlock', 'TalkToFloor', {notLoop=true})
    Say('Sherlock', 'Curious', 's01c00_Sherlock_mission_4_phrase_1', nil, nil, 'Crafty')
    Say('Swifty', 'Crafty', 's01c00_Swifty_mission_4_phrase_1', nil, 's01c01_character_Swifty_tmp_name')
    SetupAnim('Sherlock', 'OfferToMouse', {notLoop=true})
    Say('Sherlock', 'Amiable', 's01c00_Sherlock_mission_4_phrase_2')
    SetupAnim('Swifty', 'EmotionYes', {notLoop=true})
    Say('Swifty', 'Curious', 's01c00_Swifty_mission_4_phrase_2', nil, 's01c01_character_Swifty_tmp_name', nil, 'Question')
    EndDialog()

    Parallel(function()
        Walk('Swifty', 'swifty_point_4_0')
        Walk('Sherlock', 'sherlock_point_4_1')
		MoveCamera('camera_point_4_1', 1)
    end)

    Parallel(function()
        Sequence(function()
            Delay(.5)
            Play('Swifty', 'Wait')
        end)
        Sequence(function()
            Play('CarpetBag_display', 'Open')
            Play('Sherlock', 'TakeSandwich')
            SetActive('SherlockSandwich', true)
            SetupAnim('Sherlock', 'IdleSandwich')
            ApplyAnim('Sherlock')
            Play('Sherlock', 'TakeSandwichUp')
        end)
    end)

    SetupAnim('Sherlock', 'WalkSandwich')
    Parallel(function()
        Walk('Sherlock', 'sherlock_point_4_2')
		MoveCamera('camera_point_4_2', .8)
    end)

    StartDialog()
    SetupAnim('Sherlock', 'TalkSandwich')
    Say('Sherlock', 'spec:DreamilySandwich', 's01c00_Sherlock_mission_4_phrase_3')
    Say('Swifty', 'Joyous', 's01c00_Swifty_mission_4_phrase_3', 'Sherlock', 's01c01_character_Swifty_tmp_name', 'Amiable', 'spec:Cheese')
    EndDialog()

    Parallel(function()
        Play('Sherlock', 'GiveSandwichSitDown')
        Sequence(function()
            Delay(.5)
            Walk('Swifty', 'swifty_point_4_1')
        end)
    end)
    Play('Swifty', 'Take')
    SetActive('SherlockSandwich', false)
    SetActive('SwiftySandwich', true)
    Parallel(function()
        Play('Sherlock', 'GiveSandwichStandUp')
        Sequence(function()
            ResetAnim('Sherlock')
            Play('Swifty', 'TakeEnd')
            Play('Swifty', 'Eat')
        end)
    end)
    SetActive('SwiftySandwich', false)
    Walk('Swifty', 'swifty_point_4_2')
    SetActive('SwiftyClock', true)
    Walk('Swifty', 'swifty_point_4_1')

    StartDialog()
    Say('Swifty', 'spec:PockesWatchButton', 's01c00_Swifty_mission_4_phrase_4', 'Sherlock', 's01c01_character_Swifty_tmp_name', 'Amiable', 'spec:Watch')
    SetupAnim('Sherlock', 'Surprised', {notLoop=true})
    Say('Sherlock', 'Surprised', 's01c00_Sherlock_mission_4_phrase_4')
    EndDialog()

    Parallel(function()
        Play('Sherlock', 'RaisesClock')
        Play('Swifty', 'Take')
    end)
    SetActive('SwiftyClock', false)
    SetActive('SherlockClock', true)
    Parallel(function()
        Play('Swifty', 'TakeEnd')
        Play('Sherlock', 'RaisesClockEnd')
    end)

    StartDialog()
    SetupAnim('Sherlock', 'LooksClock', {notLoop=true})
    Say('Sherlock', 'spec:WithOpenedWatch', 's01c00_Sherlock_mission_4_phrase_5', 'Swifty', nil, 'Joyous')
    EndDialog()

    Play('Sherlock', 'PutsClock')
    SetActive('SherlockClock', false)

    StartDialog()
    Say('Sherlock', 'Amiable', 's01c00_Sherlock_mission_4_phrase_6')
    SetupAnim('Sherlock', 'Thinking', {notLoop=true})
    Say('Sherlock', 'Thoughtful', 's01c00_Sherlock_mission_4_phrase_7')

    SetupAnim('Sherlock', 'PointToEachOtherMouse', {notLoop=true})
    Say('Sherlock', 'Amiable', 's01c00_Sherlock_mission_4_phrase_8')

    SetupAnim('Swifty', 'EmotionYes', {notLoop=true})
    Say('Swifty', 'Excited', 's01c00_Swifty_mission_4_phrase_5', nil, 's01c01_character_Swifty_tmp_name', nil, 'Like')

    SetupAnim('Sherlock', 'HappyAndThinking', {notLoop=true})
    Say('Sherlock', 'Joyous', 's01c00_Sherlock_mission_4_phrase_9')
    EndDialog()

	ShowInputNameWindow()

	StartDialog()
    Parallel(function()
        Say('Swifty', 'Joyous', 's01c00_Swifty_mission_4_phrase_6', nil, nil, nil, 'Exclamation')
        Play('Swifty', 'Happy')
    end)
    EndDialog()

    InvestigationCompleted();

    SetActive('Knock', true)
    Play('Knock')
    SetActive('Knock', false)

    Parallel(function()
        Sequence(function()
            ShowAnimatedEmotion('Swifty', 'QuestionExclamation')
            Walk('Swifty', 'swifty_point_4_3')
        end)
        Sequence(function()
            StartDialog()
            SetupAnim('Sherlock', 'Surprised', {notLoop=true})
            Say('Sherlock', 'Surprised', 's01c00_Sherlock_mission_4_phrase_10', 'Sherlock')
            EndDialog()
        end)
    end)

    Parallel(function()
        Walk('Sherlock', 'sherlock_point_4_3')
		MoveCamera('camera_point_4_3', .8, 1.2)
		--ZoomCamera(1.5, .9);
    end)

    SetActive('Swifty', false);
    Play('Door', 'Open')
    Walk('Lavanda', 'lavanda_point_4_0')

    StartDialog()
    SetupAnim('Lavanda', 'TalkTears', {notLoop=true})
    Say('Lavanda', 'InTears', 's01c00_Lavanda_mission_4_phrase_1')

    SetupAnim('Lavanda', 'TalkEmotional', {notLoop=true})
    Say('Lavanda', 'Amazedly', 's01c00_Lavanda_mission_4_phrase_2')
    SetupAnim('Sherlock', 'Introducing', {notLoop=true})
    Say('Sherlock', 'Calm', 's01c00_Sherlock_mission_4_phrase_11')

    EndDialog()
    SetAllInteractive(false)
end

function CreateInteractiveEnvironment(f)

    return f.InteractiveEnvironment(
    {
        CreateInteractiveLocation(f, '0000_SherlockApartment',
        {
            f.InteractiveObject('Table',
            {
                SherlockWalkAndSpeech(f, 'io_decoration_desk_1_point',
                    {{'s01c00_lio_0000_decoration_desk_1_0'},
                     {'s01c00_lio_0000_decoration_desk_1_1'},
                     {'s01c00_lio_0000_decoration_desk_1_2'}}),
                SherlockWalkAndSpeech(f, 'io_decoration_desk_1_point',
                    {{'s01c00_lio_0000_decoration_desk_1_3'}},
                    f.InvestigationRestriction(2, '<')),
                SherlockWalkAndSpeech(f, 'io_decoration_desk_1_point',
                    {{'s01c00_lio_0000_decoration_desk_1_4'},
                    {'s01c00_lio_0000_decoration_desk_1_11_0',
                     's01c00_lio_0000_decoration_desk_1_11_1'},
                    {'s01c00_lio_0000_decoration_desk_1_12_0',
                     's01c00_lio_0000_decoration_desk_1_12_1'},
                    {'s01c00_lio_0000_decoration_desk_1_9'},
                    {'s01c00_lio_0000_decoration_desk_1_10'}},
                    f.InvestigationRestriction(1, '>')),
                SherlockWalkAndSpeech(f, 'io_decoration_desk_1_point',
                    {{'s01c00_lio_0000_decoration_desk_1_5'},
                     {'s01c00_lio_0000_decoration_desk_1_6'}},
                    f.InvestigationRestriction(3, '=')),
                SherlockWalkAndSpeech(f, 'io_decoration_desk_1_point',
                    {{'s01c00_lio_0000_decoration_desk_1_7'},
                     {'s01c00_lio_0000_decoration_desk_1_8'}},
                    f.InvestigationRestriction(4, '='))
            }),
            f.InteractiveObject('Bed',
            {
                SherlockWalkAndSpeech(f, 'io_decoration_bed_point',
                    {{'s01c00_lio_0000_decoration_bed_0'},
                     {'s01c00_lio_0000_decoration_bed_1'},
                     {'s01c00_lio_0000_decoration_bed_2'},
                     {'s01c00_lio_0000_decoration_bed_3'},
                     {'s01c00_lio_0000_decoration_bed_9'},
                     {'s01c00_lio_0000_decoration_bed_10'},
                     {'s01c00_lio_0000_decoration_bed_11'},
                    {'s01c00_lio_0000_decoration_bed_12_0',
                     's01c00_lio_0000_decoration_bed_12_1'},
                    {'s01c00_lio_0000_decoration_bed_13_0',
                     's01c00_lio_0000_decoration_bed_13_1'},
                     {'s01c00_lio_0000_decoration_bed_14'}},
                     f.InvestigationRestriction(3,'>')),
                SherlockWalkAndSpeech(f, 'io_decoration_bed_point',
                    {{'s01c00_lio_0000_decoration_bed_4'},
                     {'s01c00_lio_0000_decoration_bed_5'},
                     {'s01c00_lio_0000_decoration_bed_6'}},
                    f.InvestigationRestriction(3, '=')),
                SherlockWalkAndSpeech(f, 'io_decoration_bed_point',
                    {{'s01c00_lio_0000_decoration_bed_7'},
                     {'s01c00_lio_0000_decoration_bed_8'}},
                    f.InvestigationRestriction(4, '='))
            }),
            f.InteractiveObject('decoration-desk_2',
            {
                SherlockWalkAndSpeech(f, 'io_decoration_desk_2_point',
                    {{'s01c00_lio_0000_decoration_desk_2_0'},
                     {'s01c00_lio_0000_decoration_desk_2_1'},
                     {'s01c00_lio_0000_decoration_desk_2_2'}}),
                SherlockWalkAndSpeech(f, 'io_decoration_desk_2_point',
                    {{'s01c00_lio_0000_decoration_desk_2_3'},
                     {'s01c00_lio_0000_decoration_desk_2_4'}},
                    f.InvestigationRestriction(2, '<')),
                SherlockWalkAndSpeech(f, 'io_decoration_desk_2_point',
                    {{'s01c00_lio_0000_decoration_desk_2_5'},
                     {'s01c00_lio_0000_decoration_desk_2_6'}},
                    f.InvestigationRestriction(3, '=')),
                SherlockWalkAndSpeech(f, 'io_decoration_desk_2_point',
                    {{'s01c00_lio_0000_decoration_desk_2_7'},
                     {'s01c00_lio_0000_decoration_desk_2_8'}},
                    f.InvestigationRestriction(4, '='))
            }),
            f.InteractiveObject('CarpetBag',
            {
                SherlockWalkAndSpeech(f, 'io_carpet_bag_point',
                    {{'s01c00_lio_0000_carpet_bag_0'},
                     {'s01c00_lio_0000_carpet_bag_1'},
                     {'s01c00_lio_0000_carpet_bag_2'},
                     {'s01c00_lio_0000_carpet_bag_3'}}),
                SherlockWalkAndSpeech(f, 'io_carpet_bag_point',
                    {{'s01c00_lio_0000_carpet_bag_4'},
                     {'s01c00_lio_0000_carpet_bag_5'}},
                    f.InvestigationRestriction(2, '<')),
                SherlockWalkAndSpeech(f, 'io_carpet_bag_point',
                    {{'s01c00_lio_0000_carpet_bag_6'},
                     {'s01c00_lio_0000_carpet_bag_7'}},
                    f.InvestigationRestriction(4, '='))
            }),
            f.InteractiveObject('decoration-portrait',
            {
                SherlockWalkAndSpeech(f, 'io_fireplace_point',
                    {{'s01c00_lio_0000_decoration_portrait_0'},
                     {'s01c00_lio_0000_decoration_portrait_1'}})
            }),
            f.InteractiveObject('Fireplace',
            {
                SherlockWalkAndSpeech(f, 'io_fireplace_point',
                    {{'s01c00_lio_0000_place_fire_0'},
                     {'s01c00_lio_0000_place_fire_1'},
                     {'s01c00_lio_0000_place_fire_2'},
                     {'s01c00_lio_0000_place_fire_3'}}),
                SherlockWalkAndSpeech(f, 'io_fireplace_point',
                    {{'s01c00_lio_0000_place_fire_4'}},
                    f.InvestigationRestriction(2, '<'))
            }),
            f.InteractiveObject('decoration-firewood',
            {
                SherlockWalkAndSpeech(f, 'io_firewood_point',
                    {{'s01c00_lio_0000_place_wood_0'},
                     {'s01c00_lio_0000_place_wood_1'},
                     {'s01c00_lio_0000_place_wood_2'}})
            }),
            f.InteractiveObject('Door',
            {
                SherlockWalkAndSpeech(f, 'io_door_point',
                    {{'s01c00_lio_0000_door_0'},
                     {'s01c00_lio_0000_door_1'},
                     {'s01c00_lio_0000_door_2'}}),
                SherlockWalkAndSpeech(f, 'io_door_point',
                    {{'s01c00_lio_0000_door_3'},
                     {'s01c00_lio_0000_door_4'},
                     {'s01c00_lio_0000_door_5'}},
                    f.InvestigationRestriction(2, '<')),
                SherlockWalkAndSpeech(f, 'io_door_point',
                    {{'s01c00_lio_0000_door_6'},
                     {'s01c00_lio_0000_door_7'}},
                    f.InvestigationRestriction(3, '=')),
                SherlockWalkAndSpeech(f, 'io_door_point',
                    {{'s01c00_lio_0000_door_8'}},
                    f.InvestigationRestriction(3, '>'))
            }),
            CreateInteractiveObjects(f,
                {
                    'decoration-vase',
                    'decoration-vase_2',
                    'decoration-vase_3'
                },
                CreateSameActions(f, {
                    'io_decoration_vase_point',
                    'io_decoration_window_point',
                    'io_decoration_vase_point_3'
                }, SherlockWalkAndSpeech,
                    {{'s01c00_lio_0000_vase_0'},
                     {'s01c00_lio_0000_vase_1'},
                     {'s01c00_lio_0000_vase_2'},
                     {'s01c00_lio_0000_vase_3'}})
            ),
            f.InteractiveObject('Clock',
            {
                SherlockWalkAndSpeech(f, 'io_clock_point',
                    {{'s01c00_lio_0000_clock_0'},
                     {'s01c00_lio_0000_clock_1'},
                     {'s01c00_lio_0000_clock_2'},
                     {'s01c00_lio_0000_clock_3'}}),
                SherlockWalkAndSpeech(f, 'io_clock_point',
                    {{'s01c00_lio_0000_clock_4'}},
                    f.InvestigationRestriction(2, '<'))
            }),
            f.InteractiveObject('Cage',
            {
                SherlockWalkAndSpeech(f, 'io_bird_cage_point',
                    {{'s01c00_lio_0000_bird_cage_0'},
                     {'s01c00_lio_0000_bird_cage_1'},
                     {'s01c00_lio_0000_bird_cage_2'},
                     {'s01c00_lio_0000_bird_cage_3'},
                     {'s01c00_lio_0000_bird_cage_4'}}),
                SherlockWalkAndSpeech(f, 'io_bird_cage_point',
                    {{'s01c00_lio_0000_bird_cage_5'}},
                    f.InvestigationRestriction(2, '<')),
                SherlockWalkAndSpeech(f, 'io_bird_cage_point',
                    {{'s01c00_lio_0000_bird_cage_6'}},
                    f.InvestigationRestriction(3, '=')),
                SherlockWalkAndSpeech(f, 'io_bird_cage_point',
                    {{'s01c00_lio_0000_bird_cage_7'}},
                    f.InvestigationRestriction(4, '='))
            }),
            f.InteractiveObject('decoration-cabinet_1',
            {
                SherlockWalkAndSpeech(f, 'io_decoration_cabinet_1_point',
                    {{'s01c00_lio_0000_cabinet_1_0'},
                     {'s01c00_lio_0000_cabinet_1_1'},
                     {'s01c00_lio_0000_cabinet_1_2'},
                     {'s01c00_lio_0000_cabinet_1_3'},
                     {'s01c00_lio_0000_cabinet_1_4'},
                     {'s01c00_lio_0000_cabinet_1_5'}})
            }),
            f.InteractiveObject('decoration-window',
            {
                SherlockWalkAndSpeech(f, 'io_decoration_window_point',
                    {{'s01c00_lio_0000_decoration_window_0'},
                     {'s01c00_lio_0000_decoration_window_1'},
                     {'s01c00_lio_0000_decoration_window_2'},
                     {'s01c00_lio_0000_decoration_window_3'}})
            }),
            f.InteractiveObject('decoration-chest_of_drawers',
            {
                SherlockWalkAndSpeech(f, 'io_decoration_mirror_point',
                    {{'s01c00_lio_0000_decoration_chest_of_drawers_0'},
                     {'s01c00_lio_0000_decoration_chest_of_drawers_1'},
                     {'s01c00_lio_0000_decoration_chest_of_drawers_2'},
                     {'s01c00_lio_0000_decoration_chest_of_drawers_3'}}),
                SherlockWalkAndSpeech(f, 'io_decoration_mirror_point',
                    {{'s01c00_lio_0000_decoration_chest_of_drawers_4'}},
                    f.InvestigationRestriction(2, '<')),
                SherlockWalkAndSpeech(f, 'io_decoration_mirror_point',
                    {{'s01c00_lio_0000_decoration_chest_of_drawers_5'}},
                    f.InvestigationRestriction(3, '=')),
            }),
            f.InteractiveObject('decoration-mirror',
            {
                SherlockWalkAndSpeech(f, 'io_decoration_mirror_point',
                    {{'s01c00_lio_0000_decoration_mirror_0'},
                     {'s01c00_lio_0000_decoration_mirror_1'},
                     {'s01c00_lio_0000_decoration_mirror_2'}})
            }),
            f.InteractiveObject('decoration-cabinet_2',
            {
                SherlockWalkAndSpeech(f, 'io_decoration_cabinet_2_point',
                    {{'s01c00_lio_0000_decoration_cabinet_2_0'},
                     {'s01c00_lio_0000_decoration_cabinet_2_1'},
                     {'s01c00_lio_0000_decoration_cabinet_2_2'}}),
                SherlockWalkAndSpeech(f, 'io_decoration_cabinet_2_point',
                    {{'s01c00_lio_0000_decoration_cabinet_2_3'}},
                    f.InvestigationRestriction(2, '<')),
                SherlockWalkAndSpeech(f, 'io_decoration_cabinet_2_point',
                    {{'s01c00_lio_0000_decoration_cabinet_2_4'}},
                    f.InvestigationRestriction(3, '='))
            }),
            f.InteractiveObject('decoration-box',
            {
                SherlockWalkAndSpeech(f, 'io_decoration_box_point',
                    {{'s01c00_lio_0000_decoration_box_0'},
                     {'s01c00_lio_0000_decoration_box_1'},
                     {'s01c00_lio_0000_decoration_box_2'},
                     {'s01c00_lio_0000_decoration_box_3'}})
            }),
            f.InteractiveObject('decoration-sofa',
            {
                SherlockWalkAndSpeech(f, 'io_decoration_sofa_point',
                    {{'s01c00_lio_0000_decoration_sofa_0'},
                     {'s01c00_lio_0000_decoration_sofa_1'},
                     {'s01c00_lio_0000_decoration_sofa_2'},
                     {'s01c00_lio_0000_decoration_sofa_3'}})
            }),
            f.InteractiveObject('decoration-bar_chair',
            {
                SherlockWalkAndSpeech(f, 'io_decoration_bar_chair_point',
                    {{'s01c00_lio_0000_decoration_bar_chair_0'},
                     {'s01c00_lio_0000_decoration_bar_chair_1_0', 's01c00_lio_0000_decoration_bar_chair_1_1'},
                     {'s01c00_lio_0000_decoration_bar_chair_2'},
                     {'s01c00_lio_0000_decoration_bar_chair_3'}})
            }),
            f.InteractiveObject('decoration-kitchen',
            {
                SherlockWalkAndSpeech(f, 'io_decoration_kitchen_point',
                   {{'s01c00_lio_0000_decoration_kitchen_0'},
                    {'s01c00_lio_0000_decoration_kitchen_1_0', 's01c00_lio_0000_decoration_kitchen_1_1'},
                    {'s01c00_lio_0000_decoration_kitchen_2'}})
            }),
            CreateInteractiveObjects(f,
                 {
                     'decoration-chair_1',
                     'decoration-chair_2',
                     'decoration-chair_3'
                 },
                 CreateSameActions(f, {
                     'io_decoration_chair_1_point',
                     'io_decoration_chair_2_point',
                     'io_decoration_chair_3_point'
                     }, SherlockWalkAndSpeech,
                         {{'s01c00_lio_0000_decoration_chair_0'},
                          {'s01c00_lio_0000_decoration_chair_1'},
                          {'s01c00_lio_0000_decoration_chair_2'}})
            ),
            f.InteractiveObject('decoration-armchair',
            {
                SherlockWalkAndSpeech(f, 'io_decoration_armchair_point',
                    {{'s01c00_lio_0000_decoration_armchair_0'},
                     {'s01c00_lio_0000_decoration_armchair_1_0', 's01c00_lio_0000_decoration_armchair_1_1'},
                     {'s01c00_lio_0000_decoration_armchair_2_0', 's01c00_lio_0000_decoration_armchair_2_1'},
                     {'s01c00_lio_0000_decoration_armchair_3'},
                     {'s01c00_lio_0000_decoration_armchair_4'}})
            }),
            f.InteractiveObject('decoration-nightstand',
            {
                SherlockWalkAndSpeech(f, 'io_decoration_nightstand_point',
                    { { 's01c00_lio_0000_decoration_nightstand_0' },
                      { 's01c00_lio_0000_decoration_nightstand_1_0', 's01c00_lio_0000_decoration_nightstand_1_1' },
                      { 's01c00_lio_0000_decoration_nightstand_2' },
                      { 's01c00_lio_0000_decoration_nightstand_3' }})
            }),
            f.InteractiveObject('decoration-shield',
            {
                SherlockWalkAndSpeech(f, 'io_decoration_shield_point',
                    {{'s01c00_lio_0000_decoration_shield_0'},
                     {'s01c00_lio_0000_decoration_shield_1'},
                     {'s01c00_lio_0000_decoration_shield_2'},
                     {'s01c00_lio_0000_decoration_shield_3'}})
            }),
            CreateInteractiveObjects(f,
                 {
                     'decoration-picture_1',
                     'decoration-picture_2',
                     'decoration-picture_3'
                 },
                 CreateSameActions(f, {
                     'io_decoration_picture_point_1',
                     'io_decoration_picture_point_2',
                     'io_decoration_picture_point_3'
                     }, SherlockWalkAndSpeech,
                         {{'s01c00_lio_0000_decoration_picture_0_0', 's01c00_lio_0000_decoration_picture_0_1'},
                          {'s01c00_lio_0000_decoration_picture_1'},
                          {'s01c00_lio_0000_decoration_picture_2_0', 's01c00_lio_0000_decoration_picture_2_1'},
                          {'s01c00_lio_0000_decoration_picture_3'}})
            ),
            f.InteractiveObject('SherlockIso',
            {
                SherlockSpeech(f, {{'s01c00_lio_0000_sherlock_0'},
                    {'s01c00_lio_0000_sherlock_1'},
                    {'s01c00_lio_0000_sherlock_2'},
                    {'s01c00_lio_0000_sherlock_3'},
                    {'s01c00_lio_0000_sherlock_4'},
                    {'s01c00_lio_0000_sherlock_5'}}, true),
                SherlockSpeech(f, {{'s01c00_lio_0000_sherlock_6'},
                    {'s01c00_lio_0000_sherlock_7'}},
                    true,
                    f.InvestigationRestriction(2, '<')),
                SherlockSpeech(f, {{'s01c00_lio_0000_sherlock_8'},
                    {'s01c00_lio_0000_sherlock_9'}},
                    true,
                    f.InvestigationRestriction(3, '=')),
                SherlockSpeech(f, {{'s01c00_lio_0000_sherlock_10'},
                    {'s01c00_lio_0000_sherlock_11'}},
                    true,
                    f.InvestigationRestriction(4, '='))
            })
        })
    })
end