Guest User

Untitled

a guest
Jan 23rd, 2018
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. void OnStart()
  2. {
  3. AddEntityCollideCallback("Player", "AreaBangDoor", "CollideBangDoor", true, 1); //Begin the door bang and pain event
  4. AddEntityCollideCallback("Player", "ScriptArea_2", "func_sound", true, 1);
  5. AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
  6. AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
  7. SetEntityPlayerInteractCallback("phonograph_1", "func1", true);
  8. }
  9. void CollideBangDoor(string &in asParent, string &in asChild, int alState) //Player collides with area, the door bangs. Add a timer for a scare later.
  10. {
  11.  
  12.  
  13. PlaySoundAtEntity("bangs", "05_event_door_bang", "mansion_a", 1, false);
  14. PlaySoundAtEntity("whineaa", "scare_whine_loop", "Player", 0.5f, false);
  15.  
  16. FadeSepiaColorTo(0.75f, 0.3f);
  17. FadeImageTrailTo(1.5, 0.5);
  18.  
  19. AddTimer("bang1", 0.6f, "TimerBangDoor");
  20. AddTimer("bang2", 1.6f, "TimerBangDoor");
  21. AddTimer("bang3", 2.5f, "TimerBangDoor");
  22. AddTimer("bang4", 3.0f, "TimerBangDoor");
  23.  
  24. }
  25. void TimerBangDoor(string &in asTimer)
  26. {
  27. if(asTimer == "bang1"){
  28. AddPropImpulse("mansion_a", 0, 0, 5, "World");
  29. PlaySoundAtEntity("scare", "react_scare", "Player", 0.25f, false);
  30. CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "mansion_a", false);
  31. StartScreenShake(0.008, 0.5f, 0.1f,0.3f);
  32. GiveSanityDamage(10, true);
  33. }
  34. else if(asTimer == "bang2") {
  35. AddPropImpulse("mansion_a", 0, 0, 5, "World");
  36. CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "mansion_a", false);
  37. StartScreenShake(0.008, 0.5f, 0.1f,0.3f);
  38. }
  39. else if(asTimer == "bang3") {
  40. AddPropImpulse("mansion_a", 0, 0, 5, "World");
  41. PlaySoundAtEntity("scare", "react_breath", "Player", 0.5f, false);
  42. CreateParticleSystemAtEntity("bang1", "ps_dust_impact_vert.ps", "mansion_a", false);
  43. StartScreenShake(0.008, 0.5f, 0.1f,0.3f);
  44. }
  45. else {
  46. SetSwingDoorLocked("mansion_a", false, false);
  47. FadeSepiaColorTo(0, 0.3f);
  48. FadeImageTrailTo(0, 0.1);
  49. StopSound("whineaa", 4);
  50. }
  51. }
  52. void KeyOnDoor(string &in asItem, string &in asEntity)
  53. {
  54. SetSwingDoorLocked("mansion_1", false, true);
  55. PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
  56. RemoveItem("key_1");
  57. }
  58. void func_slam(string &in asParent, string &in asChild, int alState)
  59. {
  60. SetSwingDoorClosed("mansion_1", true, true);
  61. StartPlayerLookAt("mansion_1", 10.0f, 10.0f, "");
  62. AddTimer("", 1.0f, "stoplook");
  63. PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
  64. PlaySoundAtEntity("", "react_scare", "Player", 0, false);
  65. PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
  66. GiveSanityDamage(5.0f, true);
  67. SetSwingDoorLocked("mansion_1", true, true);
  68. }
  69. void stoplook(string &in asTimer)
  70. {
  71. StopPlayerLookAt();
  72. }
  73.  
  74. void OnEnter()
  75. {
  76. AddEntityCollideCallback("Player", "corpse_fallout", "corpse1", true, 1); //Corpse falls out of cabinet
  77. }
  78. void corpse1(string &in asParent, string &in asChild, int alState)
  79. {
  80. SetEntityActive("corpse_male_1", true); //Corpse falls out of the closet
  81. }
Add Comment
Please, Sign In to add comment