void OnStart()
{
FadeOut(0.01f);
AddTimer("", 2.1f, "awake2");
AddTimer("", 5.0f, "awake");
FadePlayerRollTo(90, 1, 2);
MovePlayerHeadPos(0, -1.5f, 0, 1, 0.1f);
PlayMusic("00_event_gallery", true, 1, 0.1, 10, false);
AddTimer("StopMusicTimer", 15.0f, "StopMusicFunc");
PreloadSound("general_piano01.snt");
SetEntityPlayerInteractCallback("ScriptArea_001", "PianoFunc", false);
AddEntityCollideCallback("Player", "Script001", "Script001", true, 1);
AddEntityCollideCallback("Player", "kappa33", "kappa33", true, 1);
AddUseItemCallback("", "key01", "door01", "UseKeyOnDoor", true);
AddUseItemCallback("", "key02", "door02", "UseKeyOnDoor", true);
AddEntityCollideCallback("Player", "ScryptArea1_1", "Scrypt2", true, 1);
AddEntityCollideCallback("Player", "Jumpperro", "Jumpscare2", true, 1);
AddEntityCollideCallback("Player", "jumperro022", "Jumpscare3", true, 1);
AddUseItemCallback("", "KeyDesc01", "level_hub_1", "FUNCTION", true);
}
void StopMusicFunc(string &in asTimer)
{
StopMusic(1.0f, 10);
}
void PianoFunc(string &in asEntity)
{
StopSound("PianoSound", 2.5f);
PlaySoundAtEntity("PianoSound", "general_piano01.snt", "Script001", 0.5f, false);
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem(asItem);
}
void FUNCTION(string &in item, string &in door)
{
SetLevelDoorLocked("level_hub_1", false);
PlayGuiSound("unlock_door.snt", 100);
RemoveItem("KeyDesc01");
}
void Scrypt2(string &in asParent, string &in asChild, int alState)
{
SetMessage("MessageCategory2", "MessageEntry2", 0);
}
void kappa33(string &in asParent, string &in asChild, int alState)
{
SetMessage("MessageCategory3", "MessageEntry3", 0);
}
void Jumpscare2(string &in asParent, string &in asChild, int alState)
{
PlayGuiSound("15_the_big_scream.snt", 1.0f);
SetEntityActive("portret1", true);
SetEntityActive("portret2", true);
SetEntityActive("portret3", true);
SetEntityActive("portret4", true);
SetEntityActive("portret5", true);
SetEntityActive("portret6", true);
SetEntityActive("portret7", true);
SetEntityActive("redlamp1", true);
SetEntityActive("redlamp2", true);
SetEntityActive("redlamp3", true);
SetEntityActive("redlamp4", true);
SetEntityActive("redlamp5", true);
SetEntityActive("redlamp6", true);
SetEntityActive("redlamp7", true);
SetEntityActive("redlamp8", true);
AddTimer("", 2.5f, "JumpscareEntity_Gone");
}
void Jumpscare3(string &in asParent, string &in asChild, int alState)
{
PlayGuiSound("15_body_impact.snt", 1.0f);
SetEntityActive("rycerz1", true);
SetEntityActive("rycerz2", true);
SetEntityActive("rycerz3", true);
SetEntityActive("rycerz4", true);
SetEntityActive("rycerz5", true);
SetEntityActive("rycerz6", true);
SetEntityActive("rycerz7", true);
SetEntityActive("rycerz8", true);
AddTimer("", 2.5f, "JumpscareEntity_Gone");
}
void awake2(string asTimer)
{
FadeIn(5.0f);
}
void awake(string asTimer)
{
FadePlayerRollTo(0, 1, 2);
MovePlayerHeadPos(0, 0.0f, 0, 0.5, 0.1f);
}