void OnStart()
{
AddEntityCollideCallback("crowbar_joint_1", "crowbar_broke_zone1", "CrowbarFunc", true, 1); AddEntityCollideCallback("crowbar_joint_2", "crowbar_broke_zone2", "CrowbarFunc2", true, 1);
AddUseItemCallback("", "key_1", "mansion_6", "KeyFunc", true);
AddUseItemCallback("", "key_1", "mansion_7", "Key1Func", true);
AddUseItemCallback("", "hammer_1", "mansion_6", "HammerFunc", true);
AddUseItemCallback("", "hammer_1", "mansion_7", "Hammer1Func", true);
}
void CrowbarFunc(string &in asParent, string &in asChild, int alState)
{
if(GetEntityExists("key_1")==false)
{
if(GetEntityExists("hammer_1")==false)
{
if(HasItem("key_1")==false)
{
if(HasItem("hammer_1")==false)
{
SetEntityActive("crowbar_joint_1", false);
SetEntityActive("crowbar_joint_1_broke", true);
SetSwingDoorLocked("mansion_6", false, true);
AddPropImpulse("mansion_6", 0, 0, -10, "World");
CreateParticleSystemAtEntity("HW1", "ps_hit_wood.ps", "crowbar_p1", true);
PlaySoundAtEntity("BR", "break_wood_metal", "crowbar_p1_1", 0, false);
SetMessage("Things", "S22", 5);
RemoveTimer("KillMe");
}
else
{
SetEntityActive("crowbar_joint_1", false);
SetEntityActive("crowbar_joint_1_broke", true);
AddPropImpulse("mansion_6", 0, 0, -10, "World");
CreateParticleSystemAtEntity("HW1", "ps_hit_wood.ps", "crowbar_p1", true);
PlaySoundAtEntity("BR", "break_wood_metal", "crowbar_p1_1", 0, false);
SetMessage("Things", "S21", 5);
}
}
else
{
SetEntityActive("crowbar_joint_1", false);
SetEntityActive("crowbar_joint_1_broke", true);
AddPropImpulse("mansion_6", 0, 0, -10, "World");
CreateParticleSystemAtEntity("HW1", "ps_hit_wood.ps", "crowbar_p1", true);
PlaySoundAtEntity("BR", "break_wood_metal", "crowbar_p1_1", 0, false);
SetMessage("Things", "S21", 5);
}
}
else
{
SetEntityActive("crowbar_joint_1", false);
SetEntityActive("crowbar_joint_1_broke", true);
AddPropImpulse("mansion_6", 0, 0, -10, "World");
CreateParticleSystemAtEntity("HW1", "ps_hit_wood.ps", "crowbar_p1", true);
PlaySoundAtEntity("BR", "break_wood_metal", "crowbar_p1_1", 0, false);
SetMessage("Things", "S21", 5);
}
}
else
{
SetEntityActive("crowbar_joint_1", false);
SetEntityActive("crowbar_joint_1_broke", true);
AddPropImpulse("mansion_6", 0, 0, -10, "World");
CreateParticleSystemAtEntity("HW1", "ps_hit_wood.ps", "crowbar_p1", true);
PlaySoundAtEntity("BR", "break_wood_metal", "crowbar_p1_1", 0, false);
SetMessage("Things", "S21", 5);
}
}
void CrowbarFunc2(string &in asParent, string &in asChild, int alState)
{
if(GetEntityExists("key_1")==false)
{
if(GetEntityExists("hammer_1")==false)
{
if(HasItem("key_1")==false)
{
if(HasItem("hammer_1")==false)
{
SetEntityActive("crowbar_joint_2", false);
SetEntityActive("crowbar_joint_2_broke", true);
SetSwingDoorLocked("mansion_7", false, true);
AddPropImpulse("mansion_7", 0, 0, -10, "World");
CreateParticleSystemAtEntity("HW2", "ps_hit_wood.ps", "crowbar_p2", true);
PlaySoundAtEntity("BR2", "break_wood_metal", "crowbar_p2_2", 0, false);
RemoveTimer("KillMe");
SetMessage("Things", "S22", 5);
}
else
{
SetEntityActive("crowbar_joint_2", false);
SetEntityActive("crowbar_joint_2_broke", true);
AddPropImpulse("mansion_7", 0, 0, -10, "World");
CreateParticleSystemAtEntity("HW2", "ps_hit_wood.ps", "crowbar_p2", true);
PlaySoundAtEntity("BR2", "break_wood_metal", "crowbar_p2_2", 0, false);
SetMessage("Things", "S21", 5);
}
}
else
{
SetEntityActive("crowbar_joint_2", false);
SetEntityActive("crowbar_joint_2_broke", true);
AddPropImpulse("mansion_7", 0, 0, -10, "World");
CreateParticleSystemAtEntity("HW2", "ps_hit_wood.ps", "crowbar_p2", true);
PlaySoundAtEntity("BR2", "break_wood_metal", "crowbar_p2_2", 0, false);
SetMessage("Things", "S21", 5);
}
}
else
{
SetEntityActive("crowbar_joint_2", false);
SetEntityActive("crowbar_joint_2_broke", true);
AddPropImpulse("mansion_7", 0, 0, -10, "World");
CreateParticleSystemAtEntity("HW2", "ps_hit_wood.ps", "crowbar_p2", true);
PlaySoundAtEntity("BR2", "break_wood_metal", "crowbar_p2_2", 0, false);
SetMessage("Things", "S21", 5);
}
}
else
{
SetEntityActive("crowbar_joint_2", false);
SetEntityActive("crowbar_joint_2_broke", true);
AddPropImpulse("mansion_7", 0, 0, -10, "World");
CreateParticleSystemAtEntity("HW2", "ps_hit_wood.ps", "crowbar_p2", true);
PlaySoundAtEntity("BR2", "break_wood_metal", "crowbar_p2_2", 0, false);
SetMessage("Things", "S21", 5);
}
}
void KeyFunc(string &in asItem, string &in asEntity)
{
if(GetEntityExists("crowbar_1")==false)
{
if(GetEntityExists("hammer_1")==false)
{
if(HasItem("crowbar_1")==false)
{
if(HasItem("hammer_1")==false)
{
SetSwingDoorLocked("mansion_6", false, true);
PlaySoundAtEntity("BR", "KeyUnlocke.snt", "crowbar_p1_11", 0, false);
SetMessage("Things", "S22", 5);
RemoveItem("key_1");
RemoveTimer("KillMe");
}
else
{
CreateParticleSystemAtEntity("KeyP", "ps_dust_drilling.ps", "KeyP1", true);
PlaySoundAtEntity("BR", "KeyCrash.snt", "crowbar_p1_11", 0, false);
SetMessage("Things", "S23", 5);
RemoveItem("key_1");
}
}
else
{
CreateParticleSystemAtEntity("KeyP", "ps_dust_drilling.ps", "KeyP1", true);
PlaySoundAtEntity("BR", "KeyCrash.snt", "crowbar_p1_11", 0, false);
SetMessage("Things", "S23", 5);
RemoveItem("key_1");
}
}
else
{
CreateParticleSystemAtEntity("KeyP", "ps_dust_drilling.ps", "KeyP1", true);
PlaySoundAtEntity("BR", "KeyCrash.snt", "crowbar_p1_11", 0, false);
SetMessage("Things", "S23", 5);
RemoveItem("key_1");
}
}
else
{
CreateParticleSystemAtEntity("KeyP", "ps_dust_drilling.ps", "KeyP1", true);
PlaySoundAtEntity("BR", "KeyCrash.snt", "crowbar_p1_11", 0, false);
SetMessage("Things", "S23", 5);
RemoveItem("key_1");
}
}
void Key1Func(string &in asItem, string &in asEntity)
{
if(GetEntityExists("crowbar_1")==false)
{
if(GetEntityExists("hammer_1")==false)
{
if(HasItem("crowbar_1")==false)
{
if(HasItem("hammer_1")==false)
{
SetSwingDoorLocked("mansion_7", false, true);
PlaySoundAtEntity("BR", "KeyUnlocke.snt", "crowbar_p1_12", 0, false);
SetMessage("Things", "S22", 5);
RemoveItem("key_1");
RemoveTimer("KillMe");
}
else
{
CreateParticleSystemAtEntity("KeyP2", "ps_dust_drilling.ps", "KeyP2", true);
PlaySoundAtEntity("BR", "KeyCrash.snt", "crowbar_p1_12", 0, false);
SetMessage("Things", "S23", 5);
RemoveItem("key_1");
}
}
else
{
CreateParticleSystemAtEntity("KeyP2", "ps_dust_drilling.ps", "KeyP2", true);
PlaySoundAtEntity("BR", "KeyCrash.snt", "crowbar_p1_12", 0, false);
SetMessage("Things", "S23", 5);
RemoveItem("key_1");
}
}
else
{
CreateParticleSystemAtEntity("KeyP2", "ps_dust_drilling.ps", "KeyP2", true);
PlaySoundAtEntity("BR", "KeyCrash.snt", "crowbar_p1_12", 0, false);
SetMessage("Things", "S23", 5);
RemoveItem("key_1");
}
}
else
{
CreateParticleSystemAtEntity("KeyP2", "ps_dust_drilling.ps", "KeyP2", true);
PlaySoundAtEntity("BR", "KeyCrash.snt", "crowbar_p1_12", 0, false);
SetMessage("Things", "S23", 5);
RemoveItem("key_1");
}
}
void HammerFunc(string &in asItem, string &in asEntity)
{
if(GetEntityExists("key_1")==false)
{
if(GetEntityExists("crowbar_1")==false)
{
if(HasItem("key_1")==false)
{
if(HasItem("crowbar_1")==false)
{
SetSwingDoorLocked("mansion_6", false, true);
AddPropImpulse("mansion_6", 0, 0, -100, "World");
SetSwingDoorDisableAutoClose("mansion_6", true);
SetSwingDoorClosed("mansion_6", false, false);
SetMoveObjectState("mansion_6", 1);
CreateParticleSystemAtEntity("HW1", "ps_hit_wood.ps", "crowbar_p1", true);
PlaySoundAtEntity("BRHammer1", "break_wood_metal", "crowbar_p1_1", 0, false);
SetMessage("Things", "S22", 5);
RemoveItem("hammer_1");
RemoveTimer("KillMe");
}
else
{
CreateParticleSystemAtEntity("HW1", "ps_hit_wood.ps", "crowbar_p1", true);
PlaySoundAtEntity("BRHammer1", "break_wood_metal", "crowbar_p1_1", 0, false);
SetMessage("Things", "S24", 5);
RemoveItem("hammer_1");
}
}
else
{
CreateParticleSystemAtEntity("HW1", "ps_hit_wood.ps", "crowbar_p1", true);
PlaySoundAtEntity("BRHammer1", "break_wood_metal", "crowbar_p1_1", 0, false);
SetMessage("Things", "S24", 5);
RemoveItem("hammer_1");
}
}
else
{
CreateParticleSystemAtEntity("HW1", "ps_hit_wood.ps", "crowbar_p1", true);
PlaySoundAtEntity("BRHammer1", "break_wood_metal", "crowbar_p1_1", 0, false);
SetMessage("Things", "S24", 5);
RemoveItem("hammer_1");
}
}
else
{
CreateParticleSystemAtEntity("HW1", "ps_hit_wood.ps", "crowbar_p1", true);
PlaySoundAtEntity("BRHammer1", "break_wood_metal", "crowbar_p1_1", 0, false);
SetMessage("Things", "S24", 5);
RemoveItem("hammer_1");
}
}
void Hammer1Func(string &in asItem, string &in asEntity)
{
if(GetEntityExists("key_1")==false)
{
if(GetEntityExists("crowbar_1")==false)
{
if(HasItem("key_1")==false)
{
if(HasItem("crowbar_1")==false)
{
SetSwingDoorLocked("mansion_7", false, true);
AddPropImpulse("mansion_7", 0, 0, 100, "World");
SetSwingDoorDisableAutoClose("mansion_7", true);
SetSwingDoorClosed("mansion_7", false, false);
SetMoveObjectState("mansion_7", 1);
CreateParticleSystemAtEntity("HW1", "ps_hit_wood.ps", "crowbar_p2", true);
PlaySoundAtEntity("BRHammer1", "break_wood_metal", "crowbar_p2_2", 0, false);
SetMessage("Things", "S22", 5);
RemoveItem("hammer_1");
RemoveTimer("KillMe");
}
else
{
CreateParticleSystemAtEntity("HW1", "ps_hit_wood.ps", "crowbar_p2", true);
PlaySoundAtEntity("BRHammer1", "break_wood_metal", "crowbar_p2_2", 0, false);
SetMessage("Things", "S24", 5);
RemoveItem("hammer_1");
}
}
else
{
CreateParticleSystemAtEntity("HW1", "ps_hit_wood.ps", "crowbar_p2", true);
PlaySoundAtEntity("BRHammer1", "break_wood_metal", "crowbar_p2_2", 0, false);
SetMessage("Things", "S24", 5);
RemoveItem("hammer_1");
}
}
else
{
CreateParticleSystemAtEntity("HW1", "ps_hit_wood.ps", "crowbar_p2", true);
PlaySoundAtEntity("BRHammer1", "break_wood_metal", "crowbar_p2_2", 0, false);
SetMessage("Things", "S24", 5);
RemoveItem("hammer_1");
}
}
else
{
CreateParticleSystemAtEntity("HW1", "ps_hit_wood.ps", "crowbar_p2", true);
PlaySoundAtEntity("BRHammer1", "break_wood_metal", "crowbar_p2_2", 0, false);
SetMessage("Things", "S24", 5);
RemoveItem("hammer_1");
}
}