Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- COMPOUND mission created by AINC_STALKER with credit to AINC_Trades.
- Extended Crate Array and Crate Lists added to difficulty levels.
- Allows more customisation of crate contents based on difficulty
- SPECIAL 1 and SPECIAL 2 are generally used for high value items.
- IE: If this was a building supply mission i would add metal to 1 and concrete to the 2nd.
- Easy/mod/difficult/hardcore based on work by [CiC]red_ned http://cic-gaming.co.uk
- Overall template based on work by Defent and eraser1
- */
- private ["_num", "_side", "_pos", "_OK", "_difficulty", "_AICount", "_group", "_type", "_launcher", "_staticGuns", "_crate1", "_vehicle", "_pinCode", "_class", "_veh", "_crate_loot_values1", "_missionAIUnits", "_missionObjs", "_msgStart", "_msgWIN", "_msgLOSE", "_missionName", "_markers", "_time", "_added", "_cleanup", "_baseObjs", "_crate_weapons", "_crate_weapon_list", "_crate_items", "_crate_item_list", "_crate_backpacks", "_PossibleDifficulty", "_VehicleChance", "_VehicleClass", "_VehicleClasses"];
- // For logging purposes
- _num = DMS_MissionCount;
- // Set mission side (only "bandit" is supported for now)
- _side = "bandit";
- // This part is unnecessary, but exists just as an example to format the parameters for "DMS_fnc_MissionParams" if you want to explicitly define the calling parameters for DMS_fnc_FindSafePos.
- // It also allows anybody to modify the default calling parameters easily.
- if ((isNil "_this") || {_this isEqualTo [] || {!(_this isEqualType [])}}) then
- {
- _this =
- [
- [10,DMS_WaterNearBlacklist,DMS_MinSurfaceNormal,DMS_SpawnZoneNearBlacklist,DMS_TraderZoneNearBlacklist,DMS_MissionNearBlacklist,DMS_PlayerNearBlacklist,DMS_TerritoryNearBlacklist,DMS_ThrottleBlacklists],
- [
- []
- ],
- _this
- ];
- };
- // Check calling parameters for manually defined mission position.
- // You can define "_extraParams" to specify the vehicle classname to spawn, either as _vehClass or [_vehClass]
- _OK = (_this call DMS_fnc_MissionParams) params
- [
- ["_pos",[],[[]],[3],[],[],[]],
- ["_extraParams",[]]
- ];
- if !(_OK) exitWith
- {
- diag_log format ["DMS ERROR :: Called MISSION nedresearch_mission.sqf with invalid parameters: %1",_this];
- };
- //create possible difficulty add more of one difficulty to weight it towards that
- _PossibleDifficulty = [
- "easy",
- "easy",
- "moderate",
- "moderate",
- "difficult",
- "difficult",
- "difficult",
- "hardcore",
- "hardcore"
- ];
- //choose difficulty and set value
- _difficulty = selectRandom _PossibleDifficulty;
- switch (_difficulty) do
- {
- case "easy":
- {
- _AICount = (20 + (round (random 5)));
- _crate_weapons = (10 + (round (random 1)));
- _crate_items = (10 + (round (random 1)));
- _crate_backpacks = (10 + (round (random 1)));
- _VehicleClasses = ["B_G_Offroad_01_armed_F", "B_G_Offroad_01_armed_F"];
- _VehicleChance = 25; // as a percentage
- };
- case "moderate":
- {
- _AICount = (25 + (round (random 5)));
- _crate_weapons = (15 + (round (random 1)));
- _crate_items = (15 + (round (random 1)));
- _crate_backpacks = (15 + (round (random 1)));
- _VehicleClasses = ["B_LSV_01_armed_olive_F", "B_LSV_01_armed_olive_F"];
- _VehicleChance = 50; // as a percentage
- };
- case "difficult":
- {
- _AICount = (30 + (round (random 5)));
- _crate_weapons = (20 + (round (random 1)));
- _crate_items = (20 + (round (random 1)));
- _crate_backpacks = (20 + (round (random 1)));
- _VehicleClasses = ["I_MRAP_03_hmg_F", "I_MRAP_03_hmg_F"];
- _VehicleChance = 75; // as a percentage
- };
- case "hardcore":
- {
- _AICount = (35 + (round (random 5)));
- _crate_weapons = (25 + (round (random 1)));
- _crate_items = (25 + (round (random 1)));
- _crate_backpacks = (25 + (round (random 1)));
- _VehicleClasses = ["B_APC_Tracked_01_CRV_F", "B_APC_Tracked_01_CRV_F"];
- _VehicleChance = 100; // as a percentage
- };
- };
- //Crate Loot used by all.
- _crate_weapons_list = ["arifle_MXC_F","arifle_MX_F","arifle_MX_GL_F","arifle_MXM_F","arifle_MXM_Black_F","arifle_MXC_Black_F","arifle_MX_Black_F","arifle_MX_GL_Black_F","arifle_SPAR_01_blk_F","arifle_SPAR_01_GL_blk_F","arifle_SPAR_02_blk_F","arifle_SPAR_03_blk_F","arifle_MX_SW_Black_F","LMG_Zafir_F","srifle_EBR_F","srifle_DMR_01_F","srifle_DMR_03_woodland_F"];
- _crate_items_list = ["Exile_Item_EMRE","Exile_Item_InstantCoffee"];
- _crate_backpacks_list = ["B_ViperLightHarness_blk_F","B_Carryall_oucamo","B_AssaultPack_blk"];
- _group =
- [
- [[(_pos select 0)+2,(_pos select 1)+4,0],[(_pos select 0)-10,(_pos select 1)+0,0]],
- _AICount, // Number of AI
- _difficulty, // "random","hardcore","difficult","moderate", or "easy"
- "random", // "random","assault","MG","sniper" or "unarmed" OR [_type,_launcher]
- _side // "bandit","hero", etc.
- ] call DMS_fnc_SpawnAIGroup_MultiPos;
- // add vehicle patrol
- _veh =
- [
- [
- [(_pos select 0)+100,(_pos select 1)+100,0]
- ],
- _group,
- "assault",
- _difficulty,
- _side
- ] call DMS_fnc_SpawnAIVehicle;
- // add static guns
- _staticGuns =
- [
- [
- // make statically positioned relative to centre point, keep static as they are on top of building
- [(_pos select 0) -10,(_pos select 1) +10,0],
- [(_pos select 0) -10,(_pos select 1) -10,0],
- [(_pos select 0) +2,(_pos select 1) +18,+13],
- [(_pos select 0) +2,(_pos select 1) -16,+13],
- [(_pos select 0) -25,(_pos select 1) +15,+14],
- [(_pos select 0) -43,(_pos select 1) +18,+13],
- [(_pos select 0) -43,(_pos select 1) -16,+13]
- ],
- _group,
- "assault",
- "static",
- "bandit"
- ] call DMS_fnc_SpawnAIStaticMG;
- // Create buildings - check OBJECTS sqf matches
- _baseObjs =
- [
- "STALKER_AINC_objects",
- _pos
- ] call DMS_fnc_ImportFromM3E_3DEN;
- //choose vehicle from potentials
- _VehicleClass = selectRandom _VehicleClasses;
- if (_VehicleChance >= (random 100)) then
- {
- _pinCode = (1000 +(round (random 8999)));
- _vehicle = [_VehicleClass,[(_pos select 0) +30, (_pos select 1) -0],_pinCode] call DMS_fnc_SpawnPersistentVehicle;
- _msgWIN = ['#0080ff',format ["AINC compound secured. %1 secured. Code is %2 ...",_VehicleClass,_pinCode]];
- } else
- {
- _vehicle = [_VehicleClass,[(_pos select 0) +30, (_pos select 1) -0, 0]] call DMS_fnc_SpawnNonPersistentVehicle;
- _msgWIN = ['#0080ff',"AINC compound secured."];
- };
- // Create Crate type
- _crate1 = ["Box_NATO_Wps_F",_pos] call DMS_fnc_SpawnCrate;
- // setup crate iteself with items
- _crate_loot_values1 =
- [
- [_crate_weapons,_crate_weapons_list],
- [_crate_items,_crate_items_list],
- [_crate_backpacks,_crate_backpacks_list]
- ];
- // Define mission-spawned AI Units
- _missionAIUnits =
- [
- _group // We only spawned the single group for this mission
- ];
- // Define mission-spawned objects and loot values
- _missionObjs =
- [
- _staticGuns+_baseObjs+[_veh], // armed AI vehicle, base objects, and static guns
- [_vehicle], //this is prize vehicle
- [[_crate1,_crate_loot_values1]] //this is prize crate
- ];
- // Define Mission Win message defined in persistent choice
- _msgStart = ['#FFFF00',"AINC Security have set up a %1 re-supply compound. Raid them before they complete operations",_difficulty];
- // Define Mission Lose message
- _msgLOSE = ['#FF0000',"EXILE SECURITY HAS DEFENDED THE COMPOUND , PATROLS ARE INCREASING."];
- // Define mission name (for map marker and logging)
- _missionName = "EXILE SECURITY COMPOUND";
- // Create Markers
- _markers =
- [
- _pos,
- _missionName,
- _difficulty
- ] call DMS_fnc_CreateMarker;
- // Record time here (for logging purposes, otherwise you could just put "diag_tickTime" into the "DMS_AddMissionToMonitor" parameters directly)
- _time = diag_tickTime;
- // Parse and add mission info to missions monitor
- _added =
- [
- _pos,
- [
- [
- "kill",
- _group
- ],
- [
- "playerNear",
- [_pos,DMS_playerNearRadius]
- ]
- ],
- [
- _time,
- (DMS_MissionTimeOut select 0) + random((DMS_MissionTimeOut select 1) - (DMS_MissionTimeOut select 0))
- ],
- _missionAIUnits,
- _missionObjs,
- [_missionName,_msgWIN,_msgLOSE],
- _markers,
- _side,
- _difficulty,
- []
- ] call DMS_fnc_AddMissionToMonitor;
- // 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_AddMissionToMonitor! Deleting mission objects and resetting DMS_MissionCount.",_missionName];
- // Delete AI units and the crate. I could do it in one line but I just made a little function that should work for every mission (provided you defined everything correctly)
- _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