forked from A3Wasteland/ArmA3_Wasteland.Altis
/
mission_HackLaptop.sqf
77 lines (59 loc) · 2.38 KB
/
mission_HackLaptop.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
// @file Name: mission_HackLaptop.sqf
// @file Author: JoSchaap, AgentRev, LouD
if (!isServer) exitwith {};
#include "extraMissionDefines.sqf";
private ["_bunker", "_laptop", "_obj", "_randomGroup", "_vehicleName"];
_setupVars =
{
_missionType = "Enemy Laptop";
_locationsArray = MissionSpawnMarkers;
};
_setupObjects =
{
_missionPos = markerPos _missionLocation;
_bunker = createVehicle ["Land_BagBunker_Small_F", [_missionPos select 0, _missionPos select 1], [], 0, "CAN COLLIDE"];
_missionPos = getPosASL _bunker;
_laptop = createVehicle ["Land_Laptop_unfolded_F", _missionPos, [], 0, "CAN COLLIDE"];
_laptop setPosASL [_missionPos select 0, (_missionPos select 1) - 0.25, _missionPos select 2];
_obj = createVehicle ["I_HMG_01_high_F", _missionPos,[], 10,"None"];
_obj setPosASL [_missionPos select 0, (_missionPos select 1) + 2, _missionPos select 2];
AddLaptopHandler = _laptop;
publicVariable "AddLaptopHandler";
_laptop setVariable [ "Done", false, true ];
// NPC Randomizer
_randomGroup = [createGroup1,createGroup2,createGroup3,createGroup4,createGroup5] call BIS_fnc_selectRandom;
_aiGroup = createGroup CIVILIAN;
[_aiGroup,_missionPos] spawn _randomGroup;
_aiGroup setCombatMode "RED";
_aiGroup setBehaviour "COMBAT";
_vehicleName = "Laptop";
_missionHintText = format ["A <t color='%2'>%1</t> with enemy bank accounts has been spotted, go hack it.", _vehicleName, extraMissionColor];
};
_waitUntilMarkerPos = nil;
_waitUntilExec =
{
AddLaptopHandler = _laptop;
publicVariable "AddLaptopHandler";
};
_waitUntilCondition = nil;
_waitUntilSuccessCondition = { _laptop getVariable ["Done", false] };
_ignoreAiDeaths = true;
_failedExec =
{
// Mission failed
RemoveLaptopHandler = _laptop;
publicVariable "RemoveLaptopHandler";
{ deleteVehicle _x } forEach [_bunker, _obj, _laptop];
};
_successExec =
{
// Mission completed
RemoveLaptopHandler = _laptop;
publicVariable "RemoveLaptopHandler";
{ deleteVehicle _x } forEach [_bunker, _laptop];
_successHintMessage = format ["The laptop is hacked and the smugglers are dead. The weapons and money are yours!"];
};
_this call extraMissionProcessor;