Guest User

Untitled

a guest
Aug 26th, 2013
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.36 KB | None | 0 0
  1. private ["_array","_source","_kills","_killsV","_humanity","_wait","_myKills","_infected","_canHitFree","_myHumanity","_method","_body","_playerID","_id","_myGroup","_magazineArray","_control","_item","_val","_max"];
  2. if (deathHandled) exitWith {};
  3.  
  4. deathHandled = true;
  5.  
  6. // ################## grave cross parameter start ##################
  7. _magazines = call player_countmagazines;
  8. _backpack = unitBackpack player;
  9.  
  10. // #### ITEM backpack check start ####
  11. private ["_newBackpackType","_backpackWpn","_backpackMag"];
  12. dayz_myBackpack = unitBackpack player;
  13. _newBackpackType = (typeOf dayz_myBackpack);
  14. if(_newBackpackType != "") then {
  15. _backpackWpn = getWeaponCargo unitBackpack player;
  16. _backpackMag = getMagazineCargo unitBackpack player;
  17. };
  18. // #### ITEM backpack check stop ####
  19. // ################## grave cross parameter stop ##################
  20.  
  21.  
  22. //Death
  23. _body = player;
  24. _playerID = getPlayerUID player;
  25.  
  26. _infected = 0;
  27. if (r_player_infected) then {
  28. _infected = 1;
  29. };
  30.  
  31. //Send Death Notice
  32. //["dayzDeath",[dayz_characterID,0,_body,_playerID,dayz_playerName,_infected]] call callRpcProcedure;
  33. dayzDeath = [dayz_characterID,0,_body,_playerID,dayz_playerName,_infected];
  34. publicVariableServer "dayzDeath";
  35.  
  36. _id = [player,20,true,getPosATL player] spawn player_alertZombies;
  37.  
  38. sleep 0.5;
  39.  
  40. player setDamage 1;
  41. 0.1 fadeSound 0;
  42.  
  43. player setVariable ["NORRN_unconscious", false, true];
  44. player setVariable ["unconsciousTime", 0, true];
  45. player setVariable ["USEC_isCardiac",false,true];
  46. player setVariable ["medForceUpdate",true,true];
  47. //remove combat timer on death
  48. player setVariable ["startcombattimer", 0, true];
  49. r_player_unconscious = false;
  50. r_player_cardiac = false;
  51.  
  52. _id = player spawn spawn_flies;
  53.  
  54. _humanity = 0;
  55. _wait = 0;
  56.  
  57. _array = _this;
  58. if (count _array > 0) then {
  59. _source = _array select 0;
  60. _method = _array select 1;
  61. if (!isNull _source) then {
  62. if (_source != player) then {
  63. _canHitFree = player getVariable ["freeTarget",false];
  64. _myHumanity = ((player getVariable ["humanity",0]) / 10);
  65. _myKills = ((player getVariable ["humanKills",0]) / 5) * (1000 - _myHumanity);
  66.  
  67. if (!_canHitFree) then {
  68. //Process Morality Hit
  69. _humanity = -(2000 - _myKills);
  70. _kills = _source getVariable ["humanKills",0];
  71. _source setVariable ["humanKills",(_kills + 1),true];
  72. _wait = 300;
  73. } else {
  74. //Process Morality Hit
  75. //_humanity = _myKills * 100;
  76. _killsV = _source getVariable ["banditKills",0];
  77. _source setVariable ["banditKills",(_killsV + 1),true];
  78. _wait = 0;
  79. };
  80. if (_humanity < 0) then {
  81. _wait = 0;
  82. };
  83. if (!_canHitFree) then {
  84. //["dayzHumanity",[_source,_humanity,_wait]] call broadcastRpcCallAll;
  85. dayzHumanity = [_source,_humanity,_wait];
  86. publicVariable "dayzHumanity";
  87. };
  88. };
  89. };
  90. _body setVariable ["deathType",_method,true];
  91. };
  92.  
  93. terminate dayz_musicH;
  94. terminate dayz_lootCheck;
  95. terminate dayz_slowCheck;
  96. terminate dayz_animalCheck;
  97. terminate dayz_monitor1;
  98. terminate dayz_medicalH;
  99. terminate dayz_gui;
  100. terminate dayz_zedCheck;
  101. terminate dayz_locationCheck;
  102. terminate dayz_combatCheck;
  103. terminate dayz_friendliesCheck;
  104.  
  105. //Reset (just in case)
  106. //deleteVehicle dayz_playerTrigger;
  107. disableUserInput false;
  108. r_player_dead = true;
  109.  
  110. "dynamicBlur" ppEffectEnable true;"dynamicBlur" ppEffectAdjust [4]; "dynamicBlur" ppEffectCommit 0.2;
  111.  
  112. "colorCorrections" ppEffectEnable true;
  113. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.01], [1, 1, 1, 0.0]];
  114. "colorCorrections" ppEffectCommit 1;
  115.  
  116. //Player is Dead!
  117. 3 fadeSound 0;
  118. 0 cutText ["", "BLACK",10];
  119. dayz_DeathActioned = true;
  120. sleep 1;
  121.  
  122. TitleText[localize "str_player_12","PLAIN DOWN",5];
  123.  
  124. dayz_originalPlayer enableSimulation true;
  125.  
  126. addSwitchableUnit dayz_originalPlayer;
  127. setPlayable dayz_originalPlayer;
  128. selectPlayer dayz_originalPlayer;
  129.  
  130. _myGroup = group _body;
  131. [_body] joinSilent dayz_firstGroup;
  132. deleteGroup _myGroup;
  133.  
  134. // ################## grave cross script start ##################
  135.  
  136. // --------------------player items setparameter
  137. _playerWeapons = weapons _body;
  138. _playerMagazines = _magazines;
  139.  
  140.  
  141. // ############# script ##############
  142. removeAllWeapons _body;
  143. clearMagazineCargo _body;
  144. hidebody _body;
  145.  
  146. // --------------------Create the tombstone objects.
  147. _graveBase = createVehicle ["GraveCross2", position _body, [], 0, "NO_COLLIDE"];
  148. _graveBase setPosATL position _body; // setPos again because arma.
  149. _graveBase setDir _playerDir;
  150.  
  151. // --------------------Create a loot container inside the grave.
  152. _tempContainer = createVehicle ["weaponHolder", getPosATL _graveBase, [], 0, "can_collide"];
  153. _containerLoc = getPosATL _tempContainer;
  154. _containerLoc = [((_containerLoc select 0) + 0),((_containerLoc select 1) + 0),0];
  155. _tempContainer setPosATL _containerLoc;
  156.  
  157.  
  158. // #### PLAYER items to weaponholder start ####
  159. // player add weapons
  160. {
  161. _tempContainer addWeaponCargoGlobal [_x,1];
  162. } forEach _playerWeapons;
  163.  
  164. // player add items
  165. {
  166. _tempContainer addMagazineCargoGlobal [_x,1];
  167. } forEach _playerMagazines;
  168.  
  169. // #### PLAYER items to weaponholder stop ####
  170. // #### BACKPACK items to weaponsholder start ####
  171.  
  172. if (!isNil "_newBackpackType") then {
  173. if (_newBackpackType != "") then {
  174. _backpackWpnTypes = [];
  175. _backpackWpnQtys = [];
  176. if (count _backpackWpn > 0) then {
  177. _backpackWpnTypes = _backpackWpn select 0;
  178. _backpackWpnQtys = _backpackWpn select 1;
  179. };
  180. _countr = 0;
  181. {
  182. _tempContainer addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];
  183. _countr = _countr + 1;
  184. } forEach _backpackWpnTypes;
  185. _backpackmagTypes = [];
  186. _backpackmagQtys = [];
  187. if (count _backpackmag > 0) then {
  188. _backpackmagTypes = _backpackMag select 0;
  189. _backpackmagQtys = _backpackMag select 1;
  190. };
  191. _countr = 0;
  192. {
  193. _tempContainer addmagazineCargoGlobal [_x,(_backpackmagQtys select _countr)];
  194. _countr = _countr + 1;
  195. } forEach _backpackmagTypes;
  196. };
  197. };
  198. // #### BACKPACK items to weaponsholder stop ####
  199. // #### BACKPACK to weaponsholder start ####
  200.  
  201.  
  202. // ### vanilla dayz ###
  203. _class = typeOf _backpack;
  204. if (_class == "CZ_VestPouch_EP1") then {createVehicle ["CZ_VestPouch_EP1", position _body, [], 2, "can_collide"];};
  205. _class = typeOf _backpack;
  206. if (_class == "DZ_Patrol_Pack_EP1") then {createVehicle ["DZ_Patrol_Pack_EP1", position _body, [], 2, "can_collide"];};
  207. _class = typeOf _backpack;
  208. if (_class == "DZ_Assault_Pack_EP1") then {createVehicle ["DZ_Assault_Pack_EP1", position _body, [], 2, "can_collide"];};
  209. _class = typeOf _backpack;
  210. if (_class == "DZ_CivilBackpack_EP1") then {createVehicle ["DZ_CivilBackpack_EP1", position _body, [], 2, "can_collide"];};
  211. _class = typeOf _backpack;
  212. if (_class == "DZ_ALICE_Pack_EP1") then {createVehicle ["DZ_ALICE_Pack_EP1", position _body, [], 2, "can_collide"];};
  213. _class = typeOf _backpack;
  214. if (_class == "DZ_Backpack_EP1") then {createVehicle ["DZ_Backpack_EP1", position _body, [], 2, "can_collide"];};
  215. _class = typeOf _backpack;
  216. if (_class == "DZ_British_ACU") then {createVehicle ["DZ_British_ACU", position _body, [], 2, "can_collide"];};
  217. _class = typeOf _backpack;
  218. if (_class == "DZ_Czech_Vest_Puch") then {createVehicle ["DZ_Czech_Vest_Puch", position _body, [], 2, "can_collide"];};
  219.  
  220.  
  221. // ### epoch ###
  222.  
  223.  
  224. _class = typeOf _backpack;
  225. if (_class == "DZ_GunBag_EP1") then {createVehicle ["DZ_GunBag_EP1", position _body, [], 2, "can_collide"];};
  226. _class = typeOf _backpack;
  227. if (_class == "DZ_TerminalPack_EP1") then {createVehicle ["DZ_TerminalPack_EP1", position _body, [], 2, "can_collide"];};
  228. _class = typeOf _backpack;
  229. if (_class == "DZ_TK_Assault_Pack_EP1") then {createVehicle ["DZ_TK_Assault_Pack_EP1", position _body, [], 2, "can_collide"];};
  230. // #### BACKPACK to weaponsholder stop ####
  231.  
  232. [_graveBase, _tempContainer] spawn {
  233. };
  234. hideBody _body;
  235.  
  236. // ################## grave cross script stop ##################
  237.  
  238. 3 cutRsc ["default", "PLAIN",3];
  239. 4 cutRsc ["default", "PLAIN",3];
  240.  
  241.  
  242. if (count _array > 0) then {
  243. _body setVariable ["deathType",_method,true];
  244. };
  245.  
  246. _body setVariable["combattimeout", 0, true];
  247.  
  248. //["dayzFlies",player] call broadcastRpcCallAll;
  249. sleep 2;
  250.  
  251. 1 cutRsc ["DeathScreen","BLACK OUT",3];
  252.  
  253.  
  254. playMusic "dayz_track_death_1";
  255.  
  256. "dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
  257. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5;
Advertisement
Add Comment
Please, Sign In to add comment