Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- "Comms Alpha" v2.1c static mission for Tanoa.
- Created by [CiC]red_ned using templates by eraser1
- Exile_Car_BTR40_Camo increases persistent chance with difficulty
- 17 years of CiC
- 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", "_vehicle", "_pinCode", "_VehicleChance", "_cash"];
- // For logging purposes
- _num = DMS_MissionCount;
- // Set mission side (only "bandit" is supported for now)
- _side = "bandit";
- _pos = [10033.3,11792.4,0]; //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
- _VehicleChance = 10; //10% SpawnPersistentVehicle chance
- _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
- _cash = (250 + round (random (500))); // cash in crate
- };
- 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)));
- _VehicleChance = 20; //20% SpawnPersistentVehicle chance
- _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)));
- _cash = (250 + round (random (500))); // cash in crate
- };
- 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)));
- _VehicleChance = 75; //75% SpawnPersistentVehicle chance
- _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)));
- _cash = (250 + round (random (500))); // cash in crate
- };
- //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)));
- _VehicleChance = 90; //90% SpawnPersistentVehicle chance
- _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)));
- _cash = (250 + round (random (500))); // cash in crate
- };
- };
- // 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 =
- [
- [10023.8,11830.5,0],
- [10022.5,11806.9,0],
- [10043.2,11809.6,0],
- [9947.78,11805.3,0],
- [9949.77,11790.5,0.0664],
- [9943.55,11776.7,0],
- [9976.6,11779.4,0],
- [9993.78,11779.1,0],
- [10009.2,11781.3,0],
- [10057.1,11759.3,0.0236],
- [10062.2,11767.4,0],
- [10064.7,11796.8,0],
- [10063.5,11784,0],
- [10070.1,11756.7,0],
- [10064.9,11756,0],
- [10070.8,11768.8,0],
- [10094.3,11744.7,0],
- [10083.8,11749.5,0],
- [10098.8,11755.1,0],
- [10101.7,11787.7,0],
- [10096.2,11795.7,0.1512],
- [10035.4,11760.8,0],
- [10018.3,11759.8,0],
- [10024.2,11783.8,0],
- [10040.8,11791.7,0],
- [9978.8,11817,0],
- [10013.9,11827.5,0],
- [10053.3,11828.3,0],
- [10075,11809.2,0],
- [10104.3,11745.3,0],
- [10000.7,11802.7,0],
- [10044.1,11795.7,0.5526],
- [10017.9,11802.8,0.6483]
- ];
- _group =
- [
- _AISoldierSpawnLocations+[_pos,_pos,_pos], // Pass the regular spawn locations as well as the center pos 3x
- _AICount, // Set in difficulty select
- _difficulty, // Set in difficulty select
- "random",
- _side
- ] call DMS_fnc_SpawnAIGroup_MultiPos;
- //Reduce Static guns if mission is easy
- if (_difficultyM isEqualTo "easy") then {
- _staticGuns =
- [
- [
- [10101.7,11736.9,0],
- [10119.5,11744.2,0],
- [10083.8,11745,0],
- [10072.2,11749.3,0],
- [10041.5,11781.4,0],
- [10009.8,11811.1,0],
- [9972.2,11806,0],
- [9970.87,11781,0],
- [9941.86,11782.5,0],
- [10062.5,11824.7,0],
- [10075.7,11772.3,0],
- [10064,11791.8,0],
- [10064.3,11801.7,0]
- ],
- _group,
- "assault",
- _difficulty,
- "bandit",
- "random"
- ] call DMS_fnc_SpawnAIStaticMG;
- } else
- {
- _staticGuns =
- [
- [
- _pos vectorAdd [-5,0,0], // 5 meters West of center pos
- _pos vectorAdd [0,-5,0], // 5 meters South of center pos
- [10045.3,11760.9,0],
- [10101.7,11736.9,0],
- [10119.5,11744.2,0],
- [10083.8,11745,0],
- [10072.2,11749.3,0],
- [10041.5,11781.4,0],
- [10009.8,11811.1,0],
- [9972.2,11806,0],
- [9970.87,11781,0],
- [9941.86,11782.5,0],
- [10062.5,11824.7,0],
- [10075.7,11772.3,0],
- [10064,11791.8,0],
- [10064.3,11801.7,0]
- ],
- _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 =
- [
- [[9947.22,11791,0.0769348],"I_CargoNet_01_ammo_F"],
- [[10056,11761.6,0],"I_CargoNet_01_ammo_F"],
- [[10088.9,11747,0.119232],"I_CargoNet_01_ammo_F"],
- [[10067.4,11760,0.085144],"I_CargoNet_01_ammo_F"],
- [[9998.37,11783.5,0],"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;
- // load tabs in
- _crate0 setVariable ["ExileMoney", _cash,true];
- //_crate1 setVariable ["ExileMoney", _cash,true];
- // 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
- ];
- // is %chance greater than random number
- if (_VehicleChance >= (random 100)) then {
- _pinCode = (1000 +(round (random 8999)));
- _vehicle = ["Exile_Car_BTR40_Camo",[9947,11799.4,0],_pinCode] call DMS_fnc_SpawnPersistentVehicle;
- _msgWIN = ['#0080ff',format ["Convicts have successfully cleared Comms Alpha Station and stolen all the crates, BTR40 entry code is %1...",_pinCode]];
- } else
- {
- _vehicle = ["Exile_Car_BTR40_Camo",[9947,11799.4,0]] call DMS_fnc_SpawnNonPersistentVehicle;
- _msgWIN = ['#0080ff',"Convicts have successfully cleared Comms Alpha Station and stolen all the crates"];
- };
- // Define mission-spawned objects and loot values with vehicle
- _missionObjs =
- [
- _staticGuns, // static gun(s). Note, we don't add the base itself because it already spawns on server start.
- [_vehicle], // vehicle prize
- [[_crate0,_crate_loot_values0],[_crate1,_crate_loot_values1]]
- ];
- // Define Mission Start message
- _msgStart = ['#FFFF00',format["Comms Alpha Station is being invaded by %1 terrorists",_difficultyM]];
- // Define Mission Win message defined in vehicle choice
- // Define Mission Lose message
- _msgLOSE = ['#FF0000',"Invaders have stripped Comms Alpha Station of loot and left."];
- // Define mission name (for map marker and logging)
- _missionName = "Comms Alpha Invasion";
- // Create Markers
- _markers =
- [
- _pos,
- _missionName,
- _difficultyM
- ] call DMS_fnc_CreateMarker;
- _circle = _markers select 1;
- _circle setMarkerDir 0;
- _circle setMarkerSize [150,150];
- _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,
- _difficultyM,
- [[],[]]
- ] 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