void OnStart()
{
AddUseItemCallback("", "key_0", "locked_door0", "UsedKeyOnDoor0", true);
AddUseItemCallback("", "key_1", "locked_door1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "explode_scare", "Explode", true, 1);
SetEntityCallbackFunc("key_1", "OnPickup");
AddEntityCollideCallback("Player", "Message_1", "Message1", true, 1);
AddEntityCollideCallback("Player", "Message_2", "Message2", true, 1);
AddEntityCollideCallback("Player", "Message_3", "Message3", true, 1);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("locked_door1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false);
RemoveItem("key_1");
}
void UsedKeyOnDoor0(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("locked_door0", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "locked_door0", 0, false);
RemoveItem("key_0");
}
void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("servant_grunt_1", true);
AddTimer("", 20.0f, "GruntDisable");
ShowEnemyPlayerPosition("servant_grunt_1");
}
void GruntDisable(string &in asTimer)
{
SetEntityActive("servant_grunt_1", false);
}
void DoorLockedPlayer(string &in entity)
{
if(GetSwingDoorLocked("gruntdoorss") == true)
{
SetMessage("Messages", "gruntdoor", 2);
}
}
//////////////////////////////////////////////////////////////////
void OnEnter()
{
AddUseItemCallback("", "trap", "locked_door1", "Trapitup", true);
SetEntityCallbackFunc("trap", "OnPickup1");
}
void Trapitup(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("locked_door1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false);
RemoveItem("trap");
}
void OnPickup1(string &in asEntity, string &in type)
{
SetEntityActive("1", true);
ShowEnemyPlayerPosition("1");
SetEntityActive("2", true);
ShowEnemyPlayerPosition("2");
SetEntityActive("3", true);
ShowEnemyPlayerPosition("3");
SetEntityActive("4", true);
ShowEnemyPlayerPosition("4");
SetEntityActive("5", true);
ShowEnemyPlayerPosition("5");
}
void Message1(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup1", 0);
}
void Message2(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup2", 0);
}
void Message3(string &in asChild, string &in asParent, int alState)
{
SetMessage("Messages", "Popup3", 0);
}
////////////////////////////////////////////////////////////////////////////////////
void Explode(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("vase_1", 0);
SetPropHealth("vase_2", 0);
}
///////////////////////////////////////////////////////////////