Mudbill

Elevator Script (Amnesia)

Jun 26th, 2013
505
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void OnStart()
  2. {
  3. FadeOut(0);
  4. FadeIn(3);
  5.  
  6. TimerShake("");
  7. TimerShakeLamp("");
  8.  
  9. SetMoveObjectStateExt("elevator_wall01_1", -1, 2, 1, 0.2, true);
  10.  
  11. CreateParticleSystemAtEntity("scrape1", "ps_elevator_slow.ps", "AreaScrape_1", false);
  12. CreateParticleSystemAtEntity("scrape2", "ps_elevator_slow.ps", "AreaScrape_2", false);
  13. PlaySoundAtEntity("scrape1", "14_scrape_low.snt", "AreaScrape_1", 5, false);
  14. PlaySoundAtEntity("scrape2", "14_scrape_low.snt", "AreaScrape_2", 5, false);
  15.  
  16. PlaySoundAtEntity("MoveSound", "elevator_move_normal", "AreaEffect", 1, true);
  17.  
  18. AddTimer("", 38, "TimerEndElevator");
  19. AddTimer("", 10, "TimerStopElevator");
  20. AddTimer("", 18, "TimerResumeElevator");
  21. }
  22.  
  23. void TimerResumeElevator(string &in asTimer)
  24. {
  25. SetMoveObjectStateExt("elevator_wall01_1", -1, 2, 1, 0.2, true);
  26. PlaySoundAtEntity("MoveSound", "elevator_move_normal", "AreaEffect", 1, true);
  27.  
  28. CreateParticleSystemAtEntity("scrape1", "ps_elevator_slow.ps", "AreaScrape_1", false);
  29. CreateParticleSystemAtEntity("scrape2", "ps_elevator_slow.ps", "AreaScrape_2", false);
  30. PlaySoundAtEntity("scrape1", "14_scrape_low.snt", "AreaScrape_1", 5, false);
  31. PlaySoundAtEntity("scrape2", "14_scrape_low.snt", "AreaScrape_2", 5, false);
  32. SetLightVisible("LightScrape_1", true);
  33. SetLightVisible("LightScrape_2", true);
  34. TimerShake("");
  35. TimerShakeLamp("");
  36. }
  37.  
  38. void TimerStopElevator(string &in asTimer)
  39. {
  40. SetMoveObjectStateExt("elevator_wall01_1", -1, 2, 0, 0.2, true);
  41. PlaySoundAtEntity("", "elevator_stop", "AreaEffect", 0, false);
  42.  
  43. DestroyParticleSystem("scrape1");
  44. DestroyParticleSystem("scrape2");
  45. StopSound("scrape1", 0.1);
  46. StopSound("scrape2", 0.1);
  47. SetLightVisible("LightScrape_1", false);
  48. SetLightVisible("LightScrape_2", false);
  49. RemoveTimer("shake");
  50. RemoveTimer("shakelamp");
  51.  
  52. GiveSanityDamage(20, true);
  53. StartScreenShake(0.1, 1, 0, 0);
  54.  
  55. StopSound("MoveSound", 0.2);
  56.  
  57. AddTimer("scare", 1, "TimerPlayerReact");
  58. AddTimer("breath", 2.5, "TimerPlayerReact");
  59. AddTimer("breath", 4.5, "TimerPlayerReact");
  60. }
  61.  
  62. void TimerPlayerReact(string &in asTimer)
  63. {
  64. PlayGuiSound("react_" + asTimer, 0.6);
  65. }
  66.  
  67. void TimerShake(string &in asTimer)
  68. {
  69. StartScreenShake(0.01, 2, 0, 0);
  70. AddTimer("shake", 2, "TimerShake");
  71. }
  72.  
  73. void TimerShakeLamp(string &in asTimer)
  74. {
  75. AddPropImpulse("elevator_lamp_1", RandFloat(0.7, 1.3), 0, 0, "world");
  76. AddTimer("shakelamp", RandFloat(0.6, 1.9), "TimerShakeLamp");
  77. }
  78.  
  79. void TimerEndElevator(string &in asTimer)
  80. {
  81. FadeOut(1);
  82. AddTimer("", 1, "EndMap");
  83. }
  84.  
  85. void EndMap(string &in asTimer)
  86. {
  87. ChangeMap("Level1.map", "", "", "");
  88. }
RAW Paste Data