void Dream(string &in asTimer)
{
AddLocalVarInt("DreamStep", 1);
float fEventSpeed = 5;
switch(GetLocalVarInt("DreamStep"))
{
case 1:
AddEntityCollideCallback("servant_brute_2", "BruteDoor", "BruteBreakDoor", true, 1);
AddEntityCollideCallback("Player", "EnterRoomArea", "EnterRoom", true, 1);
SetPlayerHealth(50);
FadeOut(0);
SetMessage("ChapterOneMisc", "IntroQuote", 11.5f);
SetPlayerActive(false);
TeleportPlayer("DreamStart");
SetSanityDrainDisabled(true);
PlayMusic("DreamWhisper.ogg", false, 1, 1, 5, false);
SetPlayerMoveSpeedMul(0.2f);
SetPlayerRunSpeedMul(0.3f);
SetPlayerLookSpeedMul(0.3f);
FadeGlobalSoundSpeed(0.6f, 1);
fEventSpeed = 12;
AddDebugMessage("Case1 initializing", true);
break;
case 2:
for(int g = 1; g <= 51; g++)
SetEntityActive("13_burner_" +g, true);
SetPlayerActive(true);
PlaySoundAtEntity("", "sanity_damage.snt", "Player", 0.0f, false);
FadeIn(0.1f);
FadeImageTrailTo(2, 1);
PlayMusic("29_amb.ogg", true, 1, 1, 5, false);
fEventSpeed = 10;
AddDebugMessage("Case2 initializing", true);
break;
case 3:
SetEntityActive("servant_brute_2", true);
CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "DoorBreak", false);
PlaySoundAtEntity("", "break_wood.snt", "BruteDoor_1", 0, false);
SetEntityActive("FirstDoor", false);
StartPlayerLookAt("servant_brute_2", 1, 1, "");
AlertEnemyOfPlayerPresence("servant_brute_2");
fEventSpeed = 5;
AddDebugMessage("Case3 initializing", true);
case 4:
fEventSpeed = 5;
AddDebugMessage("Case4 initializing", true);
break;
case 5:
CheckPoint ("DeathRespawn", "PlayerStartBed", "DeathRespawn", "DeathRespawn", "DeathRespawn");
StartPlayerLookAt("AreaDreamLook", 0.5f, 1, "");
AddTimer("", 2, "StopLook");
TeleportPlayer("Dream1");
AlertEnemyOfPlayerPresence("servant_brute_2");
SetSwingDoorClosed("dreamdoor", false, false);
SetSwingDoorDisableAutoClose("dreamdoor", true);
AddPropForce("dreamdoor", 0, 0, 3000, "world");
fEventSpeed = 3;
AddDebugMessage("Case5 initializing", true);
break;
}
if(GetLocalVarInt("DreamStep") < 5) AddTimer("Dream1", fEventSpeed, "Dream");
}