void OnStart()
{
SetPlayerLampOil(10.0f);
AddEntityCollideCallback("Player", "ScriptArea_1", "ActivateMonsters", true, 1);
AddUseItemCallback("","CabinetKey1", "cabinet_nice_1","UsedKeyOnDoor", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", true, true);
SetSwingDoorLocked("cabinet_nice_1", false, true);
PlaySoundAtEntity("","unlock_door", "cabinet_nice_1" ,0.0f, false);
RemoveItem("CabinetKey1");
StartPlayerLookAt("Monster3", 2, 2, "");
AddTimer("donelook", 2.5f, "TimerDoneLookAt");
SetEntityActive("Monster3", true);
}
void TimerDoneLookAt(string &in asTimer)
{
StopPlayerLookAt();
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
void ActivateMonsters(string &in asParent, string &in asChild, int alState)
{
/////////////////////
// Monster 1
SetEntityActive("Monster1", true);
AddEnemyPatrolNode("Monster1", "PatrolNode1", 10.0f, "");
GiveSanityDamage(15.0f, true);
/////////////////////
// Monster 2
SetEntityActive("Monster2", true);
AddEnemyPatrolNode("Monster2", "Monster2Path1", 6.0f, "");
AddEnemyPatrolNode("Monster2", "Monster2Path2", 6.0f, "");
AddEnemyPatrolNode("Monster2", "Monster2Path3", 6.0f, "");
AddEnemyPatrolNode("Monster2", "Monster2Path4", 6.0f, "");
AddEnemyPatrolNode("Monster2", "Monster2Path1", 6.0f, "");
AddEnemyPatrolNode("Monster2", "Monster2Path2", 6.0f, "");
AddEnemyPatrolNode("Monster2", "Monster2Path3", 6.0f, "");
AddEnemyPatrolNode("Monster2", "Monster2Path4", 6.0f, "");
}
void OnLeverStateChange("Lever1", -1)
{
if (alState == 1)
{
SetSwingDoorLocked("mansion_2", false, true);
}
}