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);
SetEntityCallbackFunc("Cellar_Door_Key", "OnPickupCellarKey");
}
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);
}
void SpideyGoPoof(string &in asEntity, int alState)
{
if(alState == 1) //Only if the player is look at the area
{
AddTimer("Poof", 3.0, "Gone");
}
}
void Gone(string &in asTimer)
{
SetEntityActive("Spider_1",false);
}
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 OnLeave()
{
}