Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.44 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3. Author: Robin Withes
  4. Desc: Handles multiple different medical events.
  5. When: This script gets called in fn_revived.sqf
  6. */
  7. if (!alive player) exitWith {};
  8. //////Medical Events etc////////
  9. _brokenLeg = {
  10. [] spawn {
  11. morphineHeal = 0;
  12. _robinTime = time + 500;
  13. while {true} do {
  14. if (_robinTime < time) exitWith {hint "Your legs have healed";};
  15. if (morphineHeal == 1) exitWith {hint "You have been healed";};
  16. if (!alive player) exitWith {};
  17. if (stance player != "PRONE") then {
  18. hint "Your legs are broken and you cant stand up!";
  19. player switchMove "AidlPpneMstpSnonWnonDnon_AI";
  20. };
  21. sleep 1;
  22. };
  23. };
  24. };
  25.  
  26. _cardiacArrest = {
  27. [] spawn {
  28. cardiacHeal = 0;
  29. _robinTime3 = time + 120;
  30. hint "Your heart is going crazy!";
  31. while {true} do {
  32. if (_robinTime3 < time) exitWith {hint "You've gone out of cardiac arrest!"; enableCamShake false;};
  33. if (cardiacHeal == 1) exitWith {hint "You've gone out of cardiac arrest!"; enableCamShake false;};
  34. if (!alive player) exitWith {enableCamShake false;};
  35. enableCamShake true;
  36. _randomShake2 = selectRandom [12,13,14,15,16,17];
  37. addCamShake [_randomShake2, 20, 100];
  38. sleep 10;
  39. hint "You fainted!";
  40. titleCut ["", "BLACK FADED", 999];
  41. player playMoveNow "Incapacitated";
  42. sleep 3;
  43. titleCut ["", "BLACK IN", 5];
  44. player switchMove "AidlPpneMstpSnonWnonDnon_AI";
  45. };
  46. };
  47. };
  48.  
  49. _concussion = {
  50. [] spawn {
  51. concussionHeal = 0;
  52. _robinTime2 = time + 1200;
  53. hint "You have a massive headache, You should get some medical help!";
  54. PP_wetD = ppEffectCreate ["WetDistortion",300];
  55. PP_wetD ppEffectEnable true;
  56. PP_wetD ppEffectAdjust [1,0.2,0.2,1.84,1.53,1.68,1.61,0.05,0.01,0.05,0.01,0.1,0.1,0.2,0.2];
  57. PP_wetD ppEffectCommit 0;
  58. while {true} do {
  59. if (_robinTime2 < time) exitWith {hint "Your concussion has stopped!"; PP_wetD ppEffectEnable false;};
  60. if (concussionHeal == 1) exitWith {hint "Your concussion has been healed!"; PP_wetD ppEffectEnable false;};
  61. if (!alive player) exitWith {PP_wetD ppEffectEnable false;};
  62. };
  63. };
  64. };
  65.  
  66. _brokenArm = {
  67. [] spawn {
  68. brokenArmHeal = 0;
  69. _robinTime4 = time + 600;
  70. hint "Your arm feels weird...";
  71. while {true} do {
  72. if (_robinTime4 < time) exitWith {hint "Your arm has been healed"; enableCamShake false;};
  73. if (brokenArmHeal == 1) exitWith {hint "Your arm has been healed"; enableCamShake false;};
  74. if (currentWeapon player != "") then {
  75. _unitWeapon = currentWeapon player;
  76. _timer = 15;
  77. hint format ["Your %1 is too heavy to carry with your broken hand!",_unitWeapon];
  78. while {currentWeapon player != ""} do {
  79. _timer = _timer - 4;
  80. if (_timer < 0) then {
  81. _unitWeapon = currentWeapon player;
  82. player removeWeapon _unitWeapon;
  83. hint "You dropped your weapon!";
  84. _holder = createVehicle [ "GroundWeaponHolder", getPosATL player, [], 0, "CAN_COLLIDE" ];
  85. _holder addWeaponCargoGlobal [_unitWeapon,1];
  86. };
  87. enableCamShake true;
  88. addCamShake [10, 10, 40];
  89. sleep 4;
  90. };
  91. };
  92. };
  93. };
  94. };
  95.  
  96. _metalObject = {
  97.  
  98. };
  99.  
  100. _bloodLoss = {
  101. player setDamage 0.99;
  102. };
  103.  
  104. _weetapix = {
  105. [] spawn {
  106. SUB(life_hunger,90);
  107. [] call life_fnc_hudUpdate;
  108. hint "Your starving and you have a strange desire for Weetabix™. Get something to eat fast!";
  109. player enableFatigue true;
  110. player setFatigue 1;
  111. PP_wetD = ppEffectCreate ["WetDistortion",300];
  112. PP_wetD ppEffectEnable true;
  113. PP_wetD ppEffectAdjust [0.2,0.2,0.2,1,1,1,1,-0.08,0.01,0.05,0.01,0.1,0.1,0.2,0.2];
  114. PP_wetD ppEffectCommit 0;
  115. PP_colorC = ppEffectCreate ["ColorCorrections",1500];
  116. PP_colorC ppEffectEnable true;
  117. PP_colorC ppEffectAdjust [0.2,0.78,0.06,[0.03,0,0,0],[1,1,1,1],[0.33,0.33,0.33,0],[0,0,0,0,0,0,4]];
  118. PP_colorC ppEffectCommit 0;
  119.  
  120. while {true} do {
  121. player setFatigue 1;
  122. sleep 3;
  123. if (!alive player) exitWith {
  124. player enableFatigue false;
  125. player setFatigue 0;
  126. PP_colorC ppEffectEnable false;
  127. PP_wetD ppEffectEnable false;
  128. };
  129. if (life_hunger > 20) exitWith {
  130. player enableFatigue false;
  131. player setFatigue 0;
  132. PP_colorC ppEffectEnable false;
  133. hint "You nourished yourself and feel alot better!";
  134. PP_wetD ppEffectEnable false;
  135. };
  136. };
  137. };
  138. };
  139. //////Medical Events End////////
  140. _dummy = selectRandom [_brokenLeg,_concussion,_cardiacArrest,_brokenArm,_weetapix];
  141.  
  142. [] call _dummy;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement