Jump to content

Recommended Posts

If you like my work, please consider a donation:

btn_donate_LG.gif $USD

btn_donate_LG.gif $EURO

refugiados_da_paz_zpskv2vxttv.png

 

Peacefull Conrads Refugee Camp is a place where peacefull people is know to be set up after the overall contagion of the zombie virus.

 

There is some time from the last contact with this camp, whi don't you go there and take a look?

 

1 - The Script: Run this on the server or in a headless client.

//=====================================
// KONFIGURATION
//=====================================

//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]
];

//Zombie Spawn Array
donn_terror_zomb = [
	[
		[[6624-3735,14212-5342,0],'cid_salv', 450, 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,14177-5342,0], 25, 15, 60, 15, 0, 1.1, 60],
		[[6786-3735,14320-5342,0], 25, 15, 60, 15, 0, 1.1, 60],
		[[6791-3735,14091-5342,0], 25, 15, 60, 15, 0, 1.1, 60],
		[[6668-3735,14121-5342,0], 25, 15, 60, 15, 0, 1.1, 60],
		[[6599-3735,14260-5342,0], 25, 15, 60, 15, 0, 1.1, 60],
		[[6624-3735,14212-5342,0],100, 40,100, 15, 0, 1.1, 60],
		[[6624-3735,14212-5342,0],120, 14, 60, 15, 1, 1.2, 60],
		[[6624-3735,14212-5342,0], 10,  1, 60, 15, 2, 3.5,120]
	]
];

//=====================================
// SPAWN BUILDINGS
//=====================================

diag_log "[TERROR-Z] Buildings INIT Initialized!";

//Camp Center
_bomberman = [2889, 8870];

{
	for "_y" from 1 to (_x select 1) do {
		_vehicle = createVehicle [_x select 0, _bomberman, [], 90, "NONE"];
		_vehicle setDir (random 360);
		sleep 0.001;
	};
} forEach _camp_vehicles;

//Parked Buses
_ikarus = [
	[[2890,8988,0],25 + (random 16),"UNLOCKED"],
	[[2898,8983,0],25 + (random 16),"UNLOCKED"],
	[[2905,8975,0],25 + (random 16),"LOCKED"],
	[[2912,8971,0],25 + (random 16),"LOCKED"],
	[[2921,8967,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
_vehicle = createVehicle ["mbg_apartments_big_01_EO", [2753,9007,0.22], [], 0, "CAN_COLLIDE"];
_vehicle setPosATL [2753,9007,0.22];
_vehicle setDir 130;

//LOOT:

_lootPos = [
	[6660.3984-3735, 14177.261-5342],
	[6786.0361-3735, 14320.882-5342],
	[6791.7695-3735, 14091.711-5342],
	[6668.1357-3735, 14121.218-5342],
	[6599.8535-3735, 14260.836-5342]
];
_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 - Run on the Client, init.sqf for example. This makes the zombies explode when players are near then.

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)!";

	donn_noZombieAreas = [
		[[2889,8870,0],400]
	];
	{
		_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;
};
3 - FSM file (zombie behavior): put that code in a text file, in the mission folder, with this folder and name \terror_zombies\zombie_agent_terror.fsm. See that the extension of this file is not sqm, but fsm.

/*%FSM<COMPILE "e:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Zombie Agent">*/
/*%FSM<HEAD>*/
/*
item0[] = {"Inicia",0,250,-250.000000,-425.000000,-150.000000,-375.000000,0.000000,"Inicia"};
item1[] = {"Achou_Perto",4,218,-25.000000,-350.000000,75.000000,-300.000000,0.000000,"Achou" \n "Perto"};
item2[] = {"Verdadeiro",4,218,-250.000000,-325.000000,-150.000000,-275.000000,0.000000,"Verdadeiro"};
item3[] = {"Procura_um_Human",2,4346,-150.000000,-250.000000,-50.000000,-200.000000,0.000000,"Procura" \n "um Humano"};
item4[] = {"Procura_de_novo",4,218,-250.000000,-175.000000,-150.000000,-125.000000,0.000000,"Procura" \n "de novo?"};
item5[] = {"Andar_at__Humano",2,250,100.000000,-300.000000,200.000000,-250.000000,0.000000,"Andar até" \n "Humano!"};
item6[] = {"Update_posi__o_",4,218,225.000000,-350.000000,325.000000,-300.000000,0.000000,"Update" \n "posição?"};
item7[] = {"Perdeu_de_Vista",4,218,-25.000000,25.000000,75.000000,75.000000,0.000000,"Perdeu" \n "de Vista?"};
item8[] = {"Humano_Morto_",4,218,-25.000000,-75.000000,75.000000,-25.000000,0.000000,"Humano" \n "Morto?"};
item9[] = {"",7,210,-104.000000,-4.000001,-95.999992,4.000001,0.000000,""};
item10[] = {"",7,210,-104.000000,96.000000,-96.000000,104.000008,0.000000,""};
item11[] = {"Explodir_",2,250,400.000000,-425.000000,500.000000,-375.000000,0.000000,"Explodir!"};
item12[] = {"Recuperado_",4,218,400.000000,75.000000,500.000000,125.000000,0.000000,"Recuperado?"};
item13[] = {"Perto_Humano_",4,218,100.000000,-425.000000,200.000000,-375.000000,0.000000,"Perto" \n "Humano?"};
item14[] = {"",7,210,-104.000000,-404.000000,-96.000000,-396.000000,0.000000,""};
item15[] = {"Achou_Longe",4,218,-25.000000,-150.000000,75.000000,-100.000000,0.000000,"Achou" \n "Longe"};
item16[] = {"Correr_para_mais",2,250,100.000000,-200.000000,200.000000,-150.000000,0.000000,"Correr para" \n "mais perto"};
item17[] = {"Update_posi__o_",4,218,225.000000,-150.000000,325.000000,-100.000000,0.000000,"Update" \n "posição?"};
item18[] = {"Chegou_Perto_",4,218,225.000000,-250.000000,325.000000,-200.000000,0.000000,"Chegou" \n "Perto?"};
item19[] = {"",7,210,371.000000,-279.000000,379.000000,-271.000000,0.000000,""};
item20[] = {"",7,210,371.000000,-179.000000,379.000000,-171.000000,0.000000,""};
item21[] = {"",7,210,371.000000,46.000000,379.000000,54.000004,0.000000,""};
item22[] = {"",7,210,371.000000,-54.000000,379.000000,-46.000000,0.000000,""};
item23[] = {"Humano_Longe_",4,218,-25.000000,-250.000000,75.000000,-200.000000,0.000000,"Humano" \n "Longe?"};
link0[] = {0,2};
link1[] = {1,5};
link2[] = {2,3};
link3[] = {3,1};
link4[] = {3,4};
link5[] = {3,14};
link6[] = {3,15};
link7[] = {4,3};
link8[] = {5,6};
link9[] = {5,13};
link10[] = {5,19};
link11[] = {5,23};
link12[] = {6,5};
link13[] = {7,9};
link14[] = {8,9};
link15[] = {9,3};
link16[] = {10,9};
link17[] = {11,12};
link18[] = {12,10};
link19[] = {13,11};
link20[] = {14,13};
link21[] = {15,16};
link22[] = {16,13};
link23[] = {16,17};
link24[] = {16,18};
link25[] = {16,20};
link26[] = {17,16};
link27[] = {18,5};
link28[] = {19,20};
link29[] = {20,22};
link30[] = {21,7};
link31[] = {22,8};
link32[] = {22,21};
link33[] = {23,16};
globals[] = {25.000000,1,0,0,0,640,480,1,174,6316128,1,-488.040009,633.607056,150.522751,-478.192963,983,551,1};
window[] = {2,-1,-1,-1,-1,805,125,1333,125,3,1001};
*//*%FSM</HEAD>*/
class FSM
{
  fsmName = "DayZ Zombie Agent";
  class States
  {
    /*%FSM<STATE "Inicia">*/
    class Inicia
    {
      name = "Inicia";
      init = /*%FSM<STATEINIT""">*/"private [""_choosenEyePos"",""_agentOriPos"",""_timeLost"",""_choosenDead"",""_viewDistance"",""_grenade"",""_playersCanSee"",""_agent"",""_found"",""_choosen"",""_players"",""_start"",""_newPos""];" \n
       "" \n
       "_viewDistance = _this select 0;" \n
       "_agent = _this select 1;" \n
       "_varString = _this select 2;" \n
       "_ZdistToWalk = _this select 3;" \n
       "_Zspecial = _this select 4;" \n
       "_ZinconTime = _this select 5;" \n
       "" \n
       "_agentOriPos = getPosATL _agent;" \n
       "" \n
       "_agent disableAI ""FSM"";" \n
       "_agent setBehaviour ""CARELESS"";" \n
       "_agent setCombatMode ""RED"";" \n
       "_agent setSkill 0;" \n
       "" \n
       "_agentFugitiveQty = 0;"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Verdadeiro">*/
        class Verdadeiro
        {
          priority = 0.000000;
          to="Procura_um_Human";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/"_found = false;" \n
           "_away = false;" \n
           "_newPos = getPosATL _agent;"/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Procura_um_Human">*/
    class Procura_um_Human
    {
      name = "Procura_um_Human";
      init = /*%FSM<STATEINIT""">*/"_start = diag_tickTime;" \n
       "if (call compile format[""donn_terror_trigger_%1"",_varString]) then {" \n
       "	_choosen = [_agent,_viewDistance] call donn_terror_getTarget;" \n
       "	if !(isNull _choosen) then {" \n
       "		_found = true;" \n
       "	" \n
       "		_choosenPos = _choosen getVariable [""donn_pos"",getPosATL _agent];" \n
       "		if (isNil ""_choosenPos"") then {_choosenPos = getPosATL _agent;};" \n
       "	" \n
       "		if ((_agent distance _newPos) + (_newPos distance _choosenPos) > 20) then {" \n
       "			_away = true;" \n
       "		} else {" \n
       "			_away = false;" \n
       "		};" \n
       "	};" \n
       "};"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Procura_de_novo">*/
        class Procura_de_novo
        {
          priority = 0.000000;
          to="Procura_um_Human";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _start) > 5"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "Achou_Longe">*/
        class Achou_Longe
        {
          priority = 0.000000;
          to="Correr_para_mais";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"_found && _away"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/"_choosenDead = false;" \n
           "_distance_ZP_ok = true;"/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "Perto_Humano_">*/
        class Perto_Humano_
        {
          priority = 0.000000;
          to="Explodir_";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"damage _agent >= 0.5"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "Achou_Perto">*/
        class Achou_Perto
        {
          priority = 0.000000;
          to="Andar_at__Humano";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"_found && !_away" \n
           ""/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/"_choosenDead = false;" \n
           "_distance_ZP_ok = true;"/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Andar_at__Humano">*/
    class Andar_at__Humano
    {
      name = "Andar_at__Humano";
      init = /*%FSM<STATEINIT""">*/"_start = diag_tickTime;" \n
       "" \n
       "_choosenPos = _choosen getVariable [""donn_pos"",getPosATL _agent];" \n
       "if (isNil ""_choosenPos"") then {_choosenPos = getPosATL _agent;};" \n
       "" \n
       "_distance_ZP_ok = _agent distance _choosenPos < _viewDistance && (_choosenPos select 2) < 4.5;" \n
       "" \n
       "if (_distance_ZP_ok) then {" \n
       "	if (alive _choosen) then {" \n
       "		_newPos = _choosenPos;" \n
       "		_agent moveTo _newPos;" \n
       "		_agent forceSpeed 2;" \n
       "	} else {" \n
       "		_choosenDead = true;" \n
       "	};" \n
       "};"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Perto_Humano_">*/
        class Perto_Humano_
        {
          priority = 0.000000;
          to="Explodir_";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"damage _agent >= 0.5"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "Humano_Longe_">*/
        class Humano_Longe_
        {
          priority = 0.000000;
          to="Correr_para_mais";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"(_agent distance _newPos) + (_newPos distance (_choosen getVariable [""donn_pos"",getPosATL _agent])) > _ZdistToWalk"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "Humano_Morto_">*/
        class Humano_Morto_
        {
          priority = 0.000000;
          to="Procura_um_Human";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"_choosenDead"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/"_newPos = _agentOriPos;" \n
           "_agent moveTo _newPos;" \n
           "_agent forceSpeed 10;" \n
           "_found = false;" \n
           "_away = false;"/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "Perdeu_de_Vista">*/
        class Perdeu_de_Vista
        {
          priority = 0.000000;
          to="Procura_um_Human";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"!_distance_ZP_ok"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/"_newPos = _agentOriPos;" \n
           "_agent moveTo _newPos;" \n
           "_agent forceSpeed 10;" \n
           "_found = false;" \n
           "_away = false;"/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "Update_posi__o_">*/
        class Update_posi__o_
        {
          priority = 0.000000;
          to="Andar_at__Humano";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"moveToCompleted _agent || moveToFailed _agent"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Explodir_">*/
    class Explodir_
    {
      name = "Explodir_";
      init = /*%FSM<STATEINIT""">*/"_agent forceSpeed 0;" \n
       "_agent setUnitPos ""DOWN"";" \n
       "_start = diag_tickTime;" \n
       """SmallSecondary"" createVehicle (getPosATL _agent);" \n
       "if (_Zspecial == 1) then {" \n
       "	""G_Camel_HE"" createVehicle (getPosATL _agent);" \n
       "};" \n
       "if (_Zspecial == 2) then {" \n
       "	""Bo_GBU12_LGB"" createVehicle (getPosATL _agent);" \n
       "};" \n
       "if (damage _agent > 0.7) then {" \n
       "	""G_Camel_HE"" createVehicle (getPosATL _agent);" \n
       "	_agent setDamage 0.6;" \n
       "};"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Recuperado_">*/
        class Recuperado_
        {
          priority = 0.000000;
          to="Procura_um_Human";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"diag_tickTime-_start > _ZinconTime"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/"_agent setDamage 0;" \n
           "_agent setUnitPos ""UP"";" \n
           "" \n
           "_newPos = _agentOriPos;" \n
           "_agent moveTo _newPos;" \n
           "_agent forceSpeed 10;" \n
           "" \n
           "donn_terror_deadZombies = donn_terror_deadZombies - [_agent];" \n
           "" \n
           "_found = false;" \n
           "_away = false;"/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
    /*%FSM<STATE "Correr_para_mais">*/
    class Correr_para_mais
    {
      name = "Correr_para_mais";
      init = /*%FSM<STATEINIT""">*/"_start = diag_tickTime;" \n
       "" \n
       "_agP = getPosATL _agent;" \n
       "_agPX =_agP select 0;" \n
       "_agPY =_agP select 1;" \n
       "" \n
       "_choosenPos = _choosen getVariable [""donn_pos"",getPosATL _agent];" \n
       "if (isNil ""_choosenPos"") then {_choosenPos = getPosATL _agent;};" \n
       "" \n
       "_distance_ZP_ok = _agent distance _choosenPos < _viewDistance && (_choosenPos select 2) < 4.5;" \n
       "" \n
       "if (_distance_ZP_ok) then {" \n
       "	if (alive _choosen) then {" \n
       "		_cP = _choosenPos;" \n
       "		_cPX = _cP select 0;" \n
       "		_cPY = _cP select 1;" \n
       "" \n
       "		_nPX = (_agPX+_cPX)/2;" \n
       "		_nPY = (_agPY+_cPY)/2;" \n
       "		_newPos = [_nPX,_nPY,0];" \n
       "		" \n
       "		_agent moveTo _newPos;" \n
       "		_agent forceSpeed 8;" \n
       "	} else {" \n
       "		_choosenDead = true;" \n
       "	};" \n
       "};"/*%FSM</STATEINIT""">*/;
      precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
      class Links
      {
        /*%FSM<LINK "Update_posi__o_">*/
        class Update_posi__o_
        {
          priority = 0.000000;
          to="Correr_para_mais";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"moveToCompleted _agent || moveToFailed _agent"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "Chegou_Perto_">*/
        class Chegou_Perto_
        {
          priority = 0.000000;
          to="Andar_at__Humano";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"(_agent distance _newPos) + (_newPos distance (_choosen getVariable [""donn_pos"",getPosATL _agent])) < _ZdistToWalk"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "Humano_Morto_">*/
        class Humano_Morto_
        {
          priority = 0.000000;
          to="Procura_um_Human";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"_choosenDead"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/"_newPos = _agentOriPos;" \n
           "_agent moveTo _newPos;" \n
           "_agent forceSpeed 10;" \n
           "_found = false;" \n
           "_away = false;"/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "Perdeu_de_Vista">*/
        class Perdeu_de_Vista
        {
          priority = 0.000000;
          to="Procura_um_Human";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"!_distance_ZP_ok"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/"_newPos = _agentOriPos;" \n
           "_agent moveTo _newPos;" \n
           "_agent forceSpeed 10;" \n
           "_found = false;" \n
           "_away = false;"/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
        /*%FSM<LINK "Perto_Humano_">*/
        class Perto_Humano_
        {
          priority = 0.000000;
          to="Explodir_";
          precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
          condition=/*%FSM<CONDITION""">*/"damage _agent >= 0.5"/*%FSM</CONDITION""">*/;
          action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
        };
        /*%FSM</LINK>*/
      };
    };
    /*%FSM</STATE>*/
  };
  initState="Inicia";
  finalStates[] =
  {
  };
};
/*%FSM</COMPILE>*/
OBS: fsm files are created by FSM Creator, but since they are text files, they can be provided like above.

More help:

Where to put the files?

- Script 1 runs on server (i run it at the end of the file server_functions.sqf).

- Script 2 runs on client (i run it in init.sqf).

- Script 3 does not need to run, but you need to put it in the correct place in the mission file: \terror_zombies\zombie_agent_terror.fsm.

Link to comment
Share on other sites

It's a city with loot, to get the loot you need to deal with the zombies, with two or more players the task is more easy.

The zombies can run entirelly on the server or in a headless client, easily as [] execVM "...terror_zombies.sqf".

It does not make use of any Epoch files, all the code its needs & FSM is on it.

Link to comment
Share on other sites

they have a new FSM (zombie Logic) that make no use of any of the Epoch function. The functions it use are in the SQF file that comes with it.

You can spawn then anywere, in groups, with 6 or more configurations.

The zombies with one and two spheres above the head are special zombies, with bigger explosions.

The zombie with two spheres make the "atomic" explosion you saw on video.

Link to comment
Share on other sites

  • 2 months later...

@ ALL,

*** Item 2) updated! ***

 

@ ALL,

Image added on the first post.

 

@ ElDubya,

The video is removed because this version is not in the city show on video, but in a refugee camp. This is the one i'm using in my server.

does this place the camp at a static position or random ??

on chernarus where would I find it ???

 

edit.....

I found it works great thankzzzz.....

Link to comment
Share on other sites

@ ALL,

The position of the camp is fixed, but the objects spawn in random position on the camp (tents, fire, barrel, cargo, etc...).

It's for Chernarus, if you want to port it to another map just tell-me the desired center of the camp [X,Y] (not GPS position).

@ Smoingred,

- Script 1 run on server (i run it at the end of the file server_functions.sqf).

- Script 2 run on client (i run it in init.sqf).

- Script 3 does not need to run, but you need to put it in the correct place in the mission file: \terror_zombies\zombie_agent_terror.fsm.

Link to comment
Share on other sites

It's for Chernarus, if you want to port it to another map just tell-me the desired center of the camp [X,Y] (not GPS position).

 

 

Taviana :  2479.62,17209.4

 

Napf : 17082.7,4299.16

 

Thanks Donnovan. Also, with your convoy script, is it just matter of making a waypoint at every single crossroad and intersection on the map to alter that for different maps? If it is, I can do that :)

Link to comment
Share on other sites

Renegade2k6,

 

I believe you can remove the spheres by removing this lines from script 1:

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

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

i love it! but i have doble spawn of everything (ikarus,zombies and buildings) and get kicked by battleye SetDamage when the zeds blow me, anyone know how to fix it?

 

i'm adding to server_funcions.sqf:

[] execVM "\z\addons\dayz_server\init\basezombie.sqf";

 

and adding the next one to the init.sqf

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
  • Discord

×
×
  • Create New...