void lockdoor(string &in asParent, string &in asChild, int alState)
{
StartScreenShake(0.01f, 0.5f, 0.5f, 1.0f);
SetEntityActive("lockdoor", false);
PlayGuiSound("scare_slam_door.snt", 0.7f);
AddPropForce("cellar_wood01_4", 0, 0, -50000, "world");
AddTimer("", 0.4, "lockit");
}
void lockit(string &in asTimer)
{
float fEventSpeed=0;
AddLocalVarInt("TimerEvent", 1);
switch(GetLocalVarInt("TimerEvent"))
{
case 1:
SetSwingDoorLocked("cellar_wood01_4", true, false);
PlayGuiSound("lock_door", 1.6);
SetEntityActive("male_arm_1", false);
fEventSpeed = 3.0f;
break;
case 2:
PlayGuiSound("amb_hunt04.ogg", 1.6);
PlayMusic("att_grunt", true, 1, 5, 1, true);
SetPlayerRunSpeedMul(0.5f);
SetPlayerMoveSpeedMul(0.5f);
fEventSpeed = 2.0f;
break;
case 3:
StartScreenShake(0.1f, 0.5f, 0.1f,0.3f);
AddPropImpulse("cellar_wood01_4", 0, 0, -10, "World");
PlaySoundAtEntity("", "21_bang_door", "cellar_wood01_4", 0.25f, false);
CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "cellar_wood01_4", false);
fEventSpeed = 3.0f;
break;
case 4:
StartScreenShake(0.1f, 0.5f, 0.1f,0.3f);
AddPropImpulse("cellar_wood01_4", 0, 0, -10, "World");
PlaySoundAtEntity("", "21_bang_door", "cellar_wood01_4", 0.25f, false);
CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "cellar_wood01_4", false);
fEventSpeed = 0.6f;
break;
case 5:
AddEffectVoice("voices", "Ch01L09.ogg", "Voice", "HolyGesus",
false, "EventDoor", 1, 1);
SetEntityActive("corpse_male_arm_1", true);
StartPlayerLookAt("corpse_male_arm_1", 10, 4, "");
fEventSpeed = 1.0f;
break;
case 6:
AddEffectVoice("voices", "Ch01L08.ogg", "Voice", "HolyGesus",
false, "EventDoor", 1, 1);
StopPlayerLookAt();
fEventSpeed = 2.0f;
break;
case 7:
PlayGuiSound("react_breath", 0.7f);
fEventSpeed = 2.0f;
break;
}
if(GetLocalVarInt("TimerEvent") <7) AddTimer("TimerEvent",fEventSpeed, "lockit");
}