void OnStart()
{
AddUseItemCallback("", "Crowbar_Entity", "Door", "CrowbarInteract", true);
AddEntityCollideCallback("Crowbar_Joint", "JointCollideArea_1", "BreakDoorCrowbar", true, 1);
}
void CrowbarInteract(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2f, "TimerSwitchJoint");
RemoveItem("Crowbar_Entity");
}
void TimerSwitchJoint(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "Door", 0, false);
SetEntityActive("Crowbar_Joint", true);
}
void BreakDoorCrowbar(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("Door", false, true);
AddPropImpulse("Door", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("Door", true);
SetSwingDoorClosed("Door", false, false);
SetMoveObjectState("prison_1", 1);
PlaySoundAtEntity("","break_wood_metal", "EffectsArea", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "EffectsArea", false);
SetEntityActive("Crowbar_Joint", false);
SetLocalVarInt("DoorVarInt", 1);
}
void OnEnter()
{
}
void OnLeave()
{
}