Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ******************************************************************************************
- // * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
- // ******************************************************************************************
- // @file Version: 1.0
- // @file Name: mission_AirWreck.sqf
- // @file Author: [404] Deadbeat, [404] Costlyy, AgentRev
- // @file Created: 08/12/2012 15:19
- if (!isServer) exitwith {};
- #include "sideMissionDefines.sqf"
- private ["_nbUnits", "_wreckPos", "_wreck", "_box1", "_box2", "_loadout"];
- _setupVars =
- {
- _missionType = "Aircraft Wreck";
- _locationsArray = MissionSpawnMarkers;
- _nbUnits = if (missionDifficultyHard) then { AI_GROUP_LARGE } else { AI_GROUP_MEDIUM };
- };
- _setupObjects =
- {
- _missionPos = markerPos _missionLocation;
- _wreckPos = _missionPos vectorAdd ([[random 10, 0, 0], random 360] call BIS_fnc_rotateVector2D);
- // Class, Position, Fuel, Ammo, Damage, Special
- _wreck = createVehicle ["Land_Wreck_Heli_Attack_01_F", _wreckPos, [], 5, "None"];
- _box1 = createVehicle ["Box_NATO_WpsSpecial_F", _missionPos, [], 5, "None"];
- _box1 setDir random 360;
- [_box1, randomMissionSpecialCargo, 1] call randomCargoFill;
- _box2 = createVehicle ["Box_East_WpsSpecial_F", _missionPos, [], 5, "None"];
- _box2 setDir random 360;
- [_box2, randomMissionExplosiveCargo, 1] call randomCargoFill;
- { _x setVariable ["R3F_LOG_disabled", true, true] } forEach [_box1, _box2];
- _aiGroup = createGroup CIVILIAN;
- _loadout = aiLoadoutsBasic call BIS_fnc_selectRandom;
- [_aiGroup, _missionPos, _loadout, _nbUnits] call createRandomGroup;
- _missionPicture = getText (configFile >> "CfgVehicles" >> typeOf _wreck >> "picture");
- _missionHintText = "A helicopter has come down under enemy fire!<br/>Go get the supplies for your team";
- ////////////////////////// add minefield /////////////////////////////////////////////////////////////////////
- #define MINE_TYPES "ATMine"
- for "_x" from 0 to 59 do {
- _mine = createMine [[MINE_TYPES] call BIS_fnc_selectrandom, _wreckPos, [], 38];
- };
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////
- };
- _waitUntilMarkerPos = nil;
- _waitUntilExec = nil;
- _waitUntilCondition = nil;
- _failedExec =
- {
- // Mission failed
- { deleteVehicle _x } forEach [_box1, _box2, _wreck];
- };
- _successExec =
- {
- // Mission completed
- { _x setVariable ["R3F_LOG_disabled", false, true] } forEach [_box1, _box2];
- deleteVehicle _wreck;
- ///////////////////////// remove minefield ////////////////////////////////////////////////////////////
- _mineList = _wreckPos nearObjects ["ATMine", 50];
- { deleteVehicle _x } forEach _mineList;
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- _successHintMessage = "The air wreck supplies have been collected, well done.";
- };
- _this call sideMissionProcessor;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement