Jump to content

Donnovan

Member
  • Posts

    840
  • Joined

  • Last visited

  • Days Won

    12

Posts posted by Donnovan

  1. @ All,

     

    The veicles explode because they are not listed in the safe vehicles variable:

     

    I added this code in the main scrip (first post updated), this will hopefully fix the problem:

    [] spawn {
    	waitUntil {!isNil "DZE_safeVehicle"};
    	sleep 5;
    	_cascaVehicles = ["Lada2","UAZ_CDF","HMMWV_M1035_DES_EP1","Offroad_DSHKM_Gue","UAZ_MG_CDF","WMMWV_M998A2_SOV_DES_EP1"];
    	DZE_safeVehicle = DZE_safeVehicle + _cascaVehicles;
    };
    

    This code must be run on the server, so if anyone is running the script in a Headless Client, copy this code and run it on the server. No need to remove it.

     

    @ Charles,

     

    I will love to help. You already helped me! But even if you had not helped.

     

    You can edit anything you want.

     

    About dificulty, you believe a vehicle with turret could help? This can be done really simple, since the code for it, and for bigger convoys (4, 5, 6 vehicles) is ready.

  2. If you don't mind humoring me, why do you have to call the convoy before the wai/dzms?  Just trying to learn, obviously you are right!

    The script is completely stand alone, so there is no matter where or when you exec it.

    The only thing i found that interfer with other AI scripts are zombies friendship with bots. For Casca cars, its desirable to make zombies as AI friends, so AI don't get distracted by zonbies and traders.

    To do that, see post #13.

  3. A small change in configuration:

    _cascasToSpawn = 8; //Number of convoys to Spawn: default is 8
    _convoyFormation = [1,1,1,2,2,2,3,3]; //number of cars in each convoy. Must have _cascasToSpawn numbers.
    _cascasToSpawn: the number of convoys to spawn.

    _convoyFormation: number of cars in each of the convoys set on _cascasToSpawn. Can be 1, 2 or 3.

    So, the number of itens in _convoyFormation must be equal the number in _cascasToSpawn.

    Example 1:

    _cascasToSpawn = 10;

    _convoyFormation = [1,1,2,2,2,2,3,3,3,3]; //10 numbers (must be 1, 2 or 3 only)

    Example 2:

    _cascasToSpawn = 10;

    _convoyFormation = [1,1,1,1,1,1,1,1,1,1]; //10 single convoys (1 car only)

    Example 2:

    _cascasToSpawn = 5;

    _convoyFormation = [3,3,3,3,3]; //5 convoys with 3 cars

    Wrong Example 1:

    _cascasToSpawn = 7;

    _convoyFormation = [1,2,2,3]; //Wrong! The array must have 7 numbers!

  4. @ ElDubya,

    Thanks for the tutorial!

    @ CharlesDarwin,

    ElDubya tutorial is nice. Try it please!

    @ All,

    The only problem left is that, i believe, DZMS makes AI and zombies enemyes, so the convoy can stop because of zombies.

    If this happens, you can try to fix by making Zombies and AI friends with those lines:

     

    //Bots Friend to Zombies
    EAST setFriend [CIVILIAN,1];
    CIVILIAN setFriend [EAST,1];
    
    You must run this command on the server and it can be run at the end of the server file init/server_functions.sqf.

    Some other script may also run this command, so if its not working, may be some other AI script is changing it.

  5. Here my HC server release, it contains:

    - Server File

    - Mission File

    - BE filters

    - Bat file to start the HC server

    - Config.cfg with the necessary configuration for HC

    Link: https://www.dropbox.com/s/a37plq5oyarlnhc/Arma%202%20Epoch%20Good%20Man%20Server%20Release.7z?dl=0

    Payd features was removed (i.e. infiStar).

    If you want to add infiStar, you need to make some changes in it because of custom keys used on the scripts and because of the DayZ Group Management Script. Leave a post please.

  6. @smokingred,

     

    You can change those arrays, on the Extra Konfiguration Section:

    //Simple loot, for car 1 of convoys with 1 car and for car 1 and 2 with convoys with 2 or 3 cars
    //[command to add loot,the item to add as loot,[quantity of the item when in a convoy with 1 vehicle,2 vehicles,3 vehicles]]
    _loot1 = [
    	["addWeaponCargoGlobal","NVGoggles",[3,4,5]],
    	["addWeaponCargoGlobal","ItemEtool",[3,4,5]],
    	["addWeaponCargoGlobal","Binocular_Vector",[2,3,4]],
    	["addMagazineCargoGlobal","ItemBloodBag",[8,12,16]],
    	["addMagazineCargoGlobal","PartEngine",[5,7,9]],
    	["addMagazineCargoGlobal","ItemBandage",[20,25,30]],
    	["addMagazineCargoGlobal","HandGrenade_West",[6,10,14]],
    	["addMagazineCargoGlobal","ItemBriefcase100oz",[1,1,2]],
    	["addMagazineCargoGlobal","ItemBriefcase100oz",[1,1,1]]
    ];
    
    //High loot, for car 3 of convoys with 3 cars
    //[command to add loot,the item to add as loot,[quantity of the item when in a convoy with 1 vehicle,2 vehicles,3 vehicles]]
    _loot2 = [
    	["addMagazineCargoGlobal","ItemBriefcase100oz",[1,2,3]],
    	["addMagazineCargoGlobal","ItemBriefcase100oz",[1,1,2]],
    	["addMagazineCargoGlobal","ItemBriefcase100oz",[1,1,2]]
    ];
    
  7. @ ElBubya,

     

    Its like that, they stay off for x seconds when they explode. than they became danger again.

    //Zombie Spawn Array
    donn_terror_zomb = [
    	[
    		[[_cx,_cY,0],'cid_salv', 400, 3], //Special line, not realated to spawn
    		//[
    		//	[position],
    		//	Spawn Radius,
    		//	number os zeds,
    		//	zeds view distance,
    		//	dist from player to start to walk,
    		//	special zed? 0 or 1 or 2,
    		//	zed life multiplier 1 is normal life ,
    		//	time to be on the ground after explosion
    		//]
    		[[6660-3735+_fx,14177-5342+_fy,0], 25, 15, 60, 15, 0, 1.1, 60],
    		[[6786-3735+_fx,14320-5342+_fy,0], 25, 15, 60, 15, 0, 1.1, 60],
    		[[6791-3735+_fx,14091-5342+_fy,0], 25, 15, 60, 15, 0, 1.1, 60],
    		[[6668-3735+_fx,14121-5342+_fy,0], 25, 15, 60, 15, 0, 1.1, 60],
    		[[6599-3735+_fx,14260-5342+_fy,0], 25, 15, 60, 15, 0, 1.1, 60],
    		[[6624-3735+_fx,14212-5342+_fy,0],100, 40,100, 15, 0, 1.1, 60],
    		[[6624-3735+_fx,14212-5342+_fy,0],120, 14, 60, 15, 1, 1.2, 60],
    		[[6624-3735+_fx,14212-5342+_fy,0], 10,  1, 60, 15, 2, 3.5,120]
    	]
    ];
    

    The last number (mostly 60) is how much time they will stay off after the explosion. When they are on this state they offer no risk.

     

    If you think its too much hard or too much easy, it's a matter of ajusting this array.

     

    I used zombies with less vision distance and that start to walk 25 o 30 meters from the player, but since it was running in the HC, i had more than 250 zombies. This version is a attempt to make it run on the server, so zombies are fewer (130) but they have a bigger distance vision, and start to walk more near the player.

     

    Tell-me what is wrong and i will try to adjust the array for you.

  8. If you like my work, please consider a donation:
     
    btn_donate_LG.gif $USD
     
    btn_donate_LG.gif $EURO

     

    BANKO MAT - AI CHERNARUS MISSION - WITH SEARCH LIGHST FOR NIGHT ATTACKS
     
    Banko%20dia_zpshxbf1xci.png
     
    ArmA2OA%202015-01-24%2022-09-32-38_zpsel
     
    INSTALLATION

     

    Put the code bellow in a text file with the name banko_mat.sqf. Put this file at the root of your server PBO. Than run the script at the end of your server file init\server_functions.sqf with the command [] execVM "\z\addons\dayz_server\banko_mat.sqf";.
     
    1 - THE SCRIPT:

    //=====================
    //SPAWN BANKO BUILDINGS
    //=====================
    
    diag_log "[HC_ON] Bankai script init!";
    _vehicle = createVehicle ['Land_aif_hotel_bio', [4114.26,8427.27,0.786], [], 0, 'CAN_COLLIDE']; _vehicle setDir 295; _vehicle setPosATL [4114.26,8427.27,0.786]; _vehicle = nil;
    _vehicle = createVehicle ['Land_aif_sara_domek05', [4132.75,8466.39,0.208], [], 0, 'CAN_COLLIDE']; _vehicle setDir 204; _vehicle setPosATL [4132.75,8466.39,0.208]; _vehicle = nil;
    _vehicle = createVehicle ['Land_aif_strazni_vez', [4143.78,8420.04,0.031], [], 0, 'CAN_COLLIDE']; _vehicle setDir 27; _vehicle setPosATL [4143.78,8420.04,0.031]; _vehicle = nil;
    _vehicle = createVehicle ['Land_aif_strazni_vez', [4081.05,8420.35,0.045], [], 0, 'CAN_COLLIDE']; _vehicle setDir 197; _vehicle setPosATL [4081.05,8420.35,0.045]; _vehicle = nil;
    _vehicle = createVehicle ['Land_aif_watertower1', [4099.88,8468.16,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 238; _vehicle setPosATL [4099.88,8468.16,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Fort_Watchtower_EP1', [4153.9,8441.02,0.201], [], 0, 'CAN_COLLIDE']; _vehicle setDir 208; _vehicle setPosATL [4153.9,8441.02,0.201]; _vehicle = nil;
    _vehicle = createVehicle ['Land_HBarrier_large', [4139.34,8411.09,0.208], [], 0, 'CAN_COLLIDE']; _vehicle setDir 209; _vehicle setPosATL [4139.34,8411.09,0.208]; _vehicle = nil;
    _vehicle = createVehicle ['Land_HBarrier_large', [4147.37,8427.39,0.134], [], 0, 'CAN_COLLIDE']; _vehicle setDir 205; _vehicle setPosATL [4147.37,8427.39,0.134]; _vehicle = nil;
    _vehicle = createVehicle ['Land_HBarrier_large', [4088.21,8443.52,0.07], [], 0, 'CAN_COLLIDE']; _vehicle setDir 115; _vehicle setPosATL [4088.21,8443.52,0.07]; _vehicle = nil;
    _vehicle = createVehicle ['Land_HBarrier_large', [4084.74,8428.5,0.006], [], 0, 'CAN_COLLIDE']; _vehicle setDir 31; _vehicle setPosATL [4084.74,8428.5,0.006]; _vehicle = nil;
    _vehicle = createVehicle ['Land_HBarrier1', [4118.59,8427.83,0.852], [], 0, 'CAN_COLLIDE']; _vehicle setDir 26; _vehicle setPosATL [4118.59,8427.83,0.852]; _vehicle = nil;
    _vehicle = createVehicle ['Land_HBarrier1', [4118.11,8425.17,8.666], [], 0, 'CAN_COLLIDE']; _vehicle setDir 118; _vehicle setPosATL [4118.11,8425.17,8.666]; _vehicle = nil;
    _vehicle = createVehicle ['Land_HBarrier1', [4117.45,8424.18,8.739], [], 0, 'CAN_COLLIDE']; _vehicle setDir 118; _vehicle setPosATL [4117.45,8424.18,8.739]; _vehicle = nil;
    _vehicle = createVehicle ['Land_HBarrier1', [4116.9,8423,8.758], [], 0, 'CAN_COLLIDE']; _vehicle setDir 118; _vehicle setPosATL [4116.9,8423,8.758]; _vehicle = nil;
    _vehicle = createVehicle ['Land_HBarrier1', [4117.97,8420.85,16.449], [], 0, 'CAN_COLLIDE']; _vehicle setDir 206; _vehicle setPosATL [4117.97,8420.85,16.449]; _vehicle = nil;
    _vehicle = createVehicle ['Land_HBarrier1', [4119.53,8425.8,4.676], [], 0, 'CAN_COLLIDE']; _vehicle setDir 295; _vehicle setPosATL [4119.53,8425.8,4.676]; _vehicle = nil;
    _vehicle = createVehicle ['Land_HBarrier1', [4117.98,8426.2,12.546], [], 0, 'CAN_COLLIDE']; _vehicle setDir 24; _vehicle setPosATL [4117.98,8426.2,12.546]; _vehicle = nil;
    _vehicle = createVehicle ['Land_HBarrier1_DZ', [4117.29,8428.54,0.894], [], 0, 'CAN_COLLIDE']; _vehicle setDir 26; _vehicle setPosATL [4117.29,8428.54,0.894]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4150.6,8415.99,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 204; _vehicle setPosATL [4150.6,8415.99,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4152.98,8421.65,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 204; _vehicle setPosATL [4152.98,8421.65,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4157.9,8432.65,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 206; _vehicle setPosATL [4157.9,8432.65,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4133.87,8482.61,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 119; _vehicle setPosATL [4133.87,8482.61,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4146.1,8476.31,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 116; _vehicle setPosATL [4146.1,8476.31,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4157.12,8471.42,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 110; _vehicle setPosATL [4157.12,8471.42,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4161.43,8467.38,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 172; _vehicle setPosATL [4161.43,8467.38,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4162.45,8461.18,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 169; _vehicle setPosATL [4162.45,8461.18,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4163.93,8449.02,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 173; _vehicle setPosATL [4163.93,8449.02,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4160.66,8438.1,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 205; _vehicle setPosATL [4160.66,8438.1,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4128.85,8485.35,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 116; _vehicle setPosATL [4128.85,8485.35,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4111.36,8486.18,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 74; _vehicle setPosATL [4111.36,8486.18,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4117.27,8487.94,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 78; _vehicle setPosATL [4117.27,8487.94,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4092.97,8473.57,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 29; _vehicle setPosATL [4092.97,8473.57,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4095.59,8479.02,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 26; _vehicle setPosATL [4095.59,8479.02,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4099.47,8483.08,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 72; _vehicle setPosATL [4099.47,8483.08,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4140.67,8393.56,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 29; _vehicle setPosATL [4140.67,8393.56,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4145.54,8404.69,0.031], [], 0, 'CAN_COLLIDE']; _vehicle setDir 207; _vehicle setPosATL [4145.54,8404.69,0.031]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4123.67,8382.52,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 113; _vehicle setPosATL [4123.67,8382.52,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4129.79,8380.7,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 84; _vehicle setPosATL [4129.79,8380.7,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4137.82,8388.09,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 37; _vehicle setPosATL [4137.82,8388.09,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4112.73,8388.01,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 116; _vehicle setPosATL [4112.73,8388.01,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4107.15,8390.11,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 113; _vehicle setPosATL [4107.15,8390.11,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4083.19,8451.31,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 23; _vehicle setPosATL [4083.19,8451.31,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4085.84,8456.92,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 25; _vehicle setPosATL [4085.84,8456.92,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4076.64,8433.82,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 26; _vehicle setPosATL [4076.64,8433.82,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4078.64,8439.86,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 21; _vehicle setPosATL [4078.64,8439.86,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4074.56,8428.3,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 18; _vehicle setPosATL [4074.56,8428.3,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4071.13,8416.68,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 14; _vehicle setPosATL [4071.13,8416.68,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4069.86,8410.93,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 11; _vehicle setPosATL [4069.86,8410.93,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4073.03,8403.15,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 109; _vehicle setPosATL [4073.03,8403.15,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4078.88,8401.09,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 111; _vehicle setPosATL [4078.88,8401.09,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4090.17,8396.69,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 113; _vehicle setPosATL [4090.17,8396.69,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_Cargo2E_EP1', [4095.93,8394.93,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 112; _vehicle setPosATL [4095.93,8394.93,0]; _vehicle = nil;
    _vehicle = createVehicle ['Land_Misc_ConcBox_EP1', [4096.36,8461.04,0], [], 0, 'CAN_COLLIDE']; _vehicle setDir 34; _vehicle setPosATL [4096.36,8461.04,0]; _vehicle = nil;
    _vehicle = createVehicle ['RampConcrete', [4103.19,8402.95,-0.56], [], 0, 'CAN_COLLIDE']; _vehicle setDir 205; _vehicle setPosATL [4103.19,8402.95,-0.56]; _vehicle = nil;
    _vehicle = createVehicle ['RampConcrete', [4137.88,8473.67,-1.354], [], 0, 'CAN_COLLIDE']; _vehicle setDir 24; _vehicle setPosATL [4137.88,8473.67,-1.354]; _vehicle = nil;
    _vehicle = createVehicle ['RampConcrete', [4130.67,8457.81,-1.042], [], 0, 'CAN_COLLIDE']; _vehicle setDir 205; _vehicle setPosATL [4130.67,8457.81,-1.042]; _vehicle = nil;
    _vehicle = createVehicle ['RampConcrete', [4125.4,8451.55,-1.153], [], 0, 'CAN_COLLIDE']; _vehicle setDir 23; _vehicle setPosATL [4125.4,8451.55,-1.153]; _vehicle = nil;
    
    //=============================
    //SPAWN BOTS, TURRETS, VEHICLES
    //=============================
    
    //Killed Function
    donn_killed = {
    	_unit = _this select 0;
    	_player = _this select 1;
    	if (isPlayer _player) then {
    		{
    			if (((position _x) distance (position _unit)) <= 300) then {
    				_x reveal [_player, 4.0];
    			}
    		} forEach allUnits;
    		
    	};
    	if ("RPG7V" in (weapons _unit)) then {
    		_unit removeWeapon "RPG7V";
    		_unit removeMagazines "PG7V";
    	};
    };
    
    //Spawn AI Function
    bank_aiSpawn = {
    	private ["_radSpawn","_position","_unitcount","_skill","_unitGroup","_aiskin","_unit","_weapon","_magazine","_secWayPoints","_wp","_wpMain"];
    	_position = _this select 0;
    	_unitcount = _this select 1;
    	_skill = _this select 2;
    	_radSpawn = _this select 3;
    	_wayPoints = _this select 4;
    	_combatMode = _this select 5;
    	_unitGroup = createGroup east;
    	for "_x" from 1 to _unitcount do {
    		_aiskin = [
    			"GUE_Commander_DZ",
    			"GUE_Soldier_2_DZ",
    			"GUE_Soldier_CO_DZ",
    			"GUE_Soldier_Crew_DZ",
    			"GUE_Soldier_MG_DZ",
    			"GUE_Soldier_Sniper_DZ"
    		] call BIS_fnc_selectRandom;
    		_unit = _unitGroup createUnit [_aiskin, _position, [], _radSpawn, "PRIVATE"];
    		[_unit] joinSilent _unitGroup;
    		_unit enableAI "TARGET";
    		_unit enableAI "AUTOTARGET";
    		_unit enableAI "MOVE";
    		_unit enableAI "ANIM";
    		_unit enableAI "FSM";
    		_unit setCombatMode _combatMode;
    		_unit setBehaviour "COMBAT";
    		removeAllWeapons _unit;
    		removeAllItems _unit;
    		_weapon = [
    			"FN_FAL",
    			"FN_FAL_ANPVS4",
    			"Mk_48_DZ",
    			"M249_DZ",
    			"BAF_L85A2_RIS_Holo",
    			"G36C",
    			"G36C_camo",
    			"G36A_camo",
    			"G36K_camo",
    			"AK_47_M",
    			"AKS_74_U",
    			"M14_EP1",
    			"bizon_silenced",
    			"DMR_DZ",
    			"RPK_74"
    		] call BIS_fnc_selectRandom;
    		_magazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
    		_magazine = _magazines call BIS_fnc_selectRandom;
    		for "_i" from 1 to 6 do {
    			_unit addMagazine _magazine;
    		};
    		_unit addWeapon _weapon;
    		_unit selectWeapon _weapon;
    		_unit addBackpack "DZ_Backpack_EP1";
    		{_unit addMagazine _x} forEach ["ItemBandage","ItemBandage","ItemPainkiller"];
    		{_unit addWeapon _x} forEach ["ItemKnife","ItemFlashlight"];
    		_unit setSkill 1;
    		_unit addEventHandler ["Killed",{_this call donn_killed;}];
    	};
    	_unit addWeapon "RPG7V";
    	_unit addMagazine "PG7V";
    	_unit addMagazine "PG7V";
    	_unit addMagazine "PG7V";
    	_unit addMagazine "PG7V";
    	_secWayPoints = [];
    	{
    		if ((_position select 0) != (_x select 0) || (_position select 1) != (_x select 1) || (_position select 2) != (_x select 2)) then {
    			_secWayPoints = _secWayPoints + [_x];
    		};
    	} forEach _wayPoints;
    	{_wp = _unitGroup addWaypoint [_x, _radSpawn]; _wp setWaypointType "MOVE";} forEach _secWayPoints;
    	_wpMain = _unitGroup addWaypoint [_position, _radSpawn];
    	_wpMain setWaypointType "CYCLE";
    	diag_log text format["[BANKO]: %1 AI Spawned.",count (units _unitGroup)];
    };
    
    //Populate Turret Function
    turret_unitGroup = createGroup east;
    donn_popTurret = {
    	_aiSkill = _this select 0;
    	{
    		_unit = turret_unitGroup createUnit ["GUE_Commander_DZ", [0,0,0], [], 5, "PRIVATE"];
    		[_unit] joinSilent turret_unitGroup;
    		_unit setCombatMode "YELLOW";
    		_unit setBehaviour "COMBAT";
    		removeAllWeapons _unit;
    		removeAllItems _unit;
    		_unit setSkill _aiSkill;
    		_unit addEventHandler ["Killed",{_this call donn_killed;}];
    		_unit moveInGunner _x;
    		_x spawn {
    			while {true} do {
    				_this setVehicleAmmo 1;
    				sleep 180;
    			};
    		};
    	} forEach (_this select 1);
    };
    
    //Anti Aereo
    //_zu_1 = createVehicle ["ZU23_Ins", [4117,8427,20.1], [], 0, "CAN_COLLIDE"];
    //_zu_2 = createVehicle ["ZU23_Ins", [4113,8431,20.2], [], 0, "CAN_COLLIDE"];
    _zu_1 = createVehicle ["KORD_high", [4117,8427,20.1], [], 0, "CAN_COLLIDE"];
    _zu_2 = createVehicle ["KORD_high", [4113,8431,20.2], [], 0, "CAN_COLLIDE"];
    sleep 0.2;
    _zu_1 setPosATL [4117,8427,20.1];
    _zu_2 setPosATL [4113,8431,20.2];
    sleep 0.2;
    _zu_1 setDir 160;
    _zu_2 setDir 340;
    
    //KORD High 0.50
    _kd_1 = createVehicle ["KORD_high", [4155.0,8443.0,5.00], [], 0, "CAN_COLLIDE"];
    _kd_2 = createVehicle ["KORD_high", [4152.0,8419.0,5.20], [], 0, "CAN_COLLIDE"];
    _kd_3 = createVehicle ["KORD_high", [4077.0,8434.0,5.10], [], 0, "CAN_COLLIDE"];
    _kd_4 = createVehicle ["KORD_high", [4091.3,8396.3,5.10], [], 0, "CAN_COLLIDE"];
    _kd_5 = createVehicle ["KORD_high", [4145.4,8476.7,5.10], [], 0, "CAN_COLLIDE"];
    _kd_6 = createVehicle ["KORD_high", [4083.6,8429.6,2.35], [], 0, "CAN_COLLIDE"];
    sleep 0.2;
    _kd_1 setPosATL [4155.0,8443.0,5.00];
    _kd_2 setPosATL [4152.0,8419.0,5.20];
    _kd_3 setPosATL [4077.0,8434.0,5.10];
    _kd_4 setPosATL [4091.3,8396.3,5.10];
    _kd_5 setPosATL [4145.4,8476.7,5.10];
    _kd_6 setPosATL [4083.6,8429.6,2.35];
    sleep 0.2;
    _kd_1 setDir 53;
    _kd_2 setDir 112;
    _kd_3 setDir 297;
    _kd_4 setDir 186;
    _kd_5 setDir 13;
    _kd_6 setDir 30;
    
    //KORD High 0.50 Intern
    _kdi_1 = createVehicle ["KORD_high", [4115.55,8430.11, 0.86], [], 0, "CAN_COLLIDE"];
    _kdi_2 = createVehicle ["KORD_high", [4128.80,8430.00, 0.48], [], 0, "CAN_COLLIDE"];
    _kdi_3 = createVehicle ["KORD_high", [4105.70,8431.00, 1.14], [], 0, "CAN_COLLIDE"];
    _kdi_4 = createVehicle ["KORD_high", [4099.00,8437.60, 1.29], [], 0, "CAN_COLLIDE"];
    _kdi_5 = createVehicle ["KORD_high", [4119.00,8436.00, 4.58], [], 0, "CAN_COLLIDE"];
    _kdi_6 = createVehicle ["KORD_high", [4133.37,8429.00,11.88], [], 0, "CAN_COLLIDE"];
    _kdi_7 = createVehicle ["KORD_high", [4130.00,8440.00,11.94], [], 0, "CAN_COLLIDE"];
    _kdi_8 = createVehicle ["KORD_high", [4103.00,8443.50,12.70], [], 0, "CAN_COLLIDE"];
    sleep 0.2;
    _kdi_1 setPosATL [4115.55,8430.11, 0.86];
    _kdi_2 setPosATL [4128.80,8430.00, 0.48];
    _kdi_3 setPosATL [4105.70,8431.00, 1.14];
    _kdi_4 setPosATL [4099.00,8437.60, 1.29];
    _kdi_5 setPosATL [4119.00,8436.00, 4.58];
    _kdi_6 setPosATL [4133.37,8429.00,11.88];
    _kdi_7 setPosATL [4130.00,8440.00,11.94];
    _kdi_8 setPosATL [4103.00,8443.50,12.70];
    sleep 0.2;
    _kdi_1 setDir 320;
    _kdi_2 setDir 336;
    _kdi_3 setDir 203;
    _kdi_4 setDir 78;
    _kdi_5 setDir 295;
    _kdi_6 setDir 295;
    _kdi_7 setDir 206;
    _kdi_8 setDir 115;
    
    
    //Populate Turrets
    _turrets = [_zu_1,_zu_2,_kd_1,_kd_2,_kd_3,_kd_4,_kd_5,_kd_6,_kdi_1,_kdi_2,_kdi_3,_kdi_4,_kdi_5,_kdi_6,_kdi_7,_kdi_8];
    [1, _turrets] call donn_popTurret;
    
    //Vehicles - Locked
    _btr_1 = createVehicle ["BTR40_MG_TK_GUE_EP1", [4150,8457,0], [], 0, "CAN_COLLIDE"];
    _btr_2 = createVehicle ["BTR40_MG_TK_GUE_EP1", [4133,8398,0], [], 0, "CAN_COLLIDE"];
    _btr_3 = createVehicle ["BTR40_MG_TK_GUE_EP1", [4090,8410,0], [], 0, "CAN_COLLIDE"];
    _btr_1 lock true;
    _btr_2 lock true;
    _btr_3 lock true;
    _btr_1 setDir 231;
    _btr_2 setDir 233;
    _btr_3 setDir 210;
    
    //Helis - Locked
    _heli_1 = createVehicle ["Mi24_D_TK_EP1", [4130.00,8364.00,0.00], [], 0, "CAN_COLLIDE"];
    _heli_2 = createVehicle ["Ka52", [4109.00,8504.00,0.00], [], 0, "CAN_COLLIDE"];
    _heli_1 lock true;
    _heli_2 lock true;
    _heli_1 setPosATL [4130.00,8364.00,0.00];
    _heli_2 setPosATL [4109.00,8504.00,0.00];
    _heli_1 setDir 255;
    _heli_2 setDir 75;
    
    //Areas
    _patrol_1_interno = [
    	[4148,8456,0],
    	[4128,8390,0],
    	[4102,8401,0]
    ];
    _patrol_2_interno = [
    	[4081,8409,0],
    	[4114,8474,0],
    	[4130,8453,0]
    ];
    _patrol_1_externo = [
    	[4098,8503,0],
    	[4174,8480,0],
    	[4135,8361,0],
    	[4056,8400,0]
    ];
    _patrol_teto = [
    	[4131,8437,16.0],
    	[4120,8411,16.3],
    	[4098,8421,17.0],
    	[4107,8446,17.0]
    ];
    _patrol_all = [
    	[8,3,_patrol_1_interno,_patrol_1_interno,"YELLOW"],
    	[8,4,_patrol_2_interno,_patrol_2_interno,"YELLOW"],
    	[8,3,_patrol_1_externo,_patrol_1_externo,"RED"],
    	[8,4,_patrol_1_externo,_patrol_1_externo,"RED"]
    //	[0,1,_patrol_teto,_patrol_teto,"YELLOW"]
    ];
    
    //Spawn AI Call Func
    {
    	_rad = _x select 0;
    	_qty = _x select 1;
    	_patrolPoints = _x select 3;
    	_combatMode = _x select 4;
    	{
    		[_x,_qty,3,_rad,_patrolPoints,_combatMode] call bank_aiSpawn;
    	} forEach (_x select 2);
    } forEach _patrol_all;
    
    //Banko Loot
    _lootPos = [4135.34,8435.4,11.9];
    if ((random 100) <= 50) then {_lootPos = [4107.84,8448.80,12.64];};
    _loot = createVehicle ["RULaunchersBox", _lootPos, [], 0, "CAN_COLLIDE"];
    clearweaponcargoGlobal _loot;
    clearmagazinecargoGlobal _loot;
    _loot addWeaponCargoGlobal ["M107_DZ",2];
    _loot addmagazineCargoGlobal ["10Rnd_127x99_m107",5];
    _qtyBC = 4 + ([1,2,3] call BIS_fnc_selectRandom);
    _loot addmagazineCargoGlobal ["ItemBriefcase100oz",_qtyBC];
    _loot addmagazineCargoGlobal ["ItemSodaRabbit",50];
    _loot setVariable ["permaLoot",true,true];
    _loot setPosATL _lootPos;
    [_loot, _lootpos] spawn {
    	_loot = _this select 0;
    	_lootPos = _this select 1;
    	while {true} do {
    		waitUntil {sleep 0.001; ((getPosATL _loot) select 2) > 15};
    		_loot setPosATL _lootPos;
    	};
    };
    
    //===============================================
    //SPAWN SEARCHLIGHTS WITH SPECIAL BOT UTILIZATION
    //===============================================
    
    donn_vecDir = {
    	private ["_pnt1","_pnt2","_vec","_vecX","_vecY","_magnitude","_asin1","_asin2","_acos1","_acos2","_asin1r","_asin2r","_acos1r","_acos2r","_calcDir"];
    	_pnt1 = _this select 0;
    	_pnt2 = _this select 1;
    	_vec = [(_pnt2 select 0) - (_pnt1 select 0), (_pnt2 select 1) - (_pnt1 select 1)];
    	_vecX = _vec select 0;
    	_vecY = _vec select 1;
    	_magnitude = sqrt(_vecX^2 + _vecY^2);
    
    	_asin1 = asin (_vecX/_magnitude);
    	_asin2 = 180 - _asin1;
    	_acos1 = acos (_vecY/_magnitude);
    	_acos2 = -_acos1;
    	
    	_asin1 = (_asin1 + 360) mod 360;
    	_asin2 = (_asin2 + 360) mod 360;
    	_acos1 = (_acos1 + 360) mod 360;
    	_acos2 = (_acos2 + 360) mod 360;
    	
    	_asin1r = (round (_asin1 * 100))/100;
    	_asin2r = (round (_asin2 * 100))/100;
    	_acos1r = (round (_acos1 * 100))/100;
    	_acos2r = (round (_acos2 * 100))/100;
    
    	_calcDir = 0;
    	if (_asin1r == _acos1r) then {_calcDir = _asin1};
    	if (_asin1r == _acos2r) then {_calcDir = _asin1};
    	if (_asin2r == _acos1r) then {_calcDir = _asin2};
    	if (_asin2r == _acos2r) then {_calcDir = _asin2};
    	_calcDir = _calcDir mod 360;
    	_calcDir
    };
    donn_angleOnPos = {
    	private ["_orig","_false","_origWatch","_origPos","_falsePos","_posFix","_newWatch"];
    	_orig = _this select 0;
    	_false = _this select 1;
    	_origWatch = _this select 2;
    	_origPos = getPos _orig;
    	_falsePos = getPos _false;
    	_posFix = [
    		(_falsePos select 0) - (_origPos select 0),
    		(_falsePos select 1) - (_origPos select 1)
    	];
    	_newWatch = [
    		(_origWatch select 0) + (_posFix select 0),
    		(_origWatch select 1) + (_posFix select 1),
    		0
    	];
    	_newWatch
    };
    donn_angleInside = {
    	//Angles must be from 0 to 360
    	private ["_angle","_left","_right","_dif","_angleOk"];
    	_angle = _this select 0;
    	_left = _this select 1;
    	_right = _this select 2;
    	_dif = abs (_left - _right);
    	_angleOk = false;
    	if (_dif <= 180) then {
    		if (_angle <= _right && _angle >= _left) then {_angleOk = true;};
    		if (_angle <= _left && _angle >= _right) then {_angleOk = true;};
    	} else {
    		if ((_angle >= _right || _angle <= _left) && _right > _left) then {_angleOk = true;};
    		if ((_angle >= _left || _angle <= _right) && _left > _right) then {_angleOk = true;};
    	};
    	_angleOk
    };
    donn_difAngles = {
    	//Angles must be from 0 to 360
    	private ["_initAngle","_endAngle","_difGeral","_difAngles","_difAbs"];
    	_initAngle = _this select 0;
    	_endAngle = _this select 1;
    	_difGeral = _endAngle - _initAngle;
    	if ((abs _difGeral) < 180) then {
    		_difAngles = _difGeral;
    	} else {
    		_difAbs = 360 - (abs _difGeral);
    		if (_endAngle > _initAngle) then {
    			_difAngles	= -_difAbs;
    		} else {
    			_difAngles	= _difAbs;
    		};
    	};
    	_difAngles
    };
    
    donn_unitDir = [];
    donn_oneRun = [];
    donn_justrun = [];
    
    donn_dirChange = {
    	_unit = _this select 0;
    	_posWatch = _this select 1;
    	_unitId = _this select 2;
    	donn_oneRun set [_unitId, (donn_oneRun select _unitId) + 1];
    	_oneRun = donn_oneRun select _unitId;
    	waitUntil {(donn_justRun select _unitId) == (_oneRun - 1)};
    	_unitPos = getPosATL _unit;
    	_newAngle = [_unitPos, _posWatch] call donn_vecDir;
    	donn_newAngle = _newAngle;
    	_oldAngle = donn_unitDir select _unitId;
    	_difAngles = [_oldAngle, _newAngle] call donn_difAngles;
    	_timeChange = abs ((_difAngles/360) * 7.5);
    	_speed = 0;
    	if (_timeChange > 0) then {_speed = _difAngles/_timeChange;};
    	_start = diag_tickTime;
    	_timePassed = 0;
    	while {_timePassed < _timeChange && (donn_oneRun select _unitId) == _oneRun} do {
    		sleep 0.001;
    		_timePassed = diag_tickTime - _start;
    		donn_unitDir set [_unitId, _oldAngle + (_timePassed/_timeChange) * _difAngles];
    	};
    	donn_unitDir set [_unitId, _newAngle];
    	donn_justrun set [_unitId, _oneRun];
    };
    
    //Check for Invasors
    donn_BNK_invasors = [];
    [] spawn {
    	while {true} do {
    		private ["_invasors"];
    		_invasors = [];
    		{
    			if (([4113,8424,16] distance _x) < 300) then {
    				_invasors = _invasors + [_x];
    			};
    		} forEach playableUnits;
    		donn_BNK_invasors = _invasors;
    		systemChat (str donn_BNK_invasors);
    		sleep 10;
    	};
    };
    
    donn_BNK_invasors_del = [];
    donn_onLight = [];
    donn_knowNoOne = [];
    
    donn_holo = {
    	_unit = _this select 0;
    	_range = _this select 1;
    	_vehicle = _this select 2;
    	_unitId = _this select 3;
    	_initDir = getDir _vehicle;
    	
    	//Max & Min Angles
    	_right = (_initDir + 360 + _range/2) mod 360;
    	_left = (_initDir + 360 - _range/2) mod 360;
    	
    	//diag_log format ["[D-SL] INIT - _left: %1 / _initDir: %2 / _right: %3 / range: %4", _left, _initDir, _right, _range];
    	
    	//Generate Watch Dir List
    	_watchDirList = [];
    	for "_x" from 0 to 4 do {
    		_watchDirList = _watchDirList + [(_left + (_x * (_range/4))) mod 360];
    	};
    	
    	//diag_log format ["[D-SL] INIT - _watchDirList: %1", _watchDirList];
    	
    	//Global Status
    	donn_knowNoOne set [_unitId, true];
    	donn_unitDir set [_unitId, _initDir];	
    	
    	// Start scanning 
    	[_unit, _watchDirList, _unitId] spawn {
    		private ["_unit","_watchDirList","_unitId"];
    		_unit = _this select 0;
    		_watchDirList = _this select 1;
    		_unitId = _this select 2;
    		while {alive _unit} do {
    			waitUntil {donn_knowNoOne select _unitId};
    			_watchDir = _watchDirList call BIS_fnc_selectRandom;
    			donn_watchDir = _watchDir;
    			_posUnit = getPosATL _unit;
    			_posWatch = [(_posUnit select 0) + 150 * (sin _watchDir), (_posUnit select 1) + 150 * (cos _watchDir), 0];
    			_unit doWatch _posWatch;
    			[_unit, _posWatch, _unitId] spawn donn_dirChange;
    			//diag_log ("[D-SL] - Mandou unit " + str _unitId + " olhar!");
    			sleep 3.75;
    		};
    	};
    
    	//Engage on Player
    	[_unit, _left, _right, _vehicle, _unitId] spawn {
    		private ["_unit","_left","_right","_vehicle","_invasor","_invasorPos","_unitPos","_angleOk","_angleOk2","_unitDir","_visionLeft","_visionRight","_invAngle","_onLightOthers"];
    		_unit = _this select 0;
    		_left = _this select 1;
    		_right = _this select 2;
    		_vehicle = _this select 3;
    		_unitId = _this select 4;
    		_unitId spawn {
    			_unitId = _this;
    			while {true} do {
    				waitUntil {sleep 0.001; (count donn_BNK_invasors) > 0};
    				donn_BNK_invasors_del set [_unitId, donn_BNK_invasors];
    				waitUntil {sleep 0.001; (count (donn_BNK_invasors_del select _unitId)) == 0};
    			};
    		};
    		while {true} do {
    			while {(count donn_BNK_invasors) > 0} do {
    				waitUntil {sleep 0.001; (count (donn_BNK_invasors_del select _unitId)) > 0};
    				_invasor = (donn_BNK_invasors_del select _unitId) select 0;
    				_invasorPos = getPosATL _invasor;
    				_unitPos = getPosATL _unit;
    				
    				//Calculate Distances
    				_maxDist = 200;
    				_minDist = 45;
    
    				//Calculate Angle to Enlight and light limit angles
    				_unitDir = donn_unitDir select _unitId;
    				_invAngle = [_unitPos, _invasorPos] call donn_vecDir;
    				_visionLeft = (_unitDir + 360 - 18.5) mod 360;
    				_visionRight = (_unitDir + 360 + 18.5) mod 360; 
    				
    				//Angles are ok? 
    				_invOnLight = [_invAngle,_visionLeft,_visionRight] call donn_angleInside;
    				_invOnRange = [_invAngle,_left,_right] call donn_angleInside;
    				_angleOk = [_unitDir,_left,_right] call donn_angleInside;
    				
    				//Distance Invasor
    				_invasorDist = _invasor distance _unit;
    
    				//Do Action
    				_onLightOthers = _invasor in (donn_onLight - [donn_onLight select _unitId]);
    				if (_angleOk && _invOnLight && _invOnRange && (_invasorDist < _maxDist) && (_invasorDist > _minDist) && (alive _invasor) && (alive _unit) && ((vehicle _unit) == _vehicle) && !_onLightOthers) then {
    					donn_knowNoOne set [_unitId, false];
    					donn_onLight set [_unitId, _invasor];
    					_unit doWatch _invasorPos;
    					[_unit, _invasorPos, _unitId] spawn donn_dirChange;
    					sleep 0.25;
    				} else {
    					donn_knowNoOne set [_unitId, true];
    					donn_onLight set [_unitId, ObjNull];
    					donn_BNK_invasors_del set [_unitId, (donn_BNK_invasors_del select _unitId) - [_invasor]];
    					sleep 0.001;
    				};
    			};
    			sleep 2;
    		};
    	};
    };
    
    light_unitGroup = createGroup east;
    donn_popLight = {
    	{
    		_searchLight = _x select 0;
    		_unitId = _x select 1;
    		donn_BNK_invasors_del set [_unitId, []];
    		donn_onLight set [_unitID, ObjNull];
    		donn_oneRun set [_unitID, 0];
    		donn_justrun set [_unitID, 0];
    		_unit = light_unitGroup createUnit ["GUE_Commander_DZ", [0,0,0], [], 0, "PRIVATE"];
    		[_unit] joinSilent light_unitGroup;
    		_unit removeAllEventHandlers "handleDamage";
    		_unit addEventHandler ["handleDamage", {0}];
    		_unit setVariable ["donn_noDel",true,true];
    		_unit disableAI "TARGET";
    		_unit disableAI "AUTOTARGET";
    		_unit disableAI "MOVE";
    		_unit disableAI "ANIM";
    		_unit disableAI "FSM";
    		_unit setBehaviour "CARELESS";
    		_unit setCombatMode "BLUE";
    		_unit setSkill 1;
    		removeAllWeapons _unit;
    		removeAllItems _unit;
    		_unit moveInGunner _searchLight;
    		_unit setUnitPos "UP";
    		[_unit, 120, _searchLight, _unitId] spawn donn_holo;
    	} forEach _this;
    };
    
    //Search Light
    _sl_1 = createVehicle ["SearchLight", [4120.63,8399.37,12.38], [], 0, "CAN_COLLIDE"];
    _sl_2 = createVehicle ["SearchLight", [4087.35,8418.23,13.16], [], 0, "CAN_COLLIDE"];
    _sl_3 = createVehicle ["SearchLight", [4141.12,8436.15,11.61], [], 0, "CAN_COLLIDE"];
    _sl_4 = createVehicle ["SearchLight", [4099.50,8466.90,20.25], [], 0, "CAN_COLLIDE"];
    _sl_1 setPosATL [4120.63,8399.37,12.38];
    _sl_2 setPosATL [4087.35,8418.23,13.16];
    _sl_3 setPosATL [4141.12,8436.15,11.61];
    _sl_4 setPosATL [4099.50,8466.90,20.25];
    _sl_1 setDir 207;
    _sl_2 setDir 295;
    _sl_3 setDir 114;
    _sl_4 setDir 340;
    
    //Populate Search Lights
    _lights = [[_sl_1,0],[_sl_2,1],[_sl_3,2],[_sl_4,3]];
    _lights call donn_popLight;
    
    //=================
    //SHOW ICON ON MAP
    //=================
    
    [] spawn {
    	while {true} do {
    		_don_marker_put = createMarker ["Don_Banko_1", [4114, 8447]];
    		_don_marker_put setMarkerShape "Icon";
    		_don_marker_put setMarkerType "Flag1";
    		_don_marker_put setMarkerText "Banko Mat Mission";
    		_don_marker_put setMarkerColor "ColorBlack";
    		sleep 10;
    		deleteMarker "Don_Banko_1";
    	};
    };
    

    2 - Enable the Banko Building on your mission.sqm file (this file is in the root of your mission folder):
     
    On the Class Mission, in addOns[], add the "aif_arma1buildings" entry, at the end, like bellow, without comma.

    version=11;
    class Mission
    {
    	addOns[]=
    	{
    		"chernarus",
    		"ca_modules_animals",
    		"dayz_anim",
    		"dayz_code",
    		"dayz_communityassets",
    		"dayz_weapons",
    		"dayz_equip",
    		"dayz_epoch",
    		"dayz_vehicles",
    		"cacharacters_pmc",
    		"ca_modules_functions",
    		"glt_m300t",
    		"pook_h13",
    		"csj_gyroac",
    		"map_eu",
    		"jetskiyanahuiaddon",
    		"aif_arma1buildings"
    	};
  9. @ FBI,

     

    For Chernarus original location you can use the files in Post #1. For custom location, use the instructions on post #1, but with the files in post #21.

     

    @ kriogenics,

     

    Is not you running the script two times?

     

    @ ElDubya,

     

    The version with custom location is working ok? I have not tested it. Just waiting some feedback before to rise it to the first post.

  10. Here script 1 (to run on the server or hc) and script 2 (to run on the client) with configurable position of the camp:

     

    You set the camp center in the first option _camp_center.

     

    1 - To run on the server:

    //=====================================
    // KONFIGURATION
    //=====================================
    
    //The center position of the Camp
    _camp_center = [2889, 8870];
    
    //Number of buildings, tents, buildings, on the camp
    _camp_vehicles = [
    	["Acamp", 40],
    	["Land_A_tent", 25],
    	["TentStorage", 15],
    	["Land_Fire_Barrel_Burning", 15],
    	["Misc_Cargo1B_military", 5]
    ];
    
    //Don't mess with those lines
    _original_pos = [2889, 8870];
    _ox = _original_pos select 0;
    _oy = _original_pos select 1;
    _cx = _camp_center select 0;
    _cy = _camp_center select 1;
    _fx = _cx - _ox;
    _fy = _cy - _oy;
    
    //Zombie Spawn Array
    donn_terror_zomb = [
    	[
    		[[_cx,_cY,0],'cid_salv', 400, 3], //Special line, not realated to spawn
    		//[
    		//	[position],
    		//	Spawn Radius,
    		//	number os zeds,
    		//	zeds view distance,
    		//	dist from player to start to walk,
    		//	special zed? 0 or 1 or 2,
    		//	zed life multiplier 1 is normal life ,
    		//	time to be on the ground after explosion
    		//]
    		[[6660-3735+_fx,14177-5342+_fy,0], 25, 15, 60, 15, 0, 1.1, 60],
    		[[6786-3735+_fx,14320-5342+_fy,0], 25, 15, 60, 15, 0, 1.1, 60],
    		[[6791-3735+_fx,14091-5342+_fy,0], 25, 15, 60, 15, 0, 1.1, 60],
    		[[6668-3735+_fx,14121-5342+_fy,0], 25, 15, 60, 15, 0, 1.1, 60],
    		[[6599-3735+_fx,14260-5342+_fy,0], 25, 15, 60, 15, 0, 1.1, 60],
    		[[6624-3735+_fx,14212-5342+_fy,0],100, 40,100, 15, 0, 1.1, 60],
    		[[6624-3735+_fx,14212-5342+_fy,0],120, 14, 60, 15, 1, 1.2, 60],
    		[[6624-3735+_fx,14212-5342+_fy,0], 10,  1, 60, 15, 2, 3.5,120]
    	]
    ];
    
    //=====================================
    // SEND CAMP POS TO PLAYERS
    //=====================================
    
    donn_noZombieAreas = [
    	[[_cx,_cY,0],400]
    ];
    publicVariable "donn_noZombieAreas";
    
    //=====================================
    // SPAWN BUILDINGS
    //=====================================
    
    diag_log "[TERROR-Z] Buildings INIT Initialized!";
    
    //Spawn Camp
    {
    	for "_y" from 1 to (_x select 1) do {
    		_vehicle = createVehicle [_x select 0, _camp_center, [], 90, "NONE"];
    		_vehicle setDir (random 360);
    		sleep 0.001;
    	};
    } forEach _camp_vehicles;
    
    //Parked Buses
    _ikarus = [
    	[[2890+_fx,8988+_fy,0],25 + (random 16),"UNLOCKED"],
    	[[2898+_fx,8983+_fy,0],25 + (random 16),"UNLOCKED"],
    	[[2905+_fx,8975+_fy,0],25 + (random 16),"LOCKED"],
    	[[2912+_fx,8971+_fy,0],25 + (random 16),"LOCKED"],
    	[[2921+_fx,8967+_fy,0],25 + (random 16),"UNLOCKED"]
    ];
    {	
    	_vehicle = createVehicle ["Ikarus_TK_CIV_EP1", _x select 0, [], 0, "NONE"];
    	_vehicle setPosATL (_x select 0);
    	_vehicle setDir (_x select 1);
    	_vehicle setVariable ["ObjectID", "1", true];
    	_vehicle setVariable ["ObjectUID", "1", true];
    	_vehicle setVehicleLock (_x select 2);
    	PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor, _vehicle];
    } forEach _ikarus;
    
    //Alone Building (****) Remove it if you want
    _vehicle = createVehicle ["mbg_apartments_big_01_EO", [2753+_fx,9007+_fy,0.22], [], 0, "CAN_COLLIDE"];
    _vehicle setPosATL [2753+_fx,9007+_fy,0.22];
    _vehicle setDir 130;
    
    //LOOT:
    
    _lootPos = [
    	[6660.3984-3735+_fx, 14177.261-5342+_fy],
    	[6786.0361-3735+_fx, 14320.882-5342+_fy],
    	[6791.7695-3735+_fx, 14091.711-5342+_fy],
    	[6668.1357-3735+_fx, 14121.218-5342+_fy],
    	[6599.8535-3735+_fx, 14260.836-5342+_fy]
    ];
    _lootPosOrder = [
    	[0,1,2,3,4],
    	[4,3,2,1,0],
    	[3,4,0,1,2],
    	[0,4,1,3,2],
    	[2,1,0,4,3],
    	[3,0,4,2,1],
    	[1,4,0,2,3],
    	[1,2,3,0,4],
    	[4,3,2,0,1]
    ];
    
    _order = _lootPosOrder call BIS_fnc_selectRandom;
    
    //=====================================
    // SPAWN LOOT
    //=====================================
    
    //WEAPONS MAIN:
    _this = createVehicle ["TKVehicleBox_EP1", (_lootPos select (_order select 0)), [], 0, "CAN_COLLIDE"];
    _this setDir -182.5;
    
    //Clear Cargo	
    clearweaponcargoGlobal _this;
    clearmagazinecargoGlobal _this;
    
    //Add Cargo
    _this addWeaponCargoGlobal ["DMR_DZ",3];
    _this addWeaponCargoGlobal ["M249_DZ",2];
    _this addWeaponCargoGlobal ["Mk_48_DZ",2];
    _this addWeaponCargoGlobal ["NVGoggles",2];
    _this addWeaponCargoGlobal ["Binocular_Vector",1];
    //_this addWeaponCargoGlobal ["BAF_L85A2_RIS_SUSAT",1];
    //_this addWeaponCargoGlobal ["BAF_L85A2_RIS_Holo",1];
    //_this addWeaponCargoGlobal ["G36K_camo",1];
    //_this addWeaponCargoGlobal ["M4A1_AIM_SD_camo",1];
    //_this addWeaponCargoGlobal ["FN_FAL",1];
    //_this addWeaponCargoGlobal ["M14_EP1",1];
    //_this addWeaponCargoGlobal ["M9SD",1];
    
    _this addmagazineCargoGlobal ["20Rnd_762x51_DMR",5];
    _this addmagazineCargoGlobal ["200Rnd_556x45_M249",3];
    _this addmagazineCargoGlobal ["ItemHeatPack",5];
    _this addmagazineCargoGlobal ["ItemPainkiller",5];
    _this addmagazineCargoGlobal ["ItemMorphine",5];
    _this addmagazineCargoGlobal ["ItemBloodBag",5];
    _this addmagazineCargoGlobal ["ItemAntibiotic",5];
    //_this addmagazineCargoGlobal ["30Rnd_556x45_StanagSD",5];
    //_this addmagazineCargoGlobal ["20Rnd_762x51_FNFAL",5];
    //_this addmagazineCargoGlobal ["100Rnd_762x51_M240",5];
    //_this addmagazineCargoGlobal ["30Rnd_556x45_G36",5];
    //_this addmagazineCargoGlobal ["30Rnd_556x45_Stanag",5];
    //_this addmagazineCargoGlobal ["15Rnd_9x19_M9SD",5];
    
    _this addbackpackCargoGlobal ["DZ_Backpack_EP1",2];
    _this setPos  (_lootPos select (_order select 0));
    _this setVariable ["permaLoot",true,true]; //*DONN*
    
    //VEHICLE PARTS:
    _this = createVehicle ["TKVehicleBox_EP1", (_lootPos select (_order select 1)), [], 0, "CAN_COLLIDE"];
    
    //Clear Cargo	
    clearweaponcargoGlobal _this;
    clearmagazinecargoGlobal _this;
    
    //Add Cargo
    _this addWeaponCargoGlobal ["NVGoggles",3];
    _this addWeaponCargoGlobal ["ItemToolbox",5];
    
    _this addmagazineCargoGlobal ["PartEngine",5];
    _this addmagazineCargoGlobal ["PartGeneric",5];
    _this addmagazineCargoGlobal ["PartVRotor",5];
    _this addmagazineCargoGlobal ["PartWheel",6];
    _this addmagazineCargoGlobal ["PartFueltank",7];
    _this addmagazineCargoGlobal ["PartGlass",10];
    _this addmagazineCargoGlobal ["ItemJerrycan",15];
    
    _this addbackpackCargoGlobal ["DZ_Backpack_EP1",2];
    _this setPos (_lootPos select (_order select 1));
    _this setVariable ["permaLoot",true,true]; //*DONN*
    
    //FOOD:
    _this = createVehicle ["TKVehicleBox_EP1", (_lootPos select (_order select 2)), [], 0, "CAN_COLLIDE"];
    _this setDir -178.83;
    
    //Clear Cargo	
    clearweaponcargoGlobal _this;
    clearmagazinecargoGlobal _this;
    
    //Add Cargo
    _this addWeaponCargoGlobal ["NVGoggles",3];
    _this addWeaponCargoGlobal ["ItemGPS",4];
    
    _this addmagazineCargoGlobal ["FoodCanBadguy",6];
    _this addmagazineCargoGlobal ["FoodCanBoneboy",5];
    _this addmagazineCargoGlobal ["FoodCanCorn",5];
    _this addmagazineCargoGlobal ["FoodCanCurgon",5];
    _this addmagazineCargoGlobal ["FoodCanDemon",5];
    _this addmagazineCargoGlobal ["FoodCanFraggleos",5];
    _this addmagazineCargoGlobal ["FoodCanHerpy",5];
    _this addmagazineCargoGlobal ["FoodCanDerpy",5];
    _this addmagazineCargoGlobal ["FoodCanTylers",5];
    _this addmagazineCargoGlobal ["ItemSodaMtngreen",7];
    _this addmagazineCargoGlobal ["ItemSodaR4z0r",5];
    _this addmagazineCargoGlobal ["ItemSodaClays",5];
    _this addmagazineCargoGlobal ["ItemSodaSmasht",5];
    _this addmagazineCargoGlobal ["ItemSodaDrwaste",5];
    _this addmagazineCargoGlobal ["ItemSodaLemonade",5];
    _this addmagazineCargoGlobal ["ItemSodaLvg",7];
    _this addmagazineCargoGlobal ["ItemSodaMzly",5];
    _this addmagazineCargoGlobal ["ItemSodaRabbit",5];
    
    _this addbackpackCargoGlobal ["DZ_Backpack_EP1",1];
    _this setPos (_lootPos select (_order select 2));
    _this setVariable ["permaLoot",true,true]; //*DONN*
    
    //MEDICAL:
    _this = createVehicle ["TKVehicleBox_EP1", (_lootPos select (_order select 3)), [], 0, "CAN_COLLIDE"];
    _this setDir 90.560677;
    
    //Clear Cargo	
    clearweaponcargoGlobal _this;
    clearmagazinecargoGlobal _this;
    
    //Add Cargo
    _this addWeaponCargoGlobal ["NVGoggles",1];
    _this addWeaponCargoGlobal ["ItemGPS",1];
    
    _this addmagazineCargoGlobal ["ItemBandage",50];
    _this addmagazineCargoGlobal ["ItemPainkiller",15];
    _this addmagazineCargoGlobal ["ItemMorphine",12];
    _this addmagazineCargoGlobal ["ItemBloodBag",12];
    _this addmagazineCargoGlobal ["ItemEpinephrine",10];
    _this addmagazineCargoGlobal ["ItemAntibiotic",12];
    
    _this addbackpackCargoGlobal ["DZ_Backpack_EP1",2];
    _this setPos (_lootPos select (_order select 3));
    _this setVariable ["permaLoot",true,true]; //*DONN*
    
    
    //BUILDING MATERIAL AND SOME WEAPONS:
    _this = createVehicle ["TKVehicleBox_EP1", (_lootPos select (_order select 4)), [], 0, "CAN_COLLIDE"];
    
    //Clear Cargo	
    clearweaponcargoGlobal _this;
    clearmagazinecargoGlobal _this;
    
    //Add Cargo
    _this addWeaponCargoGlobal ["ItemEtool",10];
    _this addWeaponCargoGlobal ["ItemToolbox",5];
    _this addWeaponCargoGlobal ["NVGoggles",2];
    
    _this addmagazineCargoGlobal ["HandGrenade_West",10];
    _this addmagazineCargoGlobal ["ItemSandbag",10];
    _this addmagazineCargoGlobal ["ItemTankTrap",5];
    _this addmagazineCargoGlobal ["ItemWire",10];
    _this addmagazineCargoGlobal ["ItemTent",4];
    _this addmagazineCargoGlobal ["PartGeneric",5];
    _this addmagazineCargoGlobal ["TrapBear",8];
    
    //*DONN* Jon Weapon Loot
    _this addWeaponCargoGlobal ["NVGoggles",2];
    _this addWeaponCargoGlobal ["KSVK_DZE",3];
    _this addWeaponCargoGlobal ["VSS_vintorez",2];
    _this addWeaponCargoGlobal ["SCAR_H_CQC_CCO_SD",1];
    _this addWeaponCargoGlobal ["FN_FAL_ANPVS4",1];
    
    //*DONN* Jon Magazine Loot
    _this addmagazineCargoGlobal ["150Rnd_127x107_DSHKM",3];
    _this addmagazineCargoGlobal ["5Rnd_127x108_KSVK",7];
    _this addmagazineCargoGlobal ["5Rnd_127x108_KSVK",3];
    _this addmagazineCargoGlobal ["20Rnd_9x39_SP5_VSS",3];
    _this addmagazineCargoGlobal ["20Rnd_762x51_FNFAL",3];
    
    _this addbackpackCargoGlobal ["DZ_Backpack_EP1",1];
    _this setPos (_lootPos select (_order select 4));
    _this setVariable ["permaLoot",true,true]; //*DONN*
    
    diag_log "[TERROR-Z] Buildings Finalized!";
    
    //=====================================
    // SPAWN EXPLODING ZOMBIES
    //=====================================
    
    diag_log "[HC_ON] Terrozon script init!";
    donn_terror_deadZombies = [];
    donn_terror_mult = 1;
    
    donn_terror_zombDamage = {
    	private ['_zombie','_damage','_projectile','_zombie_explodeTrigered','_zombie_actDam','_source'];
    	_zombie = _this select 0;
    	_zombie_actDam = damage _zombie;
    	_damage = _this select 2;
    	_healt = _zombie getVariable ['donn_hp',1];
    	_damage = _damage * (0.5/_healt);
    	_source = _this select 3;
    	_projectile = _this select 4;
    	if (isPlayer _source && !(_projectile in ['SmallSecondary','G_Camel_HE','Bo_GBU12_LGB',''])) then {
    		if (_zombie_actDam + _damage > 0.5) then {
    			_damage = 0;
    			if !(_zombie in donn_terror_deadZombies) then {
    				donn_terror_deadZombies = donn_terror_deadZombies + [_zombie];
    				[_zombie] call donn_terror_explode;
    			};
    		};
    	} else {
    		_damage = 0;
    	};
    	_damage
    };
    donn_terror_explode = {
    	private ['_zombie','_special','_radSearch','_blowMult','_nearZombies','_nearToBlow','_randExtra','_rand','_blowWait'];
    	_zombie = _this select 0;
    	_special = _zombie getVariable ['donn_spe',0];
    	if (_special == 0) then {_radSearch =  10; _blowMult =   1; _blowWait = 0.25;};
    	if (_special == 1) then {_radSearch =  25; _blowMult =   5; _blowWait = 0.25;};
    	if (_special == 2) then {_radSearch = 120; _blowMult = 100; _blowWait = 0.25;};
    	_nearZombies = (nearestObjects [_zombie, ['zZombie_Base'], _radSearch]) - [_zombie];
    	_nearToBlow = [];
    	_rand = random 100;
    	_randExtra = 1;
    	if (_rand < 80) then {_randExtra = 2;};
    	if (_rand < 60) then {_randExtra = 3;};
    	if (_rand < 40) then {_randExtra = 4;};
    	if (_rand < 20) then {_randExtra = 5;};
    	if (_rand < 10) then {_randExtra = 10;};
    	_randExtra = _randExtra * _blowMult;
    	{
    		if (count _nearToBlow < _randExtra) then {
    			if (_x getVariable ['donn_spe',0] == 0) then {
    				_nearToBlow = _nearToBlow + [_x];
    			};
    		};
    	} forEach _nearZombies;
    	_zombie setDamage 0.6;
    	_nearToBlow spawn {
    		{
    			_x setDamage 0.6;
    			if (((_forEachIndex + 1) mod 5) == 0) then {sleep 0.15;};
    		} forEach _this;
    	};
    };
    donn_terror_getTarget = {
    	private ['_zombie','_viewDistance','_zTarget','_nearTargets','_playerPos','_playerPosZ'];
    	_zombie = _this select 0;
    	_viewDistance = _this select 1;
    	_nearTargets = [];
    	{
    		_playerPos = _x getVariable ['donn_pos',getPosATL _x];
    		_playerPosZ = _playerPos select 2;
    		if ((_zombie distance _playerPos) < _viewDistance && _playerPosZ < 4.5) then {
    			_nearTargets = _nearTargets + [_x];
    		};
    	} forEach playableUnits;
    	if (count _nearTargets > 0) then {
    		_zTarget = _nearTargets call BIS_fnc_selectRandom;
    	} else {
    		_zTarget = ObjNull;
    	};
    	_zTarget
    };
    sleep 10;
    {
    	{
    		if (_forEachIndex == 0) then {
    			donn_terror_check_var = _x select 1;
    			_x spawn {
    				private ['_center','_var','_rad','_cycle','_result'];
    				_center = _this select 0;
    				_var = _this select 1;
    				_rad = _this select 2;
    				_cycle = _this select 3;
    				call compile format['donn_terror_trigger_%1 = false;', _var];
    				while {true} do {
    					_result = false;
    					{
    						if (_x distance _center < _rad) exitWith {
    							_result = true;
    						};
    					} forEach playableUnits;
    					call compile format['donn_terror_trigger_%1 = _result;', _var];
    				};
    				sleep _cycle;
    			};
    		} else {
    			private ['_qtyZomb','_deployRad', '_insertPoint','_viewDistance','_unitTypes','_sphere'];
    			_insertPoint = _x select 0;
    			_deployRad = _x select 1;
    			_qtyZomb = _x select 2;
    			_qtyZomb = round (_qtyZomb * donn_terror_mult);
    			_viewDistance = _x select 3;
    			_distToWalk = _x select 4;
    			_special = _x select 5;
    			_health = _x select 6;
    			_inconTime = _x select 7;
    			_unitTypes = []+ getArray (configFile >> 'CfgBuildingLoot' >> 'Default' >> 'zombieClass');
    			for '_k' from 1 to _qtyZomb do {
    				private ['_agent','_type'];
    				_type = _unitTypes call BIS_fnc_selectRandom;
    				_agent = createAgent [_type,_insertPoint,[],_deployRad,'NONE'];
    				sleep 0.01;
    				if (_special > 0) then {
    					for '_x' from 1 to _special do {
    						_sphere = createVehicle ['Sign_sphere100cm_EP1', getPosATL _agent, [], 0, 'CAN_COLLIDE'];
    						_sphere attachTo [_agent, [0,0,2.25 + (_x - 1) * 1]];
    					};
    					_agent setVariable ['donn_spe',_special,true];
    				} else {
    					_agent setVariable ['donn_spe',0,true];
    				};
    				_agent removeAllEventHandlers 'handleDamage';
    				_agent addEventHandler ['handleDamage',{_this call donn_terror_zombDamage}];
    				_agent setVariable ['donn_terrorZombie',true,true];
    				_agent setVariable ['donn_hp',_health,false];
    				_agent setDir (random 360);
    				[_viewDistance,_agent,donn_terror_check_var,_distToWalk,_special,_inconTime] execFSM 'terror_zombies\zombie_agent_terror.fsm';
    			};
    		};
    	} forEach _x;
    } forEach donn_terror_zomb;
    diag_log 'TERROR ZOMBIES RODOU (HC/SERVER)!';
    
    //=====================================
    // SHOW ICONS ON THE MAP
    //=====================================
    
    [] spawn {
    	while {true} do {
    		_don_marker_put = createMarker ["Conrads Refugee Camp",[2889, 8870]];
    		_don_marker_put setMarkerShape "Icon";
    		_don_marker_put setMarkerText "Conrads Refugee Camp";
    		_don_marker_put setMarkerType "Flag1";
    		_don_marker_put setMarkerColor "ColorBlack";
    		sleep 5;
    		deleteMarker "Conrads Refugee Camp";
    	};
    };
    

    2 - To run on the clients:

    if (!isServer) then {
    	donn_playerInTerror = false;
    	[] spawn {
    		private ["_nearZombies","_isTerrorZ","_Zdamage"];
    		while {true} do {
    			if (vehicle player == player) then {
    				_nearZombies = (getPosATL player) nearEntities ["zZombie_Base",2.5];
    				_Zdamage = 0.6;
    			} else {
    				_nearZombies = (getPosATL vehicle player) nearEntities ["zZombie_Base",5];
    				_Zdamage = 0.8;
    			};
    			{
    				_isTerrorZ = _x getVariable ["donn_terrorZombie",false];
    				if !(isNil "_isTerrorZ") then {
    					if (_x getVariable ["donn_spe",0] == 0) then {
    						_x setDamage _Zdamage;
    					};
    				};
    			} forEach _nearZombies;
    			sleep 0.25;
    		};
    	};
    	[] spawn {
    		while {true} do {
    			player setVariable ["donn_pos",getPosATL player,true];
    			uiSleep 2;
    		};
    	};
    	diag_log "TERROR ZOMBIES OK (CLIENT)!";
    
    	waitUntil {sleep 4;!(isNil "donn_noZombieAreas")};
    	{
    		_x spawn {
    			private ["_playerPos","_areaPos","_distCheck"];
    			_areaPos = _this select 0;
    			_distCheck = _this select 1;
    			while {true} do {
    				waitUntil {
    					sleep 5;
    					_playerPos = getPosATL player;
    					(_areaPos distance _playerPos) < _distCheck
    				};
    				diag_log "ZOMBOFF!";
    				player_zombieCheck = {};
    				waitUntil {
    					sleep 5;
    					_playerPos = getPosATL player;
    					(_areaPos distance _playerPos) > _distCheck
    				};
    				diag_log "ZOMBON!";
    				player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
    			};
    		};
    	} forEach donn_noZombieAreas;
    };
    
×
×
  • Create New...