enable new zed brains and spawn function

This commit is contained in:
vbawol 2016-06-14 09:00:38 -05:00
parent d4362f3b12
commit e33cb4ef81
2 changed files with 10 additions and 23 deletions

View File

@ -115,23 +115,9 @@ switch _unitClass do {
[] execFSM "\x\addons\a3_epoch_code\System\Event_Air_Drop.fsm";
};
case "EPOCH_RyanZombie_1": {
_unitClass = selectRandom ["EPOCH_RyanZombie_1","EPOCH_RyanZombie_2","EPOCH_RyanZombie_3","EPOCH_RyanZombie_4","EPOCH_RyanZombie_5"];
// diag_log format["DEBUG: spawned %1",_unitClass];
_unit = createAgent[_unitClass, _targetPos, [], 120, "FORM"];
_unit call _disableAI;
// climb out of ground
_unit switchMove "AmovPercMstpSnonWnonDnon_SaluteOut";
_unit setmimic "dead";
_unit setface (selectRandom ["RyanZombieFace1", "RyanZombieFace2", "RyanZombieFace3", "RyanZombieFace4", "RyanZombieFace5"]);
removegoggles _unit;
// load temp brains
[_unit,true] execFSM "\x\addons\a3_epoch_code\System\Zombie_Brain.fsm";
// spawn more up to limit
_id = "EPOCH_RyanZombie_1" call EPOCH_unitSpawn;
_unit = [] call EPOCH_zombieSpawn;
// spawn more zeds up to limit max spawn limit.
"EPOCH_RyanZombie_1" call EPOCH_unitSpawn;
};
};

View File

@ -14,27 +14,28 @@
Example:
[] call EPOCH_zombieSpawn;
Parameter(s):
Returns:
zedHandle
OBJECT - Zombie Agent
*/
private ["_zRange","_disableAI","_unitClass","_unit","_clutterPos","_zedHandle"];
_zRange = getNumber (getMissionConfig "CfgEpochRyanZombie" >> "range");
_disableAI = {{_this disableAI _x}forEach["TARGET","AUTOTARGET","FSM"];};
_unitClass = selectRandom ["EPOCH_RyanZombie_1","EPOCH_RyanZombie_2","EPOCH_RyanZombie_3","EPOCH_RyanZombie_4","EPOCH_RyanZombie_5"];
_unit = createAgent[_unitClass, position player, [], _zRange, "FORM"];
_clutterPos = getPosATL _unit;
if!(isOnRoad _unit)then{
createVehicle ["Land_Grave_dirt_F", _clutterPos, [], 0, "CAN_COLLIDE"];
if!(isOnRoad _unit)then{
createVehicle ["Land_Grave_dirt_F", _clutterPos, [], 0, "CAN_COLLIDE"];
};
_unit call _disableAI;
_unit switchMove "AmovPercMstpSnonWnonDnon_SaluteOut";
_unit setmimic "dead";
_unit setface (selectRandom ["RyanZombieFace1", "RyanZombieFace2", "RyanZombieFace3", "RyanZombieFace4", "RyanZombieFace5"]);
removegoggles _unit;
zedHandle = [_unit,true] execFSM "epoch_code\system\EPOCH_zombie_brain.fsm";
_zedHandle = [_unit,true] execFSM "epoch_code\system\EPOCH_zombie_brain.fsm";
_unit addEventHandler ["FiredNear", "(_this select 0) setVariable [""zFiredNear"",[_this select 1, _this select 2]];"];
_unit addEventHandler ["Hit", "(_this select 0) setVariable [""zHit"",[_this select 1, _this select 2]];"];
//if(isNil "axeFlag")then{ axeFlag = createVehicle ["Flag_Blue_F", (getpos player), [], 10, "CAN_COLLIDE"];};
_unit