Jump to content

[Release] Banko Mat - Chernarus Mission


Donnovan

Recommended Posts

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"
	};
Link to comment
Share on other sites

Well, we got this:

[2015-03-30 | 07:02:48] Player #2 KillKillKill () has been kicked by BattlEye: CreateVehicle Restriction #2
[2015-03-30 | 07:03:02] Player #0 [F.S.B]WorlDLorD () has been kicked by BattlEye: CreateVehicle Restriction #2
[2015-03-30 | 07:03:11] Player #1 [F.S.B]Kid () has been kicked by BattlEye: CreateVehicle Restriction #2
 
Do I need to add exeptions to battleeye or infistar?
Link to comment
Share on other sites

 

Well, we got this:

[2015-03-30 | 07:02:48] Player #2 KillKillKill () has been kicked by BattlEye: CreateVehicle Restriction #2
[2015-03-30 | 07:03:02] Player #0 [F.S.B]WorlDLorD () has been kicked by BattlEye: CreateVehicle Restriction #2
[2015-03-30 | 07:03:11] Player #1 [F.S.B]Kid () has been kicked by BattlEye: CreateVehicle Restriction #2
 
Do I need to add exeptions to battleeye or infistar?

 

 

Check your createvehicle.log and add an exception in createvehicle.txt for whatever they are being kicked for.

Link to comment
Share on other sites

 

Well, we got this:

[2015-03-30 | 07:02:48] Player #2 KillKillKill () has been kicked by BattlEye: CreateVehicle Restriction #2
[2015-03-30 | 07:03:02] Player #0 [F.S.B]WorlDLorD () has been kicked by BattlEye: CreateVehicle Restriction #2
[2015-03-30 | 07:03:11] Player #1 [F.S.B]Kid () has been kicked by BattlEye: CreateVehicle Restriction #2
 
Do I need to add exeptions to battleeye or infistar?

 

battleeye

 

you  need to add !="RULaunchersBox"  to your

createvehicle.txt

 

5 "box" !="DebugBoxPlayer_DZ" !="MedBox0" !="AmmoBoxSmall_556" !="AmmoBoxSmall_762" !="ItemMatchbox" !="ItemToolbox" !="CardBoardBox" !="FoodBox1" !="FoodBox2" !="FoodBox3" !="LockboxStorageLocked" !="LockboxStorage" !="WeaponHolder_ItemLockbox" !="USOrdnanceBox" !="USVehicleBox_EP1" !="MAP_Misc_PostBox" !="MAP_phone_box" !="MAP_Camo_box" !="MAP_phonebox" !="MAP_icebox" !="MAP_box_c" !="Land_Misc_ConcBox_EP1" !="USBasicWeaponsBox" !="FoodBox0" !="RUBasicAmmunitionBox" !="LocalBasicAmmunitionBox" !="BAF_BasicAmmunitionBox" !="RUVehicleBox" !="BAF_BasicWeapons" !="USSpecialWeaponsBox" !="TKBasicAmmunitionBox_EP1" !="RUBasicWeaponsBox"  !="UNBasicWeapons_EP1"  !="USBasicAmmunitionBox_EP1" !="BAF_OrdnanceBox" !="TKVehicleBox_EP1" !="RULaunchersBox"

 

 

or at least thats what I had to add

Link to comment
Share on other sites

But alas, you guys are runing it in a client or Headless Client? Those are the only situation you need to update BE filters.

If you run it on the server, there is no need to mess with BE filters, since the server is not checked by BE filters.

Try something like that in init.sqf:

if (isServer) then {
    [] execVM "...bankomat.sqf";
};
Or add only this line at the end of the server file init/server_functions.sqf:

[] execVM "...bankomat.sqf";
Link to comment
Share on other sites

calamity,

You is running the Refugee Camp and the Banko script on all clients, so if 50 clients connect to your server, you will have run each script 50 times, gererating 50X more AI units, 50X more Exploding zombies and 50X more of each static object (buildings, tents, cargo, etc).

Do like i explain in post #18.

Link to comment
Share on other sites

calamity,

You is running the Refugee Camp and the Banko script on all clients, so if 50 clients connect to your server, you will have run each script 50 times, gererating 50X more AI units, 50X more Exploding zombies and 50X more of each static object (buildings, tents, cargo, etc).

Do like i explain in post #18.

 gererating 50X more AI units, 50X more Exploding zombies and 50X more of each static object 

 

woweewahwow

Link to comment
Share on other sites

 

unfortunately I Lost ALOT of fps

went from 57 down to 35

 

lol, thats not even possible, your server can never exceed 50fps so how did you manage to get 57?

 

@donnovan

your script is gigantus, you should divide it up and compile some of the functions before you use them, it is never a good idea to to just have everything in one script like this as it can choke the server completly, not to mention the amount of vehicles you are spawning, all in all this is a real server fps killer.

 

also i see a lot of repetition in there, if you do something more than once you should considder making a function to speed things up, you could also find your center position of these objects and calculate offsets instead of using actual positions, that way you could basicly spawn this on any map and will be restricted to one map, basicly you can always spawn it in the excact same way on any position on the map if you did that.

Link to comment
Share on other sites

But alas, you guys are runing it in a client or Headless Client? Those are the only situation you need to update BE filters.

If you run it on the server, there is no need to mess with BE filters, since the server is not checked by BE filters.

Try something like that in init.sqf:

if (isServer) then {
    [] execVM "...bankomat.sqf";
};
Or add only this line at the end of the server file init/server_functions.sqf:

[] execVM "...bankomat.sqf";

I am running it server side. Mpmissions root put it it inside init.sqf. I will change it to  server_functions.sqf and see if that fixes it. Thanks to everyone.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...