Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- "Oil Rig Pirates" v2.1 static mission for Altis.
- Created by Fatunkist using templates by eraser1
- easy/mod/difficult/hardcore - reworked by [CiC]red_ned http://cic-gaming.co.uk
- */
- private ["_AICount", "_AIMaxReinforcements", "_AItrigger", "_AIwave", "_AIdelay", "_staticguns", "_missionObjs", "_crate0", "_crate1", "_crate_loot_values0", "_crate_loot_values1", "_crate_weapons0", "_crate_weapons1", "_crate_items0", "_crate_items1", "_crate_backpacks0", "_crate_backpacks1", "_difficultyM", "_difficulty", "_PossibleDifficulty", "_msgWIN", "_cash"];
- // For logging purposes
- _num = DMS_MissionCount;
- // Set mission side (only "bandit" is supported for now)
- _side = "bandit";
- _pos = [15542, 13477.1, 108.110]; //insert the centre here
- if ([_pos,DMS_StaticMinPlayerDistance] call DMS_fnc_IsPlayerNearby) exitWith {"delay"};
- //create possible difficulty add more of one difficulty to weight it towards that
- _PossibleDifficulty = [
- "easy",
- "moderate",
- "moderate",
- "difficult",
- "difficult",
- "difficult",
- "hardcore",
- "hardcore",
- "hardcore",
- "hardcore"
- ];
- //choose mission difficulty and set value and is also marker colour
- _difficultyM = selectRandom _PossibleDifficulty;
- switch (_difficultyM) do
- {
- case "easy":
- {
- _difficulty = "easy"; //AI difficulty
- _AICount = (15 + (round (random 5))); //AI starting numbers
- _AIMaxReinforcements = (10 + (round (random 30))); //AI reinforcement cap
- _AItrigger = (10 + (round (random 5))); //If AI numbers fall below this number then reinforce if any left from AIMax
- _AIwave = (4 + (round (random 4))); //Max amount of AI in reinforcement wave
- _AIdelay = (55 + (round (random 120))); //The delay between reinforcements
- _cash = (250 + round (random (500))); //this gives 250 to 750 cash
- _crate_weapons0 = (5 + (round (random 20))); //Crate 0 weapons number
- _crate_items0 = (5 + (round (random 20))); //Crate 0 items number
- _crate_backpacks0 = (3 + (round (random 1))); //Crate 0 back packs number
- _crate_weapons1 = (4 + (round (random 2))); //Crate 1 weapons number
- _crate_items1 = (10 + (round (random 40))); //Crate 1 items number
- _crate_backpacks1 = (1 + (round (random 8))); //Crate 1 back packs number
- };
- case "moderate":
- {
- _difficulty = "moderate";
- _AICount = (20 + (round (random 5)));
- _AIMaxReinforcements = (20 + (round (random 20)));
- _AItrigger = (10 + (round (random 10)));
- _AIwave = (5 + (round (random 3)));
- _AIdelay = (55 + (round (random 120)));
- _cash = (500 + round (random (750))); //this gives 500 to 1250 cash
- _crate_weapons0 = (10 + (round (random 15)));
- _crate_items0 = (10 + (round (random 15)));
- _crate_backpacks0 = (3 + (round (random 1)));
- _crate_weapons1 = (6 + (round (random 3)));
- _crate_items1 = (20 + (round (random 30)));
- _crate_backpacks1 = (5 + (round (random 4)));
- };
- case "difficult":
- {
- _difficulty = "difficult";
- _AICount = (20 + (round (random 7)));
- _AIMaxReinforcements = (30 + (round (random 20)));
- _AItrigger = (10 + (round (random 10)));
- _AIwave = (6 + (round (random 2)));
- _AIdelay = (55 + (round (random 120)));
- _cash = (750 + round (random (1000))); //this gives 750 to 1750 cash
- _crate_weapons0 = (30 + (round (random 20)));
- _crate_items0 = (15 + (round (random 10)));
- _crate_backpacks0 = (3 + (round (random 1)));
- _crate_weapons1 = (8 + (round (random 3)));
- _crate_items1 = (30 + (round (random 20)));
- _crate_backpacks1 = (6 + (round (random 4)));
- };
- //case "hardcore":
- default
- {
- _difficulty = "hardcore";
- _AICount = (20 + (round (random 10)));
- _AIMaxReinforcements = (40 + (round (random 10)));
- _AItrigger = (15 + (round (random 5)));
- _AIwave = (6 + (round (random 2)));
- _AIdelay = (55 + (round (random 120)));
- _cash = (1000 + round (random (1500))); //this gives 1000 to 2500 cash
- _crate_weapons0 = (20 + (round (random 5)));
- _crate_items0 = (20 + (round (random 5)));
- _crate_backpacks0 = (2 + (round (random 1)));
- _crate_weapons1 = (10 + (round (random 2)));
- _crate_items1 = (40 + (round (random 10)));
- _crate_backpacks1 = (10 + (round (random 2)));
- };
- };
- // Define spawn locations for AI Soldiers. These will be used for the initial spawning of AI as well as reinforcements.
- // The center spawn location is added 3 times so at least 3 AI will spawn initially at the center location, and so that future reinforcements are more likely to spawn at the center.
- _AISoldierSpawnLocations =
- [
- [15540.5,13478.5,108.163],
- [15545.8,13480,107.987],
- [15543.7,13473.6,108.340],
- [15525.5,13508.1,131.571],
- [15540.3,13474.5,133.765],
- [15512.8,13476.4,133.888],
- [15506.8,13489.2,107.263],
- [15515,13494.8,106.981],
- [15515.7,13487.5,107.595],
- [15556.4,13466.3,133.684],
- [15543.8,13457.6,134.483],
- [15536.9,13452.7,135.013],
- [15550.4,13461.6,108.685],
- [15546.1,13458.5,108.976],
- [15542.6,13456.1,109.222],
- [15525.7,13477.2,133.881],
- [15524.9,13481.7,133.552],
- [15520.9,13479.8,133.691],
- [15511.9,13507.4,105.887],
- [15515.8,13510.2,105.797],
- [15519.4,13512.6,105.722],
- [15493.5,13498.3,131.397],
- [15496.3,13489.7,132.399],
- [15501.3,13492.9,132.265],
- [15560.5,13493.7,107.263],
- [15556,13497.5,107.108],
- [15554.4,13491.4,107.666],
- [15517.1,13450.1,145.999],
- [15519.1,13445.2,146.254],
- [15523.1,13441.1,146.345],
- [15531.8,13445.3,114.393],
- [15530.2,13447.5,114.353],
- [15527,13445.7,114.584],
- [15559.7,13471,147.802],
- [15562.8,13465.8,147.866],
- [15567.7,13469,147.649]
- ];
- _group =
- [
- _AISoldierSpawnLocations+[_pos,_pos,_pos], // Pass the regular spawn locations as well as the center pos 3x
- _AICount,
- _difficulty,
- "random",
- _side
- ] call DMS_fnc_SpawnAIGroup_MultiPos;
- //Reduce Static guns if mission is easy
- if (_difficultyM isEqualTo "easy") then {
- _staticGuns =
- [
- [
- [15502.7,13506.9,139.553],
- [15489.9,13498.2,139.775],
- [15500.7,13481.5,141.746],
- [15539.9,13503.4,158.243],
- [15537.9,13493.7,158.814],
- [15564.4,13469,151.439],
- [15525.6,13444.9,148.209],
- [15530.2,13447.7,147.853],
- [15567,13458.9,95.216],
- [15556.4,13451.7,95.856]
- ],
- _group,
- "assault",
- _difficulty,
- "bandit",
- "random"
- ] call DMS_fnc_SpawnAIStaticMG;
- } else
- {
- _staticGuns =
- [
- [
- _pos vectorAdd [-1,0,0], // 1 meter West of center pos
- [15502.7,13506.9,139.553],
- [15489.9,13498.2,139.775],
- [15500.7,13481.5,141.746],
- [15539.9,13503.4,158.243],
- [15537.9,13493.7,158.814],
- [15564.4,13469,151.439],
- [15525.6,13444.9,148.209],
- [15530.2,13447.7,147.853],
- [15567,13458.9,95.216],
- [15556.4,13451.7,95.856],
- [15494.8,13512.3,91.902],
- [15484,13504.2,92.089],
- [15524.3,13521.2,136.648]
- ],
- _group,
- "assault",
- _difficulty,
- "bandit",
- "random"
- ] call DMS_fnc_SpawnAIStaticMG;
- };
- // Define the classnames and locations where the crates can spawn (at least 2, since we're spawning 2 crates)
- _crateClasses_and_Positions =
- [
- [[15496.5,13512.2,91.982],"I_CargoNet_01_ammo_F"],
- [[15494.4,13515,91.649],"I_CargoNet_01_ammo_F"],
- [[15505.4,13485.6,141.481],"I_CargoNet_01_ammo_F"],
- [[15508.5,13487.6,141.379],"I_CargoNet_01_ammo_F"],
- [[15553.7,13451.8,95.981],"I_CargoNet_01_ammo_F"],
- [[15555.7,13448.5,95.992],"I_CargoNet_01_ammo_F"],
- [[15567,13459.5,95.206],"I_CargoNet_01_ammo_F"],
- [[15483.1,13503.3,92.126],"I_CargoNet_01_ammo_F"]
- ];
- {
- deleteVehicle (nearestObject _x); // Make sure to remove any previous crates.
- } forEach _crateClasses_and_Positions;
- // Shuffle the list
- _crateClasses_and_Positions = _crateClasses_and_Positions call ExileClient_util_array_shuffle;
- // Create Crates
- _crate0 = [_crateClasses_and_Positions select 0 select 1, _crateClasses_and_Positions select 0 select 0] call DMS_fnc_SpawnCrate;
- _crate1 = [_crateClasses_and_Positions select 1 select 1, _crateClasses_and_Positions select 1 select 0] call DMS_fnc_SpawnCrate;
- // Enable smoke on the crates due to size of area
- {
- _x setVariable ["DMS_AllowSmoke", true];
- } forEach [_crate0,_crate1];
- // Define mission-spawned AI Units
- _missionAIUnits =
- [
- _group // We only spawned the single group for this mission
- ];
- // Define the group reinforcements
- _groupReinforcementsInfo =
- [
- [
- _group, // pass the group
- [
- [
- 0, // Let's limit number of units instead...
- 0
- ],
- [
- _AIMaxReinforcements, // Maximum units that can be given as reinforcements (defined in difficulty selection).
- 0
- ]
- ],
- [
- _AIdelay, // The delay between reinforcements. >> you can change this in difficulty settings
- diag_tickTime
- ],
- _AISoldierSpawnLocations,
- "random",
- _difficulty,
- _side,
- "reinforce",
- [
- _AItrigger, // Set in difficulty select - Reinforcements will only trigger if there's fewer than X members left
- _AIwave // X reinforcement units per wave. >> you can change this in mission difficulty section
- ]
- ]
- ];
- // setup crates with items from choices
- _crate_loot_values0 =
- [
- _crate_weapons0, // Set in difficulty select - Weapons
- _crate_items0, // Set in difficulty select - Items
- _crate_backpacks0 // Set in difficulty select - Backpacks
- ];
- _crate_loot_values1 =
- [
- _crate_weapons1, // Set in difficulty select - Weapons
- _crate_items1, // Set in difficulty select - Items
- _crate_backpacks1 // Set in difficulty select - Backpacks
- ];
- // add cash to _crate0
- _crate0 setVariable ["ExileMoney", _cash,true];
- // Define mission-spawned objects and loot values
- _missionObjs =
- [
- _staticGuns, // static gun(s). Note, we don't add the base itself because it already spawns on server start.
- [],
- [[_crate0,_crate_loot_values0],[_crate1,_crate_loot_values1]]
- ];
- // Define Mission Start message
- _msgStart = ['#FFFF00',format["A large group of %1 pirates have taken over the Pyrgos Gulf Oil Rig",_difficultyM]];
- // Define Mission Win message
- _msgWIN = ['#0080ff',"Convicts have successfully killed the terrorists and claimed all the crates"];
- // Define Mission Lose message
- _msgLOSE = ['#FF0000',"The terrorists have gone off to find more parts for their vehicles..."];
- // Define mission name (for map marker and logging)
- _missionName = "Death at Dawn Pirates";
- // Create Markers
- _markers =
- [
- _pos,
- _missionName,
- _difficultyM
- ] call DMS_fnc_CreateMarker;
- _circle = _markers select 1;
- _circle setMarkerDir 20;
- _circle setMarkerSize [250,250];
- _time = diag_tickTime;
- // Parse and add mission info to missions monitor
- _added =
- [
- _pos,
- [
- [
- "kill",
- _group
- ],
- [
- "playerNear",
- [_pos,100]
- ]
- ],
- _groupReinforcementsInfo,
- [
- _time,
- DMS_StaticMissionTimeOut call DMS_fnc_SelectRandomVal
- ],
- _missionAIUnits,
- _missionObjs,
- [_missionName,_msgWIN,_msgLOSE],
- _markers,
- _side,
- _difficulty,
- [[],[]]
- ] call DMS_fnc_AddMissionToMonitor_Static;
- // Check to see if it was added correctly, otherwise delete the stuff
- if !(_added) exitWith
- {
- diag_log format ["DMS ERROR :: Attempt to set up mission %1 with invalid parameters for DMS_fnc_AddMissionToMonitor_Static! Deleting mission objects and resetting DMS_MissionCount.",_missionName];
- _cleanup = [];
- {
- _cleanup pushBack _x;
- } forEach _missionAIUnits;
- _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1));
- {
- _cleanup pushBack (_x select 0);
- } foreach (_missionObjs select 2);
- _cleanup call DMS_fnc_CleanUp;
- // Delete the markers directly
- {deleteMarker _x;} forEach _markers;
- // Reset the mission count
- DMS_MissionCount = DMS_MissionCount - 1;
- };
- // Notify players
- [_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus;
- if (DMS_DEBUG) then
- {
- (format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement