Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.08 KB | None | 0 0
  1. // ******************************************************************************************
  2. // * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
  3. // ******************************************************************************************
  4. // @file Name: mission_RussianRoulette.sqf
  5. // @file Author: JoSchaap, AgentRev, GriffinZS, RickB, soulkobk
  6.  
  7. if (!isServer) exitwith {};
  8. #include "specialMissionDefines.sqf";
  9.  
  10. private ["_positions", "_camonet", "_hostage", "_hostage", "_vehicleName", "_cashrandomizera", "_cashamountrandomizera", "_cashpilerandomizera", "_casha", "_cashamounta", "_cashpilea", "_cashrandomizerb", "_cashamountrandomizerb", "_cashpilerandomizerb", "_cashb", "_cashamountb", "_cashpileb", "_cash1", "_cash2", "_drop_item", "_drugpilerandomizer", "_drugpile"];
  11.  
  12. _setupVars =
  13. {
  14. _missionType = "Russian Roulette";
  15. _locationsArray = MissionSpawnMarkers;
  16. };
  17.  
  18. _setupObjects =
  19. {
  20. _missionPos = markerPos _missionLocation;
  21.  
  22. //delete existing base parts and vehicles at location
  23. _baseToDelete = nearestObjects [_missionPos, ["All"], 25];
  24. { deleteVehicle _x } forEach _baseToDelete;
  25.  
  26. _camonet = createVehicle ["Land_Shed_03_F", [_missionPos select 0, _missionPos select 1], [], 0, "CAN COLLIDE"];
  27. _camonet allowdamage false;
  28. _camonet setDir random 360;
  29. _camonet setVariable ["R3F_LOG_disabled", false];
  30.  
  31. _missionPos = getPosATL _camonet;
  32.  
  33.  
  34. _hostage = createVehicle ["C_man_1_1_F", _missionPos, [], 0, "CAN COLLIDE"];
  35. removeAllWeapons _hostage;
  36. removeAllAssignedItems _hostage;
  37. removeBackpack _hostage;
  38. removeVest _hostage;
  39. removeUniform _hostage;
  40. _hostage addHeadgear "H_RacingHelmet_1_black_F";
  41. _hostage setPosATL [_missionPos select 0, _missionPos select 1, _missionPos select 2];
  42. waitUntil {alive _hostage};
  43. [_hostage, "UnaErcPoslechVelitele1"] call switchMoveGlobal;
  44. _hostage disableAI "autoTarget";
  45. _hostage disableAI "ANIM";
  46. _hostage setBehaviour "Careless";
  47. _hostage allowFleeing 0;
  48. _hostage disableAI "Move";
  49.  
  50. _hostage2 = createVehicle ["C_man_1_1_F", _missionPos, [], 0, "CAN COLLIDE"];
  51. removeAllWeapons _hostage2;
  52. removeAllAssignedItems _hostage2;
  53. removeBackpack _hostage2;
  54. removeVest _hostage2;
  55. removeUniform _hostage2;
  56. _hostage2 addHeadgear "H_RacingHelmet_1_black_F";
  57. _hostage2 setPosATL [_missionPos select 0, _missionPos select 1, _missionPos select 2];
  58. waitUntil {not alive _hostage2 };
  59. [_hostage2, "UnaErcPoslechVelitele1"] call switchMoveGlobal;
  60. _hostage2 disableAI "autoTarget";
  61. _hostage2 disableAI "ANIM";
  62. _hostage2 setBehaviour "Careless";
  63. _hostage2 allowFleeing 0;
  64. _hostage2 disableAI "Move";
  65. _hostage2 addRating 1e11;
  66. _hostage2 addEventHandler ["Killed", server_playerDied];
  67.  
  68. _aiGroup = createGroup CIVILIAN;
  69. [_aiGroup,_missionPos,2,5] spawn createcustomGroup;
  70.  
  71. _aiGroup setCombatMode "RED";
  72. _aiGroup setBehaviour "COMBAT";
  73.  
  74. _vehicleName = "Hostage";
  75. _missionHintText = format ["<br/>Ever wanted to play <t color='%2'>God</t>?<br/>Here is your opportunity. Kill the guards and then choose, which hostage you <t color='%2'>eliminate</t>.<br/>Choose wisely.", _vehicleName, specialMissionColor];
  76. };
  77.  
  78. _waitUntilMarkerPos = nil;
  79. _waitUntilExec = nil;
  80. _waitUntilCondition = {!alive _hostage};
  81.  
  82. _failedExec =
  83. {
  84. // Mission failed
  85.  
  86. { deleteVehicle _x } forEach [_camonet, _hostage, _hostage2];
  87.  
  88. };
  89.  
  90. _successExec =
  91. {
  92. // Mission completed
  93.  
  94.  
  95. { deleteVehicle _x } forEach [_camonet, _hostage, _hostage2];
  96.  
  97. //Random fake - real money
  98. _cashrandomizera = ["money","cmoney","money","cmoney"];
  99. _cashamountrandomizera = [200,300,400,500,600,700];
  100. _cashpilerandomizera = [3,5];
  101.  
  102. _casha = _cashrandomizera call BIS_fnc_SelectRandom;
  103. _cashamounta = _cashamountrandomizera call BIS_fnc_SelectRandom;
  104. _cashpilea = _cashpilerandomizera call BIS_fnc_SelectRandom;
  105.  
  106. for "_i" from 1 to _cashpilea do
  107. {
  108. _cash1 = createVehicle ["Land_Money_F",[(_lastPos select 0), (_lastPos select 1) - 5,0],[], 0, "NONE"];
  109. _cash1 setPos ([_lastPos, [[2 + random 3,0,0], random 360] call BIS_fnc_rotateVector2D] call BIS_fnc_vectorAdd);
  110. _cash1 setDir random 360;
  111. _cash1 setVariable [_casha, _cashamounta, true];
  112. _cash1 setVariable ["owner", "world", true];
  113. };
  114.  
  115. _cashrandomizerb = ["money","cmoney","money","cmoney"];
  116. _cashamountrandomizerb = [200,300,400,500,600,700];
  117. _cashpilerandomizerb = [3,5];
  118.  
  119. _cashb = _cashrandomizerb call BIS_fnc_SelectRandom;
  120. _cashamountb = _cashamountrandomizerb call BIS_fnc_SelectRandom;
  121. _cashpileb = _cashpilerandomizerb call BIS_fnc_SelectRandom;
  122.  
  123. for "_i" from 1 to _cashpileb do
  124. {
  125. _cash2 = createVehicle ["Land_Money_F",[(_lastPos select 0), (_lastPos select 1) - 5,0],[], 0, "NONE"];
  126. _cash2 setPos ([_lastPos, [[2 + random 3,0,0], random 360] call BIS_fnc_rotateVector2D] call BIS_fnc_vectorAdd);
  127. _cash2 setDir random 360;
  128. _cash2 setVariable [_cashb, _cashamountb, true];
  129. _cash2 setVariable ["owner", "world", true];
  130. };
  131.  
  132.  
  133. _successHintMessage = format ["How does it feel? You eliminate the correct one .."];
  134. };
  135.  
  136. _this call specialMissionProcessor;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement