////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityPlayerInteractCallback("Mansion_5", "MonsterActivate", true);
AddUseItemCallback("", "LockedDoorKey_1", "LockedDoor_1", "UsedKeyOnDoor", true);
AddUseItemCallback("", "Key_2", "Door_2", "UsedKeyOnDoor2", true);
AddEntityCollideCallback("Player", "Scare_1", "CollideScare_1", true, 1);
AddEntityCollideCallback("Player", "Doorslam_1", "CollideDoorslam_1", true, 1);
AddEntityCollideCallback("Player", "MonsterActivate", "CollideMonsterActivate", true, 1);
}
void MonsterActivate(string &in Entity)
{
SetEntityActive("Frank", true);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LockedDoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "LockedDoor_1", 0, false);
RemoveItem("LockedDoorKey");
}
void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door_2", false, true);
PlaySoundAtEntity("", "unlock_door", "Door_2", 0, false);
RemoveItem("Key_2");
}
void CollideScare_1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("ScareDoor_1", true, true);
}
void CollideDoorslam_1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("LockedDoor_1", true, true);
}
void CollideMonsterActivate(string &in asParent, string &in asChild, int alState)
{
SetNPCAwake("Frank_2", true, false);
AddEnemyPatrolNode("Frank_2", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Frank_2", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("Frank_2", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("Frank_2", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("Frank_2", "PathNodeArea_36", 0, "");
SetEnemyDisabled("Frank_2", true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
///////////////////////////
//Run when leaving map
void OnLeave()
{
}