void OnStart()
{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "PlayerCollide_Spotlight", "SpotlightOn", true, 1);
AddEntityCollideCallback("Player", "PlayerCollide_SpotlightOff", "SpotlightOff", true, 1);
AddUseItemCallback("", "Key_AlcDoor", "AlcDoor", "UsedKeyOnAlcDoor", true);
AddEntityCollideCallback("SlantLadder", "SlantLadderArea", "ActivateLadder", true, 1);
SetEntityCallbackFunc("Cellar_Door_Key", "OnPickupCellarKey");
AddEntityCollideCallback("Player", "SkullLadder", "MakeSkullLadder", true, 1);
AddEntityCollideCallback("Player", "LookAtHatch", "Lookey", true, 1);
AddEntityCollideCallback("Player", "TakenAlready", "TookStuffAlready", true, 1);
AddEntityCollideCallback("Player", "IShouldTurnBack", "TurnBack", true, 1);
SetLocalVarInt("Var1", 0);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
}
void UsedKeyOnAlcDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("AlcDoor", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "AlcDoor", 0.0f, true);
RemoveItem("Key_AlcDoor");
}
void OnPickupCellarKey(string &in asEntity, string &in type)
{
SetEntityActive("CellarKeyDis_*",false);
SetEntityActive("CellarKeyApp_*",true);
SetEntityActive("TakenAlready",true);
}
void SpideyGoPoof(string &in asEntity, int alState)
{
if(alState == 1) //Only if the player is look at the area
{
GiveSanityDamage(5, true);
AddTimer("Poof", 1.0, "Gone");
}
}
void Gone(string &in asTimer)
{
SetPropActiveAndFade("Spider_1", false, 0.5f);
}
void SpotlightOn(string &in asParent, string &in asChild, int alState)
{
SetLightVisible("Spotlight_4", true);
}
void SpotlightOff(string &in asParent, string &in asChild, int alState)
{
SetLightVisible("Spotlight_4", false);
}
void DoorLocked(string &in asEntity)
{
if(GetSwingDoorLocked("AlcDoor") == true)
{
SetMessage("Messages", "AlLocked", 0);
}
}
void NotNow(string &in asEntity)
{
if(GetSwingDoorLocked("hatch_ceiling_1") == true)
{
SetMessage("Messages", "NotNow", 0);
}
}
void ActivateLadder (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("ladder_static_8", true);
SetEntityActive("SlantLadder", false);
SetEntityActive("LadderArea_2", true);
}
void MakeSkullLadder (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("human_skull_*", true);
SetEntityActive("Sladder_*", false);
GiveSanityDamage(5, true);
AddTimer("SkullLadderTimer", 4.0, "SkullLadderEnd");
}
void SkullLadderEnd (string &in asTimer)
{
SetPropActiveAndFade("human_skull_*", false, 0.5f);
SetEntityActive("Sladder_*", true);
}
void TakeWine(string &in asEntity)
{
SetMessage("Messages", "WineTaken", 0);
SetSwingDoorLocked("CellarDoor", true, true);
}
void CellarDoorLockedWhy(string &in asEntity)
{
if(GetSwingDoorLocked("CellarDoor") == true)
{
SetMessage("Messages", "WhyDoorLocked", 0);
SetSwingDoorLocked("hatch_ceiling_1", false, true);
SetEntityActive("wood_box02_4", false);
SetEntityActive("LookAtHatch", true);
}
}
void Lookey (string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
StartPlayerLookAt("hatch_ceiling_1", 1.0f, 1.0f, "");
SetMessage("Messages", "IsKeyThere", 0);
AddTimer("DoneLooking", 2.0, "DoneLookingAtHatch");
}
void DoneLookingAtHatch(string &in asTimer)
{
SetPlayerActive(true);
StopPlayerLookAt();
}
void TookStuffAlready(string &in asParent, string &in asChild, int alState)
{
SetMessage("Messages", "PickedUpAlready", 0);
}
void TurnBack(string &in asParent, string &in asChild, int alState)
{
SetMessage("Messages", "WhereamI", 0);
SetEntityActive ("WhatThe", true);
SetEntityActive ("TurnBack", true);
}
void WallHasAppeared(string &in asEntity, int alState)
{
if(alState == 1) //Only if the player is look at the area
{
GiveSanityDamage(5, true);
SetMessage("Messages", "WhatThe", 0);
}
}
void CDoor1(string &in asEntity)
{
SetEntityActive("DoorRoomApp1_*", true);
SetEntityActive("DoorRoomDis1_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor2(string &in asEntity)
{
SetEntityActive("DoorRoomApp2_*", true);
SetEntityActive("DoorRoomDis2_*", false);
AddLocalVarInt("Var1", 1);
func12();
} //This one. You forgot a closing brace
void CDoor3(string &in asEntity)
{
SetEntityActive("DoorRoomApp3_*", true);
SetEntityActive("DoorRoomDis3_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor4(string &in asEntity)
{
SetEntityActive("DoorRoomApp4_*", true);
SetEntityActive("DoorRoomDis4_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor5(string &in asEntity)
{
SetEntityActive("DoorRoomApp5_*", true);
SetEntityActive("DoorRoomDis5_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor6(string &in asEntity)
{
SetEntityActive("DoorRoomApp6_*", true);
SetEntityActive("DoorRoomDis6_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor7(string &in asEntity)
{
SetEntityActive("DoorRoomApp7_*", true);
SetEntityActive("DoorRoomDis7_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor8(string &in asEntity)
{
SetEntityActive("DoorRoomApp8_*", true);
SetEntityActive("DoorRoomDis8_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor9(string &in asEntity)
{
SetEntityActive("DoorRoomApp9_*", true);
SetEntityActive("DoorRoomDis9_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor10(string &in asEntity)
{
SetEntityActive("DoorRoomApp10_*", true);
SetEntityActive("DoorRoomDis10_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void CDoor11(string &in asEntity)
{
SetEntityActive("DoorRoomApp11_*", true);
SetEntityActive("DoorRoomDis11_*", false);
AddLocalVarInt("Var1", 1);
func12();
}
void func12(string &in asEntity)
{
if(GetLocalVarInt("Var1") == 11)
{
SetEntityActive("CRoomCarpet", false);
}
}
void OnLeave()
{
}