This commit is contained in:
2022-04-21 16:15:41 +03:00
commit 9d4fc88901
601 changed files with 66252 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,129 @@
/*
DZMSInit.sqf by Vampire
This is the file that every other file branches off from.
It checks that it is safe to run, sets relations, and starts mission timers.
Updated for DZMS 2.0 by JasonTM
*/
// Global for other scripts to check if DZMS is installed.
DZMSInstalled = true;
diag_log text "[DZMS]: Starting DayZ Mission System.";
DZMSRelations = [];
if (!isNil "DZAI_isActive") then {DZMSRelations = DZMSRelations + ["DZAI"];};
if (!isNil "SAR_version") then {DZMSRelations = DZMSRelations + ["SargeAI"];};
if (!isNil "WAIconfigloaded") then {DZMSRelations = DZMSRelations + ["WickedAI"];};
call {
// If we have multiple relations running, lets warn the user
if (count DZMSRelations > 1) exitWith {
diag_log text "[DZMS]: Multiple Relations Detected! Unwanted AI Behaviour May Occur!";
diag_log text "[DZMS]: If Issues Arise, Decide on a Single AI System! (DZAI, SargeAI, or WickedAI)";
};
// If only one set of relations were found, let the user know which one is being used.
if (count DZMSRelations == 1) exitWith {diag_log text format["[DZMS]: Using %1 Relations.",(DZMSRelations select 0)];};
// They weren't found, so let's set relationships
diag_log text "[DZMS]: Relations not found! Using DZMS Relations.";
// Create the groups if they aren't created already
createCenter east;
// Make AI Hostile to Survivors
WEST setFriend [EAST,0];
EAST setFriend [WEST,0];
// Make AI Hostile to Zeds
EAST setFriend [CIVILIAN,0];
CIVILIAN setFriend [EAST,0];
};
//Destroy the global variable
DZMSRelations = nil;
// This variable is used to lock the mission spawning to avoid data collisions
DZMSMarkerReady = true;
// This array will store the data for missions
DZMSMissionData = [];
// Let's initialize the mission count variables
DZMSBanditRunning = 0;
DZMSHeroRunning = 0;
// Let's initialize the mission end times
DZMSBanditEndTime = diag_tickTime;
DZMSHeroEndTime = diag_tickTime;
// We need to check for Epoch and OverWatch to adjust vehicle spawning, and configurations
DZMSEpoch = isClass (configFile >> "CfgWeapons" >> "Chainsaw");
DZMSOverwatch = isClass (configFile >> "CfgWeapons" >> "USSR_cheytacM200");
// Let's Load the General Mission Configuration
call compile preprocessFileLineNumbers "\z\addons\dayz_server\DZMS\DZMSConfig.sqf";
// Report the version
if (DZMSDebug) then {diag_log text format ["[DZMS]: Currently Running Version: %1", DZMSVersion];};
// Lets check for a copy-pasted config file
if (DZMSVersion != "2.1") then {
diag_log text format ["[DZMS]: Outdated Configuration Detected! Please Update DZMS!"];
diag_log text format ["[DZMS]: Old Versions are not supported by the Mod Author!"];
};
// These variables are initialized here because they are not used in all versions.
DZMSMakeVehKey = false;
DZMSAICheckWallet = false;
DZMSUseRPG = false;
DZMSM2Static = false;
DZMS_HeroDogTag = 0;
DZMS_BanditDogTag = 0;
DZMS_AllowThermal = false;
DZMSHighValue = [];
call {
// Epoch + Overwatch = Overpoch
if (DZMSEpoch && DZMSOverwatch) exitWith {
call compile preprocessFileLineNumbers "\z\addons\dayz_server\DZMS\ExtConfig\OverpochExtConfig.sqf";
diag_log text "[DZMS]: DayZ Overpoch Detected! Overpoch Configs loaded";
};
// Epoch detected!
if (DZMSEpoch && !DZMSOverwatch) exitWith {
call compile preprocessFileLineNumbers "\z\addons\dayz_server\DZMS\ExtConfig\EpochExtConfig.sqf";
diag_log text "[DZMS]: DayZ Epoch Detected! Epoch Configs loaded!";
};
// Epoch and Overwatch not detected, load Vanilla Mod configs.
call compile preprocessFileLineNumbers "\z\addons\dayz_server\DZMS\ExtConfig\VanillaExtConfig.sqf";
diag_log text "[DZMS]: DayZ Vanilla Mod Detected! Vanilla Configs loaded!";
};
// Lets compile our functions
call compile preprocessFileLineNumbers "\z\addons\dayz_server\DZMS\Scripts\DZMSFunctions.sqf";
DZMSAIKilled = compile preprocessFileLineNumbers "\z\addons\dayz_server\DZMS\Scripts\DZMSAIKilled.sqf";
DZMSAISpawn = compile preprocessFileLineNumbers "\z\addons\dayz_server\DZMS\Scripts\DZMSAISpawn.sqf";
DZMSM2Spawn = compile preprocessFileLineNumbers "\z\addons\dayz_server\DZMS\Scripts\DZMSM2Spawn.sqf";
DZMSBoxSetup = compile preprocessFileLineNumbers "\z\addons\dayz_server\DZMS\Scripts\DZMSBox.sqf";
DZMSSpawnVeh = compile preprocessFileLineNumbers "\z\addons\dayz_server\DZMS\Scripts\DZMSSpawnVeh.sqf";
DZMSWaitMissionComp = compile preprocessFileLineNumbers "\z\addons\dayz_server\DZMS\Scripts\DZMSWaitMissionComp.sqf";
DZMSFindPos = compile preprocessFileLineNumbers "\z\addons\dayz_server\DZMS\Scripts\DZMSFindPos.sqf";
DZMSSpawnObjects = compile preprocessFileLineNumbers "\z\addons\dayz_server\DZMS\Scripts\DZMSSpawnObjects.sqf";
DZMSAddMajMarker = "\z\addons\dayz_server\DZMS\Scripts\DZMSAddMajMarker.sqf";
DZMSAddMinMarker = "\z\addons\dayz_server\DZMS\Scripts\DZMSAddMinMarker.sqf";
// Get the static AI spawned (if applicable)
if (DZMSStaticAI) then {
[] spawn {
while {true} do {
{
if !((_x select 0 == 0) && (_x select 1 == 0)) then {
[_x,DZMSStaticAICnt,2,"Bandit"] call DZMSAISpawn;
};
sleep 2;
} forEach DZMSStaticSpawn;
sleep DZMSStaticAITime;
};
};
};

View File

@ -0,0 +1,3 @@
This directory consists of extended configuration files.
Modifying these are not required, and are for users who want a customized setup.
- Vampire

View File

@ -0,0 +1,156 @@
/*
EpochExtConfig.sqf
This config file is loaded in DZMSInit.sqf if the Epoch mod is detected.
It contains specific AI, Crate, and Vehicle configurations for DayZ Epoch.
*/
// Generates keys for mission vehicles and places it in the gear. Only works if DZMSSaveVehicles is set to true and Epoch is detected.
DZMSMakeVehKey = false;
//If you have ZSC installed then you can set this to true to place money in ai wallets.
DZMSAICheckWallet = false;
// Do you want AI to use RPG7V's?
// Odd numbered AI will spawn with one if enabled.
DZMSUseRPG = true;
// Do you want static M2 heavy machine gunners at the missions? (Some of the easier missions don't have them).
DZMSM2Static = true;
// Attachment_Tws can spawn on the AI and in crates if true.
DZMS_AllowThermal = true;
///////////////////////////////////////////////
// Arrays of skin classnames for the AI to use
DZMSBanditSkins = ["Bandit1_DZ","BanditW1_DZ","TK_INS_Warlord_EP1_DZ","GUE_Commander_DZ"];
DZMSHeroSkins = ["Soldier_Sniper_PMC_DZ","Survivor2_DZ","SurvivorW2_DZ","Soldier1_DZ","Camo1_DZ","UN_CDF_Soldier_EP1_DZ"];
////////////////////////
// Array of AI Skills
DZMSSkills0 = [
["aimingAccuracy",0.10],
["aimingShake",0.45],
["aimingSpeed",0.45],
["endurance",0.40],
["spotDistance",0.30],
["spotTime",0.30],
["courage",0.40],
["reloadSpeed",0.50],
["commanding",0.40],
["general",0.40]
];
DZMSSkills1 = [
["aimingAccuracy",0.125],
["aimingShake",0.60],
["aimingSpeed",0.60],
["endurance",0.55],
["spotDistance",0.45],
["spotTime",0.45],
["courage",0.55],
["reloadSpeed",0.60],
["commanding",0.55],
["general",0.55]
];
DZMSSkills2 = [
["aimingAccuracy",0.15],
["aimingShake",0.75],
["aimingSpeed",0.70],
["endurance",0.70],
["spotDistance",0.60],
["spotTime",0.60],
["courage",0.70],
["reloadSpeed",0.70],
["commanding",0.70],
["general",0.70]
];
DZMSSkills3 = [
["aimingAccuracy",0.20],
["aimingShake",0.85],
["aimingSpeed",0.80],
["endurance",0.80],
["spotDistance",0.70],
["spotTime",0.70],
["courage",0.80],
["reloadSpeed",0.80],
["commanding",0.80],
["general",0.80]
];
// Set the bloodbag type
local _bloodbag = ["bloodBagONEG","ItemBloodbag"] select dayz_classicBloodBagSystem;
/////////////////////////////////////////////////////////////
// These are gear sets that will be randomly given to the AI
DZMSGear0 = [
["ItemBandage","ItemSepsisBandage","ItemAntibiotic6","ItemPainkiller6","ItemSodaGrapeDrink","FoodBaconCooked"],
["ItemKnife","ItemFlashlight"]
];
DZMSGear1 = [
["ItemBandage","ItemSepsisBandage","ItemPainkiller6","ItemMorphine","ItemSodaRocketFuel","FoodGoatCooked"],
["ItemToolbox","ItemEtool"]
];
DZMSGear2 = [
["ItemBandage","ItemAntibacterialWipe",_bloodbag,"ItemPainkiller6","ItemSodaSacrite","FishCookedTrout"],
["ItemMatchbox","ItemHatchet"]
];
DZMSGear3 = [
["ItemBandage","ItemSepsisBandage","ItemMorphine","ItemHeatPack","ItemSodaRabbit","FoodMRE"],
["ItemCrowbar","ItemMachete"]
];
DZMSGear4 = [
["ItemBandage","ItemAntibacterialWipe","ItemEpinephrine",_bloodbag,"ItemSodaMtngreen","FoodRabbitCooked"],
["ItemGPS","Binocular_Vector"]
];
// New to DayZ Epoch 1.0.7. "ItemDogTagHero" and "ItemDogTagBandit" can be traded at hero and bandit vendors for +/- humanity.
DZMS_HeroDogTag = .15; // Chance for a dog tag to be added to the inventory of a hero NPC: Between 0 and 1.
DZMS_BanditDogTag = .15; // Chance for a dog tag to be added to the inventory of a bandit NPC: Between 0 and 1.
/////////////////////////////////////////////////////////////////////////////////////////////
// These are arrays of vehicle classnames for the missions.
//Armed Choppers
DZMSChoppers = ["BAF_Merlin_DZE","UH60M_MEV_EP1_DZ","CH_47F_EP1_DZE","UH1H_DZE","Mi17_DZE","UH60M_EP1_DZE","UH1Y_DZE","MH60S_DZE","UH1H_CDF_DZE","UH1H_WD_DZE","UH1H_2_DZE","UH1H_DES_DZE","UH1H_GREY_DZE","UH1H_BLACK_DZE","UH1H_SAR_DZE","Mi17_DZE","Mi17_TK_EP1_DZE","Mi17_UN_CDF_EP1_DZE","Mi17_CDF_DZE","Mi17_DES_DZE","Mi17_GREEN_DZE","Mi17_BLUE_DZE","Mi17_BLACK_DZE","Mi171Sh_CZ_EP1_DZE","MH60S_DZE","Ka60_GL_PMC_DZE","AW159_Lynx_BAF_DZE","UH60M_EP1_DZE","UH1Y_DZE","CH_47F_EP1_DZE","CH_47F_EP1_Black_DZE","CH_47F_EP1_GREY_DZE","CH_47F_EP1_DES_DZE","pook_transport_DZE","pook_transport_CDF_DZE","pook_gunship_DZE","pook_gunship_CDF_DZE"];
//Small Vehicles
DZMSSmallVic = ["hilux1_civil_3_open_DZE","SUV_TK_CIV_EP1_DZE","HMMWV_DZ","UAZ_Unarmed_UN_EP1_DZE","HMMWV_Ambulance_CZ_DES_EP1_DZE","LandRover_TK_CIV_EP1_DZE","SUV_Camo","Nissan_Orange_DZE","BTR40_TK_INS_EP1_DZE","Jeep_DZE","ScrapAPC_DZE","Tractor_Armored_DZE"];
//Large Vehicles
DZMSLargeVic = ["Kamaz_DZE","MTVR_DES_EP1_DZE","Ural_INS_DZE","Ural_CDF_DZE","Ural_TK_CIV_EP1_DZE","Ural_UN_EP1_DZE","V3S_Open_TK_CIV_EP1_DZE","V3S_Open_TK_EP1_DZE","T810A_ACR_DZE","T810A_ACR_DES_DZE","T810A_ACR_OPEN_DZE","T810A_ACR_DES_OPEN_DZE","MTVR_Open_DZE","MTVR_DZE"];
////////////////////////////////////////////////////////////////
// Weapons Arrays - These can be adjusted as desired or make your own custom arrays
DZMSPistol = ["Revolver_DZ","Colt_Revolver_DZ","Colt_Anaconda_DZ","Colt_Bull_DZ","Colt_Python_DZ","DesertEagle_DZ","M1911_DZ","M1911_2_DZ","Kimber_M1911_DZ","Kimber_M1911_SD_DZ","USP_DZ","USP_SD_DZ","PPK_DZ","Tokarew_TT33_DZ","Makarov_DZ","Makarov_SD_DZ","APS_DZ","APS_SD_DZ","P38_DZ","BrowningHP_DZ","MK22_DZ","MK22_SD_DZ","MK22_2_DZ","MK22_2_SD_DZ","P226_DZ","P226_Silver_DZ","M9_DZ","M9_SD_DZ","M9_Camo_DZ","M9_Camo_SD_DZ","M93R_DZ","CZ75P_DZ","CZ75D_DZ","CZ75SP_DZ","CZ75SP_SD_DZ","G17_DZ","G18_DZ","P99_Black_DZ","P99_Black_SD_DZ","P99_Green_DZ","P99_Green_SD_DZ","P99_Silver_DZ","P99_Silver_SD_DZ"];
DZMSAssault = ["M16A2_DZ","M4A1_DZ","M4A1_SD_DZ","SA58_RIS_DZ","L85A2_DZ","L85A2_SD_DZ","AKM_DZ","G36C_DZ","G36C_SD_DZ","G36A_Camo_DZ","G36K_Camo_DZ","G36K_Camo_SD_DZ","CTAR21_DZ","ACR_WDL_DZ","ACR_WDL_SD_DZ","ACR_BL_DZ","ACR_BL_SD_DZ","ACR_DES_DZ","ACR_DES_SD_DZ","ACR_SNOW_DZ","ACR_SNOW_SD_DZ","AK74_DZ","AK74_SD_DZ","AK107_DZ","CZ805_A1_DZ","CZ805_A1_GL_DZ","CZ805_A2_DZ","CZ805_A2_SD_DZ","CZ805_B_GL_DZ","Famas_DZ","Famas_SD_DZ","G3_DZ","HK53A3_DZ","HK416_DZ","HK416_SD_DZ","HK417_DZ","HK417_SD_DZ","HK417C_DZ","M1A_SC16_BL_DZ","M1A_SC16_TAN_DZ","M1A_SC2_BL_DZ","Masada_DZ","Masada_SD_DZ","Masada_BL_DZ","Masada_BL_SD_DZ","MK14_DZ","MK14_SD_DZ","MK16_DZ","MK16_CCO_SD_DZ","MK16_BL_CCO_DZ","MK16_BL_Holo_SD_DZ","MK17_DZ","MK17_CCO_SD_DZ","MK17_ACOG_SD_DZ","MK17_BL_Holo_DZ","MK17_BL_GL_ACOG_DZ","MR43_DZ","PDR_DZ","RK95_DZ","RK95_SD_DZ","SCAR_H_AK_DZ","SteyrAug_A3_Green_DZ","SteyrAug_A3_Black_DZ","SteyrAug_A3_Blue_DZ","XM8_DZ","XM8_DES_DZ","XM8_GREY_DZ","XM8_GREY_2_DZ","XM8_GL_DZ","XM8_DES_GL_DZ","XM8_GREY_GL_DZ","XM8_Compact_DZ","XM8_DES_Compact_DZ","XM8_GREY_Compact_DZ","XM8_GREY_2_Compact_DZ","XM8_SD_DZ"];
DZMSLMG = ["L110A1_DZ","M249_DZ","M240_DZ","Mk48_DZ","RPK_DZ","UK59_DZ","PKM_DZ","Mk43_DZ","MK43_M145_DZ","RPK74_DZ","XM8_SAW_DZ","XM8_DES_SAW_DZ","XM8_GREY_SAW_DZ"];
DZMSSMG = ["Bizon_DZ","Bizon_SD_DZ","MP5_DZ","MP5_SD_DZ","Scorpion_Evo3_DZ","Scorpion_Evo3_CCO_SD_DZ","Groza9_DZ","Groza1_DZ","KAC_PDW_DZ","Kriss_DZ","Kriss_SD_DZ","M31_DZ","MAT49_DZ","MP7_DZ","MP7_SD_DZ","P90_DZ","P90_SD_DZ","Sten_MK_DZ","TMP_DZ","TMP_SD_DZ","UMP_DZ","UMP_SD_DZ","VAL_DZ"];
DZMSSniper = ["Mosin_PU_DZ","M4SPR_DZE","M14_DZ","M24_DZ","M24_DES_DZ","M40A3_DZ","SVD_DZ","SVD_PSO1_Gh_DES_DZ","FNFAL_DZ","DMR_DZ","L115A3_DZ","L115A3_2_DZ","Barrett_MRAD_Sniper_DZ","CZ750_DZ","Groza9_Sniper_DZ","Groza1_Sniper_DZ","HK417_Sniper_DZ","HK417_Sniper_SD_DZ","M1A_SC16_TAN_Sniper_DZ","M1A_SC16_BL_Sniper_DZ","M1A_SC2_BL_Sniper_DZ","M21_DZ","M21A5_DZ","M21A5_SD_DZ","M200_CheyTac_DZ","M200_CheyTac_SD_DZ","MK14_Sniper_DZ","MK14_Sniper_SD_DZ","MK17_Sniper_DZ","MK17_Sniper_SD_DZ","MSR_DZ","MSR_SD_DZ","MSR_NV_DZ","MSR_NV_SD_DZ","RSASS_DZ","RSASS_SD_DZ","SVU_PSO1_DZ","WA2000_DZ","XM8_Sharpsh_DZ","XM8_DES_Sharpsh_DZ","XM8_GREY_Sharpsh_DZ","XM2010_DZ","XM2010_SD_DZ","XM2010_NV_DZ","XM2010_NV_SD_DZ"];
DZMSSingleShot = ["Remington870_DZ","M1014_DZ","Winchester1866_DZ","LeeEnfield_DZ","CZ550_DZ","USAS12_DZ"];
DZMSThermal = ["BAF_L85A2_RIS_TWS_DZ","M249_TWS_EP1_Small","m8_tws","m8_tws_sd","SCAR_L_STD_EGLM_TWS","SCAR_H_STD_TWS_SD","M110_TWS_EP1","MSR_TWS_DZ","MSR_TWS_SD_DZ","XM2010_TWS_DZ","XM2010_TWS_SD_DZ","RSASS_TWS_DZ","RSASS_TWS_SD_DZ","m107_TWS_EP1_Small","BAF_AS50_TWS"];
// Weapon arrays that can spawn on the AI
DZMSAIWeps = [DZMSAssault,DZMSSMG,DZMSSingleShot,DZMSLMG,DZMSSniper];
// Weapon arrays that can spawn in the crates - Pistols spawn separately
DZMSCrateWeps = [DZMSAssault,DZMSLMG,DZMSSniper];
// Items and tools that can be added to crates
DZMSGeneralStore = ["ItemTent","ItemTentWinter","forest_net_kit","ItemMixOil","ItemWaterBottleSafe","ItemSodaCoke","ItemSodaPepsi","ItemSodaMdew","ItemSodaMtngreen","ItemSodaR4z0r","ItemSodaClays","ItemSodaSmasht","ItemSodaDrwaste","ItemSodaFranka","ItemSodaLemonade","ItemSodaLirik","ItemSodaLvg","ItemSodaMzly","ItemSodaPeppsy","ItemSodaRabbit","ItemSodaSacrite","ItemSodaRocketFuel","ItemSodaGrapeDrink","ItemSherbet","FoodPistachio","FoodNutmix","FoodChipsSulahoops","FoodChipsMysticales","FoodChipsChocolate","FoodCandyChubby","FoodCandyAnders","FoodCandyLegacys","FoodCandyMintception","FoodCakeCremeCakeClean","FoodCanBeef","FoodCanPotatoes","FoodCanGriff","FoodCanBadguy","FoodCanBoneboy","FoodCanCorn","FoodCanCurgon","FoodCanDemon","FoodCanFraggleos","FoodCanHerpy","FoodCanDerpy","FoodCanOrlok","FoodCanPowell","FoodCanTylers","FoodCanUnlabeled","FoodCanBakedBeans","FoodCanSardines","FoodCanFrankBeans","FoodCanPasta","FoodCanRusUnlabeled","FoodCanRusStew","FoodCanRusPork","FoodCanRusPeas","FoodCanRusMilk","FoodCanRusCorn","ItemJerrycan"];
DZMSCrateTools = ["ItemToolbox","ItemFishingPole","ItemGPS","ItemMap","ItemMachete","ItemKnife","ItemFlashlight","ItemMatchbox","ItemHatchet","Binocular_Vector","ItemKeyKit","Binocular","ItemCompass","NVGoggles_DZE","ItemRadio"];
DZMSMeds = [_bloodbag,"ItemBandage","ItemAntibiotic6","ItemPainkiller6","ItemMorphine","ItemAntibacterialWipe","ItemEpinephrine","ItemSepsisBandage","equip_woodensplint","FoodMRE","ItemWaterBottleSafe"];
DZMSPacks = ["Patrol_Pack_DZE1","Assault_Pack_DZE1","Czech_Vest_Pouch_DZE1","TerminalPack_DZE1","TinyPack_DZE1","ALICE_Pack_DZE1","TK_Assault_Pack_DZE1","CompactPack_DZE1","British_ACU_DZE1","GunBag_DZE1","NightPack_DZE1","SurvivorPack_DZE1","AirwavesPack_DZE1","CzechBackpack_DZE1","WandererBackpack_DZE1","LegendBackpack_DZE1","CoyoteBackpack_DZE1","LargeGunBag_DZE1"];
DZMSGrenades = ["HandGrenade_west","FlareGreen_M203","FlareWhite_M203"];
DZMSBuildSupply = [[7,"CinderBlocks"],[2,"MortarBucket"],[3,"ItemPole"],[3,"PartPlywoodPack"],[3,"PartPlankPack"],[3,"ItemSandbag"],[3,"ItemWire"],[1,"ItemFireBarrel_kit"],[1,"forest_large_net_kit"],[1,"ItemComboLock"],[3,"ItemTankTrap"],[1,"ItemRSJ"]]; // [Number to add to crate,Item]
DZMSCraftingSupply = ["ItemCanvas","equip_tent_poles","equip_nails","ItemScrews","equip_scrapelectronics","equip_floppywire","equip_metal_sheet","equip_1inch_metal_pipe","equip_2inch_metal_pipe","equip_rope","ItemLightBulb","ItemCorrugated","ItemMetalSheet"];
DZMSBuildTools = ["ItemCrowbar","ItemEtool","ItemToolbox","ItemSledgeHammer","ChainSaw","Hammer_DZE","ItemSledge","Handsaw_DZE","ItemSolder_DZE"];
DZMSVehAmmo = ["100Rnd_762x51_M240","1500Rnd_762x54_PKT","2000Rnd_762x51_M134","100Rnd_762x54_PK","100Rnd_127x99_M2","150Rnd_127x107_DSHKM"];
DZMSVehParts = ["PartEngine","PartFueltank","PartGeneric","PartGlass","PartVRotor","PartWheel","ItemFuelcan","ItemJerrycan","ItemFuelBarrel"];
DZMSHighValue = ["ItemTallSafe","ItemVault","ItemVault2","ItemLockbox","ItemLockbox2","ItemLockboxWinter","ItemLockboxWinter2","plot_pole_kit"];

View File

@ -0,0 +1,161 @@
/*
OverpochExtConfig.sqf
This config file is loaded in DZMSInit.sqf if both Epoch and Overwatch mods are detected.
It contains specific AI, Crate, and Vehicle configurations for DayZ Overpoch.
*/
// Generates keys for mission vehicles and places it in the gear. Only works if DZMSSaveVehicles is set to true and Epoch is detected.
DZMSMakeVehKey = true;
//If you have ZSC installed then you can set this to true to place money in ai wallets.
DZMSAICheckWallet = false;
// Do you want AI to use RPG7V's?
// Odd numbered AI will spawn with one if enabled.
DZMSUseRPG = false;
// Do you want static M2 heavy machine gunners at the missions? (Some of the easier missions don't have them).
DZMSM2Static = false;
///////////////////////////////////////////////
// Arrays of skin classnames for the AI to use
DZMSBanditSkins = ["Bandit1_DZ","BanditW1_DZ","TK_INS_Warlord_EP1_DZ","GUE_Commander_DZ"];
DZMSHeroSkins = ["Survivor3_DZ","Survivor2_DZ","SurvivorW2_DZ","Soldier1_DZ","Camo1_DZ","UN_CDF_Soldier_EP1"];
////////////////////////
// Array of AI Skills
DZMSSkills0 = [
["aimingAccuracy",0.10],
["aimingShake",0.45],
["aimingSpeed",0.45],
["endurance",0.40],
["spotDistance",0.30],
["spotTime",0.30],
["courage",0.40],
["reloadSpeed",0.50],
["commanding",0.40],
["general",0.40]
];
DZMSSkills1 = [
["aimingAccuracy",0.125],
["aimingShake",0.60],
["aimingSpeed",0.60],
["endurance",0.55],
["spotDistance",0.45],
["spotTime",0.45],
["courage",0.55],
["reloadSpeed",0.60],
["commanding",0.55],
["general",0.55]
];
DZMSSkills2 = [
["aimingAccuracy",0.15],
["aimingShake",0.75],
["aimingSpeed",0.70],
["endurance",0.70],
["spotDistance",0.60],
["spotTime",0.60],
["courage",0.70],
["reloadSpeed",0.70],
["commanding",0.70],
["general",0.70]
];
DZMSSkills3 = [
["aimingAccuracy",0.20],
["aimingShake",0.85],
["aimingSpeed",0.80],
["endurance",0.80],
["spotDistance",0.70],
["spotTime",0.70],
["courage",0.80],
["reloadSpeed",0.80],
["commanding",0.80],
["general",0.80]
];
// Set the bloodbag type
local _bloodbag = ["bloodBagONEG","ItemBloodbag"] select dayz_classicBloodBagSystem;
/////////////////////////////////////////////////////////////
// These are gear sets that will be randomly given to the AI
DZMSGear0 = [
["ItemBandage","ItemSepsisBandage","ItemAntibiotic6","ItemPainkiller6","ItemSodaGrapeDrink","FoodBaconCooked"],
["ItemKnife","ItemFlashlight"]
];
DZMSGear1 = [
["ItemBandage","ItemSepsisBandage","ItemPainkiller6","ItemMorphine","ItemSodaRocketFuel","FoodGoatCooked"],
["ItemToolbox","ItemEtool"]
];
DZMSGear2 = [
["ItemBandage","ItemAntibacterialWipe",_bloodbag,"ItemPainkiller6","ItemSodaSacrite","FishCookedTrout"],
["ItemMatchbox","ItemHatchet"]
];
DZMSGear3 = [
["ItemBandage","ItemSepsisBandage","ItemMorphine","ItemHeatPack","ItemSodaRabbit","FoodMRE"],
["ItemCrowbar","ItemMachete"]
];
DZMSGear4 = [
["ItemBandage","ItemAntibacterialWipe","ItemEpinephrine",_bloodbag,"ItemSodaMtngreen","FoodRabbitCooked"],
["ItemGPS","Binocular_Vector"]
];
// New to DayZ Epoch 1.0.7. Dog tags can be traded at hero and bandit vendors for +/- humanity.
DZMS_HeroDogTag = .15; // Chance for a dog tag on hero NPC: Between 0 and 1.
DZMS_BanditDogTag = .15; // Chance for a dog tag on bandit NPC: Between 0 and 1.
/////////////////////////////////////////////////////////////////////////////////////////////
// These are arrays of vehicle classnames for the missions.
//Armed Choppers
DZMSChoppers = ["BAF_Merlin_DZE","UH60M_MEV_EP1_DZ","CH_47F_EP1_DZE","UH1H_DZE","Mi17_DZE","UH60M_EP1_DZE","UH1Y_DZE","MH60S_DZE","UH1H_CDF_DZE","UH1H_WD_DZE","UH1H_2_DZE","UH1H_DES_DZE","UH1H_GREY_DZE","UH1H_BLACK_DZE","UH1H_SAR_DZE","Mi17_DZE","Mi17_TK_EP1_DZE","Mi17_UN_CDF_EP1_DZE","Mi17_CDF_DZE","Mi17_DES_DZE","Mi17_GREEN_DZE","Mi17_BLUE_DZE","Mi17_BLACK_DZE","Mi171Sh_CZ_EP1_DZE","MH60S_DZE","Ka60_GL_PMC_DZE","AW159_Lynx_BAF_DZE","UH60M_EP1_DZE","UH1Y_DZE","CH_47F_EP1_DZE","CH_47F_EP1_Black_DZE","CH_47F_EP1_GREY_DZE","CH_47F_EP1_DES_DZE","pook_transport_DZE","pook_transport_CDF_DZE","pook_gunship_DZE","pook_gunship_CDF_DZE"];
//Small Vehicles
DZMSSmallVic = ["hilux1_civil_3_open_DZE","SUV_TK_CIV_EP1_DZE","HMMWV_DZ","UAZ_Unarmed_UN_EP1_DZE","HMMWV_Ambulance_CZ_DES_EP1_DZE","LandRover_TK_CIV_EP1_DZE","SUV_Camo","Nissan_Orange_DZE","BTR40_TK_INS_EP1_DZE","Jeep_DZE","ScrapAPC_DZE","Tractor_Armored_DZE"];
//Large Vehicles
DZMSLargeVic = ["Kamaz_DZE","MTVR_DES_EP1_DZE","Ural_INS_DZE","Ural_CDF_DZE","Ural_TK_CIV_EP1_DZE","Ural_UN_EP1_DZE","V3S_Open_TK_CIV_EP1_DZE","V3S_Open_TK_EP1_DZE","T810A_ACR_DZE","T810A_ACR_DES_DZE","T810A_ACR_OPEN_DZE","T810A_ACR_DES_OPEN_DZE","MTVR_Open_DZE","MTVR_DZE"];
////////////////////////////////////////////////////////////////
// Weapons that can be added to AI or crates
DZMSPistol = ["RH_m9","RH_m9c","RH_m93r","RH_M9sd","RH_m9csd","RH_browninghp","vil_B_HP","RH_anac","RH_anacg","RH_python","RH_deagle","RH_Deagleg","RH_Deaglem","RH_Deaglemzb","RH_Deaglemz","RH_Deagles","vil_Glock","RH_g17","vil_Glock_o","RH_g17sd","RH_g18","RH_g19","RH_g19t","RH_tec9","RH_m1911","RH_m1911sd","RH_m1911old","RH_mk22","RH_mk22sd","RH_mk22v","RH_mk22vsd","RH_p38","RH_ppk","RH_mk2","RH_p226","RH_p226s","RH_bull","RH_tt33","RH_usp","RH_uspm","RH_uspsd","vil_USP45","vil_USP45SD","vil_USP","vil_USPSD","RH_vz61"];
DZMSAK = ["vil_AEK2","vil_AEK_GL","vil_AeK_3","vil_AeK_23","vil_AeK_3_K","vil_AK_105","Vil_AK_105_c","vil_AK_101","vil_AK_103","vil_AK_107","Vil_AK_107_c","vil_ak12","vil_ak12_ap","vil_ak12_gp","vil_AK_47","vil_AK_47_49","vil_AK_47_m1","vil_AK_47","vil_AK_74_N","vil_AK_74P","vil_AK_74m","vil_AK_74m_p29","vil_AK_74m_EOT_Alfa","vil_AK_74m_gp_29","vil_AK_74m_gp","vil_AK_74m_EOT","vil_AK_74m_EOT_FSB","vil_AK_74m_EOT_FSB_60","vil_AK_74m_EOT_FSB_45","vil_AK_74m_c","vil_AK_74m_k","vil_AK_74m_PSO","vil_AKM","vil_AKM_GL","vil_AKMS","vil_AKMS_GP25","vil_AKMSB","vil_AKS_47","vil_AKS_74","vil_AKS_74_gp","vil_AKS_74p_gp","vil_AKS_74p","vil_AKS_74p_45","vil_AKs_74_u","vil_AKs_74_u45","Vil_AKS_74_UB","Vil_AKS_74_UN_kobra","vil_AMD63","vil_AMD","vil_Abakan","vil_Abakan_P29","vil_Abakan_gp","vil_AK_nato_m1","vil_ASH82","vil_MPi","vil_PMI74S","vil_PMI","vil_PMIS","vil_type88_1","vil_M64","vil_M70","vil_M70B","vil_AK_nato_m80"];
DZMSSpare = ["vil_Galil","vil_Galil_arm","vil_SKS","gms_k98","gms_k98_knife","gms_k98_rg","gms_k98zf39"];
DZMSACRSD = ["FHQ_ACR_BLK_CCO_GL_SD","FHQ_ACR_TAN_CCO_GL_SD","FHQ_ACR_SNW_CCO_GL_SD","FHQ_ACR_WDL_CCO_GL_SD","FHQ_ACR_BLK_CCO_SD","FHQ_ACR_TAN_CCO_SD","FHQ_ACR_SNW_CCO_SD","FHQ_ACR_WDL_CCO_SD","FHQ_ACR_BLK_G33_GL_SD","FHQ_ACR_TAN_G33_GL_SD","FHQ_ACR_SNW_G33_GL_SD","FHQ_ACR_WDL_G33_GL_SD","FHQ_ACR_BLK_G33_SD","FHQ_ACR_TAN_G33_SD","FHQ_ACR_SNW_G33_SD","FHQ_ACR_WDL_G33_SD","FHQ_ACR_BLK_HAMR_GL_SD","FHQ_ACR_TAN_HAMR_GL_SD","FHQ_ACR_SNW_HAMR_GL_SD","FHQ_ACR_WDL_HAMR_GL_SD","FHQ_ACR_BLK_HAMR_SD","FHQ_ACR_TAN_HAMR_SD","FHQ_ACR_SNW_HAMR_SD","FHQ_ACR_WDL_HAMR_SD","FHQ_ACR_BLK_HWS_GL_SD","FHQ_ACR_TAN_HWS_GL_SD","FHQ_ACR_SNW_HWS_GL_SD","FHQ_ACR_WDL_HWS_GL_SD","FHQ_ACR_BLK_HWS_SD","FHQ_ACR_TAN_HWS_SD","FHQ_ACR_SNW_HWS_SD","FHQ_ACR_WDL_HWS_SD","FHQ_ACR_BLK_IRN_GL_SD","FHQ_ACR_TAN_IRN_GL_SD","FHQ_ACR_SNW_IRN_GL_SD","FHQ_ACR_WDL_IRN_GL_SD","FHQ_ACR_BLK_RCO_GL_SD","FHQ_ACR_TAN_RCO_GL_SD","FHQ_ACR_SNW_RCO_GL_SD","FHQ_ACR_WDL_RCO_GL_SD","FHQ_ACR_BLK_RCO_SD","FHQ_ACR_TAN_RCO_SD","FHQ_ACR_SNW_RCO_SD","FHQ_ACR_WDL_RCO_SD","FHQ_ACR_BLK_IRN_SD","FHQ_ACR_TAN_IRN_SD","FHQ_ACR_SNW_IRN_SD","FHQ_ACR_WDL_IRN_SD"];
DZMSACR = ["FHQ_ACR_BLK_IRN","FHQ_ACR_TAN_IRN","FHQ_ACR_SNW_IRN","FHQ_ACR_WDL_IRN","FHQ_ACR_BLK_CCO","FHQ_ACR_TAN_CCO","FHQ_ACR_SNW_CCO","FHQ_ACR_WDL_CCO","FHQ_ACR_BLK_CCO_GL","FHQ_ACR_TAN_CCO_GL","FHQ_ACR_SNW_CCO_GL","FHQ_ACR_WDL_CCO_GL","FHQ_ACR_BLK_G33","FHQ_ACR_TAN_G33","FHQ_ACR_SNW_G33","FHQ_ACR_WDL_G33","FHQ_ACR_BLK_G33_GL","FHQ_ACR_TAN_G33_GL","FHQ_ACR_SNW_G33_GL","FHQ_ACR_WDL_G33_GL","FHQ_ACR_BLK_HAMR","FHQ_ACR_TAN_HAMR","FHQ_ACR_SNW_HAMR","FHQ_ACR_WDL_HAMR","FHQ_ACR_BLK_HAMR_GL","FHQ_ACR_TAN_HAMR_GL","FHQ_ACR_SNW_HAMR_GL","FHQ_ACR_WDL_HAMR_GL","FHQ_ACR_BLK_HWS","FHQ_ACR_TAN_HWS","FHQ_ACR_SNW_HWS","FHQ_ACR_WDL_HWS","FHQ_ACR_BLK_HWS_GL","FHQ_ACR_TAN_HWS_GL","FHQ_ACR_SNW_HWS_GL","FHQ_ACR_WDL_HWS_GL","FHQ_ACR_BLK_IRN_GL","FHQ_ACR_TAN_IRN_GL","FHQ_ACR_SNW_IRN_GL","FHQ_ACR_WDL_IRN_GL","FHQ_ACR_BLK_RCO","FHQ_ACR_TAN_RCO","FHQ_ACR_SNW_RCO","FHQ_ACR_WDL_RCO","FHQ_ACR_BLK_RCO_GL","FHQ_ACR_TAN_RCO_GL","FHQ_ACR_SNW_RCO_GL","FHQ_ACR_WDL_RCO_GL"];
DZMSSCAR = ["SCAR_L_CQC_CCO_SD","SCAR_L_CQC","SCAR_L_CQC_Holo","SCAR_L_CQC_EGLM_Holo","SCAR_L_STD_EGLM_RCO","SCAR_L_STD_HOLO","SCAR_L_STD_Mk4CQT","SCAR_H_CQC_CCO","SCAR_H_CQC_CCO_SD","SCAR_H_STD_EGLM_Spect","SCAR_H_LNG_Sniper","SCAR_H_LNG_Sniper_SD"];
DZMSSMG = ["vil_9a91","vil_9a91_c","vil_9a91_csd","vil_VAL","vil_VAL_C","vil_Groza_HG","vil_Groza_GL","vil_Groza_SC","vil_Groza_SD","vil_Vikhr","vil_vsk94","vil_MP5_EOTech","vil_MP5SD_EOTech","vil_uzimini","vil_uzimini_SD","vil_uzi","vil_uzi_c","vil_uzi_SD"];
DZMSSniper = ["USSR_cheytacM200","USSR_cheytacM200_sd","vil_SVD_63","vil_SVD_N","vil_SVD_M","vil_SVD_P21","vil_SVD_S","FHQ_MSR_DESERT","FHQ_MSR_NV_DESERT","FHQ_MSR_NV_SD_DESERT","FHQ_MSR_SD_DESERT","FHQ_RSASS_TAN","FHQ_RSASS_SD_TAN","vil_SV_98_69","vil_SV_98","vil_SV_98_SD","vil_SVDK","FHQ_XM2010_DESERT","FHQ_XM2010_NV_DESERT","FHQ_XM2010_NV_SD_DESERT","FHQ_XM2010_SD_DESERT"];
DZMSTavor = ["RH_ctar21","RH_ctar21glacog","RH_ctar21m","RH_ctar21mgl","RH_star21"];
DZMSG3 = ["vil_AG3","vil_G3a2","vil_G3a3","vil_G3an","vil_G3anb","vil_G3SG1","vil_G3sg1b","vil_G3TGS","vil_G3TGSb","vil_G3ZF","vil_G3zfb","vil_G3a4","vil_G3a4b"];
DZMSMasada = ["RH_masacog","RH_masaim","RH_masbaim","RH_masb","RH_masbeotech","RH_mas","RH_massd","RH_massdacog","RH_masbsdacog","RH_massdaim","RH_masbsdaim","RH_masbsd","RH_massdeotech","RH_masbsdeotech"];
DZMSLMG = ["vil_RPK75_Romania","vil_M240_B","vil_M249_Para","skavil_M60","skavil_M60e3","vil_Mg3","vil_MG4","vil_MG4E","vil_PKP","vil_PKP_EOT","vil_PK","vil_PKM","vil_RPD","vil_RPK","vil_RPK75","vil_RPK74","vil_RPK74M","vil_RPK74M_P29","vil_RPK75_M72","vil_zastava_m84"];
DZMSHk417 = ["RH_hk417","RH_hk417acog","RH_hk417aim","RH_hk417s","RH_hk417sacog","RH_hk417saim","RH_hk417seotech","RH_hk417eotech","RH_hk417sd","RH_hk417sdacog","RH_hk417sdaim","RH_hk417sdeotech","RH_hk417sdsp","RH_hk417sp","RH_hk417sglacog","RH_hk417sgl","RH_hk417sglaim","RH_hk417sgleotech"];
DZMSHk416 = ["RH_hk416","RH_hk416glacog","RH_hk416gl","RH_hk416aim","RH_hk416glaim","RH_hk416s","RH_hk416sacog","RH_hk416sglacog","RH_hk416saim","RH_hk416sglaim","RH_hk416seotech","RH_hk416sgleotech","RH_hk416sgl","RH_hk416eotech","RH_hk416gleotech","RH_hk416sd","RH_hk416sdgl","RH_hk416sdglaim","RH_hk416sdeotech","RH_hk416sdgleotech"];
DZMSG36 = ["vil_AG36KA4","vil_AG36KV","vil_G36KSKdes","vil_G36KA4","vil_G36KSKES","vil_G36KSKdesES","vil_G36KES","vil_G36KVZ","vil_G36KSK","vil_G36VA4Eot","vil_G36KV3","vil_G36KVA4","vil_G36KV3Des","vil_G36VA4","vil_AG36","vil_G36a2","vil_AG36A2","vil_G36CC","vil_G36E"];
DZMSHkDMR = ["vil_HK417s","vil_M110","vil_M110sd","RH_m14","vil_M14G","RH_m14acog","RH_m14aim","RH_m14eot","RH_m1s","RH_m1sacog","RH_m1saim","RH_m1seot","RH_m1sshd","RH_m1ssp","RH_m1st","RH_m1stacog","RH_m1staim","RH_m1steot","RH_m1stshd","RH_m1stsp","RH_m21","vil_M21G","RH_sc2","RH_sc2acog","RH_sc2aim","RH_sc2eot","RH_sc2shd","RH_sc2sp","vil_SR25","vil_SR25SD"];
// Weapon arrays that can spawn on the AI
DZMSAIWeps = [DZMSAK,DZMSSpare,DZMSACRSD,DZMSACR,DZMSSCAR,DZMSSMG,DZMSSniper,DZMSTavor,DZMSG3,DZMSMasada,DZMSLMG,DZMSHk417,DZMSHk416,DZMSG36,DZMSHkDMR];
// Weapon arrays that can spawn in the crates - Pistols spawn separately
DZMSCrateWeps = [DZMSAK,DZMSSpare,DZMSACRSD,DZMSACR,DZMSSCAR,DZMSSMG,DZMSSniper,DZMSTavor,DZMSG3,DZMSMasada,DZMSLMG,DZMSHk417,DZMSHk416,DZMSG36,DZMSHkDMR];
// Items and tools that can be added to crates
DZMSGeneralStore = ["ItemTent","ItemTentWinter","forest_net_kit","ItemMixOil","ItemWaterBottleSafe","ItemSodaCoke","ItemSodaPepsi","ItemSodaMdew","ItemSodaMtngreen","ItemSodaR4z0r","ItemSodaClays","ItemSodaSmasht","ItemSodaDrwaste","ItemSodaFranka","ItemSodaLemonade","ItemSodaLirik","ItemSodaLvg","ItemSodaMzly","ItemSodaPeppsy","ItemSodaRabbit","ItemSodaSacrite","ItemSodaRocketFuel","ItemSodaGrapeDrink","ItemSherbet","FoodPistachio","FoodNutmix","FoodChipsSulahoops","FoodChipsMysticales","FoodChipsChocolate","FoodCandyChubby","FoodCandyAnders","FoodCandyLegacys","FoodCandyMintception","FoodCakeCremeCakeClean","FoodCanBeef","FoodCanPotatoes","FoodCanGriff","FoodCanBadguy","FoodCanBoneboy","FoodCanCorn","FoodCanCurgon","FoodCanDemon","FoodCanFraggleos","FoodCanHerpy","FoodCanDerpy","FoodCanOrlok","FoodCanPowell","FoodCanTylers","FoodCanUnlabeled","FoodCanBakedBeans","FoodCanSardines","FoodCanFrankBeans","FoodCanPasta","FoodCanRusUnlabeled","FoodCanRusStew","FoodCanRusPork","FoodCanRusPeas","FoodCanRusMilk","FoodCanRusCorn","ItemJerrycan"];
DZMSCrateTools = ["ItemToolbox","ItemFishingPole","ItemGPS","ItemMap","ItemMachete","ItemKnife","ItemFlashlight","ItemMatchbox","ItemHatchet","Binocular_Vector","ItemKeyKit","Binocular","ItemCompass","NVGoggles_DZE","ItemRadio"];
DZMSMeds = [_bloodbag,"ItemBandage","ItemAntibiotic6","ItemPainkiller6","ItemMorphine","ItemAntibacterialWipe","ItemEpinephrine","ItemSepsisBandage","equip_woodensplint","FoodMRE","ItemWaterBottleSafe"];
DZMSPacks = ["Patrol_Pack_DZE1","Assault_Pack_DZE1","Czech_Vest_Pouch_DZE1","TerminalPack_DZE1","TinyPack_DZE1","ALICE_Pack_DZE1","TK_Assault_Pack_DZE1","CompactPack_DZE1","British_ACU_DZE1","GunBag_DZE1","NightPack_DZE1","SurvivorPack_DZE1","AirwavesPack_DZE1","CzechBackpack_DZE1","WandererBackpack_DZE1","LegendBackpack_DZE1","CoyoteBackpack_DZE1","LargeGunBag_DZE1"];
DZMSGrenades = ["HandGrenade_west","FlareGreen_M203","FlareWhite_M203"];
DZMSBuildSupply = [[3,"CinderBlocks"],[1,"MortarBucket"],[3,"ItemPole"],[3,"PartPlywoodPack"],[3,"PartPlankPack"],[3,"ItemSandbag"],[3,"ItemWire"],[1,"ItemFireBarrel_kit"],[1,"forest_large_net_kit"],[1,"ItemComboLock"],[3,"ItemTankTrap"],[1,"ItemRSJ"]]; // [Number to add to crate,Item]
DZMSCraftingSupply = ["equip_tent_poles","equip_nails","ItemScrews","equip_scrapelectronics","equip_floppywire","equip_metal_sheet","equip_1inch_metal_pipe","equip_2inch_metal_pipe","equip_rope","ItemLightBulb","ItemCorrugated","ItemMetalSheet"];
DZMSBuildTools = ["ItemCrowbar","ItemEtool","ItemToolbox","ItemSledgeHammer","ChainSaw","Hammer_DZE","ItemSledge","Handsaw_DZE","ItemSolder_DZE"];
DZMSVehAmmo = ["100Rnd_762x51_M240","1500Rnd_762x54_PKT","2000Rnd_762x51_M134","100Rnd_762x54_PK","100Rnd_127x99_M2","150Rnd_127x107_DSHKM"];
DZMSVehParts = ["PartEngine","PartFueltank","PartGeneric","PartGlass","PartVRotor","PartWheel","ItemFuelcan","ItemJerrycan","ItemFuelBarrel"];
DZMSHighValue = ["ItemTallSafe","ItemVault","ItemVault2","ItemLockbox","ItemLockbox2","ItemLockboxWinter","ItemLockboxWinter2","plot_pole_kit"];

View File

@ -0,0 +1,133 @@
/*
VanillaExtConfig.sqf
This config file is loaded in DZMSInit.sqf if the Vanilla DayZ Mod is detected.
It contains specific AI, Crate, and Vehicle configurations for DayZ Vanilla Mod.
*/
///////////////////////////////////////////////
// Arrays of skin classnames for the AI to use
DZMSBanditSkins = ["Bandit1_DZ","BanditW1_DZ","TK_GUE_Soldier_Sniper_EP1","TK_Soldier_Officer_EP1"];
DZMSHeroSkins = ["Survivor3_DZ","Survivor2_DZ","SurvivorW2_DZ","Soldier1_DZ","Camo1_DZ","UN_CDF_Soldier_EP1","CZ_Soldier_DES_EP1","UN_CDF_Soldier_Officer_EP1"];
////////////////////////
// Array of AI Skills
DZMSSkills0 = [
["aimingAccuracy",0.10],
["aimingShake",0.45],
["aimingSpeed",0.45],
["endurance",0.40],
["spotDistance",0.30],
["spotTime",0.30],
["courage",0.40],
["reloadSpeed",0.50],
["commanding",0.40],
["general",0.40]
];
DZMSSkills1 = [
["aimingAccuracy",0.125],
["aimingShake",0.60],
["aimingSpeed",0.60],
["endurance",0.55],
["spotDistance",0.45],
["spotTime",0.45],
["courage",0.55],
["reloadSpeed",0.60],
["commanding",0.55],
["general",0.55]
];
DZMSSkills2 = [
["aimingAccuracy",0.15],
["aimingShake",0.75],
["aimingSpeed",0.70],
["endurance",0.70],
["spotDistance",0.60],
["spotTime",0.60],
["courage",0.70],
["reloadSpeed",0.70],
["commanding",0.70],
["general",0.70]
];
DZMSSkills3 = [
["aimingAccuracy",0.20],
["aimingShake",0.85],
["aimingSpeed",0.80],
["endurance",0.80],
["spotDistance",0.70],
["spotTime",0.70],
["courage",0.80],
["reloadSpeed",0.80],
["commanding",0.80],
["general",0.80]
];
// Set the bloodbag type
local _bloodbag = ["bloodBagONEG","ItemBloodbag"] select dayz_classicBloodBagSystem;
/////////////////////////////////////////////////////////////
// These are gear sets that will be randomly given to the AI
DZMSGear0 = [
["ItemBandage","ItemBandage","ItemAntibiotic","ItemPainkiller","ItemSodaGrapeDrink","FoodBaconCooked"],
["ItemKnife","ItemFlashlight"]
];
DZMSGear1 = [
["ItemBandage","ItemBandage","ItemPainkiller","ItemMorphine","ItemSodaRocketFuel","FoodGoatCooked"],
["ItemToolbox","ItemEtool"]
];
DZMSGear2 = [
["ItemBandage","ItemAntibacterialWipe",_bloodbag,"ItemPainkiller","ItemSodaSacrite","FishCookedTrout"],
["ItemMatchbox","ItemHatchet"]
];
DZMSGear3 = [
["ItemBandage","ItemBandage","ItemMorphine","ItemHeatPack","ItemSodaRabbit","FoodMRE"],
["ItemCrowbar","ItemMachete"]
];
DZMSGear4 = [
["ItemBandage","ItemAntibacterialWipe","ItemEpinephrine",_bloodbag,"ItemSodaMtngreen","FoodRabbitCooked"],
["ItemGPS","Binocular_Vector"]
];
/////////////////////////////////////////////////////////////////////////////////////////////
// These are arrays of vehicle classnames for the missions.
//Armed Choppers
DZMSChoppers = ["UH1H_DZ","Mi17_DZ","UH1H_2_DZ"];
//Small Vehicles
DZMSSmallVic = ["hilux1_civil_3_open_EP1","SUV_TK_CIV_EP1","HMMWV_DZ","UAZ_Unarmed_UN_EP1","BAF_Offroad_D"];
//Large Vehicles
DZMSLargeVic = ["Ural_TK_CIV_EP1","Ural_INS","V3S_Civ"];
////////////////////////////////////////////////////////////////
// Weapons Arrays - These can be adjusted as desired or make your own custom arrays
DZMSPistol = ["M9_DZ","M9_SD_DZ","G17_DZ","G17_SD_DZ","Makarov_DZ","Makarov_SD_DZ","Revolver_DZ","M1911_DZ","PDW_DZ"];
DZMSAssault = ["M16A2_DZ","M4A1_DZ","M4A1_SD_DZ","SA58_RIS_DZ","L85A2_DZ","L85A2_SD_DZ","AKM_DZ","G36C_DZ","G36C_SD_DZ","G36A_Camo_DZ","G36K_Camo_DZ","G36K_Camo_SD_DZ"];
DZMSLMG = ["L110A1_DZ","M249_DZ","M240_DZ","Mk48_DZ","RPK_DZ","UK59_DZ","PKM_DZ"];
DZMSSMG = ["Bizon_DZ","Bizon_SD_DZ","MP5_DZ","MP5_SD_DZ"];
DZMSSniper = ["Mosin_PU_DZ","M4SPR","M14_DZ","M24_DZ","M24_des_EP1","M40A3_DZ","SVD_DZ","SVD_des_EP1","FNFAL_DZ","DMR_DZ","L115A3_DZ","L115A3_2_DZ"];
DZMSSingleShot = ["Remington870_DZ","M1014_DZ","Winchester1866_DZ","LeeEnfield_DZ","CZ550_DZ"];
// Weapon arrays that can spawn on the AI. Because I want mostly assault rifles, I add them to the array multiple times to increase the frequency
DZMSAIWeps = [DZMSAssault,DZMSAssault,DZMSAssault,DZMSAssault,DZMSSMG,DZMSSingleShot,DZMSLMG,DZMSSniper];
// Weapon arrays that can spawn in the crates. Pistols spawn separately
DZMSCrateWeps = [DZMSAssault,DZMSAssault,DZMSAssault,DZMSLMG,DZMSSniper];
// Items and tools that can be added to crates
DZMSGeneralStore = ["ItemSandbag","equip_string","equip_duct_tape","equip_rope","equip_herb_box","equip_pvc_box","equip_lever","equip_rag","ItemJerrycan","PartWoodPile","ItemTent","ItemDomeTent","ItemWaterBottleSafe","ItemSodaCoke","ItemSodaPepsi","ItemSodaMdew","ItemSodaMtngreen","ItemSodaR4z0r","ItemSodaClays","ItemSodaSmasht","ItemSodaDrwaste","ItemSodaFranka","ItemSodaLemonade","ItemSodaLirik","ItemSodaLvg","ItemSodaMzly","ItemSodaPeppsy","ItemSodaRabbit","ItemSodaSacrite","ItemSodaRocketFuel","ItemSodaGrapeDrink","ItemSherbet","FoodPistachio","FoodNutmix","FoodChipsSulahoops","FoodChipsMysticales","FoodChipsChocolate","FoodCandyChubby","FoodCandyAnders","FoodCandyLegacys","FoodCandyMintception","FoodCakeCremeCakeClean","FoodCanBeef","FoodCanPotatoes","FoodCanGriff","FoodCanBadguy","FoodCanBoneboy","FoodCanCorn","FoodCanCurgon","FoodCanDemon","FoodCanFraggleos","FoodCanHerpy","FoodCanDerpy","FoodCanOrlok","FoodCanPowell","FoodCanTylers","FoodCanUnlabeled","FoodCanBakedBeans","FoodCanSardines","FoodCanFrankBeans","FoodCanPasta","FoodCanRusUnlabeled","FoodCanRusStew","FoodCanRusPork","FoodCanRusPeas","FoodCanRusMilk","FoodCanRusCorn"];
DZMSCrateTools = ["ItemToolbox","ItemFishingPole","ItemGPS","ItemMap","ItemMachete","ItemKnife","ItemFlashlight","ItemMatchbox","ItemHatchet","Binocular_Vector"];
DZMSMeds = [_bloodbag,"ItemBandage","ItemAntibiotic","ItemPainkiller","ItemMorphine","ItemAntibacterialWipe","ItemEpinephrine","FoodMRE","ItemWaterBottleSafe"];
DZMSPacks = ["DZ_Patrol_Pack_EP1","DZ_Assault_Pack_EP1","DZ_Czech_Vest_Pouch","DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1","DZ_British_ACU","DZ_CivilBackpack_EP1","DZ_Backpack_EP1"];
DZMSGrenades = ["HandGrenade_west","FlareGreen_M203","FlareWhite_M203"];
DZMSBuildSupply = [[2,"equip_1inch_metal_pipe"],[2,"equip_2inch_metal_pipe"],[2,"equip_metal_sheet"],[2,"equip_metal_sheet_rusted"],[5,"ItemStone"],[3,"ItemPlank"],[4,"ItemLog"],[1,"ItemCamonet"]]; // [Number to add to crate,Item]
DZMSCraftingSupply = ["ItemScrews","ItemPadlock","ItemRSJ","ItemConcreteBlock","equip_nails","equip_rag","equip_rope","equip_duct_tape","equip_string","equip_comfreyleafs","equip_herb_box"];
DZMSBuildTools = ["ItemCrowbar","ItemEtool","ItemToolbox","ItemSledgeHammer","ItemShovel","ItemPickaxe","ItemDIY_wood","ItemDIY_Gate"];
DZMSVehAmmo = ["100Rnd_762x51_M240","100Rnd_762x54_PK","150Rnd_127x107_DSHKM"]; // Not sure if can use 150Rnd_127x107_DSHKM
DZMSVehParts = ["PartEngine","PartFueltank","PartGeneric","PartGlass","PartVRotor","PartWheel","ItemFuelcan","ItemJerrycan"];

View File

@ -0,0 +1,281 @@
/*
AN-2 Bandit Supply Drop by Vampire
Example Code by Halv
Updated for DZMS 2.0 by JasonTM
*/
uiSleep 2;
local _markBox = true; // Mark the location of the crate once it's on the ground.
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _name = "AN2 Supply Drop";
local _localName = "STR_CL_DZMS_AN2_TITLE";
local _coords = call DZMSFindPos;
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _dotMarker = "DZMSDot" + str _mission;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,_dotMarker,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_AN2_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_AN2_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
//Lets get the AN2 Flying
local _dist = 8000; // increase or decrease this number to adjust the time it takes the plane to get to the mission.
local _porM = if (random 1 > .5) then {"+"} else {"-"};
local _porM2 = if (random 1 > .5) then {"+"} else {"-"};
local _startPos = call compile format ["[(%1 select 0) %2 %4,(%1 select 1) %3 %4, 300]",_coords,_porM,_porM2,_dist];
local _plane = "AN2_DZ" createVehicle _startPos;
local _dir = [_plane, _coords] call BIS_fnc_relativeDirTo;
_plane setDir _dir;
_plane setPos _startPos;
_plane setVelocity [(sin _dir*150),(cos _dir*150),0];
_plane engineOn true;
_plane flyInHeight 150;
_plane forceSpeed 175;
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor, _plane];
//Lets make AI for the plane and get them in it
local _aiGrp = createGroup east;
local _pilot = _aiGrp createUnit ["SurvivorW2_DZ",getPos _plane,[],0,"FORM"];
_pilot moveInDriver _plane;
//_pilot assignAsDriver _plane;
local _wp = _aiGrp addWaypoint [[(_coords select 0), (_coords select 1),150], 0];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "CARELESS";
_wp_pos = waypointPosition [_aiGrp,1];
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[_coords,6,1,_aiType,_mission] call DZMSAISpawn;
[_coords,6,2,_aiType,_mission] call DZMSAISpawn;
[_coords,4,3,_aiType,_mission] call DZMSAISpawn;
uiSleep 2;
local _aiCount = (DZMSMissionData select _mission) select 0;
local _groups = (DZMSMissionData select _mission) select 4;
local _staticGuns = (DZMSMissionData select _mission) select 5;
local _killReq = _aiCount - (DZMSRequiredKillPercent * _aiCount);
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _missionName = ["Bandit " + _name,"Hero " + _name] select _hero;
local _text = "";
local _autoMarkDot = "DZMSAutoDot" + str _mission;
local _autoText = "";
// Add AI counter if enabled.
if (DZMSAICount) then {
_text = if (_hero) then {
["STR_CL_MISSION_HERO_COUNT",_localName,_aiCount,"STR_CL_MISSION_HEROS"];
} else {
["STR_CL_MISSION_BANDIT_COUNT",_localName,_aiCount,"STR_CL_MISSION_BANDITS"];
};
PVDZ_ServerMarkerSend = ["textSingle",[_dotMarker,_text]];
publicVariable "PVDZ_ServerMarkerSend";
(_markers select 1) set [7, _text];
DZE_ServerMarkerArray set [_markerIndex, _markers];
};
local _half = false;
local _complete = false;
local _dropped = false;
local _crates = [];
local _chute = "";
local _box = "";
local _closestPlayer = objNull;
local _acArray = [];
local _claimed = false;
local _acTime = diag_tickTime;
local _claimTime = 0;
local _left = false;
local _leftTime = 0;
local _warnArray = [];
local _playerNear = false;
local _newCount = 0;
while {!_complete} do {
_newCount = (DZMSMissionData select _mission) select 0;
if (DZMSAICount) then {
// Check to see if the AI count has changed and update the marker.
if (_newCount != _aiCount) then {
_aiCount = _newCount;
_text = if (_hero) then {
["STR_CL_MISSION_HERO_COUNT",_localName,_aiCount,"STR_CL_MISSION_HEROS"];
} else {
["STR_CL_MISSION_BANDIT_COUNT",_localName,_aiCount,"STR_CL_MISSION_BANDITS"];
};
(_markers select 1) set [7, _text];
PVDZ_ServerMarkerSend = ["textSingle",[_dotMarker,_text]];
publicVariable "PVDZ_ServerMarkerSend";
DZE_ServerMarkerArray set [_markerIndex, _markers];
};
};
if (DZMSAutoClaim) then {
#include "\z\addons\dayz_server\DZMS\Scripts\DZMSAutoClaim.sqf"
};
if (!alive _plane && !_dropped) exitWith {
deleteVehicle _pilot;
[_coords,_mission,[],[],[],_groups,_staticGuns,_posIndex,true] spawn DZMSCleanupThread;
[_aiType,"STR_CL_DZMS_AN2_TITLE","STR_CL_DZMS_AN2_DEST"] call DZMSMessage;
};
if ((_plane distance _wp_pos) <= 1200 && !_half) then {
[_aiType,"STR_CL_DZMS_AN2_TITLE","STR_CL_DZMS_AN2_CLOSE"] call DZMSMessage;
//Keep on truckin'
_plane forceSpeed 175;
_plane flyInHeight 135;
_plane setSpeedMode "LIMITED";
_half = true;
};
// Check for near players
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
// If player is within range of the mission reset the start timer.
if (_playerNear) then {_startTime = diag_tickTime;};
if ((_plane distance _wp_pos) <= 200 && !_dropped) then {
//Drop the package
uiSleep 2; // let the plane get close to the mission center
local _dropDir = getDir _plane;
local _newPos = [(getPosATL _plane select 0) - 15*sin(_dropDir), (getPosATL _plane select 1) - 15*cos(_dropDir), (getPosATL _plane select 2) - 10];
[_aiType,"STR_CL_DZMS_AN2_TITLE","STR_CL_DZMS_AN2_DROP"] call DZMSMessage;
_chute = createVehicle ["ParachuteMediumEast", _newPos, [], 0, "FLY"];
_chute setPos _newPos;
_box = [_mission,_coords,"DZ_AmmoBoxBigUS","weapons",[0,0,200]] call DZMSSpawnCrate;
_box attachTo [_chute, [0, 0, 1]];
deleteWaypoint [_aiGrp, 1];
local _wp2 = _aiGrp addWaypoint [[0,0,150], 0];
_wp2 setWaypointType "MOVE";
_wp2 setWaypointBehaviour "CARELESS";
_plane forceSpeed 350;
_plane setSpeedmode "FULL";
_dropped = true;
};
if (_dropped) then {
//The box was dropped, lets get it on the ground.
// If the descent takes more than 45 seconds the chute is probably stuck in a tree.
if (isNil "_fallCount") then {
local _fallCount = 0;
while {_fallCount < 90} do {
uiSleep .5;
//if ((([_chute] call FNC_GetPos) select 2) < 2) then {_fallCount = 91};
if ((([_box] call FNC_GetPos) select 2) < 2) then {_fallCount = 91};
_fallCount = _fallCount + .5;
};
detach _box;
_coords = [(getPos _box select 0), (getPos _box select 1), 0];
_box setPos _coords;
deleteVehicle _chute;
if (_markBox) then {
_markers set [4, [_coords,"DZMSCrateDot" + str _coords,"ColorBlack","Vehicle","","",[],["STR_EPOCH_BULK_NAME"],0]];
DZE_ServerMarkerArray set [_markerIndex, _markers];
PVDZ_ServerMarkerSend = ["createSingle",(_markers select 4)];
publicVariable "PVDZ_ServerMarkerSend";
};
};
// Timeout the mission if a player is not near
if ((diag_tickTime - _startTime) > (DZMSMissionTimeOut * 60) && !_playerNear) then {
_crates = (DZMSMissionData select _mission) select 3;
[_coords,_mission,[],[],_crates,_groups,_staticGuns,_posIndex,true] spawn DZMSCleanupThread;
[_aiType,"STR_CL_DZMS_AN2_TITLE","STR_CL_DZMS_AN2_FAIL"] call DZMSMessage;
_complete = true;
};
// Check for completion
if (_newCount <= _killReq) then {
if ([_coords,10] call DZMSNearPlayer) then {
_complete = true;
[_aiType,"STR_CL_DZMS_AN2_TITLE","STR_CL_DZMS_AN2_WIN"] call DZMSMessage;
// Spawn loot in the crate
_crates = (DZMSMissionData select _mission) select 3;
{
[(_x select 0),(_x select 1)] call DZMSBoxSetup;
} count _crates;
if (DZMSSceneryDespawnTimer > 0) then {
[_coords,_mission,[],[],_crates,_groups,_staticGuns,_posIndex,false] spawn DZMSCleanupThread;
};
};
};
};
uiSleep 2;
};
// Tell all clients to remove the markers from the map
local _remove = [];
{
if (typeName _x == "ARRAY") then {
_remove set [count _remove, (_x select 1)];
};
} count _markers;
PVDZ_ServerMarkerSend = ["end",_remove];
publicVariable "PVDZ_ServerMarkerSend";
//Let the timer know the mission is over
if (_hero) then {
DZMSHeroEndTime = diag_tickTime;
DZMSHeroRunning = DZMSHeroRunning - 1;
} else {
DZMSBanditEndTime = diag_tickTime;
DZMSBanditRunning = DZMSBanditRunning - 1;
};
// Remove marker and mission data
DZE_ServerMarkerArray set [_markerIndex, -1];
DZE_MissionPositions set [_posIndex, -1];
DZMSMissionData set [_mission, -1];
//Clean up the pilot and plane (if they exist)
if (!isNull _plane) then {deleteVehicle _plane;};
if (!isNull _pilot) then {deleteVehicle _pilot;};
waitUntil{uiSleep 1; count units _aiGrp == 0};
deleteGroup _aiGrp;
diag_log text format["[DZMS]: %1 has Ended.",_missionName];

View File

@ -0,0 +1,84 @@
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "APCs";
local _localName = "STR_CL_DZMS_APC_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_APC_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_APC_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
//We create the vehicles like normal
[_mission,_coords,(["BRDM2_WINTER_DZE","BRDM2_RUST_DZE","BRDM2_Desert_ACR_DZE","BTR60_TK_EP1_DZE","BTR60_Gue_DZE","BRDM2_TK_EP1_DZE","BRDM2_CDF_DZE","BRDM2_TK_GUE_EP1_DZE"] call BIS_fnc_selectRandom),[2.4,-4.3],150.5] call DZMSSpawnVeh;
//[_mission,_coords,(["BRDM2_WINTER_DZE","BRDM2_RUST_DZE","BRDM2_Desert_ACR_DZE","BTR60_TK_EP1_DZE","BTR60_Gue_DZE","BRDM2_TK_EP1_DZE","BRDM2_CDF_DZE","BRDM2_TK_GUE_EP1_DZE"] call BIS_fnc_selectRandom),[2.7,4.8],14.2] call DZMSSpawnVeh;
[_mission,_coords,(["HMMWV_Armored_DZE","Dingo_WDL_ACR_DZE","Dingo_DST_ACR_DZE","LAV25_HQ_DZE","HMMWV_Winter_Armored_DZE"] call BIS_fnc_selectRandom),[-6,-0.2],-74] call DZMSSpawnVeh;
// Put a crate in the middle
[_mission,_coords,"DZ_AmmoBoxMedium1US","ArmedVehicle",[0,0]] call DZMSSpawnCrate;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[[(_coords select 0) - 8.4614,(_coords select 1) - 5.0527,0],6,1,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) - 8.4614,(_coords select 1) - 5.0527,0],4,1,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 7.5337,(_coords select 1) + 4.2656,0],4,1,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 7.5337,(_coords select 1) + 4.2656,0],4,1,_aiType,_mission] call DZMSAISpawn;
// Spawn Static M2 Gunner positions if enabled.
if (DZMSM2Static) then {
[[
[(_coords select 0) + 7.3,(_coords select 1) + 17, 0],
[(_coords select 0) - 18.4,(_coords select 1) + 2, 0],
[(_coords select 0) + 8,(_coords select 1) - 14.7, 0]
],0,_aiType,_mission] call DZMSM2Spawn;
};
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_APC_WIN",
"STR_CL_DZMS_APC_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,88 @@
/*
HMMWV Mission by lazyink (Full credit for original code to TheSzerdi & TAW_Tonic)
Updated to New Mission Format by Vampire
Updated for DZMS 2.0 by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "Armed Vehicles";
local _localName = "STR_CL_DZMS_AV_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %3.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_AV_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_AV_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
//We create the vehicles like normal
[_mission,_coords,["Offroad_DSHKM_INS",(["HMMWV_GPK_M2_WINTER_DZE","ArmoredSUV_PMC_DZE","LandRover_MG_TK_EP1_DZE","HMMWV_M1114_DSHKM_ACR_DZE"] call BIS_fnc_selectRandom)] select DZMSEpoch,[-6.8,-3.2],-61] call DZMSSpawnVeh;
[_mission,_coords,["Pickup_PK_INS",(["GAZ_Vodnik_DZE","BTR40_MG_TK_INS_EP1_DZE","UAZ_MG_WINTER_DZE","HMMWV_M2_DZE"] call BIS_fnc_selectRandom)] select DZMSEpoch,[6.5,4.2],0] call DZMSSpawnVeh;
// Put a crate in the middle
[_mission,_coords,"DZ_AmmoBoxMedium1US","ArmedVehicle",[0,0]] call DZMSSpawnCrate;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[[(_coords select 0) - 8.4614,(_coords select 1) - 5.0527,0],4,0,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) - 8.4614,(_coords select 1) - 5.0527,0],4,1,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 7.5337,(_coords select 1) + 4.2656,0],4,2,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 7.5337,(_coords select 1) + 4.2656,0],4,3,_aiType,_mission] call DZMSAISpawn;
// Spawn Static M2 Gunner positions if enabled.
if (DZMSM2Static) then {
[[
[(_coords select 0) + 15.5,(_coords select 1) - 13.2, 0],
[(_coords select 0) - 16,(_coords select 1) + 14.5, 0]
],0,_aiType,_mission] call DZMSM2Spawn;
};
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_AV_WIN",
"STR_CL_DZMS_AV_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,108 @@
/*
Medical C-130 Crash by lazyink (Full credit for original code to TheSzerdi & TAW_Tonic)
Modified to new format by Vampire
Updated for DZMS 2.0 by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "C130 Crash";
local _localName = "STR_CL_DZMS_C130_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_C130_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_C130_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
// Spawn Mission Objects
local _objects = [[ // The last object in the list gets returned.
["Barrels",[-7.4511,3.8544],61.911976],
["Misc_palletsfoiled",[4.062,4.7216],-29.273479],
["Paleta2",[-3.4033,-2.2256],52.402905],
["Land_Pneu",[1.17,1.249],-117.27345],
["Land_transport_crates_EP1",[3.9029,-1.8477],-70.372086],
["Fort_Crate_wood",[-2.1181,5.9765],-28.122475],
([["C130J_wreck_EP1",[-8.8681,15.3554,-.55],149.834555],["C130J",[-8.8681,15.3554],-30]] select DZMSEpoch)
],_coords,_mission] call DZMSSpawnObjects;
local _wreck = _objects select 6;
if (typeOf _wreck == "C130J") then {
_wreck setVehicleLock "LOCKED";
_wreck animate ["ramp_top",1];
_wreck animate ["ramp_bottom",1];
};
//We create the mission vehicles
[_mission,_coords,DZMSSmallVic,[14.1426,-0.6202]] call DZMSSpawnVeh;
[_mission,_coords,DZMSSmallVic,[-6.541,-11.5557]] call DZMSSpawnVeh;
//DZMSBoxFill fills the box, DZMSProtectObj prevents it from disappearing
[_mission,_coords,"DZ_AmmoBoxBigUS","supply",[-1.5547,2.3486]] call DZMSSpawnCrate;
[_mission,_coords,"DZ_AmmoBoxMedium1US","supply2",[0.3428,-1.8985]] call DZMSSpawnCrate;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[[(_coords select 0) - 10.5005,(_coords select 1) - 2.6465,0],6,0,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 4.7027,(_coords select 1) + 12.2138,0],6,1,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 2.918,(_coords select 1) - 9.0342,0],4,2,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 2.918,(_coords select 1) - 9.0342,0],4,3,_aiType,_mission] call DZMSAISpawn;
// Spawn Static M2 Gunner positions if enabled.
if (DZMSM2Static) then {
[[
[(_coords select 0) - 28.4,(_coords select 1) + 6, 0],
[(_coords select 0) + 8.9,(_coords select 1) + 27.43, 0]
],0,_aiType,_mission] call DZMSM2Spawn;
};
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_C130_WIN",
"STR_CL_DZMS_C130_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,106 @@
/*
Constructors Mission by lazyink (Full credit for original code to TheSzerdi & TAW_Tonic)
Updated to New Mission Format by Vampire
Updated for DZMS 2.0 by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "Construction Site";
local _localName = "STR_CL_DZMS_CONST_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_CONST_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_CONST_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
// Spawn Mission Objects
local _objects = [[
["MAP_A_BuildingWIP",[-2,1,.04],-30],
["Land_Ind_TankBig",[37,-7]],
["Land_Ind_TankBig",[-13,-35]],
["Land_Ind_Workshop01_01",[-27,-15],-31.6],
["Land_Ind_Workshop01_03",[9,38],-72],
["Land_Misc_Cargo1Ao",[31,20],99.8],
["Land_Misc_Cargo1B",[-36,2]],
["Land_Ind_TankSmall",[18,21],59]
],_coords,_mission] call DZMSSpawnObjects;
local _wipBuilding = _objects select 0;
//Create the vehicles
[_mission,_coords,DZMSLargeVic,[-3,28]] call DZMSSpawnVeh;
[_mission,_coords,DZMSSmallVic,[-26,14]] call DZMSSpawnVeh;
//Create the loot
[_mission,(_wipBuilding modelToWorld [-2.06445,5.56738,-6.51697]),"DZ_AmmoBoxBigUS","supply",[0,0],-30] call DZMSSpawnCrate;
[_mission,(_wipBuilding modelToWorld [6.11914,5.56396,-6.40808]),"DZ_AmmoBoxBigUS","supply2",[0,0],-30] call DZMSSpawnCrate;
[_mission,(_wipBuilding modelToWorld [0.636719,5.57471,-6.43134]),"DZ_AmmoBoxBigUS","supply2",[0,0],-30] call DZMSSpawnCrate;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[[(_coords select 0) - 21,(_coords select 1) + 32,0],6,0,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 56,(_coords select 1) + 27,0],6,1,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 27,(_coords select 1) - 52,0],6,2,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) - 41,(_coords select 1) - 20,0],6,3,_aiType,_mission] call DZMSAISpawn;
// Spawn Static M2 Gunner positions if enabled.
if (DZMSM2Static) then {
[[
(_wipBuilding modelToWorld [3.88672,11.9736,5.3772]),
(_wipBuilding modelToWorld [-25.041,12.5439,5.8855]),
((_objects select 2) modelToWorld [-5.40625,-4.40625,5.35645]),
((_objects select 1) modelToWorld [4.62305,2.0127,5.35931])
],0,_aiType,_mission] call DZMSM2Spawn;
};
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_CONST_WIN",
"STR_CL_DZMS_CONST_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,104 @@
/*
Fire Base Camp by lazyink (Full credit for original code to TheSzerdi & TAW_Tonic)
Updated to New Mission Format by Vampire
Updated for DZMS 2.0 by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "Firebase";
local _localName = "STR_CL_DZMS_FB_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_FB_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_FB_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
// Spawn Mission Objects
[[
["MAP_fort_rampart",[8,-14],-30],
["MAP_fort_rampart",[-9,15],-210],
["MAP_fort_rampart",[-16.6,-8.9],60],
["MAP_fort_rampart",[16,10],-120],
["MAP_HBarrier5",[2.3,-8.5],-30],
["MAP_HBarrier5",[-8.9,-2.3],60],
["MAP_HBarrier5",[6.9,7.2],60],
["MAP_HBarrier5",[-6.1,6.8],-30],
["MAP_fort_watchtower",[4.4,14.3],60],
["MAP_fort_watchtower",[-15.3,2.3],60],
["MAP_fort_watchtower",[15.7,-2.5],-120],
["MAP_fort_watchtower",[-4.6,-14.1],-120]
],_coords,_mission] call DZMSSpawnObjects;
[_mission,_coords,"DZ_AmmoBoxMedium1US","supply",[2,-4],-30] call DZMSSpawnCrate;
[_mission,_coords,"DZ_AmmoBoxMedium1US","supply2",[-2,4],-30] call DZMSSpawnCrate;
[_mission,_coords,"DZ_AmmoBoxMedium1US","weapons",[-5,-2.5],60] call DZMSSpawnCrate;
[_mission,_coords,"DZ_AmmoBoxMedium1US","weapons",[5,3.3],60] call DZMSSpawnCrate;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[[(_coords select 0) + 12,(_coords select 1) - 23,0],6,0,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) - 24,(_coords select 1) - 13,0],4,1,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) - 13,(_coords select 1) + 25,0],4,2,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 26,(_coords select 1) + 14,0],4,3,_aiType,_mission] call DZMSAISpawn;
// Spawn Static M2 Gunner positions if enabled.
if (DZMSM2Static) then {
[[
[(_coords select 0) + 18.45,(_coords select 1) - 8.41, 0],
[(_coords select 0) + 12.85,(_coords select 1) + 18.51, 0],
[(_coords select 0) - 18.09,(_coords select 1) + 9, 0],
[(_coords select 0) - 13.46,(_coords select 1) - 17.78, 0]
],0,_aiType,_mission] call DZMSM2Spawn;
};
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_FB_WIN",
"STR_CL_DZMS_FB_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,98 @@
/*
General Store Mission by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "General Store";
local _localName = "STR_CL_DZMS_GS_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_GS_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_GS_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
// Spawn Mission Objects
local _objects = [[
["MAP_A_GeneralStore_01",[0,0],-120],
["MAP_Ind_TankSmall",[10.9,-12.9],-30],
["MAP_t_acer2s",[-6.1,-24.3]],
["MAP_t_acer2s",[-21.1,2.6]],
["MAP_t_acer2s",[7.9,19.6]],
["MAP_t_acer2s",[23,-7.2]]
],_coords,_mission] call DZMSSpawnObjects;
local _store = _objects select 0;
// Spawn the crate
[_mission,(_store modelToWorld [-8.94629,-3.66602,-1.2164]),"DZ_AmmoBoxMedium2US","store",[0,0],-30] call DZMSSpawnCrate;
[_mission,(_store modelToWorld [-6.87158,-3.67188,-1.21259]),"DZ_AmmoBoxMedium2US","weapons",[0,0],-30] call DZMSSpawnCrate;
//Create the vehicle
[_mission,_coords,DZMSSmallVic,[16.8,-17.4],98.6] call DZMSSpawnVeh;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[[(_coords select 0) + 12,(_coords select 1) - 23,0],3,0,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) - 24,(_coords select 1) - 13,0],3,1,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) - 13,(_coords select 1) + 25,0],3,2,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 26,(_coords select 1) + 14,0],3,3,_aiType,_mission] call DZMSAISpawn;
// Spawn Static M2 Gunner positions if enabled.
if (DZMSM2Static) then {
[[
[(_coords select 0) + 25,(_coords select 1) - 25, 0],
(_store modelToWorld [7.69385,11.2803,-1.19305])
],0,_aiType,_mission] call DZMSM2Spawn;
};
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_GS_WIN",
"STR_CL_DZMS_GS_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,79 @@
/*
Bandit Heli Down! by lazyink (Full credit for code to TheSzerdi & TAW_Tonic)
Updated to new format by Vampire
Updated for DZMS 2.0 by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "Helicopter Crash";
local _localName = "STR_CL_DZMS_HC_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_HC_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_HC_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
// Spawn Mission Objects
[[
["CrashSite_US",[0,0]]
],_coords,_mission] call DZMSSpawnObjects;
[_mission,_coords,"DZ_AmmoBoxLong2RU","weapons",[-6,0]] call DZMSSpawnCrate;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[_coords,3,0,_aiType,_mission] call DZMSAISpawn;
[_coords,3,1,_aiType,_mission] call DZMSAISpawn;
[_coords,3,2,_aiType,_mission] call DZMSAISpawn;
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_HC_WIN",
"STR_CL_DZMS_HC_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,95 @@
/*
Bandit Supply Heli Crash by lazyink (Full credit for original code to TheSzerdi & TAW_Tonic)
New Mission Format by Vampire
Updated for DZMS 2.0 by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "Helicopter Landing";
local _localName = "STR_CL_DZMS_HL_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_HL_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_HL_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
// Spawn Mission Objects
[[
["Body1",[-3.0185,-0.084]],
["Body2",[1.9248,2.1201]]
],_coords,_mission] call DZMSSpawnObjects;
//We create the vehicles like normal
[_mission,_coords,DZMSChoppers,[0,0],-36.279881] call DZMSSpawnVeh;
[_mission,_coords,"HMMWV_DZ",[-8.7802,6.874]] call DZMSSpawnVeh;
//DZMSBoxFill fills the box, DZMSProtectObj prevents it from disappearing
[_mission,_coords,"DZ_AmmoBoxLongGUE","weapons",[-6.1718,0.6426]] call DZMSSpawnCrate;
[_mission,_coords,"DZ_AmmoBoxFlatUS","store",[-7.1718,1.6426]] call DZMSSpawnCrate;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[[(_coords select 0) - 8.4614,(_coords select 1) - 5.0527,0],4,0,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) - 8.4614,(_coords select 1) - 5.0527,0],4,1,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 7.5337,(_coords select 1) + 4.2656,0],4,2,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 7.5337,(_coords select 1) + 4.2656,0],4,3,_aiType,_mission] call DZMSAISpawn;
// Spawn Static M2 Gunner positions if enabled.
if (DZMSM2Static) then {
[[
[(_coords select 0) + 13.28,(_coords select 1) - 16.46, 0],
[(_coords select 0) - 11.29,(_coords select 1) + 15.89, 0]
],0,_aiType,_mission] call DZMSM2Spawn;
};
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_HL_WIN",
"STR_CL_DZMS_HL_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,78 @@
/*
Hummer Wreck by lazyink (Full credit for code to TheSzerdi & TAW_Tonic)
Updated to new format by Vampire
Updated for DZMS 2.0 by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "Humvee Crash";
local _localName = "STR_CL_DZMS_HUM_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_HUM_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_HUM_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
[[
["HMMWVwreck",[0,0]]
],_coords,_mission] call DZMSSpawnObjects;
// Spawn crate
[_mission,_coords,"DZ_AmmoBoxLong2RU","weapons",[-14,0]] call DZMSSpawnCrate;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, AI type, mission number]
[_coords,3,1,_aiType,_mission] call DZMSAISpawn;
[_coords,3,1,_aiType,_mission] call DZMSAISpawn;
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_HUM_WIN",
"STR_CL_DZMS_HUM_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,87 @@
/*
Medical Crate by lazyink (Full credit for original code to TheSzerdi & TAW_Tonic)
Updated to new format by Vampire
Updated for DZMS 2.0 by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "Medical Cache";
local _localName = "STR_CL_DZMS_MCACHE_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_MCACHE_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_MCACHE_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
//Lets add the scenery
[[
["Land_CamoNetB_NATO",[-0.0649,0.6025]]
],_coords,_mission] call DZMSSpawnObjects;
//We create the vehicles like normal
[_mission,_coords,DZMSSmallVic,[10.0303,-12.2979]] call DZMSSpawnVeh;
[_mission,_coords,DZMSLargeVic,[-6.2764,-14.086]] call DZMSSpawnVeh;
//[_mission,_coords,"USVehicleBox","medical",[0,0]] call DZMSSpawnCrate;
[_mission,_coords,"DZ_MedBox","medical",[-3.7251,-2.3614]] call DZMSSpawnCrate;
[_mission,_coords,"DZ_MedBox","medical",[-3.4346,0]] call DZMSSpawnCrate;
[_mission,_coords,"DZ_MedBox","medical",[4.0996,3.9072]] call DZMSSpawnCrate;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],4,0,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],4,1,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],4,2,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],4,3,_aiType,_mission] call DZMSAISpawn;
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_MCACHE_WIN",
"STR_CL_DZMS_MCACHE_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,99 @@
/*
Medical Supply Camp by lazyink (Full credit for original code to TheSzerdi & TAW_Tonic)
Updated to New Mission Format by Vampire
Updated for DZMS 2.0 by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "Medical Camp";
local _localName = "STR_CL_DZMS_MCAMP_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_MCAMP_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_MCAMP_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
//Create the scenery
[[
["Land_fort_artillery_nest",[-5.939,10.0459],-31.158424],
["Land_fort_artillery_nest",[6.3374,-11.1944],-211.14516],
["Land_fort_rampart",[12.2456,6.249],-120.93051],
["Land_fort_rampart",[-11.4253,-7.628],59.42643],
["Land_CamoNetVar_EAST",[4.1738,-7.9112],-27.004126],
["PowGen_Big",[-0.8936,8.1582],-56.044361],
["Barrel5",[-2.5074,7.3466]],
["Barrel5",[-3.293,7.9179]],
["Land_Campfire_burning",[3.1367,-5.087]],
["FoldChair",[0.8589,-6.2676],-132.43658],
["FoldChair",[2.6909,-7.4805],-184.45828],
["FoldChair",[5.4175,-5.4903],96.993355],
["FoldChair",[4.5722,-7.2305],142.91867],
["FoldChair",[5.0542,-3.4649],55.969147]
],_coords,_mission] call DZMSSpawnObjects;
//Create the vehicles
[_mission,_coords,DZMSSmallVic,[-17.5078,5.2578]] call DZMSSpawnVeh;
//Create the loot
//[_mission,_coords,"USLaunchersBox","weapons",[-6.8277,5.6748]] call DZMSSpawnCrate;
[_mission,_coords,"DZ_MedBox","medical",[-7.1519,1.8144],-29.851013] call DZMSSpawnCrate;
[_mission,_coords,"DZ_MedBox","medical",[-7.4116,2.5244]] call DZMSSpawnCrate;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[[(_coords select 0) - 0.5635,(_coords select 1) + 0.3173,0],3,0,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) - 0.5635,(_coords select 1) + 0.3173,0],3,1,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) - 0.5635,(_coords select 1) + 0.3173,0],3,2,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) - 0.5635,(_coords select 1) + 0.3173,0],3,3,_aiType,_mission] call DZMSAISpawn;
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_MCAMP_WIN",
"STR_CL_DZMS_MCAMP_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,89 @@
/*
Medical Outpost by lazyink (Full credit for code to TheSzerdi & TAW_Tonic)
Updated to new format by Vampire
Updated for DZMS 2.0 by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "Medical Outpost";
local _localName = "STR_CL_DZMS_MOP_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_MOP_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_MOP_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
// Spawn Mission Objects
[[
["US_WarfareBFieldhHospital_Base_EP1",[2,5]],
["MASH_EP1",[-24,-5]],
["MASH_EP1",[-17,-5]],
["MASH_EP1",[-10,-5]]
],_coords,_mission] call DZMSSpawnObjects;
//We create the vehicles
[_mission,_coords,DZMSSmallVic,[10,-5]] call DZMSSpawnVeh;
[_mission,_coords,DZMSSmallVic,[15,-5]] call DZMSSpawnVeh;
//We create and fill the crates
[_mission,_coords,"DZ_MedBox","medical",[-3,0,0.15]] call DZMSSpawnCrate;
[_mission,_coords,"DZ_AmmoBoxMedium2US","weapons",[-8,0]] call DZMSSpawnCrate;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[[(_coords select 0) - 20, (_coords select 1) - 15,0],4,0,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 10, (_coords select 1) + 15,0],4,1,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) - 10, (_coords select 1) - 15,0],4,2,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 20, (_coords select 1) + 15,0],4,3,_aiType,_mission] call DZMSAISpawn;
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_MOP_WIN",
"STR_CL_DZMS_MOP_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,71 @@
/* //
Weapons Cache Mission by lazyink (Original Full Code by TheSzerdi & TAW_Tonic)
New Mission Format by Vampire
*/ //
private ["_missName","_coords","_net","_veh1","_veh2","_vehicle","_vehicle1","_crate","_crate1","_crate2","_crate3"];
//Name of the Mission
_missName = "NATO Weapons Cache";
//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result
_coords = call DZMSFindPos;
[nil,nil,rTitleText,"Bandits have Overrun a NATO Weapons Cache!", "PLAIN",10] call RE;
//DZMSAddMajMarker is a simple script that adds a marker to the location
[_coords,_missname] ExecVM DZMSAddMajMarker;
//Lets add the scenery
_net = createVehicle ["Land_CamoNetB_NATO",[(_coords select 0) - 0.0649, (_coords select 1) + 0.6025,0],[], 0, "CAN_COLLIDE"];
[_net] call DZMSProtectObj;
//We create the vehicles like normal
_veh1 = ["small"] call DZMSGetVeh;
_veh2 = ["large"] call DZMSGetVeh;
_vehicle = createVehicle [_veh1,[(_coords select 0) + 10.0303, (_coords select 1) - 12.2979,10],[], 0, "CAN_COLLIDE"];
_vehicle1 = createVehicle [_veh2,[(_coords select 0) - 6.2764, (_coords select 1) - 14.086,10],[], 0, "CAN_COLLIDE"];
//DZMSSetupVehicle prevents the vehicle from disappearing and sets fuel and such
[_vehicle] call DZMSSetupVehicle;
[_vehicle1] call DZMSSetupVehicle;
_crate = createVehicle ["USVehicleBox",_coords,[], 0, "CAN_COLLIDE"];
_crate1 = createVehicle ["AmmoBoxSmall_556",[(_coords select 0) - 3.7251,(_coords select 1) - 2.3614, 0],[], 0, "CAN_COLLIDE"];
_crate2 = createVehicle ["AmmoBoxSmall_762",[(_coords select 0) - 3.4346, 0, 0],[], 0, "CAN_COLLIDE"];
_crate3 = createVehicle ["AmmoBoxSmall_556",[(_coords select 0) + 4.0996,(_coords select 1) + 3.9072, 0],[], 0, "CAN_COLLIDE"];
//DZMSBoxFill fills the box, DZMSProtectObj prevents it from disappearing
[_crate,"weapons"] ExecVM DZMSBoxSetup;
[_crate] call DZMSProtectObj;
[_crate1] call DZMSProtectObj;
[_crate2] call DZMSProtectObj;
[_crate3] call DZMSProtectObj;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],6,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],6,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],4,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],4,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
//Wait until the player is within 30 meters and also meets the kill req
[_coords,"DZMSUnitsMajor"] call DZMSWaitMissionComp;
//Call DZMSSaveVeh to attempt to save the vehicles to the database
//If saving is off, the script will exit.
[_vehicle] ExecVM DZMSSaveVeh;
[_vehicle1] ExecVM DZMSSaveVeh;
//Let everyone know the mission is over
[nil,nil,rTitleText,"The Weapons Cache is Under Survivor Control!", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Major SM1 Weapon Cache Mission has Ended."];
deleteMarker "DZMSMajMarker";
deleteMarker "DZMSMajDot";
//Let the timer know the mission is over
DZMSMajDone = true;

View File

@ -0,0 +1,163 @@
/*
AN-2 Bandit Supply Drop by Vampire
Example Code by Halv
*/
private ["_missName","_coords","_plane","_aiGrp","_pilot","_wp","_wp_pos","_loop","_half","_newPos","_plane2","_chute","_box","_dropDir","_wp2","_fallCount","_boxFin"];
//Name of the Mission
_missName = "AN-2 w/ Supplies";
//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result
_coords = call DZMSFindPos;
[nil,nil,rTitleText,"Dave is flying in with an AN-2.\nCapture him and take his things!", "PLAIN",10] call RE;
//DZMSAddMajMarker is a simple script that adds a marker to the location
[_coords,_missname] ExecVM DZMSAddMajMarker;
//Lets get the AN2 Flying
_plane = createVehicle ["AN2_DZ", [0,0,500], [], 0, "FLY"];
[_plane] call DZMSProtectObj;
_plane engineOn true;
_plane flyInHeight 150;
_plane forceSpeed 175;
//Empty the plane
clearMagazineCargoGlobal _plane;
clearWeaponCargoGlobal _plane;
//Lets make AI for the plane and get them in it
_aiGrp = creategroup east;
_pilot = _aiGrp createUnit ["SurvivorW2_DZ",getPos _plane,[],0,"FORM"];
_pilot moveindriver _plane;
_pilot assignAsDriver _plane;
_wp = _aiGrp addWaypoint [[(_coords select 0), (_coords select 1),150], 0];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "CARELESS";
_wp_pos = waypointPosition [_aiGrp,1];
_pilot addWeapon 'NVGoggles';
_pilot addWeapon 'ItemCompass';
_pilot addWeapon 'ItemRadio';
_pilot addWeapon 'ItemMap';
_pilot addWeapon 'ItemGPS';
sleep 5;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[_coords,6,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[_coords,6,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[_coords,4,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
_loop = true;
_half = false;
while {_loop} do {
if (!Alive _plane OR !Alive _pilot) then {
sleep 5;
// We are going to pretend the plane was shot down nearby
deleteVehicle _plane;
deleteVehicle _pilot;
_newPos = [(_coords select 0) + (random(2000)),(_coords select 1) - (random(2000)),0];
if (surfaceIsWater _newPos) then {
//newPos is water, so lets just drop it on mark
//This is a temporary fix for needed logic
_newPos = _coords;
};
//Create the plane and kill it
_plane2 = createVehicle ["AN2_DZ", [(_newPos select 0),(_newPos select 1),200], [], 0, "FLY"];
[_plane2] call DZMSProtectObj;
_plane2 engineOn true;
_plane2 flyInHeight 150;
_plane2 forceSpeed 175;
sleep 2;
_plane2 setDamage 1;
//Update the location
[_coords,"AN2 Wreck"] ExecVM DZMSAddMajMarker;
[nil,nil,rTitleText,"The AN2 was shot down by UN Peacekeepers!\nGo Find the Supplies!", "PLAIN",10] call RE;
_chute = createVehicle ["ParachuteMediumEast", [(_newPos select 0),(_newPos select 1),200], [], 0, "FLY"];
[_chute] call DZMSProtectObj;
_box = createVehicle ["USVehicleBox", [(_newPos select 0),(_newPos select 1),200],[], 0, "CAN_COLLIDE"];
[_box] call DZMSProtectObj;
_box attachTo [_chute, [0, 0, 1]];
_loop = false;
};
if ((Alive _plane) AND (Alive _pilot) AND ((_plane distance _wp_pos) <= 1200) AND (!(_half))) then {
[nil,nil,rTitleText,"The AN2 is only 1200m out from the drop point!", "PLAIN",10] call RE;
//Keep on truckin'
_plane forceSpeed 175;
_plane flyInHeight 135;
_plane setspeedmode "LIMITED";
_half = true;
};
if ((Alive _plane) AND (Alive _pilot) AND ((_plane distance _wp_pos) <= 200)) then {
//Drop the package
_dropDir = getDir _plane;
_newPos = [(getPosATL _plane select 0) - 15*sin(_dropDir), (getPosATL _plane select 1) - 15*cos(_dropDir), (getPosATL _plane select 2) - 10];
[nil,nil,rTitleText,"The AN2 has reached the location and dropped the cargo!", "PLAIN",10] call RE;
_chute = createVehicle ["ParachuteMediumEast", _newPos, [], 0, "FLY"];
[_chute] call DZMSProtectObj;
_box = createVehicle ["USVehicleBox", _newPos,[], 0, "CAN_COLLIDE"];
[_box] call DZMSProtectObj;
_box attachTo [_chute, [0, 0, 1]];
deleteWaypoint [_aiGrp, 1];
_wp2 = _aiGrp addWaypoint [[0,0,150], 0];
_wp2 setWaypointType "MOVE";
_wp2 setWaypointBehaviour "CARELESS";
_plane forceSpeed 350;
_plane setSpeedmode "FULL";
_loop = false;
};
};
//The box was dropped, lets get it on the ground.
_fallCount = 0;
while {_fallCount < 45} do {
if (((getPos _box) select 2) < 1) then {_fallCount = 46};
sleep 0.1;
_fallCount = _fallCount + 0.1;
};
detach _box;
_box setpos [(getpos _box select 0), (getpos _box select 1), 0];
_boxFin = createVehicle ["USVehicleBox",[(getpos _box select 0),(getpos _box select 1), 0],[],0,"CAN_COLLIDE"];
deletevehicle _box;
deletevehicle _chute;
[[(getpos _boxFin select 0), (getpos _boxFin select 1), 0],"AN2 Cargo"] ExecVM DZMSAddMajMarker;
clearWeaponCargoGlobal _boxFin;
clearMagazineCargoGlobal _boxFin;
clearBackpackCargoGlobal _boxFin;
[_boxFin,"weapons"] ExecVM DZMSBoxSetup;
[_boxFin] call DZMSProtectObj;
//Wait until the player is within 30 meters and also meets the kill req
[position _boxFin,"DZMSUnitsMajor"] call DZMSWaitMissionComp;
//Let everyone know the mission is over
[nil,nil,rTitleText,"The AN2 Cargo has been Secured by Survivors!", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Major SM2 AN2 Drop Mission has Ended."];
deleteMarker "DZMSMajMarker";
deleteMarker "DZMSMajDot";
//Let the timer know the mission is over
DZMSMajDone = true;

View File

@ -0,0 +1,128 @@
/*
Medical Supply Camp by lazyink (Full credit for original code to TheSzerdi & TAW_Tonic)
Updated to New Mission Format by Vampire
*/
private ["_missName","_coords","_base1","_base2","_base3","_base4","_base5","_base6","_base7","_base8","_base9","_base10","_base11","_base12","_base13","_base14","_base15","_base16","_base17","_veh1","_vehicle","_crate"];
//Name of the Mission
_missName = "Bandit Medical Camp";
//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result
_coords = call DZMSFindPos;
[nil,nil,rTitleText,"Bandits have Opened a Medical Camp!\nStop Them from Re-Supplying the Region!", "PLAIN",10] call RE;
//DZMSAddMajMarker is a simple script that adds a marker to the location
[_coords,_missname] ExecVM DZMSAddMajMarker;
//Create the scenery
_base1 = createVehicle ["Land_fort_artillery_nest",[(_coords select 0) - 5.939,(_coords select 1) + 10.0459,0],[], 0, "CAN_COLLIDE"];
_base1 setDir -31.158424;
[_base1] call DZMSProtectObj;
_base1 setVehicleLock "LOCKED";
_base1 setPos [(_coords select 0) - 5.939,(_coords select 1) + 10.0459,0];
_base2 = createVehicle ["Land_fort_artillery_nest",[(_coords select 0) + 6.3374, (_coords select 1) - 11.1944,0],[], 0, "CAN_COLLIDE"];
_base2 setDir -211.14516;
[_base2] call DZMSProtectObj;
_base2 setVehicleLock "LOCKED";
_base2 setPos [(_coords select 0) + 6.3374, (_coords select 1) - 11.1944,0];
_base3 = createVehicle ["Land_fort_rampart",[(_coords select 0) + 12.2456, (_coords select 1) + 6.249,0],[], 0, "CAN_COLLIDE"];
_base3 setDir -120.93051;
[_base3] call DZMSProtectObj;
_base3 setVehicleLock "LOCKED";
_base3 setPos [(_coords select 0) + 12.2456, (_coords select 1) + 6.249,0];
_base4 = createVehicle ["Land_fort_rampart",[(_coords select 0) - 11.4253, (_coords select 1) - 7.628,0],[], 0, "CAN_COLLIDE"];
_base4 setDir 59.42643;
[_base4] call DZMSProtectObj;
_base4 setVehicleLock "LOCKED";
_base4 setPos [(_coords select 0) - 11.4253, (_coords select 1) - 7.628,0];
_base5 = createVehicle ["MedBox0",[(_coords select 0) - 7.1519, (_coords select 1) + 1.8144,0],[], 0, "CAN_COLLIDE"];
_base5 setDir -29.851013;
[_base5] call DZMSProtectObj;
_base6 = createVehicle ["MedBox0",[(_coords select 0) - 7.4116, (_coords select 1) + 2.5244,0],[], 0, "CAN_COLLIDE"];
[_base6] call DZMSProtectObj;
_base7 = createVehicle ["WeaponHolder_ItemToolbox",[(_coords select 0) - 7.7041, (_coords select 1) + 3.332,0],[], 0, "CAN_COLLIDE"];
_base7 setDir -106.46461;
[_base7] call DZMSProtectObj;
_base8 = createVehicle ["Land_CamoNetVar_EAST",[(_coords select 0) + 4.1738, (_coords select 1) - 7.9112],[], 0, "CAN_COLLIDE"];
_base8 setDir -27.004126;
[_base8] call DZMSProtectObj;
_base8 setVehicleLock "LOCKED";
_base8 setPos [(_coords select 0) + 4.1738, (_coords select 1) - 7.9112];
_base9 = createVehicle ["PowGen_Big",[(_coords select 0) - 0.8936, (_coords select 1) + 8.1582,0],[], 0, "CAN_COLLIDE"];
_base9 setDir -56.044361;
[_base9] call DZMSProtectObj;
_base10 = createVehicle ["Barrel5",[(_coords select 0) - 2.5074, (_coords select 1) + 7.3466,0],[], 0, "CAN_COLLIDE"];
[_base10] call DZMSProtectObj;
_base11 = createVehicle ["Barrel5",[(_coords select 0) - 3.293, (_coords select 1) + 7.9179,0],[], 0, "CAN_COLLIDE"];
[_base11] call DZMSProtectObj;
_base12 = createVehicle ["Land_Campfire_burning",[(_coords select 0) + 3.1367, (_coords select 1) - 5.087,0],[], 0, "CAN_COLLIDE"];
[_base12] call DZMSProtectObj;
_base13 = createVehicle ["FoldChair",[(_coords select 0) + 0.8589, (_coords select 1) - 6.2676,0],[], 0, "CAN_COLLIDE"];
_base13 setDir -132.43658;
[_base13] call DZMSProtectObj;
_base14 = createVehicle ["FoldChair",[(_coords select 0) + 2.6909, (_coords select 1) - 7.4805,0],[], 0, "CAN_COLLIDE"];
_base14 setDir -184.45828;
[_base14] call DZMSProtectObj;
_base15 = createVehicle ["FoldChair",[(_coords select 0) + 5.4175, (_coords select 1) - 5.4903,0],[], 0, "CAN_COLLIDE"];
_base15 setDir 96.993355;
[_base15] call DZMSProtectObj;
_base16 = createVehicle ["FoldChair",[(_coords select 0) + 4.5722, (_coords select 1) - 7.2305,0],[], 0, "CAN_COLLIDE"];
_base16 setDir 142.91867;
[_base16] call DZMSProtectObj;
_base17 = createVehicle ["FoldChair",[(_coords select 0) + 5.0542, (_coords select 1) - 3.4649,0],[], 0, "CAN_COLLIDE"];
_base17 setDir 55.969147;
[_base17] call DZMSProtectObj;
//Create the vehicles
_veh1 = ["small"] call DZMSGetVeh;
_vehicle = createVehicle [_veh1,[(_coords select 0) - 17.5078, (_coords select 1) + 5.2578,0],[], 0, "CAN_COLLIDE"];
[_vehicle] call DZMSSetupVehicle;
//Create the loot
_crate = createVehicle ["USLaunchersBox",[(_coords select 0) - 6.8277, (_coords select 1) + 5.6748,0],[], 0, "CAN_COLLIDE"];
[_crate,"medical"] ExecVM DZMSBoxSetup;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[[(_coords select 0) - 0.5635,(_coords select 1) + 0.3173,0],3,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) - 0.5635,(_coords select 1) + 0.3173,0],3,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) - 0.5635,(_coords select 1) + 0.3173,0],3,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) - 0.5635,(_coords select 1) + 0.3173,0],3,1,"DZMSUnitsMajor"] call DZMSAISpawn;
//Wait until the player is within 30 meters and also meets the kill req
[_coords,"DZMSUnitsMajor"] call DZMSWaitMissionComp;
//Call DZMSSaveVeh to attempt to save the vehicles to the database
//If saving is off, the script will exit.
[_vehicle] ExecVM DZMSSaveVeh;
//Let everyone know the mission is over
[nil,nil,rTitleText,"Survivors have Taken Control of the Camp and Medical Supplies.", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Major SM3 Medical Camp Mission has Ended."];
deleteMarker "DZMSMajMarker";
deleteMarker "DZMSMajDot";
//Let the timer know the mission is over
DZMSMajDone = true;

View File

@ -0,0 +1,71 @@
/*
Bandit Supply Heli Crash by lazyink (Full credit for original code to TheSzerdi & TAW_Tonic)
New Mission Format by Vampire
*/
private ["_missName","_coords","_ranChopper","_chopper","_truck","_trash","_trash2","_crate","_crate2"];
//Name of the Mission
_missName = "Helicopter Landing";
//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result
_coords = call DZMSFindPos;
[nil,nil,rTitleText,"A Supply Helicopter has been Forced to Land!\nStop the Bandits from Taking Control of it!", "PLAIN",10] call RE;
//DZMSAddMajMarker is a simple script that adds a marker to the location
[_coords,_missname] ExecVM DZMSAddMajMarker;
//We create the vehicles like normal
_ranChopper = ["heli"] call DZMSGetVeh;
_chopper = createVehicle [_ranChopper,_coords,[], 0, "NONE"];
//DZMSSetupVehicle prevents the vehicle from disappearing and sets fuel and such
[_chopper] call DZMSSetupVehicle;
_chopper setDir -36.279881;
_truck = createVehicle ["HMMWV_DZ",[(_coords select 0) - 8.7802,(_coords select 1) + 6.874,0],[], 0, "CAN_COLLIDE"];
[_truck] call DZMSSetupVehicle;
//Lets add the scenery
_trash = createVehicle ["Body1",[(_coords select 0) - 3.0185,(_coords select 1) - 0.084,0],[], 0, "CAN_COLLIDE"];
_trash2 = createVehicle ["Body2",[(_coords select 0) + 1.9248,(_coords select 1) + 2.1201,0],[], 0, "CAN_COLLIDE"];
[_trash] call DZMSProtectObj;
[_trash2] call DZMSProtectObj;
//DZMSBoxFill fills the box, DZMSProtectObj prevents it from disappearing
_crate = createVehicle ["USLaunchersBox",[(_coords select 0) - 6.1718,(_coords select 1) + 0.6426,0],[], 0, "CAN_COLLIDE"];
[_crate,"weapons"] ExecVM DZMSBoxSetup;
[_crate] call DZMSProtectObj;
_crate2 = createVehicle ["USLaunchersBox",[(_coords select 0) - 7.1718,(_coords select 1) + 1.6426,0],[], 0, "CAN_COLLIDE"];
[_crate2,"weapons"] ExecVM DZMSBoxSetup;
[_crate2] call DZMSProtectObj;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[[(_coords select 0) - 8.4614,(_coords select 1) - 5.0527,0],6,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) - 8.4614,(_coords select 1) - 5.0527,0],4,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) + 7.5337,(_coords select 1) + 4.2656,0],4,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) + 7.5337,(_coords select 1) + 4.2656,0],4,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
//Wait until the player is within 30 meters and also meets the kill req
[_coords,"DZMSUnitsMajor"] call DZMSWaitMissionComp;
//Call DZMSSaveVeh to attempt to save the vehicles to the database
//If saving is off, the script will exit.
[_chopper] ExecVM DZMSSaveVeh;
[_truck] ExecVM DZMSSaveVeh;
//Let everyone know the mission is over
[nil,nil,rTitleText,"The Helicopter has been Taken by Survivors!", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Major SM4 Helicopter Landing Mission has Ended."];
deleteMarker "DZMSMajMarker";
deleteMarker "DZMSMajDot";
//Let the timer know the mission is over
DZMSMajDone = true;

View File

@ -0,0 +1,85 @@
/*
Medical Ural Attack by lazyink (Full credit for original code to TheSzerdi & TAW_Tonic)
Updated to New Format by Vampire
*/
private ["_missName","_coords","_crash","_body","_body1","_body2","_body3","_veh1","_vehicle","_vehicle1","_crate","_crate2"];
//Name of the Mission
_missName = "Ural Ambush";
//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result
_coords = call DZMSFindPos;
[nil,nil,rTitleText,"Bandits have Ambushed a Ural Carrying Supplies!", "PLAIN",10] call RE;
//DZMSAddMajMarker is a simple script that adds a marker to the location
[_coords,_missname] ExecVM DZMSAddMajMarker;
//We create the scenery
_crash = createVehicle ["UralWreck",_coords,[], 0, "CAN_COLLIDE"];
_crash setDir 149.64919;
[_crash] call DZMSProtectObj;
_body = createVehicle ["Body",[(_coords select 0) - 2.2905,(_coords select 1) - 3.3438,0],[], 0, "CAN_COLLIDE"];
_body setDir 61.798588;
[_body] call DZMSProtectObj;
_body1 = createVehicle ["Body",[(_coords select 0) - 2.8511,(_coords select 1) - 2.4346,0],[], 0, "CAN_COLLIDE"];
_body1 setDir 52.402905;
[_body1] call DZMSProtectObj;
_body2 = createVehicle ["Body",[(_coords select 0) - 3.435,(_coords select 1) - 1.4297,0],[], 0, "CAN_COLLIDE"];
_body2 setDir -117.27345;
[_body2] call DZMSProtectObj;
_body3 = createVehicle ["Body2",[(_coords select 0) - 4.0337,(_coords select 1) + 0.5,0],[], 0, "CAN_COLLIDE"];
_body3 setDir 23.664057;
[_body3] call DZMSProtectObj;
//We create the vehicles like normal
_veh1 = ["small"] call DZMSGetVeh;
_vehicle = createVehicle [_veh1,[(_coords select 0) + 5.7534, (_coords select 1) - 9.2149,0],[], 0, "CAN_COLLIDE"];
//DZMSSetupVehicle prevents the vehicle from disappearing and sets fuel and such
[_vehicle] call DZMSSetupVehicle;
//DZMSBoxFill fills the box, DZMSProtectObj prevents it from disappearing
_crate = createVehicle ["USBasicWeaponsBox",[(_coords select 0) + 2.6778,(_coords select 1) - 3.0889,0],[], 0, "CAN_COLLIDE"];
[_crate,"medical"] ExecVM DZMSBoxSetup;
[_crate] call DZMSProtectObj;
_crate setDir -28.85478;
_crate2 = createVehicle ["USBasicWeaponsBox",[(_coords select 0) + 1.4805,(_coords select 1) - 3.7432,0],[], 0, "CAN_COLLIDE"];
[_crate2,"medical"] ExecVM DZMSBoxSetup;
[_crate2] call DZMSProtectObj;
_crate2 setDir 62.744293;
_crate3 = createVehicle ["USBasicAmmunitionBox",[(_coords select 0) + 2.5405,(_coords select 1) - 4.1612,0],[], 0, "CAN_COLLIDE"];
[_crate3,"weapons"] ExecVM DZMSBoxSetup;
[_crate3] call DZMSProtectObj;
_crate3 setDir -27.93351;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[[(_coords select 0) - 6.9458,(_coords select 1) - 3.5352, 0],6,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) + 4.4614,(_coords select 1) + 2.5898, 0],6,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) + 4.4614,(_coords select 1) + 2.5898, 0],4,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
//Wait until the player is within 30 meters and also meets the kill req
[_coords,"DZMSUnitsMajor"] call DZMSWaitMissionComp;
//Call DZMSSaveVeh to attempt to save the vehicles to the database
//If saving is off, the script will exit.
[_vehicle] ExecVM DZMSSaveVeh;
[nil,nil,rTitleText,"The Ural Supplies have been Secured by Survivors!", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Major SM5 Ural Ambush Mission has Ended."];
deleteMarker "DZMSMajMarker";
deleteMarker "DZMSMajDot";
//Let the timer know the mission is over
DZMSMajDone = true;

View File

@ -0,0 +1,71 @@
/*
Medical Crate by lazyink (Full credit for original code to TheSzerdi & TAW_Tonic)
Updated to new format by Vampire
*/
private ["_missName","_coords","_net","_veh1","_veh2","_vehicle","_vehicle1","_crate"];
//Name of the Mission
_missName = "Bandit Protection";
//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result
_coords = call DZMSFindPos;
[nil,nil,rTitleText,"Sweets broke his legs again.\nGo kill the bandits protecting him.", "PLAIN",10] call RE;
//DZMSAddMajMarker is a simple script that adds a marker to the location
[_coords,_missname] ExecVM DZMSAddMajMarker;
//Lets add the scenery
_net = createVehicle ["Land_CamoNetB_NATO",[(_coords select 0) - 0.0649, (_coords select 1) + 0.6025,0],[], 0, "CAN_COLLIDE"];
[_net] call DZMSProtectObj;
//We create the vehicles like normal
_veh1 = ["small"] call DZMSGetVeh;
_veh2 = ["large"] call DZMSGetVeh;
_vehicle = createVehicle [_veh1,[(_coords select 0) + 10.0303, (_coords select 1) - 12.2979,10],[], 0, "CAN_COLLIDE"];
_vehicle1 = createVehicle [_veh2,[(_coords select 0) - 6.2764, (_coords select 1) - 14.086,10],[], 0, "CAN_COLLIDE"];
//DZMSSetupVehicle prevents the vehicle from disappearing and sets fuel and such
[_vehicle] call DZMSSetupVehicle;
[_vehicle1] call DZMSSetupVehicle;
_crate = createVehicle ["USVehicleBox",_coords,[], 0, "CAN_COLLIDE"];
_crate1 = createVehicle ["MedBox0",[(_coords select 0) - 3.7251,(_coords select 1) - 2.3614, 0],[], 0, "CAN_COLLIDE"];
_crate2 = createVehicle ["MedBox0",[(_coords select 0) - 3.4346, 0, 0],[], 0, "CAN_COLLIDE"];
_crate3 = createVehicle ["MedBox0",[(_coords select 0) + 4.0996,(_coords select 1) + 3.9072, 0],[], 0, "CAN_COLLIDE"];
//DZMSBoxFill fills the box, DZMSProtectObj prevents it from disappearing
[_crate,"medical"] ExecVM DZMSBoxSetup;
[_crate] call DZMSProtectObj;
[_crate1] call DZMSProtectObj;
[_crate2] call DZMSProtectObj;
[_crate3] call DZMSProtectObj;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],6,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],6,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],4,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],4,1,"DZMSUnitsMajor"] call DZMSAISpawn;
sleep 5;
//Wait until the player is within 30 meters and also meets the kill req
[_coords,"DZMSUnitsMajor"] call DZMSWaitMissionComp;
//Call DZMSSaveVeh to attempt to save the vehicles to the database
//If saving is off, the script will exit.
[_vehicle] ExecVM DZMSSaveVeh;
[_vehicle1] ExecVM DZMSSaveVeh;
//Let everyone know the mission is over
[nil,nil,rTitleText,"The Medical Cache is Under Survivor Control!", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Major SM6 Medical Cache Mission has Ended."];
deleteMarker "DZMSMajMarker";
deleteMarker "DZMSMajDot";
//Let the timer know the mission is over
DZMSMajDone = true;

View File

@ -0,0 +1,39 @@
/*
Bandit Hunting Party by lazyink (Full credit to TheSzerdi & TAW_Tonic for the code)
Updated to new format by Vampire
*/
private ["_missName","_coords","_vehicle"];
//Name of the Mission
_missName = "Bandit Squad";
//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result
_coords = call DZMSFindPos;
[nil,nil,rTitleText,"A Bandit Squad has been spotted!\nStop them from completing their patrol!", "PLAIN",10] call RE;
//DZMSAddMinMarker is a simple script that adds a marker to the location
[_coords,_missName] ExecVM DZMSAddMinMarker;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[_coords,2,1,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 5;
[_coords,2,1,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 5;
[_coords,2,1,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 5;
[_coords,2,1,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 1;
//Wait until the player is within 30 meters and also meets the kill req
[_coords,"DZMSUnitsMinor"] call DZMSWaitMissionComp;
//Let everyone know the mission is over
[nil,nil,rTitleText,"The Bandit Squad has been Wiped Out!", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Minor SM1 Bandit Squad Mission has Ended."];
deleteMarker "DZMSMinMarker";
deleteMarker "DZMSMinDot";
//Let the timer know the mission is over
DZMSMinDone = true;

View File

@ -0,0 +1,77 @@
/*
Medical Outpost by lazyink (Full credit for code to TheSzerdi & TAW_Tonic)
Updated to new format by Vampire
*/
private ["_missName","_coords","_base","_base1","_base2","_base3","_veh1","_veh2","_vehicle","_vehicle1","_crate","_crate2"];
//Name of the Mission
_missName = "Medical Outpost";
//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result
_coords = call DZMSFindPos;
[nil,nil,rTitleText,"Bandits have established a Medical Outpost!\nGo Secure their Medical Supplies!", "PLAIN",10] call RE;
//DZMSAddMinMarker is a simple script that adds a marker to the location
[_coords,_missName] ExecVM DZMSAddMinMarker;
//We create the scenery
_base = createVehicle ["US_WarfareBFieldhHospital_Base_EP1",[(_coords select 0) +2, (_coords select 1)+5,-0.3],[], 0, "CAN_COLLIDE"];
_base1 = createVehicle ["MASH_EP1",[(_coords select 0) - 24, (_coords select 1) - 5,0],[], 0, "CAN_COLLIDE"];
_base2 = createVehicle ["MASH_EP1",[(_coords select 0) - 17, (_coords select 1) - 5,0],[], 0, "CAN_COLLIDE"];
_base3 = createVehicle ["MASH_EP1",[(_coords select 0) - 10, (_coords select 1) - 5,0],[], 0, "CAN_COLLIDE"];
//DZMSProtectObj prevents it from disappearing
[_base] call DZMSProtectObj;
[_base1] call DZMSProtectObj;
[_base2] call DZMSProtectObj;
[_base3] call DZMSProtectObj;
//We create the vehicles
_veh1 = ["small"] call DZMSGetVeh;
_veh2 = ["small"] call DZMSGetVeh;
_vehicle = createVehicle [_veh1,[(_coords select 0) + 10, (_coords select 1) - 5,0],[], 0, "CAN_COLLIDE"];
_vehicle1 = createVehicle [_veh2,[(_coords select 0) + 15, (_coords select 1) - 5,0],[], 0, "CAN_COLLIDE"];
//DZMSSetupVehicle prevents the vehicle from disappearing and sets fuel and such
[_vehicle] call DZMSSetupVehicle;
[_vehicle1] call DZMSSetupVehicle;
//We create and fill the crates
_crate = createVehicle ["USVehicleBox",[(_coords select 0) - 3, _coords select 1,0],[], 0, "CAN_COLLIDE"];
//DZMSBoxFill fills the box, DZMSProtectObj prevents it from disappearing
[_crate,"medical"] ExecVM DZMSBoxSetup;
[_crate] call DZMSProtectObj;
_crate2 = createVehicle ["USLaunchersBox",[(_coords select 0) - 8, _coords select 1,0],[], 0, "CAN_COLLIDE"];
[_crate2,"weapons"] ExecVM DZMSBoxSetup;
[_crate2] call DZMSProtectObj;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[[(_coords select 0) - 20, (_coords select 1) - 15,0],4,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 3;
[[(_coords select 0) + 10, (_coords select 1) + 15,0],4,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 3;
[[(_coords select 0) - 10, (_coords select 1) - 15,0],4,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 3;
[[(_coords select 0) + 20, (_coords select 1) + 15,0],4,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 3;
//Wait until the player is within 30 meters and also meets the kill req
[_coords,"DZMSUnitsMinor"] call DZMSWaitMissionComp;
//Call DZMSSaveVeh to attempt to save the vehicles to the database
//If saving is off, the script will exit.
[_vehicle] ExecVM DZMSSaveVeh;
[_vehicle1] ExecVM DZMSSaveVeh;
//Let everyone know the mission is over
[nil,nil,rTitleText,"The Medical Outpost is under Survivor Control!", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Minor SM2 Medical Outpost Mission has Ended."];
deleteMarker "DZMSMinMarker";
deleteMarker "DZMSMinDot";
//Let the timer know the mission is over
DZMSMinDone = true;

View File

@ -0,0 +1,66 @@
/*
Bandit Stash House by lazyink (Full credit for code to TheSzerdi & TAW_Tonic)
Updated to new format by Vampire
*/
private ["_missName","_coords","_base","_base1","_veh1","_vehicle","_crate","_crate1"];
//Name of the Mission
_missName = "Stash House";
//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result
_coords = call DZMSFindPos;
[nil,nil,rTitleText,"Bandits have set up a Weapon Stash House!\nGo Empty it Out!", "PLAIN",10] call RE;
//DZMSAddMinMarker is a simple script that adds a marker to the location
[_coords,_missName] ExecVM DZMSAddMinMarker;
//We create the scenery
_base = createVehicle ["Land_HouseV_1I4",_coords,[], 0, "CAN_COLLIDE"];
_base setDir 152.66766;
_base setPos _coords;
_base1 = createVehicle ["Land_kulna",[(_coords select 0) + 5.4585, (_coords select 1) - 2.885,0],[], 0, "CAN_COLLIDE"];
_base1 setDir -28.282881;
_base1 setPos [(_coords select 0) + 5.4585, (_coords select 1) - 2.885,0];
//DZMSProtectObj prevents it from disappearing
[_base] call DZMSProtectObj;
[_base1] call DZMSProtectObj;
//We create the vehicles
_veh1 = ["small"] call DZMSGetVeh;
_vehicle = createVehicle [_veh1,[(_coords select 0) - 10.6206, (_coords select 1) - 0.49,0],[], 0, "CAN_COLLIDE"];
//DZMSSetupVehicle prevents the vehicle from disappearing and sets fuel and such
[_vehicle] call DZMSSetupVehicle;
//We create and fill the crate
_crate = createVehicle ["USBasicAmmunitionBox",[(_coords select 0) + 0.7408, (_coords select 1) + 1.565, 0.10033049],[], 0, "CAN_COLLIDE"];
[_crate,"weapons"] ExecVM DZMSBoxSetup;
[_crate] call DZMSProtectObj;
_crate1 = createVehicle ["USBasicAmmunitionBox",[(_coords select 0) - 0.2387, (_coords select 1) + 1.043, 0.10033049],[], 0, "CAN_COLLIDE"];
[_crate1,"weapons"] ExecVM DZMSBoxSetup;
[_crate1] call DZMSProtectObj;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[[(_coords select 0) - 4.0796, (_coords select 1) - 11.709,0],6,2,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 3;
[[(_coords select 0) + 2.8872, (_coords select 1) + 18.964,0],6,2,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 3;
//Wait until the player is within 30 meters and also meets the kill req
[_coords,"DZMSUnitsMinor"] call DZMSWaitMissionComp;
//Call DZMSSaveVeh to attempt to save the vehicles to the database
//If saving is off, the script will exit.
[_vehicle] ExecVM DZMSSaveVeh;
//Let everyone know the mission is over
[nil,nil,rTitleText,"The Stash House is under Survivor Control!", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Minor SM3 Stash House Mission has Ended."];
deleteMarker "DZMSMinMarker";
deleteMarker "DZMSMinDot";
//Let the timer know the mission is over
DZMSMinDone = true;

View File

@ -0,0 +1,48 @@
/*
Bandit Heli Down! by lazyink (Full credit for code to TheSzerdi & TAW_Tonic)
Updated to new format by Vampire
*/
private ["_missName","_coords","_crash","_crate"];
//Name of the Mission
_missName = "Helicopter Crash";
//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result
_coords = call DZMSFindPos;
[nil,nil,rTitleText,"A Helicopter has Crashed!\nGo Check for Survivors!", "PLAIN",10] call RE;
//DZMSAddMinMarker is a simple script that adds a marker to the location
[_coords,_missName] ExecVM DZMSAddMinMarker;
//Add the scenery
_crash = createVehicle ["UH60Wreck_DZ", _coords,[], 0, "CAN_COLLIDE"];
//DZMSProtectObj prevents it from disappearing
[_crash] call DZMSProtectObj;
//We create and fill the crates
_crate = createVehicle ["USLaunchersBox",[(_coords select 0) - 6, _coords select 1,0],[], 0, "CAN_COLLIDE"];
[_crate,"weapons"] ExecVM DZMSBoxSetup;
[_crate] call DZMSProtectObj;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[_coords,3,1,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 1;
[_coords,3,1,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 1;
[_coords,3,1,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 1;
//Wait until the player is within 30 meters and also meets the kill req
[_coords,"DZMSUnitsMinor"] call DZMSWaitMissionComp;
//Let everyone know the mission is over
[nil,nil,rTitleText,"The Helicopter Crash has been Secured by Survivors!", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Minor SM4 Crash Site Mission has Ended."];
deleteMarker "DZMSMinMarker";
deleteMarker "DZMSMinDot";
//Let the timer know the mission is over
DZMSMinDone = true;

View File

@ -0,0 +1,46 @@
/*
Hummer Wreck by lazyink (Full credit for code to TheSzerdi & TAW_Tonic)
Updated to new format by Vampire
*/
private ["_missName","_coords","_crash","_crate"];
//Name of the Mission
_missName = "Humvee Crash";
//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result
_coords = call DZMSFindPos;
[nil,nil,rTitleText,"A Humvee has crashed!\nGo Investigate the Cause of the Wreck!", "PLAIN",10] call RE;
//DZMSAddMinMarker is a simple script that adds a marker to the location
[_coords,_missName] ExecVM DZMSAddMinMarker;
//Add the scenery
_crash = createVehicle ["HMMWVwreck",_coords,[], 0, "CAN_COLLIDE"];
//DZMSProtectObj prevents it from disappearing
[_crash] call DZMSProtectObj;
//Add and fill the crate
_crate = createVehicle ["RULaunchersBox",[(_coords select 0) - 14, _coords select 1,0],[], 0, "CAN_COLLIDE"];
[_crate,"weapons"] ExecVM DZMSBoxSetup;
[_crate] call DZMSProtectObj;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[_coords,3,1,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 1;
[_coords,3,1,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 1;
//Wait until the player is within 30 meters and also meets the kill req
[_coords,"DZMSUnitsMinor"] call DZMSWaitMissionComp;
//Let everyone know the mission is over
[nil,nil,rTitleText,"The Humvee has been Secured by Survivors!", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Minor SM5 Humvee Crash Mission has Ended."];
deleteMarker "DZMSMinMarker";
deleteMarker "DZMSMinDot";
//Let the timer know the mission is over
DZMSMinDone = true;

View File

@ -0,0 +1,58 @@
/*
Weapon Truck Crash by lazyink (Full credit for code to TheSzerdi & TAW_Tonic)
Updated to new format by Vampire
*/
private ["_missName","_coords","_crash","_crate","_crate1","_crate2"];
//Name of the Mission
_missName = "Weapons Truck";
//DZMSFindPos loops BIS_fnc_findSafePos until it gets a valid result
_coords = call DZMSFindPos;
[nil,nil,rTitleText,"A Weapons Truck has Crashed!\nGo Recover the Supplies!", "PLAIN",10] call RE;
//DZMSAddMinMarker is a simple script that adds a marker to the location
[_coords,_missName] ExecVM DZMSAddMinMarker;
//Add scenery
_crash = createVehicle ["UralWreck",_coords,[], 0, "CAN_COLLIDE"];
//DZMSProtectObj prevents it from disappearing
[_crash] call DZMSProtectObj;
//Add and fill the boxes
_crate = createVehicle ["USLaunchersBox",[(_coords select 0) + 3, _coords select 1,0],[], 0, "CAN_COLLIDE"];
[_crate,"weapons"] ExecVM DZMSBoxSetup;
[_crate] call DZMSProtectObj;
_crate1 = createVehicle ["USLaunchersBox",[(_coords select 0) - 3, _coords select 1,0],[], 0, "CAN_COLLIDE"];
[_crate1,"weapons"] ExecVM DZMSBoxSetup;
[_crate1] call DZMSProtectObj;
_crate2 = createVehicle ["RULaunchersBox",[(_coords select 0) - 6, _coords select 1,0],[], 0, "CAN_COLLIDE"];
[_crate2,"weapons"] ExecVM DZMSBoxSetup;
[_crate2] call DZMSProtectObj;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, unitArray]
[_coords,3,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 1;
[_coords,3,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 1;
[_coords,3,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 1;
[_coords,3,0,"DZMSUnitsMinor"] call DZMSAISpawn;
sleep 1;
//Wait until the player is within 30 meters and also meets the kill req
[_coords,"DZMSUnitsMinor"] call DZMSWaitMissionComp;
//Let everyone know the mission is over
[nil,nil,rTitleText,"The Weapons Truck has been Secured by Survivors!", "PLAIN",6] call RE;
diag_log text format["[DZMS]: Minor SM6 Weapons Truck Mission has Ended."];
deleteMarker "DZMSMinMarker";
deleteMarker "DZMSMinDot";
//Let the timer know the mission is over
DZMSMinDone = true;

View File

@ -0,0 +1,71 @@
/*
Bandit Hunting Party by lazyink (Full credit to TheSzerdi & TAW_Tonic for the code)
Updated to new format by Vampire
Updated for DZMS 2.0 by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "Patrol Squad";
local _localName = "STR_CL_DZMS_PS_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_PS_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_PS_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[_coords,4,1,_aiType,_mission] call DZMSAISpawn;
[_coords,4,1,_aiType,_mission] call DZMSAISpawn;
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_PS_WIN",
"STR_CL_DZMS_PS_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,93 @@
/*
Bandit Stash House by lazyink (Full credit for code to TheSzerdi & TAW_Tonic)
Updated to new format by Vampire
Updated for DZMS 2.0 by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "Stash House";
local _localName = "STR_CL_DZMS_STASH_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_STASH_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_STASH_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
//We create the scenery
local _objects = [[
["MAP_HouseV_1I4",[0,0],152.66766],
["Land_kulna",[5.4585,-2.885],-28.282881]
],_coords,_mission] call DZMSSpawnObjects;
//We create the vehicle
[_mission,_coords,DZMSSmallVic,[-10.6206,-0.49]] call DZMSSpawnVeh;
//We create and fill the crate
[_mission,((_objects select 0) modelToWorld [2.19922,-0.253906,-2.78906]),"DZ_AmmoBoxSmallUS","weapons",[0,0],240] call DZMSSpawnCrate;
[_mission,((_objects select 0) modelToWorld [2.22461,-1.58496,-2.7829]),"DZ_AmmoBoxSmallUS","weapons",[0,0],240] call DZMSSpawnCrate;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[[(_coords select 0) - 4.0796, (_coords select 1) - 11.709,0],6,2,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 2.8872, (_coords select 1) + 18.964,0],6,2,_aiType,_mission] call DZMSAISpawn;
// Spawn Static M2 Gunner positions if enabled.
if (DZMSM2Static) then {
[[
[(_coords select 0) - 7.9,(_coords select 1) + 13.78, 0],
[(_coords select 0) + 9.34,(_coords select 1) - 14.17, 0]
],0,_aiType,_mission] call DZMSM2Spawn;
};
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_STASH_WIN",
"STR_CL_DZMS_STASH_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,97 @@
/*
Medical Ural Attack by lazyink (Full credit for original code to TheSzerdi & TAW_Tonic)
Updated to New Format by Vampire
Updated for DZMS 2.0 by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "Ural Ambush";
local _localName = "STR_CL_DZMS_URAL_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_URAL_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_URAL_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
// Spawn Mission Objects
[[
["UralWreck",[0,0],149.64919],
["Body",[-2.2905,-3.3438],61.798588],
["Body",[-2.8511,-2.4346],52.402905],
["Body",[-3.435,-1.4297],-117.27345],
["Body2",[-4.0337,0.5],23.664057]
],_coords,_mission] call DZMSSpawnObjects;
//We create the vehicles like normal
[_mission,_coords,DZMSSmallVic,[5.7534,-9.2149]] call DZMSSpawnVeh;
// Spawn crates
[_mission,_coords,"DZ_AmmoBoxMedium1US","supply",[2.6778,-3.0889],-28.85478] call DZMSSpawnCrate;
[_mission,_coords,"DZ_MedBox","medical",[1.4805,-3.7432],62.744293] call DZMSSpawnCrate;
[_mission,_coords,"DZ_AmmoBoxMedium2US","weapons",[2.5405,-4.1612],-27.93351] call DZMSSpawnCrate;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, AI type, mission number]
[[(_coords select 0) - 6.9458,(_coords select 1) - 3.5352, 0],6,1,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 4.4614,(_coords select 1) + 2.5898, 0],6,1,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 4.4614,(_coords select 1) + 2.5898, 0],4,1,_aiType,_mission] call DZMSAISpawn;
// Spawn Static M2 Gunner positions if enabled.
if (DZMSM2Static) then {
[[
[(_coords select 0) + 11.64,(_coords select 1) + 11.5, 0],
[(_coords select 0) - 9.37,(_coords select 1) - 14.58, 0]
],0,_aiType,_mission] call DZMSM2Spawn;
};
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_URAL_WIN",
"STR_CL_DZMS_URAL_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,92 @@
/*
Weapons Cache Mission by lazyink (Original Full Code by TheSzerdi & TAW_Tonic)
New Mission Format by Vampire
Updated for DZMS 2.0 by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "Weapons Cache";
local _localName = "STR_CL_DZMS_WCACHE_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_WCACHE_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_WCACHE_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
//Lets add the scenery
[[
["Land_CamoNetB_NATO",[-0.0649,0.6025]]
],_coords,_mission] call DZMSSpawnObjects;
//We create the vehicles like normal
[_mission,_coords,DZMSSmallVic,[10.0303,-12.2979]] call DZMSSpawnVeh;
[_mission,_coords,DZMSLargeVic,[-6.2764,-14.086]] call DZMSSpawnVeh;
[_mission,_coords,"DZ_AmmoBoxBigUS","weapons2",[0,0]] call DZMSSpawnCrate;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],4,0,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],4,1,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],4,2,_aiType,_mission] call DZMSAISpawn;
[[(_coords select 0) + 0.0352,(_coords select 1) - 6.8799, 0],4,3,_aiType,_mission] call DZMSAISpawn;
// Spawn Static M2 Gunner positions if enabled.
if (DZMSM2Static) then {
[[
[(_coords select 0) + 25,(_coords select 1) - 25, 0],
[(_coords select 0) - 25,(_coords select 1) + 25, 0]
],0,_aiType,_mission] call DZMSM2Spawn;
};
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_WCACHE_WIN",
"STR_CL_DZMS_WCACHE_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,92 @@
/*
Weapon Truck Crash by lazyink (Full credit for code to TheSzerdi & TAW_Tonic)
Updated to new format by Vampire
Updated for DZMS 2.0 by JasonTM
*/
local _mission = count DZMSMissionData -1;
local _aiType = _this select 0;
local _coords = call DZMSFindPos;
local _name = "Weapons Truck";
local _localName = "STR_CL_DZMS_WT_TITLE";
local _hero = _aiType == "Hero";
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _startTime = diag_tickTime;
diag_log format["[DZMS]: %1 %2 starting at %2.",_aiType,_name,_coords];
////////////////////// Do not edit this section ///////////////////////////
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
local _markers = [1,1,1,1];
_markers set [0, [_coords,"DZMS" + str _mission,_markerColor,"","ELLIPSE","Grid",[200,200],[],0]];
_markers set [1, [_coords,"DZMSDot" + str _mission,"ColorBlack","Vehicle","","",[],[_localized,_localName],0]];
if (DZMSAutoClaim) then {_markers set [2, [_coords,"DZMSAuto" + str _mission,"ColorRed","","ELLIPSE","Border",[DZMSAutoClaimAlertDistance,DZMSAutoClaimAlertDistance],[],0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
local _markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
[_aiType,_localName,"STR_CL_DZMS_WT_START"] call DZMSMessage;
DZMSMarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _coords];
local _posIndex = count DZE_MissionPositions - 1;
// Wait until a player is within range or timeout is reached.
local _playerNear = false;
local _timeout = false;
while {!_playerNear && !_timeout} do {
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
if (diag_tickTime - _startTime >= (DZMSMissionTimeOut * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call DZMSAbortMission;
[_aiType,_localName,"STR_CL_DZMS_WT_FAIL"] call DZMSMessage;
diag_log format["DZMS: %1 %2 aborted.",_aiType,_name,_coords];
};
//////////////////////////////// End //////////////////////////////////////
//Add scenery
[[
["UralWreck",[0,0]]
],_coords,_mission] call DZMSSpawnObjects;
// Spawn crates
[_mission,_coords,"DZ_AmmoBoxLong2RU","weapons",[3,0]] call DZMSSpawnCrate;
[_mission,_coords,"DZ_AmmoBoxLongGUE","weapons",[-3,0]] call DZMSSpawnCrate;
[_mission,_coords,"DZ_AmmoBoxMedium2US","weapons",[-6,0]] call DZMSSpawnCrate;
//DZMSAISpawn spawns AI to the mission.
//Usage: [_coords, count, skillLevel, Hero or Bandit, Mission Number]
[_coords,3,0,_aiType,_mission] call DZMSAISpawn;
[_coords,3,1,_aiType,_mission] call DZMSAISpawn;
[_coords,3,2,_aiType,_mission] call DZMSAISpawn;
[_coords,3,3,_aiType,_mission] call DZMSAISpawn;
// Spawn Static M2 Gunner positions if enabled.
if (DZMSM2Static) then {
[[
[(_coords select 0) + 3.1,(_coords select 1) - 21.9, 0],
[(_coords select 0) - 0.27,(_coords select 1) + 17.7, 0]
],0,_aiType,_mission] call DZMSM2Spawn;
};
// Start the mission loop.
[
_mission,
_coords,
_aiType,
_name,
_localName,
_markerIndex,
_posIndex,
"STR_CL_DZMS_WT_WIN",
"STR_CL_DZMS_WT_FAIL"
] spawn DZMSWaitMissionComp;

View File

@ -0,0 +1,98 @@
/*
DZMSAIKilled.sqf by Vampire
This function is called when an AI Unit is killed.
It handles the humanity allocation and body cleanup.
Updated for DZMS 2.0 by JasonTM
*/
local _unit = _this select 0;
local _player = _this select 1;
local _array = _unit getVariable ["DZMSAI" + dayz_serverKey, nil];
local _mission = _array select 0;
local _aiType = _array select 1;
if (typeName(DZMSMissionData select _mission) == "ARRAY") then {
DZMSMissionData select _mission set [0, ((DZMSMissionData select _mission) select 0) - 1];
};
//If the killer is a player, lets handle the humanity
if (isPlayer _player) then {
//diag_log text format ["[DZMS]: Debug: Unit killed by %1 at %2", _player, mapGridPosition _unit];
//Lets grab some info
local _humanity = _player getVariable ["humanity",0];
local _banditkills = _player getVariable ["banditKills",0];
local _humankills = _player getVariable["humanKills",0];
//If the player gets humanity per config, lets give it
if (DZMSMissHumanity) then {
if (_aiType == "Bandit") then {
_player setVariable ["humanity",(_humanity + DZMSBanditHumanity),true];
} else {
_player setVariable ["humanity",(_humanity - DZMSHeroHumanity),true];
};
if (DZMSKillFeed) then {
local _humanityReward = if (_aiType == "Hero") then {format["-%1 Humanity",DZMSHeroHumanity];} else {format["+%1 Humanity",DZMSBanditHumanity];};
local _aiColor = if (_aiType == "Hero") then {"#3333ff";} else {"#ff0000";};
local _params = [_aiColor,"0.50","#FFFFFF",-.4,.2,2,0.5];
RemoteMessage = ["ai_killfeed", [_aiType," AI Kill",_humanityReward],_params];
(owner _player) publicVariableClient "RemoteMessage";
};
};
//If this counts as a bandit or hero kill, lets give it
if (DZMSCntKills) then {
if (_aiType == "Bandit") then {
_player setVariable ["banditKills",(_banditkills + 1),true];
} else {
_player setVariable ["humanKills",(_humankills + 1),true];
};
};
// If ZSC installed and DZMSAICheckWallet enabled, add money to AI wallets
if (DZMSAICheckWallet && Z_singleCurrency) then {
local _cash = round(random 10) * 500; // adds money to AI wallets in 500x increments.
_unit setVariable["cashMoney",_cash ,true];
};
//Lets inform the nearby AI of roughly the players position
//This makes the AI turn and react instead of laying around
{
if (((position _x) distance (position _unit)) <= 300) then {
_x reveal [_player, 4.0];
}
} forEach allUnits;
} else {
//diag_log text format ["[DZMS]: Debug: Unit killed by %1 at %2", _player, mapGridPosition _unit];
if (DZMSRunGear) then {
//Since a player ran them over, or they died from unknown causes
//Lets strip their gear
if (!isNull (unitBackpack _unit)) then {removeBackpack _unit;};
removeAllWeapons _unit;
{
_unit removeMagazine _x
} forEach magazines _unit;
};
};
if (DZMSCleanDeath) exitWith {
_unit call sched_co_deleteVehicle;
};
_unit setVariable ["bodyName","NPC",false]; // Corpse will be deleted by sched_corpses function according to DZE_NPC_CleanUp_Time
if (DZMSUseNVG) then {
_unit removeWeapon "NVGoggles";
};
if (DZMSUseRPG && {"RPG7V" in (weapons _unit)}) then {
_unit removeWeapon "RPG7V";
_unit removeMagazines "PG7V";
};

View File

@ -0,0 +1,162 @@
/* //
DZMSAISpawn.sqf by Vampire
Updated for DZMS 2.0 by JasonTM
Usage: [position,unitcount,skillLevel,AI type,mission number] call DZMSAISpawn;
Position is the coordinates to spawn at [X,Y,Z]
UnitCount is the number of units to spawn
SkillLevel is the skill number defined in DZMSAIConfig.sqf
AI type is either "Hero" or "Bandit" set in DZMSTimer.sqf
Mission number is the count of the DZMSMissionData array (-1 because arrays are zero indexed) when the mission spawns
*/ //
local _position = _this select 0;
local _unitcount = _this select 1;
local _skill = _this select 2;
local _aiType = _this select 3;
local _mission = nil;
if (count _this > 4) then {
_mission = _this select 4;
};
local _wpRadius = 10;
local _xpos = _position select 0;
local _ypos = _position select 1;
local _aiskin = "";
local _unitGroup = createGroup east;
// Add the group to the mission data array
if !(isNil "_mission") then {
((DZMSMissionData select _mission) select 4) set [count ((DZMSMissionData select _mission) select 4), _unitGroup];
};
for "_x" from 1 to _unitcount do {
//Lets pick a skin from the array and assign as Hero or Bandit
if (_aiType == "Bandit") then {
_aiskin = DZMSBanditSkins call BIS_fnc_selectRandom;;
} else {
_aiskin = DZMSHeroSkins call BIS_fnc_selectRandom;
};
//Lets spawn the unit
local _unit = _unitGroup createUnit [_aiskin, _position, [], 10, "PRIVATE"];
//Make him join the correct team
[_unit] joinSilent _unitGroup;
//Add the behavior
_unit setCombatMode "YELLOW";
_unit setBehaviour "COMBAT";
//Remove the items he spawns with by default
removeAllWeapons _unit;
removeAllItems _unit;
//Now we need to figure out their loadout, and assign it
local _wepArray = DZMSAIWeps call BIS_fnc_selectRandom;
local _weapon = _wepArray call BIS_fnc_selectRandom;
local _magazine = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines") select 0;
for "_i" from 1 to 3 do {
_unit addMagazine _magazine;
};
_unit addBackpack (DZMSPacks call BIS_fnc_selectRandom);
_unit addWeapon _weapon;
_unit selectWeapon _weapon;
if (!DZMSOverwatch) then {
local _attachments = configFile >> "CfgWeapons" >> _weapon >> "Attachments";
if (isClass _attachments && {count _attachments > 0}) then {
local _attach = configName (_attachments call BIS_fnc_selectRandom);
if (_attach == "Attachment_Tws") then {
if (DZMS_AllowThermal) then {
_unit addMagazine _attach;
};
} else {
_unit addMagazine _attach;
};
};
};
if (DZMSUseNVG) then {
_unit addWeapon "NVGoggles";
};
//Get the gear array
local _aigear = [DZMSGear0,DZMSGear1,DZMSGear2,DZMSGear3,DZMSGear4] call BIS_fnc_selectRandom;
{
_unit addMagazine _x;
} count (_aigear select 0);
{
_unit addWeapon _x;
} count (_aigear select 1);
//Lets give a launcher to odd numbered AI if enabled
if (DZMSUseRPG) then {
if !(_x mod 2 == 0) then { // check if AI number is divisible by 2.
_unit addWeapon "RPG7V";
_unit addMagazine "PG7V";
_unit addMagazine "PG7V";
};
};
// New for 1.0.7 - Hero and bandit dog tags that can be traded for +/- humanity.
if (_aitype == "Hero") then {
if (random 1 <= DZMS_HeroDogTag) then {
_unit addMagazine "ItemDogTagHero";
};
} else {
if (random 1 <= DZMS_BanditDogTag) then {
_unit addMagazine "ItemDogTagBandit";
};
};
//Lets set the skills
local _aicskill = call {
if (_skill == 0) exitWith {DZMSSkills0;};
if (_skill == 1) exitWith {DZMSSkills1;};
if (_skill == 2) exitWith {DZMSSkills2;};
if (_skill == 3) exitWith {DZMSSkills3;};
DZMSSkills1;
};
{
_unit setSkill [(_x select 0),(_x select 1)]
} count _aicskill;
_unit addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] call DZMSAIKilled;}];
if !(isNil "_mission") then {
_unit setVariable ["DZMSAI" + dayz_serverKey, [_mission,_aiType]];
DZMSMissionData select _mission set [0, ((DZMSMissionData select _mission) select 0) + 1];
} else {
_unit setVariable ["DZMSAI" + dayz_serverKey, [-1,_aiType]];
};
};
// These are 4 waypoints in a NorthSEW around the center
local _wppos1 = [_xpos, _ypos + 20, 0];
local _wppos2 = [_xpos + 20, _ypos, 0];
local _wppos3 = [_xpos, _ypos - 20, 0];
local _wppos4 = [_xpos - 20, _ypos, 0];
_unitGroup allowFleeing 0;
// We add the 4 waypoints
local _wp1 = _unitGroup addWaypoint [_wppos1, _wpRadius];
_wp1 setWaypointType "MOVE";
local _wp2 = _unitGroup addWaypoint [_wppos2, _wpRadius];
_wp2 setWaypointType "MOVE";
local _wp3 = _unitGroup addWaypoint [_wppos3, _wpRadius];
_wp3 setWaypointType "MOVE";
local _wp4 = _unitGroup addWaypoint [_wppos4, _wpRadius];
_wp4 setWaypointType "MOVE";
// Then we add a center waypoint that tells them to visit the rest
local _wpfin = _unitGroup addWaypoint [[_xpos,_ypos, 0], _wpRadius];
_wpfin setWaypointType "CYCLE";
if (DZMSDebug) then {diag_log text format["[DZMS]: (%2) %1 AI Spawned.",count (units _unitGroup),_aiType];};

View File

@ -0,0 +1,18 @@
/*
Adds a marker for Major Missions. Only runs once.
DZMSMarkerLoop.sqf keeps this marker updated.
Usage: [coordinates,missionname]
*/
private["_nul","_nil"];
DZMSMajCoords = _this select 0;
DZMSMajName = _this select 1;
_nul = createMarker ["DZMSMajMarker", DZMSMajCoords];
"DZMSMajMarker" setMarkerColor "ColorRed";
"DZMSMajMarker" setMarkerShape "ELLIPSE";
"DZMSMajMarker" setMarkerBrush "Grid";
"DZMSMajMarker" setMarkerSize [175,175];
_nil = createMarker ["DZMSMajDot", DZMSMajCoords];
"DZMSMajDot" setMarkerColor "ColorBlack";
"DZMSMajDot" setMarkerType "Vehicle";
"DZMSMajDot" setMarkerText DZMSMajName;

View File

@ -0,0 +1,18 @@
/*
Adds a marker for Major Missions. Only runs once.
DZMSMarkerLoop.sqf keeps this marker updated.
Usage: [coordinates,missionname]
*/
private["_nul","_nil"];
DZMSMinCoords = _this select 0;
DZMSMinName = _this select 1;
_nul = createMarker ["DZMSMinMarker", DZMSMinCoords];
"DZMSMinMarker" setMarkerColor "ColorRed";
"DZMSMinMarker" setMarkerShape "ELLIPSE";
"DZMSMinMarker" setMarkerBrush "Grid";
"DZMSMinMarker" setMarkerSize [150,150];
_nil = createMarker ["DZMSMinDot", DZMSMinCoords];
"DZMSMinDot" setMarkerColor "ColorBlack";
"DZMSMinDot" setMarkerType "Vehicle";
"DZMSMinDot" setMarkerText DZMSMinName;

View File

@ -0,0 +1,109 @@
if (!_claimed) then {
// Find the closest player and send an alert
if (isNull _closestPlayer) then {
_closestPlayer = _coords call DZMSisClosest; // Find the closest player
[_closestPlayer,_name,"Start"] call DZMSAutoClaimAlert; // Send alert
_claimTime = diag_tickTime; // Set the time variable for countdown
};
// After the delay time, check player's location and either claim or not claim
if ((diag_tickTime - _claimTime) > DZMSAutoClaimDelayTime) then {
if ((_closestPlayer distance _coords) > DZMSAutoClaimAlertDistance || {!alive _closestPlayer}) then {
[_closestPlayer,_name,"Stop"] call DZMSAutoClaimAlert; // Send alert to player who is closest
_closestPlayer = objNull; // Set to default
_acArray = []; // Set to default
} else {
_claimed = true;
[_closestPlayer,_name,"Claimed"] call DZMSAutoClaimAlert; // Send alert to all players
diag_log text format ["DZMS Auto Claim: mission %1 has been claimed by %2",_name,(name _closestPlayer)];
_acArray = [getplayerUID _closestPlayer, name _closestPlayer]; // Add player UID and name to array
_markers set [3, [[(_coords select 0) + 100, (_coords select 1) + 100],_autoMarkDot,"ColorBlack","mil_objective","","",[],["STR_CL_CLAIM_MARKER",(name _closestPlayer)],0]];
DZE_ServerMarkerArray set [_markerIndex, _markers];
PVDZ_ServerMarkerSend = ["createSingle",(_markers select 3)];
publicVariable "PVDZ_ServerMarkerSend";
};
};
};
if (_claimed) then {
// Used in the marker when a player has left the mission area
_leftTime = round (DZMSAutoClaimTimeout - (diag_tickTime - _claimTime));
// This marker should run continuously until the mission is unclaimed or the player returns.
if (_left) then {
_autoText = ["STR_CL_TIMEOUT_MARKER",(_acArray select 1),_leftTime];
(_markers select 3) set [7, _autoText];
DZE_ServerMarkerArray set [_markerIndex, _markers];
PVDZ_ServerMarkerSend = ["textSingle",[_autoMarkDot,_autoText]];
publicVariable "PVDZ_ServerMarkerSend";
};
// If the player dies at the mission, change marker to countdown and set player variable to null
if ((!alive _closestPlayer) && !_left) then {
_closestPlayer = objNull; // Set the variable to null to prevent null player errors
_claimTime = diag_tickTime; // Set the time for countdown
_left = true; // Changes the marker to countdown
};
// Check to see if the dead player has returned to the mission
if (isNull _closestPlayer) then {
_closestPlayer = [_coords,_acArray] call DZMSCheckReturningPlayer;
};
// Notify the player that he/she is outside the mission area
if (!(isNull _closestPlayer) && !_left && {(_closestPlayer distance _coords) > DZMSAutoClaimAlertDistance}) then {
[_closestPlayer,_name,"Return"] call DZMSAutoClaimAlert;
_claimTime = diag_tickTime; // Set the time for the countdown
_left = true; // Set the mission marker to countdown
};
// If the player returns to the mission before the clock runs out then change the marker
if (!(isNull _closestPlayer) && _left && {(_closestPlayer distance _coords) < DZMSAutoClaimAlertDistance}) then {
[_closestPlayer,_name,"Reclaim"] call DZMSAutoClaimAlert;
_left = false; // Change the mission marker back to claim
_autoText = ["STR_CL_CLAIM_MARKER",(name _closestPlayer)];
(_markers select 3) set [7, _autoText];
DZE_ServerMarkerArray set [_markerIndex, _markers];
PVDZ_ServerMarkerSend = ["textSingle",[_autoMarkDot,_autoText]];
publicVariable "PVDZ_ServerMarkerSend";
};
// Warn other players in mission area
{
if (!(_x in (units group _closestPlayer)) && {(_x distance _coords) < DZMSAutoClaimAlertDistance} && {!(_x in _warnArray)}) then {
RemoteMessage = ["rollingMessages", ["STR_CL_CLAIM_WARNING",_acArray select 1]];
(owner _x) publicVariableClient "RemoteMessage";
_warnArray set [count _warnArray, _x]; // add player to temp array so it does not spam the message.
};
} count playableUnits;
// If the player lets the clock run out, then set the mission to unclaimed and set the variables to default
// Player left the server
if ((isNull _closestPlayer) && {(diag_tickTime - _claimTime) > DZMSAutoClaimTimeout}) then {
[_acArray ,_name,"Unclaim"] call DZMSAutoClaimAlert; // Send alert to all players
_claimed = false;
_left = false;
_acArray = [];
_warnArray = [];
PVDZ_ServerMarkerSend = ["removeSingle",_autoMarkDot];
publicVariable "PVDZ_ServerMarkerSend";
_markers set [3, 1];
DZE_ServerMarkerArray set [_markerIndex, _markers];
} else {
// Player is alive but did not return to the mission
if (((diag_tickTime - _claimTime) > DZMSAutoClaimTimeout) && {(_closestPlayer distance _coords) > DZMSAutoClaimAlertDistance}) then {
[_closestPlayer,_name,"Unclaim"] call DZMSAutoClaimAlert; // Send alert to all players
_closestPlayer = objNull;
_claimed = false;
_left = false;
_acArray = [];
_warnArray = [];
PVDZ_ServerMarkerSend = ["removeSingle",_autoMarkDot];
publicVariable "PVDZ_ServerMarkerSend";
_markers set [3, 1];
DZE_ServerMarkerArray set [_markerIndex, _markers];
};
};
};

View File

@ -0,0 +1,325 @@
/*
_crate is the object to fill
_type is the type of crate
*/
local _crate = _this select 0;
local _type = _this select 1;
local _scount = 0;
local _sSelect = 0;
local _item = "";
local _ammo = [];
local _cfg = "";
local _attach = "";
local _qty = 0;
//////////////////////////////////////////////////////////////////
// Medical Crates
if (_type == "medical") then {
// load medical
_scount = count DZMSMeds;
for "_x" from 0 to 40 do {
_sSelect = floor(random _sCount);
_item = DZMSMeds select _sSelect;
_crate addMagazineCargoGlobal [_item,1];
};
// load packs
_scount = count DZMSPacks;
for "_x" from 0 to 2 do {
_sSelect = floor(random _sCount);
_item = DZMSPacks select _sSelect;
_crate addBackpackCargoGlobal [_item,1];
};
};
////////////////////////////////////////////////////////////////
// General Store Crate
if (_type == "store") then {
// load food/drink
_scount = count DZMSGeneralStore;
for "_x" from 0 to 40 do {
_sSelect = floor(random _sCount);
_item = DZMSGeneralStore select _sSelect;
_crate addMagazineCargoGlobal [_item,1];
};
// load survival tools
_scount = count DZMSCrateTools;
for "_x" from 0 to 4 do {
_sSelect = floor(random _sCount);
_item = DZMSCrateTools select _sSelect;
_crate addWeaponCargoGlobal [_item,1];
};
// load packs
_scount = count DZMSPacks;
for "_x" from 0 to 2 do {
_sSelect = floor(random _sCount);
_item = DZMSPacks select _sSelect;
_crate addBackpackCargoGlobal [_item,1];
};
// load pistols
_scount = count DZMSPistol;
for "_x" from 0 to 2 do {
_sSelect = floor(random _sCount);
_item = DZMSPistol select _sSelect;
_crate addWeaponCargoGlobal [_item,1];
_ammo = getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
if (count _ammo > 0) then {
_crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
};
if (!DZMSOverwatch) then {
_cfg = configFile >> "CfgWeapons" >> _item >> "Attachments";
if (isClass _cfg && count _cfg > 0) then {
_attach = configName (_cfg call BIS_fnc_selectRandom);
_crate addMagazineCargoGlobal [_attach,1];
};
};
};
};
///////////////////////////////////////////////////////////////////
// Weapon Crate Small
if (_type == "weapons") then {
// load grenades
_scount = count DZMSGrenades;
for "_x" from 0 to 5 do {
_sSelect = floor(random _sCount);
_item = DZMSGrenades select _sSelect;
_crate addMagazineCargoGlobal [_item,1];
};
// load packs
_scount = count DZMSPacks;
for "_x" from 0 to 3 do {
_sSelect = floor(random _sCount);
_item = DZMSPacks select _sSelect;
_crate addBackpackCargoGlobal [_item,1];
};
// load pistols and attachments
_scount = count DZMSPistol;
for "_x" from 0 to 2 do {
_sSelect = floor(random _sCount);
_item = DZMSPistol select _sSelect;
_crate addWeaponCargoGlobal [_item,1];
_ammo = getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
if (count _ammo > 0) then {
_crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
};
if (!DZMSOverwatch) then {
_cfg = configFile >> "CfgWeapons" >> _item >> "Attachments";
if (isClass _cfg && count _cfg > 0) then {
_attach = configName (_cfg call BIS_fnc_selectRandom);
_crate addMagazineCargoGlobal [_attach,1];
};
};
};
// Load Weapons and attachments
for "_x" from 0 to 5 do {
_wepArray = DZMSCrateWeps call BIS_fnc_selectRandom;
_item = _wepArray call BIS_fnc_selectRandom;
_crate addWeaponCargoGlobal [_item,1];
_ammo = getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
if (count _ammo > 0) then {
_crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
};
if (!DZMSOverwatch) then {
_cfg = configFile >> "CfgWeapons" >> _item >> "Attachments";
if (isClass _cfg && count _cfg > 0) then {
_attach = configName (_cfg call BIS_fnc_selectRandom);
if (_attach == "Attachment_Tws") then {
if (DZMS_AllowThermal) then {
_crate addMagazineCargoGlobal [_attach,1];
};
} else {
_crate addMagazineCargoGlobal [_attach,1];
};
};
};
};
};
///////////////////////////////////////////////////////////////////
// Weapon Crate Large
if (_type == "weapons2") then {
// load grenades
_scount = count DZMSGrenades;
for "_x" from 0 to 5 do {
_sSelect = floor(random _sCount);
_item = DZMSGrenades select _sSelect;
_crate addMagazineCargoGlobal [_item,1];
};
// load packs
_scount = count DZMSPacks;
for "_x" from 0 to 3 do {
_sSelect = floor(random _sCount);
_item = DZMSPacks select _sSelect;
_crate addBackpackCargoGlobal [_item,1];
};
// load pistols
_scount = count DZMSPistol;
for "_x" from 0 to 3 do {
_sSelect = floor(random _sCount);
_item = DZMSPistol select _sSelect;
_crate addWeaponCargoGlobal [_item,1];
_ammo = getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
if (count _ammo > 0) then {
_crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
};
};
// Load Weapons
for "_x" from 0 to 10 do {
_wepArray = DZMSCrateWeps call BIS_fnc_selectRandom;
_item = _wepArray call BIS_fnc_selectRandom;
_crate addWeaponCargoGlobal [_item,1];
_ammo = getArray (configFile >> "cfgWeapons" >> _item >> "magazines");
if (count _ammo > 0) then {
_crate addMagazineCargoGlobal [(_ammo select 0),(round(random 8))];
};
if (!DZMSOverwatch) then {
_cfg = configFile >> "CfgWeapons" >> _item >> "Attachments";
if (isClass _cfg && count _cfg > 0) then {
_attach = configName (_cfg call BIS_fnc_selectRandom);
if (_attach == "Attachment_Tws") then {
if (DZMS_AllowThermal) then {
_crate addMagazineCargoGlobal [_attach,1];
};
} else {
_crate addMagazineCargoGlobal [_attach,1];
};
};
};
};
};
///////////////////////////////////////////////////////////////////
// Supply Crate
if (_type == "supply") then {
// load tools
_scount = count DZMSBuildTools;
for "_x" from 0 to 3 do {
_sSelect = floor(random _sCount);
_item = DZMSBuildTools select _sSelect;
_crate addWeaponCargoGlobal [_item,1];
};
// load construction supplies
_scount = count DZMSBuildSupply;
for "_x" from 0 to 30 do {
_sSelect = floor(random _sCount);
_item = DZMSBuildSupply select _sSelect;
_qty = _item select 0;
_type = _item select 1;
_crate addMagazineCargoGlobal [_type,_qty];
};
// load crafting supplies
_scount = count DZMSCraftingSupply;
for "_x" from 0 to 20 do {
_sSelect = floor(random _sCount);
_item = DZMSCraftingSupply select _sSelect;
_crate addMagazineCargoGlobal [_item,1];
};
// load high value
_scount = count DZMSHighValue;
if (_scount > 0 && {random 1 < .3}) then {
for "_x" from 0 to 0 do {
_sSelect = floor(random _sCount);
_item = DZMSHighValue select _sSelect;
_crate addMagazineCargoGlobal [_item,1];
};
};
// load packs
_scount = count DZMSPacks;
for "_x" from 0 to 3 do {
_sSelect = floor(random _sCount);
_item = DZMSPacks select _sSelect;
_crate addBackpackCargoGlobal [_item,1];
};
};
///////////////////////////////////////////////////////////////////
// Supply Crate 2
if (_type == "supply2") then {
// load tools
_scount = count DZMSBuildTools;
for "_x" from 0 to 1 do {
_sSelect = floor(random _sCount);
_item = DZMSBuildTools select _sSelect;
_crate addWeaponCargoGlobal [_item,1];
};
// load construction supplies
_scount = count DZMSBuildSupply;
for "_x" from 0 to 20 do {
_sSelect = floor(random _sCount);
_item = DZMSBuildSupply select _sSelect;
_qty = _item select 0;
_type = _item select 1;
_crate addMagazineCargoGlobal [_type,_qty];
};
// load crafting supplies
_scount = count DZMSCraftingSupply;
for "_x" from 0 to 20 do {
_sSelect = floor(random _sCount);
_item = DZMSCraftingSupply select _sSelect;
_crate addMagazineCargoGlobal [_item,1];
};
// load high value
_scount = count DZMSHighValue;
if (_scount > 0 && {random 1 < .3}) then {
for "_x" from 0 to 0 do {
_sSelect = floor(random _sCount);
_item = DZMSHighValue select _sSelect;
_crate addMagazineCargoGlobal [_item,1];
};
};
// load packs
_scount = count DZMSPacks;
for "_x" from 0 to 2 do {
_sSelect = floor(random _sCount);
_item = DZMSPacks select _sSelect;
_crate addBackpackCargoGlobal [_item,1];
};
};
//////////////////////////////////////////////////////////////////
// Vehicle Stuff
if (_type == "ArmedVehicle") then {
// load vehicle ammo
_scount = count DZMSVehAmmo;
for "_x" from 0 to 10 do {
_sSelect = floor(random _sCount);
_item = DZMSVehAmmo select _sSelect;
_crate addMagazineCargoGlobal [_item,1];
};
// load packs
_scount = count DZMSPacks;
for "_x" from 0 to 2 do {
_sSelect = floor(random _sCount);
_item = DZMSPacks select _sSelect;
_crate addBackpackCargoGlobal [_item,1];
};
// load vehicle parts
_scount = count DZMSVehParts;
for "_x" from 0 to 15 do {
_sSelect = floor(random _sCount);
_item = DZMSVehParts select _sSelect;
_crate addMagazineCargoGlobal [_item,1];
};
};

View File

@ -0,0 +1,57 @@
local _pos = [0,0,0];
local _num = 1;
local _findRun = true;
local _playerNear = true;
local _isTavi = toLower worldName == "tavi";
//We need to loop findSafePos until it doesn't return the map center
while {_findRun} do {
if (DZMSStaticPlc) then {
_pos = DZMSStatLocs call BIS_fnc_selectRandom;
_pos = [(_pos select 0), (_pos select 1)]; // Position needs to be 2D.
} else {
_pos = [getMarkerPos "center",0,((getMarkerSize "center") select 1) * .75,30,0,.2,0,DZMSBlacklistZones] call BIS_fnc_findSafePos;
};
local _isOk = true;
// Let's check for nearby water within 100 meters
{
if (surfaceIsWater _x) exitWith {_isOk = false;};
} count [_pos,[(_pos select 0), (_pos select 1)+100],[(_pos select 0)+100, (_pos select 1)],[(_pos select 0), (_pos select 1)-100],[(_pos select 0)-100, (_pos select 1)]];
//Lets test the height on Taviana
if (_isTavi) then {
local _tavTest = createVehicle ["Can_Small",[(_pos select 0),(_pos select 1),0],[], 0, "CAN_COLLIDE"];
_isOk = (((getPosASL _tavTest) select 2) <= 185);
deleteVehicle _tavTest;
};
// Check if position is far enough away from other missions
{
if ((typeName _x) == "ARRAY" && {_pos distance _x < DZMSDistanceBetweenMissions}) exitWith {
_isOk = false;
};
} count DZE_MissionPositions;
// Check for near safezones if Epoch/Overpoch
if (DZMSEpoch) then {
{
if (_pos distance (_x select 0) < 700) exitWith {
_isOk = false;
};
} count DZE_SafeZonePosArray;
};
//Check for players within 500 meters
_playerNear = [_pos,500] call DZMSNearPlayer;
//Lets combine all our checks to possibly end the loop
if (_isOk && !_playerNear && {count _pos == 2}) then {
_findRun = false;
};
if (DZMSDebug) then {diag_log format["DZMSFindPos: %1 attempts to find a safe position",_num];};
_num = _num + 1;
};
_pos set [2, 0];
_pos

View File

@ -0,0 +1,304 @@
/*
DayZ Mission System Functions by Vampire
Updated for DZMS 2.0 by JasonTM
*/
DZMSSpawnCrate = {
local _mission = _this select 0;
local _cratePos = _this select 1;
local _boxType = _this select 2;
local _lootType = _this select 3;
local _offset = _this select 4;
local _z = [0, (_cratePos select 2)] select (count _cratePos == 3);
local _cratePosition = [(_cratePos select 0) + (_offset select 0), (_cratePos select 1) + (_offset select 1), _z];
if (count _offset > 2) then {
_cratePosition set [2, (_offset select 2)];
};
// Override regular crates because of Vanilla blacklisting
if (!DZMSEpoch) then {
if !(_boxType == "DZ_MedBox") then {
_boxType = "AmmoBoxBig";
};
};
local _crate = _boxType createVehicle _cratePosition;
if (count _this > 5) then {
_crate setDir (_this select 5);
};
_crate setPos _cratePosition;
_crate setVariable ["permaLoot",true];
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
_crate addEventHandler ["HandleDamage", {0}];
_crate enableSimulation false;
((DZMSMissionData select _mission) select 3) set [count ((DZMSMissionData select _mission) select 3), [_crate,_lootType]];
_crate // return crate object for AN2 mission
};
DZMSNearPlayer = {
local _result = false;
local _position = _this select 0;
local _radius = _this select 1;
{
if ((isPlayer _x) && (_x distance _position <= _radius)) then {
_result = true;
};
} count playableUnits;
_result
};
DZMSCleanupThread = {
local _coords = _this select 0;
local _mission = _this select 1;
local _objects = _this select 2;
local _vehicles = _this select 3;
local _crates = _this select 4;
local _groups = _this select 5;
local _staticGuns = _this select 6;
local _posIndex = _this select 7;
local _time0ut = _this select 8;
local _cleaned = false;
local _time = diag_tickTime;
while {!_cleaned} do {
if (DZMSSceneryDespawnTimer > 0 || _time0ut) then {
if ((diag_tickTime - _time) > DZMSSceneryDespawnTimer*60 || _time0ut) then {
// delete mission objects
{
_x call sched_co_deleteVehicle;
} count _objects;
// delete vehicles if they are not claimed
{
if (_x getVariable ["DZMSCleanup" + dayz_serverKey,false]) then {
_x call sched_co_deleteVehicle;
};
} count _vehicles;
// Delete Remaining AI that are alive
{
if ((_x getVariable ["DZMSAI" + dayz_serverKey,nil]) select 0 == _mission) then {
_x call sched_co_deleteVehicle;
};
} count allunits;
// Delete Static Guns
{
_x call sched_co_deleteVehicle;
} count _staticGuns;
uiSleep 10; // Need to sleep to let the group count get to zero
// Remove AI groups if mission times out
{
if (count units _x == 0) then {
deleteGroup _x;
_groups = _groups - [_x];
//diag_log format ["DZMS: Group %1 deleted.",_x];
if (count _groups > 0) then {
diag_log format ["DZMS: Group array %1",_groups];
};
};
} count _groups;
// delete mission crates if enabled
if (DZMSSceneryDespawnLoot || _time0ut) then {
if (count _crates > 0) then {
// Wait until players are at least 50 meters away
if !([_coords,50] call DZMSNearPlayer) then {
{
(_x select 0) call sched_co_deleteVehicle;
} count _crates;
_cleaned = true;
};
};
} else {
_cleaned = true;
};
};
};
};
DZE_MissionPositions set [_posIndex, -1];
diag_log format ["DZMS: Cleanup for mission %1 complete.",_mission];
};
// Generates the keys for mission vehicles - Epoch/Overpoch only
DZMSVehKey = {
local _vehicle = _this;
local _keyColor = ["Green","Red","Blue","Yellow","Black"] call BIS_fnc_selectRandom;
local _keyNumber = (floor(random 2500)) + 1;
local _keySelected = format["ItemKey%1%2",_keyColor,_keyNumber];
local _isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
local _characterID = str(getNumber(configFile >> "CfgWeapons" >> _keySelected >> "keyid"));
if (_isKeyOK) then {
_vehicle addWeaponCargoGlobal [_keySelected,1];
_vehicle setVariable ["CharacterID",_characterID,true];
} else {
_vehicle setVariable ["CharacterID","0",true];
diag_log format["There was a problem generating a key for vehicle %1",_vehicle];
};
};
DZMSMessage = {
local _type = _this select 0;
local _title = _this select 1;
local _message = _this select 2;
local _color = "";
call {
if (DZMSAnnounceType == "Hint") exitWith {
_color = if (_type == "Hero") then {"#0D00FF";} else {"#990000";}; // Blue and Red
RemoteMessage = ["hintNoImage",[_title,_message],[_color,"1.75"]];
};
if (DZMSAnnounceType == "titleText") exitWith {
RemoteMessage = ["titleText",_message];
};
if (DZMSAnnounceType == "rollingMessages") exitWith {
RemoteMessage = ["rollingMessages",_message];
};
if (DZMSAnnounceType == "DynamicText") exitWith {
_color = if (_type == "Hero") then {"#0D00FF";} else {"#990000";}; // Blue and Red
_params = ["0.40","#FFFFFF","0.60",_color,0,-.35,10,0.5];
RemoteMessage = ["dynamic_text", ["DZMS",_message],_params];
};
};
publicVariable "RemoteMessage";
};
DZMSisClosest = {
local _position = _this;
local _closest = objNull;
local _scandist = DZMSAutoClaimAlertDistance;
{
local _dist = vehicle _x distance _position;
if (isPlayer _x && _dist < _scandist) then {
_closest = _x;
_scandist = _dist;
};
} count playableUnits;
_closest
};
DZMSAutoClaimAlert = {
local _unit = _this select 0;
local _mission = _this select 1;
local _type = _this select 2;
local _name = if (typeName _unit == "ARRAY") then {_unit select 1;} else {name _unit;};
local _message = call {
if (_type == "Start") exitWith {["STR_CL_AUTOCLAIM_ANNOUNCE",_mission,DZMSAutoClaimDelayTime];};
if (_type == "Stop") exitWith {["STR_CL_AUTOCLAIM_NOCLAIM",_mission];};
if (_type == "Return") exitWith {["STR_CL_AUTOCLAIM_RETURN",DZMSAutoClaimTimeout];};
if (_type == "Reclaim") exitWith {"STR_CL_AUTOCLAIM_RECLAIM";};
if (_type == "Claimed") exitWith {["STR_CL_AUTOCLAIM_CLAIM",_name,_mission];};
if (_type == "Unclaim") exitWith {["STR_CL_AUTOCLAIM_ABANDON",_name,_mission];};
};
if (_type == "Claimed" || _type == "Unclaim") exitWith {
RemoteMessage = ["IWAC",_message];
publicVariable "RemoteMessage";
};
RemoteMessage = ["IWAC",_message];
(owner _unit) publicVariableClient "RemoteMessage";
};
DZMSCheckReturningPlayer = {
local _position = _this select 0;
local _acArray = _this select 1;
local _playerUID = _acArray select 0;
local _returningPlayer = objNull;
{
if ((isPlayer _x) && (_x distance _position <= DZMSAutoClaimAlertDistance) && (getplayerUID _x == _playerUID)) then {
_returningPlayer = _x;
};
} count playableUnits;
_returningPlayer
};
DZMSAbortMission = {
local _mission = _this select 0;
local _aiType = _this select 1;
local _markerIndex = _this select 2;
local _posIndex = _this select 3;
local _remove = [];
{
if (typeName _x == "ARRAY") then {
_remove set [count _remove, (_x select 1)];
};
} count (DZE_ServerMarkerArray select _markerIndex);
PVDZ_ServerMarkerSend = ["end",_remove];
publicVariable "PVDZ_ServerMarkerSend";
if (_aiType == "Hero") then {
DZMSHeroEndTime = diag_tickTime;
DZMSHeroRunning = DZMSHeroRunning - 1;
} else {
DZMSBanditEndTime = diag_tickTime;
DZMSBanditRunning = DZMSBanditRunning - 1;
};
DZMSMissionData set [_mission, -1];
DZE_ServerMarkerArray set [_markerIndex, -1];
DZE_MissionPositions set [_posIndex, -1];
};
DZMSFreeze = {
{
if !(_x getVariable ["DoNotFreeze", false]) then {
{
if (alive _x) then {
_x disableAI "TARGET";
_x disableAI "MOVE";
_x disableAI "FSM";
_x setVehicleInit "this hideObject true";
};
} count units _x;
processInitCommands;
{
clearVehicleInit _x;
} count units _x;
if (DZMSDebug) then {diag_log format ["DZMS: Freezing Units of Group: %1", _x];};
};
} count _this;
};
DZMSUnFreeze = {
{
if !(_x getVariable ["DoNotFreeze", false]) then {
{
if (alive _x) then {
_x enableAI "TARGET";
_x enableAI "MOVE";
_x enableAI "FSM";
_x setVehicleInit "this hideObject false";
};
} count units _x;
processInitCommands;
{
clearVehicleInit _x;
} count units _x;
if (DZMSDebug) then {diag_log format ["DZMS: Unfreezing Units of Group: %1", _x];};
};
} count _this;
};
//------------------------------------------------------------------//
if (DZMSDebug) then {diag_log text format ["[DZMS]: Mission Functions Script Loaded!"];};

View File

@ -0,0 +1,149 @@
/* //
DZMSM2Spawn.sqf by JasonTM
Usage: [positions,,skillLevel,AI type,mission number] call DZMSM2Spawn;
Position is the coordinates to spawn at [X,Y,Z]
SkillLevel is the skill number defined in DZMSAIConfig.sqf
AI type is either "Hero" or "Bandit" set in DZMSTimer.sqf
Mission number is the count of the DZMSMissionData array (-1 because arrays are zero indexed) when the mission spawns
*/
local _positions = _this select 0;
local _skill = _this select 1;
local _aiType = _this select 2;
local _mission = nil;
if (count _this > 3) then {
_mission = _this select 3;
};
local _unitGroup = createGroup east;
local _aiskin = "";
// Add the group to the mission data array
if !(isNil "_mission") then {
((DZMSMissionData select _mission) select 4) set [count ((DZMSMissionData select _mission) select 4), _unitGroup];
};
_unitGroup setVariable ["DoNotFreeze", true];
{
//Lets pick a skin from the array and assign as Hero or Bandit
if (_aiType == "Bandit") then {
_aiskin = DZMSBanditSkins call BIS_fnc_selectRandom;;
} else {
_aiskin = DZMSHeroSkins call BIS_fnc_selectRandom;
};
//Lets spawn the unit
local _unit = _unitGroup createUnit [_aiskin, [0,0,0], [], 10, "PRIVATE"];
//Make him join the correct team
[_unit] joinSilent _unitGroup;
//Add the behavior
_unit enableAI "TARGET";
_unit enableAI "AUTOTARGET";
_unit enableAI "MOVE";
_unit enableAI "ANIM";
_unit enableAI "FSM";
_unit setCombatMode "YELLOW";
_unit setBehaviour "COMBAT";
//Remove the items he spawns with by default
removeAllWeapons _unit;
removeAllItems _unit;
//Now we need to figure out their loadout, and assign it
local _wepArray = DZMSAIWeps call BIS_fnc_selectRandom;
local _weapon = _wepArray call BIS_fnc_selectRandom;
local _magazine = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines") select 0;
for "_i" from 1 to 3 do {
_unit addMagazine _magazine;
};
_unit addBackpack (DZMSPacks call BIS_fnc_selectRandom);
_unit addWeapon _weapon;
if (!DZMSOverwatch) then {
local _attachments = configFile >> "CfgWeapons" >> _weapon >> "Attachments";
if (isClass _attachments && {count _attachments > 0}) then {
local _attach = configName (_attachments call BIS_fnc_selectRandom);
if (_attach == "Attachment_Tws") then {
if (DZMS_AllowThermal) then {
_unit addMagazine _attach;
};
} else {
_unit addMagazine _attach;
};
};
};
if (DZMSUseNVG) then {
_unit addWeapon "NVGoggles";
};
//Get the gear array
local _aigear = [DZMSGear0,DZMSGear1,DZMSGear2,DZMSGear3,DZMSGear4] call BIS_fnc_selectRandom;
{
_unit addMagazine _x
} count (_aigear select 0);
{
_unit addWeapon _x
} count (_aigear select 1);
// New for 1.0.7 - Hero and bandit dog tags that can be traded for +/- humanity.
if (_aitype == "Hero") then {
if (random 1 <= DZMS_HeroDogTag) then {
_unit addMagazine "ItemDogTagHero";
};
} else {
if (random 1 <= DZMS_BanditDogTag) then {
_unit addMagazine "ItemDogTagBandit";
};
};
//Lets set the skills
local _aicskill = call {
if (_skill == 0) exitWith {DZMSSkills0;};
if (_skill == 1) exitWith {DZMSSkills1;};
if (_skill == 2) exitWith {DZMSSkills2;};
if (_skill == 3) exitWith {DZMSSkills3;};
DZMSSkills1;
};
{
_unit setSkill [(_x select 0),(_x select 1)]
} count _aicskill;
_unit addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] call DZMSAIKilled;}];
// Lets spawn the M2 Static Gun
local _static = "M2StaticMG" createVehicle _x;
if (surfaceIsWater _x) then {
_static setPosASL _x;
} else {
_static setPosATL _x;
};
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_static];
_unit moveInGunner _static;
_static addEventHandler ["GetOut",{
_unit = _this select 2;
_static = _this select 0;
if (alive _unit) then {_unit moveInGunner _static};
}];
if !(isNil "_mission") then {
_unit setVariable ["DZMSAI" + dayz_serverKey, [_mission,_aiType]];
DZMSMissionData select _mission set [0, ((DZMSMissionData select _mission) select 0) + 1];
((DZMSMissionData select _mission) select 5) set [count ((DZMSMissionData select _mission) select 5), _static];
} else {
_unit setVariable ["DZMSAI" + dayz_serverKey, [-1,_aiType]];
};
} forEach _positions;

View File

@ -0,0 +1,49 @@
// This is a modified version of the DayZ Epoch file fn_spawnObjects.sqf used to spawn mission objects.
local _objects = _this select 0;
local _pos = _this select 1;
local _mission = _this select 2;
local _object = objNull;
local _list = [];
local _fires = [
"Base_Fire_DZ",
"flamable_DZ",
"Land_Camp_Fire_DZ",
"Land_Campfire",
"Land_Campfire_burning",
"Land_Fire",
"Land_Fire_burning",
"Land_Fire_DZ",
"Land_Fire_barrel",
"Land_Fire_barrel_burning",
"Misc_TyreHeap"
];
{
local _type = _x select 0;
local _offset = _x select 1;
local _position = [(_pos select 0) + (_offset select 0), (_pos select 1) + (_offset select 1), 0];
if (count _offset > 2) then {
_position set [2, (_offset select 2)];
};
_object = _type createVehicle [0,0,0];
if (count _x > 2) then {
_object setDir (_x select 2);
};
_object setPos _position;
_object setVectorUp surfaceNormal position _object;
if (DZMSObjectsDamageOff) then {
_object addEventHandler ["HandleDamage",{0}];
if !(_type in _fires) then {_object enableSimulation false;};
};
_list set [count _list, _object];
((DZMSMissionData select _mission) select 1) set [count ((DZMSMissionData select _mission) select 1), _object];
} forEach _objects;
_list

View File

@ -0,0 +1,137 @@
local _mission = _this select 0;
local _coords = _this select 1;
local _type = _this select 2;
local _offset = _this select 3;
if (typeName _type == "ARRAY") then {
_type = _type call BIS_fnc_selectRandom;
};
local _position = [(_coords select 0) + (_offset select 0),(_coords select 1) + (_offset select 1),0];
if ((count _offset) > 2) then {
_position set [2, (_this select 2)];
};
local _veh = _type createVehicle _position;
if (count _this > 4) then {
_veh setDir (_this select 4);
} else {
_veh setDir (round(random 360));
};
_veh setPos _position;
_veh setVariable ["CharacterID","1",true];
_veh setVariable ["ObjectID","1", true];
_veh setVariable ["DZMSCleanup" + dayz_serverKey,true,false];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor, _veh];
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
_veh setVehicleLock "locked";
local _ranFuel = random 1;
if (_ranFuel < .1) then {_ranFuel = .1;};
if (getNumber(configFile >> "CfgVehicles" >> _type >> "isBicycle") != 1) then {
local _hitpoints = _veh call vehicle_getHitpoints;
{
local _selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _x >> "name");
local _strH = "hit_" + (_selection);
_veh setHit[_selection,0];
_veh setVariable [_strH,0,true];
} count _hitpoints;
_veh setFuel _ranFuel;
};
if (DZMSVehDamageOff) then {
_veh addEventHandler ["HandleDamage",{false}];
} else {
_veh addEventHandler ["HandleDamage",{_this call fnc_veh_handleDam}];
};
((DZMSMissionData select _mission) select 2) set [count ((DZMSMissionData select _mission) select 2), _veh];
// Set "GetIn" event handlers
if (DZMSSaveVehicles) then {
if (DZMSEpoch) then {
_veh addEventHandler ["GetIn", {
local _veh = _this select 0;
local _class = typeOf _veh;
local _worldspace = [getDir _veh, getPosATL _veh];
_veh setVariable["DZMSCleanup" + dayz_serverKey, nil];
local _uid = _worldspace call dayz_objectUID2;
format ["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:", dayZ_instance, _class, 0, (_veh getVariable ["CharacterID", "0"]), _worldspace, [getWeaponCargo _veh,getMagazineCargo _veh,getBackpackCargo _veh], [], (fuel _veh), _uid] call server_hiveWrite;
local _result = (format["CHILD:388:%1:", _uid]) call server_hiveReadWrite;
if ((_result select 0) != "PASS") then {
deleteVehicle _veh;
diag_log format ["DZMS PublishVeh Error: failed to get id for %1 : UID %2.",_class, _uid];
} else {
_veh setVariable ["ObjectID", (_result select 1), true];
_veh setVariable ["lastUpdate",diag_tickTime];
_veh call fnc_veh_ResetEH;
PVDZE_veh_Init = _veh;
publicVariable "PVDZE_veh_Init";
if (DZMSDebug) then {diag_log ("DZMS PublishVeh: Created " + (_class) + " with ID " + str(_uid));};
// Send message to player
if (DZMSMakeVehKey) then {
RemoteMessage = ["rollingMessages","STR_CL_DZMS_VEH1"];
(owner (_this select 2)) publicVariableClient "RemoteMessage";
} else {
RemoteMessage = ["rollingMessages","STR_CL_DZMS_VEH2"];
(owner (_this select 2)) publicVariableClient "RemoteMessage";
};
};
}];
} else {
// DayZ Vanilla Mod
_veh addEventHandler ["GetIn", {
local _veh = _this select 0;
_veh setVariable["DZMSCleanup" + dayz_serverKey, nil];
_veh removeAllEventHandlers "HandleDamage";
_veh addEventHandler ["HandleDamage",{_this call fnc_veh_handleDam}];
RemoteMessage = ["rollingMessages","STR_CL_DZMS_VEH3"];
(owner (_this select 2)) publicVariableClient "RemoteMessage";
}];
// Save the vehicle when the player gets out
_veh addEventHandler ["GetOut", {
local _veh = _this select 0;
local _worldspace = [getDir _veh, getPosATL _veh];
local _objectUID = _worldspace call dayz_objectUID2;
_object setVariable ["ObjectUID",_objectUID,true];
if !((([_veh] call fnc_getPos) select 2) > 2) then { // Prevent helicopters from saving if the player bails out during flight.
format ["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:", dayZ_instance, typeOf _veh, 0, 0, _worldspace, [[[],[]],[[],[]],[[],[]]], [], fuel _veh, _objectUID] call server_hiveWrite;
RemoteMessage = ["rollingMessages","STR_CL_DZMS_VEH4"];
(owner (_this select 2)) publicVariableClient "RemoteMessage";
};
_veh call fnc_veh_ResetEH; // No PV for this in Vanilla Mod, so I made one to get the repair feature to work before restart.
PVCDZ_veh_Init = _veh;
publicVariable "PVCDZ_veh_Init";
}];
};
} else {
_veh addEventHandler ["GetIn",{
local _veh = _this select 0;
RemoteMessage = ["rollingMessages","STR_CL_DZMS_VEH5"];
(owner (_this select 2)) publicVariableClient "RemoteMessage";
if !(_veh getVariable ["DZMSCleanup" + dayz_serverKey, true]) exitWith {}; // Check to prevent handlers from resetting every time the player exits and re-enters the vehicle.
_veh setVariable["DZMSCleanup" + dayz_serverKey, false];
if (DZMSEpoch) then {
PVDZE_veh_Init = _veh;
publicVariable "PVDZE_veh_Init";
} else {
_veh removeAllEventHandlers "HandleDamage";
_veh addEventHandler ["HandleDamage",{_this call fnc_veh_handleDam}];
PVCDZ_veh_Init = _veh;
publicVariable "PVCDZ_veh_Init";
};
}];
};
_veh

View File

@ -0,0 +1,177 @@
// Start mission monitoring thread
local _mission = _this select 0;
local _coords = _this select 1;
local _aiType = _this select 2;
local _name = _this select 3;
local _localName = _this select 4;
local _markerIndex = _this select 5;
local _posIndex = _this select 6;
local _msgwin = _this select 7;
local _msglose = _this select 8;
local _complete = false;
local _startTime = diag_tickTime;
local _staticTime = diag_tickTime;
local _hero = _aiType == "Hero";
local _data = DZMSMissionData select _mission;
local _aiCount = _data select 0;
local _objects = _data select 1;
local _vehicles = _data select 2;
local _crates = _data select 3;
local _groups = _data select 4;
local _staticGuns = _data select 5;
local _killReq = _aiCount - (DZMSRequiredKillPercent * _aiCount);
local _markerColor = ["ColorRed","ColorBlue"] select _hero;
local _missionName = ["Bandit " + _name,"Hero " + _name] select _hero;
local _localized = ["STR_CL_MISSION_BANDIT","STR_CL_MISSION_HERO"] select _hero;
local _text = "";
local _playerNear = false;
local _closestPlayer = objNull;
local _acArray = [];
local _claimed = false;
local _acTime = diag_tickTime;
local _claimTime = 0;
local _left = false;
local _leftTime = 0;
local _warnArray = [];
local _markers = DZE_ServerMarkerArray select _markerIndex;
local _newCount = 0;
local _dotMarker = "DZMSDot" + str _mission;
local _autoMarkDot = "DZMSAutoDot" + str _mission;
local _autoText = "";
local _frozen = false;
local _cacheTime = diag_tickTime;
// Add AI counter if enabled.
if (DZMSAICount) then {
_text = if (_hero) then {
["STR_CL_MISSION_HERO_COUNT",_localName,_aiCount,"STR_CL_MISSION_HEROS"];
} else {
["STR_CL_MISSION_BANDIT_COUNT",_localName,_aiCount,"STR_CL_MISSION_BANDITS"];
};
PVDZ_ServerMarkerSend = ["textSingle",[_dotMarker,_text]];
publicVariable "PVDZ_ServerMarkerSend";
(_markers select 1) set [7, _text];
DZE_ServerMarkerArray set [_markerIndex, _markers];
};
while {!_complete} do {
_newCount = (DZMSMissionData select _mission) select 0;
if (DZMSAICount) then {
// Check to see if the AI count has changed and update the marker.
if (_newCount != _aiCount) then {
_aiCount = _newCount;
_text = if (_hero) then {
["STR_CL_MISSION_HERO_COUNT",_localName,_aiCount,"STR_CL_MISSION_HEROS"];
} else {
["STR_CL_MISSION_BANDIT_COUNT",_localName,_aiCount,"STR_CL_MISSION_BANDITS"];
};
PVDZ_ServerMarkerSend = ["textSingle",[_dotMarker,_text]];
publicVariable "PVDZ_ServerMarkerSend";
(_markers select 1) set [7, _text];
DZE_ServerMarkerArray set [_markerIndex, _markers];
};
};
// AI Caching
if (DZMSAICaching) then {
if (!_playerNear && !_frozen && {diag_tickTime - _cacheTime > 15}) then {
_groups call DZMSFreeze;
_cacheTime = diag_tickTime;
_frozen = true;
};
if (_playerNear && _frozen && {diag_tickTime - _cacheTime > 15}) then {
_groups call DZMSUnFreeze;
_cacheTime = diag_tickTime;
_frozen = false;
};
};
if (DZMSAutoClaim) then {
#include "\z\addons\dayz_server\DZMS\Scripts\DZMSAutoClaim.sqf"
};
// JIP player "invisible static gunner" glitch fix
if ((count _staticGuns) > 0 && {(diag_tickTime - _staticTime) > 180}) then {
{
(gunner _x) action ["getout",_x];
} count _staticGuns;
_staticTime = diag_tickTime;
};
// Replenish the ammo in the static guns and check for dead gunner
{
if (alive _x && ({alive _x} count crew _x > 0)) then {
_x setVehicleAmmo 1;
} else {
_x setDamage 1;
};
} count _staticGuns;
// Check for completion
if (_newCount <= _killReq) then {
if ([_coords,30] call DZMSNearPlayer) then {
_complete = true;
[_aiType,_localName,_msgwin] call DZMSMessage;
// Address mission vehicles
{
if (DZMSSaveVehicles && {DZMSMakeVehKey}) then {
_x call DZMSVehKey;
} else {
_x setVariable ["CharacterID", "0", true];
};
_x setVehicleLock "unlocked";
} count _vehicles;
// Spawn loot in the crates
{
[(_x select 0),(_x select 1)] call DZMSBoxSetup;
} count _crates;
if (DZMSSceneryDespawnTimer > 0) then {
[_coords,_mission,_objects,_vehicles,_crates,_groups,_staticGuns,_posIndex,false] spawn DZMSCleanupThread;
};
diag_log text format["[DZMS]: %1 has been completed.",_missionName];
};
};
// Check for near players
_playerNear = [_coords,DZMSTimeoutDistance] call DZMSNearPlayer;
// Timeout the mission if a player is not near
if (diag_tickTime - _startTime > DZMSMissionTimeOut*60 && !_playerNear) then {
_complete = true;
[_coords,_mission,_objects,_vehicles,_crates,_groups,_staticGuns,_posIndex,true] spawn DZMSCleanupThread;
[_aiType,_localName,_msglose] call DZMSMessage;
diag_log text format["[DZMS]: %1 has timed out.",_missionName];
};
// If player is within range of the mission reset the start timer.
if (_playerNear) then {_startTime = diag_tickTime;};
uiSleep 2;
};
// Tell all clients to remove the markers from the map
local _remove = [];
{
if (typeName _x == "ARRAY") then {
_remove set [count _remove, (_x select 1)];
};
} count _markers;
PVDZ_ServerMarkerSend = ["end",_remove];
publicVariable "PVDZ_ServerMarkerSend";
//Let the timer know the mission is over
if (_hero) then {
DZMSHeroEndTime = diag_tickTime;
DZMSHeroRunning = DZMSHeroRunning - 1;
} else {
DZMSBanditEndTime = diag_tickTime;
DZMSBanditRunning = DZMSBanditRunning - 1;
};
DZE_ServerMarkerArray set [_markerIndex, -1];
DZMSMissionData set [_mission, -1];