void OnStart()
{
AddDebugMessage("SCRIPT", false);
AddEntityCollideCallback("Player", "AreaOpenDoorGrunt", "OpenDoorGrunt", true, 0);
AddEntityCollideCallback("servant_grunt_3", "AreaMonsterDisappear_1", "MonsterDisappear_1", true, 0);
AddEntityCollideCallback("Player", "AreaStopMonster", "StopMonster", false, 0);
for(int p=1;p<3;p++) AddEntityCollideCallback("saw_"+p, "AreaWoodSaw", "BuildLadder", true, 0);
AddTimer("ScareSounds_"+RandInt(1, 5), RandInt(5, 15), "ScareSounds");
AddTimer("ScareSounds_"+RandInt(1, 5), RandInt(5, 15), "ScareSounds");
}
//////////////
//SAW PUZZLE//
void InteractWoodSaw(string &in asEntity)
{
AddDebugMessage("SCRIPT", false);
SetMessage("Messages", "04_saw", 0);
AddQuest("04_NeedSaw", "04_NeedSaw");
}
void BuildLadder(string &in asParent, string &in asChild, int alState)
{
if(GetLocalVarInt("MonsterIsActive", 1);
if(asTimer == "BuildLadder_1")
{
SetEntityActive("wooden_board01_1", false);
SetEntityActive("wooden_board01_2", false);
SetEntityActive("wooden_board_pile01_2", false);
SetEntityActive("ladder_item_1", true);
FadeIn(2);
AddTimer("BuildLadder_2", 2, "BuildLadder");
return;
}
if(asTimer == "BuildLadder_2")
{
AddPlayerSanity(10);
CompleteQuest("04_NeedSaw", "Quest_04_NeedSaw_Text");
return;
}
if(asTimer == BuildLadder)
{
FadeOut(0);
PlaySoundAtEntity("", "26_saw.snt", "Player", 0, false);
AddTimer("BuildLadder_1", 5, "BuildLadder");
}
}
//SAW PUZZLE END//
//////////////////
////////////////
//SCARE SOUNDS//
void ScareSounds(string &in asTimer)
{
if(asTimer == "ScareSounds_1")
{
PlaySoundAtEntity("", "scare_male_terrified.snt", "ScareSounds_"+RandInt(1, 5), 0, false);
AddTimer("ScareSounds_"+RandInt(1, 5), 0, "ScareSounds");
}
if(asTimer == "ScareSounds_2")
{
PlaySoundAtEntity("", "scare_male_terrified.snt", "ScareSounds_"+RandInt(1, 5), 0, false);
AddTimer("ScareSounds_"+RandInt(1, 5), 0, "ScareSounds");
}
if(asTimer == "ScareSounds_3")
{
PlaySoundAtEntity("", "scare_male_terrified.snt", "ScareSounds_"+RandInt(1, 5), 0, false);
AddTimer("ScareSounds_"+RandInt(1, 5), 0, "ScareSounds");
}
if(asTimer == "ScareSounds_4")
{
PlaySoundAtEntity("", "scare_human_noices.snt", "ScareSounds_"+RandInt(1, 5), 0, false);
AddTimer("ScareSounds_"+RandInt(1, 5), 0, "ScareSounds");
}
if(asTimer == "ScareSounds_5")
{
PlaySoundAtEntity("", "pounding_suitor_low.snt", "ScareSounds_"+RandInt(1, 5), 0, false);
AddTimer("ScareSounds_"+RandInt(1, 5), 0, "ScareSounds");
}
AddTimer("ScareSounds", RandInt(5, 15), "ScareSounds");
}
//SCARESOUNDS END//
///////////////////
///////////
//ENEMIES//
//ENEMIES END//
///////////////
void OnEnter()
{
}
void OnLeave()
{
}