//////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", false, 1);
AddUseItemCallback("", "StairsKey_1", "Stairs_1", "KeyOnDoor", true);
AddUseItemCallback("", "StairsKey_1", "Stairs_2", "UnlockLevelDoor", true);
SetEntityPlayerInteractCallback("Lantern", "func_slam", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Stairs_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Stairs_1", 0.0f, true);
}
void UnlockLevelDoor(string &in item, string &in entity)
{
SetLevelDoorLocked(entity, false)
;PlaySoundAtEntity ("", "unlock_door.snt", "Stairs_2", 0.0f, true);
RemoveItem("StairsKey_1");
}
void func_slam(string &in asEntity)
{
SetPropHealth("Door1", 0.0f);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("mansion_2", 0.1f);
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_25", 0, "");
AddTimer("MonsterFade", 65, "FadeHim");
}
void FadeHim
{
FadeEnemyToSmoke("servant_grunt_1", false);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}