Advertisement
Guest User

Untitled

a guest
Jun 25th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ******************************************************************************************
  2. // * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
  3. // ******************************************************************************************
  4. //  @file Version: 1.0
  5. //  @file Name: mission_AirWreck.sqf
  6. //  @file Author: [404] Deadbeat, [404] Costlyy, AgentRev
  7. //  @file Created: 08/12/2012 15:19
  8.  
  9. if (!isServer) exitwith {};
  10. #include "sideMissionDefines.sqf"
  11. private ["_nbUnits", "_wreckPos", "_wreck", "_box1", "_box2", "_loadout"];
  12. _setupVars =
  13. {
  14.     _missionType = "Aircraft Wreck";
  15.     _locationsArray = MissionSpawnMarkers;
  16.     _nbUnits = if (missionDifficultyHard) then { AI_GROUP_LARGE } else { AI_GROUP_MEDIUM };
  17. };
  18. _setupObjects =
  19. {
  20.     _missionPos = markerPos _missionLocation;
  21.     _wreckPos = _missionPos vectorAdd ([[random 10, 0, 0], random 360] call BIS_fnc_rotateVector2D);
  22.     // Class, Position, Fuel, Ammo, Damage, Special
  23.     _wreck = createVehicle ["Land_Wreck_Heli_Attack_01_F", _wreckPos, [], 5, "None"];
  24.     _box1 = createVehicle ["Box_NATO_WpsSpecial_F", _missionPos, [], 5, "None"];
  25.     _box1 setDir random 360;
  26.     [_box1, randomMissionSpecialCargo, 1] call randomCargoFill;
  27.     _box2 = createVehicle ["Box_East_WpsSpecial_F", _missionPos, [], 5, "None"];
  28.     _box2 setDir random 360;
  29.     [_box2, randomMissionExplosiveCargo, 1] call randomCargoFill;
  30.     { _x setVariable ["R3F_LOG_disabled", true, true] } forEach [_box1, _box2];
  31.     _aiGroup = createGroup CIVILIAN;
  32.     _loadout = aiLoadoutsBasic call BIS_fnc_selectRandom;
  33.     [_aiGroup, _missionPos, _loadout, _nbUnits] call createRandomGroup;
  34.     _missionPicture = getText (configFile >> "CfgVehicles" >> typeOf _wreck >> "picture");
  35.     _missionHintText = "A helicopter has come down under enemy fire!<br/>Go get the supplies for your team";
  36.    
  37. ////////////////////////// add minefield /////////////////////////////////////////////////////////////////////
  38.     #define MINE_TYPES "ATMine"
  39.     for "_x" from 0 to 59 do {
  40.         _mine = createMine [[MINE_TYPES] call BIS_fnc_selectrandom, _wreckPos, [], 38];
  41.     };
  42. /////////////////////////////////////////////////////////////////////////////////////////////////////////////
  43. };
  44. _waitUntilMarkerPos = nil;
  45. _waitUntilExec = nil;
  46. _waitUntilCondition = nil;
  47. _failedExec =
  48. {
  49.     // Mission failed
  50.     { deleteVehicle _x } forEach [_box1, _box2, _wreck];
  51. };
  52. _successExec =
  53. {
  54.     // Mission completed
  55.     { _x setVariable ["R3F_LOG_disabled", false, true] } forEach [_box1, _box2];
  56.     deleteVehicle _wreck;
  57. ///////////////////////// remove minefield ////////////////////////////////////////////////////////////
  58.     _mineList = _wreckPos nearObjects ["ATMine", 50];
  59.     { deleteVehicle _x } forEach _mineList;
  60. /////////////////////////////////////////////////////////////////////////////////////////////////////
  61.     _successHintMessage = "The air wreck supplies have been collected, well done.";
  62. };
  63. _this call sideMissionProcessor;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement