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

View File

@ -0,0 +1,377 @@
private ["_startDist","_PorM","_PorM2","_msgcrash","_msgdrop","_mission","_position","_difficulty","_name","_missionType","_showMarker","_enableMines","_completionType","_msgstart","_msgwin","_msglose","_mines"];
_mission = _this select 0;
_position = _this select 1;
_difficulty = _this select 2;
_name = _this select 3;
_missionType = _this select 4;
_showMarker = _this select 5;
_enableMines = _this select 6;
_completionType = _this select 7;
_airClass = _this select 8;
_vehclass = _this select 9;
_msgstart = (_this select 10) select 0;
_msgcrash = (_this select 10) select 1;
_msgdrop = (_this select 10) select 2;
_msgwin = (_this select 10) select 3;
_msglose = (_this select 10) select 4;
if(wai_debug_mode) then {diag_log format["WAI: Starting Mission number %1",_mission];};
if(wai_enable_minefield && _enableMines) then {
_mines = [_position,50,75,100] call minefield;
wai_mission_data select _mission set [2, _mines];
};
_color = call {
if(_difficulty == "Easy") exitWith {"ColorGreen"};
if(_difficulty == "Medium") exitWith {"ColorYellow"};
if(_difficulty == "Hard") exitWith {"ColorRed"};
if(_difficulty == "Extreme") exitWith {"ColorBlack"};
};
_name = call {
if(_missionType == "MainHero") exitWith {"Bandit " + _name;};
if(_missionType == "MainBandit") exitWith {"Hero " + _name;};
};
_startDist = 10000; // increase this to delay the time it takes for the plane to arrive at the mission
_PorM = if (random 1 > .5) then {"+"} else {"-"};
_PorM2 = if (random 1 > .5) then {"+"} else {"-"};
_startPos = call compile format ["[(%1 select 0) %2 %4,(%1 select 1) %3 %4, 300]",_position,_PorM,_PorM2,_startDist];
[_difficulty,_msgstart] call wai_server_message;
WAI_MarkerReady = true;
[_position,_mission,_name,_completionType,_color,_showMarker,_airClass,_vehclass,_msgcrash,_msgdrop,_msgwin,_msglose,_enableMines,_missionType,_difficulty,_startPos] spawn {
private ["_loot","_vehMark","_return","_parachute","_vehPos","_vehicle","_aigroup","_speed","_dir","_wp","_msgcrash","_msgdrop","_dropzone","_plane","_pilot","_left","_leftTime","_claimTime","_acArray","_claimed","_acTime","_acdot","_acMarker","_timeStamp","_unitGroups","_playerArray","_enableMines","_aiVehicles","_aiVehArray","_baseclean","_msgwin","_msglose","_bomb","_position","_timeout","_player_near","_complete","_starttime","_timeout_time","_max_ai","_killpercent","_mission","_missionType","_airemain","_text","_name","_completionType","_marker","_dot","_color","_showMarker","_startPos"];
_position = _this select 0;
_mission = _this select 1;
_name = _this select 2;
_completionType = _this select 3;
_color = _this select 4;
_showMarker = _this select 5;
_airClass = _this select 6;
_vehclass = _this select 7;
_msgcrash = _this select 8;
_msgdrop = _this select 9;
_msgwin = _this select 10;
_msglose = _this select 11;
_enableMines = _this select 12;
_missionType = _this select 13;
_difficulty = _this select 14;
_startPos = _this select 15;
_timeout = false;
_player_near = false;
_complete = false;
_starttime = diag_tickTime;
_timeout_time = (random((wai_mission_timeout select 1) - (wai_mission_timeout select 0)) + (wai_mission_timeout select 0)) * 60;
_max_ai = (wai_mission_data select _mission) select 0;
_unitGroups = (wai_mission_data select _mission) select 1;
_mines = (wai_mission_data select _mission) select 2;
_aiVehicles = (wai_mission_data select _mission) select 4;
_vehicles = (wai_mission_data select _mission) select 5;
_killpercent = _max_ai - (_max_ai * (wai_kill_percent / 100));
_loot = if (_missionType == "MainHero") then {Loot_VehicleDrop select 0;} else {Loot_VehicleDrop select 1;};
_playerArray = [];
_timeStamp = diag_tickTime;
_closestPlayer = objNull;
_acArray = [];
_claimed = false;
_acTime = diag_tickTime;
_claimTime = 0;
_left = false;
_leftTime = 0;
_vehDropped = false;
_onGround = false;
_crashed = false;
_dropzone = "HeliHEmpty" createVehicle [0,0,0];
_dropzone setPos _position;
_plane = _airClass createVehicle _startPos;
_dir = [_plane, _dropzone] call BIS_fnc_relativeDirTo;
_plane setDir _dir;
_plane setPos _startPos;
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_plane];
_plane engineOn true;
_speed = 150;
_plane setVelocity [(sin _dir*_speed),(cos _dir*_speed),0];
_plane flyInHeight 200;
_aigroup = createGroup civilian;
_pilot = _aigroup createUnit ["SurvivorW2_DZ",_startPos,[],0,"FORM"];
[_pilot] joinSilent _aigroup;
_pilot setSkill 1;
_pilot setCombatMode "BLUE";
_pilot moveInDriver _plane;
_pilot assignAsDriver _plane;
_aigroup setSpeedMode "LIMITED";
_wp = _aigroup addWaypoint [_position, 0];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "CARELESS";
_wp setWaypointCompletionRadius 50;
_t1 = 0;
_dropTime = 0;
while {!_timeout && !_complete} do {
if (!alive _plane && {!_vehDropped}) exitWith {
[_difficulty,_msgcrash] call wai_server_message;
_crashed = true;
_timeout = true;
};
if ((_plane distance _position < 230) && {!_vehDropped}) then {
uiSleep 1; // This gets the drop near the center of the mission
_planePos = [_plane] call FNC_GetPos;
uiSleep 1; // need to do this otherwise the C130 blows up
_parachute = createVehicle ["ParachuteMediumEast", _planePos, [], 0, "FLY"];
_parachute setPos _planePos;
_vehicle = [_vehclass,_planePos,_mission] call custom_publish;
_vehicle attachTo [_parachute, [0, 0, 1]];
_t1 = diag_tickTime;
[_difficulty,_msgdrop] call wai_server_message;
_return = _aigroup addWaypoint [_startPos, 0];
_return setWaypointType "MOVE";
_return setWaypointBehaviour "CARELESS";
[_plane,_position,_aigroup] spawn wai_clean_aircraft;
_vehDropped = true;
};
if (_vehDropped && {!_onGround}) then {
_dropTime = diag_tickTime - _t1; // used to override if stuck in a tree or on top of a building
if (((([_parachute] call FNC_GetPos) select 2) < 6) || {_dropTime > 55}) then {
detach _vehicle;
deleteVehicle _parachute;
_vehPos = [_vehicle] call FNC_GetPos;
//_vehPos set [2,0];
//_position = _vehPos;
_onGround = true;
};
};
if (count _mines > 0) then {
{
if((isPlayer _x) && (vehicle _x != _x) && (vehicle _x distance _position < 275) && !(_x in _playerArray)) then {
_x call wai_minefield_warning;
_playerArray set [count _playerArray, _x];
};
if((isPlayer _x) && (vehicle _x != _x) && (vehicle _x distance _position < 75) && (alive _x) && ((([vehicle _x] call FNC_GetPos) select 2) < 1)) then {
_bomb = "Bo_GBU12_lgb" createVehicle ([vehicle _x] call FNC_GetPos);
uiSleep 3;
deleteVehicle _bomb;
};
} count playableUnits;
};
if ((diag_tickTime - _timeStamp) > 180 && (count _aiVehicles) > 0) then {
{
if (_x isKindOf "StaticWeapon") then {
(gunner _x) action ["getout",_x];
};
} forEach _aiVehicles;
_timeStamp = diag_tickTime;
};
if (use_wai_autoclaim && _showMarker) then {
#include "\z\addons\dayz_server\WAI\compile\auto_claim.sqf"
};
if (count _aiVehicles > 0) then {
_aiVehicles call wai_monitor_ai_vehicles;
};
if (_showMarker) then {
if (ai_show_count) then {
_aiCount = (wai_mission_data select _mission) select 0;
_text = format["%1 (%2 A.I.)",_name,_aiCount];
} else {
_text = _name;
};
_marker = createMarker [_missionType + str(_mission), _position];
_marker setMarkerColor _color;
_marker setMarkerShape "ELLIPSE";
_marker setMarkerBrush "Solid";
_marker setMarkerSize [300,300];
_dot = createMarker [_missionType + str(_mission) + "dot", _position];
_dot setMarkerColor "ColorBlack";
_dot setMarkerType "mil_dot";
_dot setMarkerText _text;
if (_onGround) then {
_vehMark = createMarker [_missionType + str(_mission) + "vehicle", _vehPos];
_vehMark setMarkerColor "ColorBlack";
_vehMark setMarkerType "mil_dot";
_vehMark setMarkerText _vehclass;
};
if (use_wai_autoclaim) then {
_acMarker = createMarker [_missionType + str(_mission) + "auto", _position];
_acMarker setMarkerShape "ELLIPSE";
_acMarker setMarkerBrush "Border";
_acMarker setMarkerColor "ColorRed";
_acMarker setMarkerSize [ac_alert_distance,ac_alert_distance];
if (_claimed) then {
_acdot = createMarker [_missionType + str(_mission) + "autodot", [(_position select 0) + 100, (_position select 1) + 100]];
_acdot setMarkerColor "ColorBlack";
_acdot setMarkerType "mil_objective";
if (_left) then {
_acdot setMarkerText format["%1 Claim Timeout [%2]",(_acArray select 1),_leftTime];
} else {
_acdot setMarkerText format["Claimed by %1",(name _closestPlayer)];
};
};
};
uiSleep 1;
deleteMarker _marker;
deleteMarker _dot;
if (!isNil "_acMarker") then {deleteMarker _acMarker;};
if (!isNil "_acdot") then {deleteMarker _acdot;};
if (!isNil "_vehMark") then {deleteMarker _vehMark;};
} else {
uiSleep 1;
};
_player_near = [_position,wai_timeout_distance] call isNearPlayer;
if (diag_tickTime - _starttime >= _timeout_time && !_player_near) then {
_timeout = true;
} else {
if (_player_near) then {_starttime = diag_tickTime;};
};
if (_onGround) then {
_complete = [_mission,_completionType,_killpercent,_vehPos] call wai_completion_check;
};
};
if (_complete) then {
[_vehicle,_mission,[[_vehicle]]] call wai_generate_vehicle_key;
_vehicle setVehicleLock "unlocked";
[_vehicle,_vehclass,2] call load_ammo;
[_vehicle,_loot] call dynamic_crate;
if (count _mines > 0) then {
_mines call wai_fnc_remove;
};
[_difficulty,_msgwin] call wai_server_message;
if (_missionType == "MainBandit") then {
b_missionsrunning = b_missionsrunning - 1;
wai_b_starttime = diag_tickTime;
} else {
h_missionsrunning = h_missionsrunning - 1;
wai_h_starttime = diag_tickTime;
};
diag_log format["WAI: [Mission: %1]: Ended at %2",_name,_position];
if (wai_clean_mission_time > 0) then {
private ["_finish_time","_cleaned","_playernear"];
_finish_time = diag_tickTime;
_cleaned = false;
while {!_cleaned} do {
uiSleep 3;
if (count _aiVehicles > 0) then {
_aiVehicles call wai_monitor_ai_vehicles;
};
if (diag_tickTime - _finish_time >= 60*wai_clean_mission_time) then {
if (count _aiVehicles > 0) then {
_aiVehicles call wai_fnc_remove;
};
_mission call wai_remove_ai;
if (count _vehicles > 0) then {
[_mission,_vehicles] call wai_remove_vehicles;
};
deleteVehicle _dropzone;
uiSleep 5;
{
if (count units _x == 0) then {
deleteGroup _x;
};
} forEach _unitGroups;
wai_mission_markers = wai_mission_markers - [(_missionType + str(_mission))];
wai_mission_data set [_mission, -1];
_cleaned = true;
};
};
};
};
if (_timeout) then {
if (alive _plane) then {
[_plane,_position,_aigroup] spawn wai_clean_aircraft;
};
if (count _mines > 0) then {
_mines call wai_fnc_remove;
};
if (count _aiVehicles > 0) then {
_aiVehicles call wai_fnc_remove;
};
_mission call wai_remove_ai;
if (count _vehicles > 0) then {
[_mission,_vehicles] call wai_remove_vehicles;
};
deleteVehicle _dropzone;
if (!_crashed) then {
[_difficulty,_msglose] call wai_server_message;
};
if (_missionType == "MainBandit") then {
b_missionsrunning = b_missionsrunning - 1;
wai_b_starttime = diag_tickTime;
} else {
h_missionsrunning = h_missionsrunning - 1;
wai_h_starttime = diag_tickTime;
};
uiSleep 5;
{
if (count units _x == 0) then {
deleteGroup _x;
};
} forEach _unitGroups;
wai_mission_markers = wai_mission_markers - [(_missionType + str(_mission))];
wai_mission_data set [_mission, -1];
diag_log format["WAI: [Mission: %1]: Timed out at %2",_name,_position];
};
};

View File

@ -0,0 +1,82 @@
if (!_claimed) then {
// Find the closest player and send an alert
if (isNull _closestPlayer) then {
_closestPlayer = _position call wai_isClosest; // Find the closest player
[_closestPlayer,_name,"Start"] call wai_AutoClaimAlert; // Send alert
_claimTime = diag_tickTime; // Set the time variable for countdown
};
// After the delay time, check player's location and either claim or not claim
if ((diag_tickTime - _claimTime) > ac_delay_time) then {
if ((_closestPlayer distance _position) > ac_alert_distance || {!alive _closestPlayer}) then {
[_closestPlayer,_name,"Stop"] call wai_AutoClaimAlert; // Send alert to player who is closest
_closestPlayer = objNull; // Set to default
_acArray = []; // Set to default
} else {
_claimed = true;
[_closestPlayer,_name,"Claimed"] call wai_AutoClaimAlert; // Send alert to all players
diag_log text format ["WAI Auto Claim: mission %1 has been claimed by %2",_name,(name _closestPlayer)];
_acArray = [getplayerUID _closestPlayer, name _closestPlayer]; // Add player UID and name to array
};
};
};
if (_claimed) then {
// Used in the marker when a player has left the mission area
_leftTime = round (ac_timeout - (diag_tickTime - _claimTime));
// If the player dies at the mission, change marker to countdown and set player variable to null
if ((!alive _closestPlayer) && !_left) then {
_closestPlayer = objNull; // Set the variable to null to prevent null player errors
_claimTime = diag_tickTime; // Set the time for countdown
_left = true; // Changes the marker to countdown
};
// Check to see if the dead player has returned to the mission
if (isNull _closestPlayer) then {
_closestPlayer = [_position,_acArray] call wai_checkReturningPlayer;
};
// Notify the player that he/she is outside the mission area
if (!(isNull _closestPlayer) && ((_closestPlayer distance _position) > ac_alert_distance) && !_left) then {
[_closestPlayer,_name,"Return"] call wai_AutoClaimAlert;
_claimTime = diag_tickTime; // Set the time for the countdown
_left = true; // Set the mission marker to countdown
};
// If the player returns to the mission before the clock runs out then change the marker
if (!(isNull _closestPlayer) && ((_closestPlayer distance _position) < ac_alert_distance) && _left) then {
[_closestPlayer,_name,"Reclaim"] call wai_AutoClaimAlert;
_left = false; // Change the mission marker back to claim
};
// Warn other players in mission area
{
if(!(_x in (units group _closestPlayer)) && ((_x distance _position) < ac_alert_distance )) then {
//warn
RemoteMessage = ["rollingMessages", format["You are in %1's mission. Ask %1 for permission!",_acArray select 1] ];
(owner _x) publicVariableClient "RemoteMessage";
};
} forEach playableUnits;
// If the player lets the clock run out, then set the mission to unclaimed and set the variables to default
// Player left the server
if ((isNull _closestPlayer) && ((diag_tickTime - _claimTime) > ac_timeout)) then {
[_acArray ,_name,"Unclaim"] call wai_AutoClaimAlert; // Send alert to all players
_claimed = false;
_left = false;
_acArray = [];
} else {
// Player is alive but did not return to the mission
if (((diag_tickTime - _claimTime) > ac_timeout) && ((_closestPlayer distance _position) > ac_alert_distance)) then {
[_closestPlayer,_name,"Unclaim"] call wai_AutoClaimAlert; // Send alert to all players
_closestPlayer = objNull;
_claimed = false;
_left = false;
_acArray = [];
};
};
};

View File

@ -0,0 +1,159 @@
private ["_unit","_ailist","_hit","_count","_vehpos","_max_distance","_vehicle","_position_fixed","_position","_dir","_class","_dam","_damage","_hitpoints","_selection","_fuel","_key","_inventory"];
_count = count _this;
_class = _this select 0;
_position = _this select 1;
_mission = _this select 2;
_max_distance = 17;
_position_fixed = false;
_dir = floor(round(random 360));
if (typeName _class == "ARRAY") then {
_class = _class call BIS_fnc_selectRandom;
};
if (_count > 3) then {
_position_fixed = _this select 3;
};
if (_count > 4) then {
_dir = _this select 4;
};
if (!_position_fixed) then {
_vehpos = [0,0,0];
while {count _vehpos > 2} do {
_vehpos = [_position,12,_max_distance,10,0,0.7,0] call BIS_fnc_findSafePos; // Works better
//_vehpos = _position findEmptyPosition[20,_max_distance,_class];
_max_distance = (_max_distance + 10);
};
} else {
_vehpos = _position;
};
_vehicle = _class createVehicle _vehpos;
_vehicle setDir _dir;
_vehicle setPos _vehpos;
_vehicle setVectorUp surfaceNormal position _vehicle;
_vehicle setVariable ["ObjectID","1",true];
_vehicle setVariable ["CharacterID","1",true]; // Set character ID to non-zero number so players see the red "Vehicle Locked" message
_vehicle setVariable ["mission" + dayz_serverKey,_mission, false];
clearWeaponCargoGlobal _vehicle;
clearMagazineCargoGlobal _vehicle;
_vehicle setVehicleLock "locked";
((wai_mission_data select _mission) select 5) set [count ((wai_mission_data select _mission) select 5), _vehicle];
if (wai_debug_mode) then {diag_log format["WAI: Spawned %1 at %2",_class,_vehpos];};
if (getNumber(configFile >> "CfgVehicles" >> _class >> "isBicycle") != 1) then {
_hitpoints = _vehicle call vehicle_getHitpoints;
{
_dam = (random((wai_vehicle_damage select 1) - (wai_vehicle_damage select 0)) + (wai_vehicle_damage select 0)) / 100;
_selection = getText(configFile >> "cfgVehicles" >> _class >> "HitPoints" >> _x >> "name");
if ((_selection in dayZ_explosiveParts) && _dam > 0.8) then {
_dam = 0.8
};
_isglass = ["glass", _selection] call fnc_inString;
if(!_isglass && _dam > 0.1) then {
_strH = "hit_" + (_selection);
_vehicle setHit[_selection,_dam];
_vehicle setVariable [_strH,_dam,true];
if (wai_debug_mode) then {diag_log format["WAI: Calculated damage for %1 is %2",_selection,_dam];};
};
} count _hitpoints;
_fuel = (random((wai_mission_fuel select 1) - (wai_mission_fuel select 0)) + (wai_mission_fuel select 0)) / 100;
_vehicle setFuel _fuel;
if (wai_debug_mode) then {diag_log format["WAI: Added %1 percent fuel to vehicle",_fuel];};
};
if (wai_godmode_vehicles) then {
_vehicle addEventHandler ["HandleDamage",{0}];
} else {
_vehicle addEventHandler ["HandleDamage",{_this call fnc_veh_handleDam}];
};
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_vehicle];
if (wai_keep_vehicles) then {
_vehicle addEventHandler ["GetIn", {
_vehicle = _this select 0;
_unit = _this select 2;
_vehicle setVariable ["mission" + dayz_serverKey,nil];
if !(isPlayer _unit) exitWith {};
if (wai_debug_mode) then {diag_log "PUBLISH: Attempt " + str(_vehicle);};
_class = typeOf _vehicle;
_characterID = _vehicle getVariable ["CharacterID", "0"];
_worldspace = [getDir _vehicle, getPosATL _vehicle];
_hitpoints = _vehicle call vehicle_getHitpoints;
_damage = damage _vehicle;
_fuel = fuel _vehicle;
_uid = _worldspace call dayz_objectUID2;
_array = [];
{
_hit = ([_vehicle,_x] call object_getHit) select 0; //Update for 1.0.7
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
if (wai_debug_mode) then {diag_log format ["Section Part: %1, Dmg: %2",_selection,_hit];};
} count _hitpoints;
_inventory = [getWeaponCargo _vehicle, getMagazineCargo _vehicle, getBackpackCargo _vehicle];
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance,_class,_damage,_characterID,_worldspace,_inventory,_array,_fuel,_uid];
_key call server_hiveWrite;
_key = format["CHILD:388:%1:",_uid];
_result = _key call server_hiveReadWrite;
_outcome = _result select 0;
if (wai_debug_mode) then {diag_log "HIVE: WRITE: "+ (str _key);};
if (_outcome != "PASS") then {
deleteVehicle _vehicle;
diag_log "CUSTOM: failed to get id for : " + (str _uid);
} else {
_oid = _result select 1;
_vehicle setVariable ["ObjectID", _oid, true];
if (wai_debug_mode) then {diag_log "CUSTOM: Selected " + (str _oid);};
_vehicle setVariable ["lastUpdate",diag_tickTime];
_vehicle call fnc_veh_ResetEH;
PVDZE_veh_Init = _vehicle;
publicVariable "PVDZE_veh_Init";
diag_log ("PUBLISH: Created " + (_class) + " with ID " + str(_uid));
if (wai_vehicle_message) then {
[nil,(_this select 2),"loc",rTitleText,"This vehicle is saved to the database.","PLAIN",5] call RE;
};
};
}];
} else {
_vehicle addEventHandler ["GetIn", {
_vehicle = _this select 0;
if (wai_vehicle_message) then {
[nil,(_this select 2),"loc",rTitleText,"WARNING: This vehicle will be deleted at restart!","PLAIN",5] call RE;
};
if (_vehicle getVariable ["claimed",nil] == "yes") exitWith {};
_vehicle setVariable ["mission" + dayz_serverKey,nil];
_vehicle setVariable ["claimed","yes",false];
_vehicle removeAllEventHandlers "HandleDamage";
_vehicle addEventHandler ["HandleDamage",{_this call fnc_veh_handleDam}];
}];
};
_vehicle

View File

@ -0,0 +1,171 @@
private ["_multiArrItem","_multiArrWep","_loot","_vehicles","_complete","_marker","_ammo","_tool","_crate","_weapon","_item","_backpack","_num_tools","_num_items","_num_backpacks","_num_weapons","_weapons_array","_tool_array","_item_array","_backpack_array","_num_pistols","_pistols_array","_pistol","_pistolammo"];
_crate = _this select 0;
_loot = _this select 1;
if ((count _this) > 2) then {
_complete = _this select 2;
};
_multiArrItem = false;
_multiArrWep = false;
if !(isNil "_complete") then {
if (typeOf _crate in (crates_large + crates_medium + crates_small)) then {
if (wai_crates_smoke && sunOrMoon == 1) then {
_marker = "smokeShellPurple" createVehicle getPosATL _crate;
_marker setPosATL (getPosATL _crate);
_marker attachTo [_crate,[0,0,0]];
};
if (wai_crates_flares && sunOrMoon != 1) then {
_marker = "RoadFlare" createVehicle getPosATL _crate;
_marker setPosATL (getPosATL _crate);
_marker attachTo [_crate, [0,0,0]];
PVDZ_obj_RoadFlare = [_marker,0];
publicVariable "PVDZ_obj_RoadFlare";
};
};
};
if(typeName (_loot select 0) == "ARRAY") then {
_num_weapons = (_loot select 0) select 0;
_weapons_array = (_loot select 0) select 1;
} else {
_num_weapons = _loot select 0;
_weapons_array = ai_wep_random;
_multiArrWep = true;
};
if(typeName (_loot select 1) == "ARRAY") then {
_num_tools = (_loot select 1) select 0;
_tool_array = (_loot select 1) select 1;
} else {
_num_tools = _loot select 1;
_tool_array = crate_tools;
};
if(typeName (_loot select 2) == "ARRAY") then {
_num_items = (_loot select 2) select 0;
_item_array = (_loot select 2) select 1;
} else {
_num_items = _loot select 2;
_item_array = crate_items_random;
_multiArrItem = true;
};
if(typeName (_loot select 3) == "ARRAY") then {
_num_pistols = (_loot select 3) select 0;
_pistols_array = (_loot select 3) select 1;
} else {
_num_pistols = _loot select 3;
if (WAI_Overpoch) then {
_pistols_array = ai_wep_owpistol;
} else {
_pistols_array = ai_wep_pistol;
};
};
if(typeName (_loot select 4) == "ARRAY") then {
_num_backpacks = (_loot select 4) select 0;
_backpack_array = (_loot select 4) select 1;
} else {
_num_backpacks = _loot select 4;
_backpack_array = crate_backpacks_all;
};
if(_num_weapons > 0) then {
if (_multiArrWep) then {
for "_i" from 1 to _num_weapons do {
_weapons_array = ai_wep_random select (floor (random (count ai_wep_random)));
_weapon = _weapons_array select (floor (random (count _weapons_array)));
_ammo = _weapon call find_suitable_ammunition;
_crate addWeaponCargoGlobal [_weapon,1];
_crate addMagazineCargoGlobal [_ammo, (round(random((wai_num_mags select 1) - (wai_num_mags select 0))) + (wai_num_mags select 0))];
};
} else {
for "_i" from 1 to _num_weapons do {
_weapon = _weapons_array select (floor (random (count _weapons_array)));
_ammo = _weapon call find_suitable_ammunition;
_crate addWeaponCargoGlobal [_weapon,1];
_crate addMagazineCargoGlobal [_ammo, (round(random((wai_num_mags select 1) - (wai_num_mags select 0))) + (wai_num_mags select 0))];
};
};
};
if(_num_tools > 0) then {
for "_i" from 1 to _num_tools do {
_tool = _tool_array select (floor (random (count _tool_array)));
if(typeName (_tool) == "ARRAY") then {
_crate addWeaponCargoGlobal [_tool select 0,_tool select 1];
} else {
_crate addWeaponCargoGlobal [_tool,1];
};
};
};
if(_num_items > 0) then {
if (_multiArrItem) then {
for "_i" from 1 to _num_items do {
_item_array = crate_items_random select (floor (random (count crate_items_random)));
_item = _item_array select (floor (random (count _item_array)));
if(typeName (_item) == "ARRAY") then {
_crate addMagazineCargoGlobal [_item select 0,_item select 1];
} else {
_crate addMagazineCargoGlobal [_item,1];
};
};
} else {
for "_i" from 1 to _num_items do {
_item = _item_array select (floor (random (count _item_array)));
if(typeName (_item) == "ARRAY") then {
_crate addMagazineCargoGlobal [_item select 0,_item select 1];
} else {
_crate addMagazineCargoGlobal [_item,1];
};
};
};
};
if(_num_pistols > 0) then {
for "_i" from 1 to _num_pistols do {
_pistol = _pistols_array select (floor (random (count _pistols_array)));
_pistolammo = _pistol call find_suitable_ammunition;
_crate addWeaponCargoGlobal [_pistol,1];
_crate addMagazineCargoGlobal [_pistolammo, (round(random((wai_num_mags select 1) - (wai_num_mags select 0))) + (wai_num_mags select 0))];
};
};
if(_num_backpacks > 0) then {
for "_i" from 1 to _num_backpacks do {
_backpack = _backpack_array select (floor (random (count _backpack_array)));
if(typeName (_backpack) == "ARRAY") then {
_crate addBackpackCargoGlobal [_backpack select 0,_backpack select 1];
} else {
_crate addBackpackCargoGlobal [_backpack,1];
};
};
};
if (wai_high_value_chance > 0) then {
if(random 100 < wai_high_value_chance) then {
_item = crate_items_high_value select (floor (random (count crate_items_high_value)));
_crate addMagazineCargoGlobal [_item,1];
};
};
if(wai_debug_mode) then {
diag_log format["WAI: Spawning in a dynamic crate with %1 guns, %2 tools, %3 items and %4 pistols and %5 backpacks",_num_weapons,_num_tools,_num_items,_num_pistols,_num_backpacks];
};

View File

@ -0,0 +1,119 @@
private ["_i","_traders","_safepos","_validspot","_position","_color","_markers"];
if (wai_use_blacklist) then {
_safepos = [getMarkerPos "center",150,((getMarkerSize "center") select 1),(_this select 0),0,0.4,0,wai_blacklist];
} else {
_safepos = [getMarkerPos "center",150,((getMarkerSize "center") select 1),(_this select 0),0,0.4,0];
};
_i = 0;
_validspot = false;
while {!_validspot} do {
_i = _i + 1;
_position = if (!wai_user_spawnpoints) then {_safepos call BIS_fnc_findSafePos} else {WAI_StaticSpawnPoints call BIS_fnc_selectRandom};
_validspot = true;
// if the count of the selected position is more than two BIS_fnc_findSafePos failed
if (!wai_user_spawnpoints) then {
if ((count _position) > 2) then {
_validspot = false;
_color = "ColorBlue";
};
};
if (wai_avoid_samespot) then {
{
if ((_position distance _x) < 200) then {
_validspot = false;
_color = "ColorBlue";
};
} forEach wai_markedPos;
};
// If DZMS installed, include the markers
_markers = if (!isNil "DZMSMarkers") then {DZMSMarkers + wai_mission_markers} else {wai_mission_markers};
if (_validspot && {wai_avoid_missions != 0}) then {
{
if (getMarkerColor _x != "" && (_position distance (getMarkerPos _x) < wai_avoid_missions)) exitWith {
if (wai_debug_mode) then {diag_log format ["WAI: Invalid Position (Marker: %1)",_x];};
_validspot = false;
_color = "ColorBlue";
};
} count _markers;
};
if (_validspot && {wai_avoid_safezones != 0}) then {
{
_szPos = _x select 0;
if (_position distance _szPos < wai_avoid_safezones) exitWith {
if (wai_debug_mode) then {diag_log "WAI: Invalid Position (SafeZone)";};
_color = "ColorBrown";
_validspot = false;
};
} forEach DZE_SafeZonePosArray;
};
if (_validspot && {wai_avoid_water != 0}) then {
if ([_position,wai_avoid_water] call isNearWater) then {
if (wai_debug_mode) then {diag_log "WAI: Invalid Position (Water)";};
_color = "ColorBlue";
_validspot = false;
};
};
if (_validspot && {wai_avoid_town != 0}) then {
if ([_position,wai_avoid_town] call isNearTown) then {
if (wai_debug_mode) then {diag_log "WAI: Invalid Position (Town)";};
_color = "ColorGreen";
_validspot = false;
};
};
if (_validspot && {wai_avoid_road != 0}) then {
if ([_position,wai_avoid_road] call isNearRoad) then {
if (wai_debug_mode) then {diag_log "WAI: Invalid Position (Road)";};
_color = "ColorGrey";
_validspot = false;
};
};
if (_validspot && {wai_avoid_players != 0}) then {
if ([_position,wai_avoid_players] call isNearPlayer) then {
if (wai_debug_mode) then {diag_log "WAI: Invalid Position (player)";};
_color = "ColorPink";
_validspot = false;
};
};
if (_validspot && {wai_avoid_plots != 0}) then {
if (count (_position nearEntities ["Plastic_Pole_EP1_DZ", wai_avoid_plots]) > 0) then {
if (wai_debug_mode) then {diag_log "WAI: Invalid Position (plot)";};
_color = "ColorBlack";
_validspot = false;
};
};
if (!_validspot) then {
if (wai_debug_mode) then {
_marker = createMarkerLocal ["spotMarker" + (str _i),[_position select 0,_position select 1]];
_marker setMarkerShapeLocal "ICON";
_marker setMarkerTypeLocal "DOT";
_marker setMarkerColorLocal _color;
_marker setMarkerSizeLocal [1.0, 1.0];
_marker setMarkerTextLocal "fail";
};
};
if (_validspot) then {
if (wai_debug_mode) then {diag_log format ["Loop complete, valid position %1 in %2 attempts.",_position,_i];};
};
};
if (wai_avoid_samespot) then {
wai_markedPos set [count wai_markedPos, _position];
};
_position set [2, 0];
_position

View File

@ -0,0 +1,287 @@
find_suitable_ammunition = {
private["_weapon","_result","_ammoArray"];
_result = false;
_weapon = _this;
_ammoArray = getArray (configFile >> "cfgWeapons" >> _weapon >> "magazines");
if (count _ammoArray > 0) then {_result = _ammoArray select 0;};
if (typeName _result == "BOOL") then {diag_log format["WAI: Cannot find magazine for weapon - %1.",_weapon];};
_result
};
wai_spawnCrate = {
private ["_pos","_crate","_mission","_offset","_type","_loot","_position","_crates"];
_crates = _this select 0;
_pos = _this select 1;
if (count _this > 2) then {
_mission = _this select 2;
};
{
_loot = _x select 0;
_type = _x select 1;
_offset = _x select 2;
_position = [(_pos select 0) + (_offset select 0), (_pos select 1) + (_offset select 1), 0];
if (count _offset > 2) then {
_position set [2, (_offset select 2)];
};
if (typeName _type == "ARRAY") then {
_type = _type call BIS_fnc_selectRandom;
};
_crate = _type createVehicle [0,0,0];
if (count _x > 3) then {
_crate setDir (_x select 3);
};
if (surfaceIsWater _position) then {
_crate setPosASL _position;
} else {
_crate setPos _position;
};
_crate setVariable ["permaLoot",true];
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
_crate addEventHandler ["HandleDamage", {0}];
_crate enableSimulation false;
if (!isNil "_mission") then {
((wai_mission_data select _mission) select 3) set [count ((wai_mission_data select _mission) select 3), [_crate,_loot]];
} else {
(wai_static_data select 3) set [count (wai_static_data select 3), [_crate,_loot]];
};
} count _crates;
};
wai_server_message = {
private ["_color","_params","_type"];
_type = _this select 0;
_message = _this select 1;
call {
if (wai_mission_announce == "Radio") exitWith {
RemoteMessage = ["radio",_message];
};
if (wai_mission_announce == "DynamicText") exitWith {
_color = call {
if(_type == "Easy") exitWith {"#00cc00"};
if(_type == "Medium") exitWith {"#ffff66"};
if(_type == "Hard") exitWith {"#990000"};
if(_type == "Extreme") exitWith {"#33334d"};
};
_params = ["0.40","#FFFFFF","0.60",_color,0,-.35,10,0.5];
RemoteMessage = ["dynamic_text", ["STR_CL_MISSION_ANNOUNCE",_message],_params];
};
if (wai_mission_announce == "titleText") exitWith {
RemoteMessage = ["titleText",_message];
};
};
publicVariable "RemoteMessage";
};
wai_minefield_warning = {
private ["_owner","_params"];
_owner = (owner _this);
_params = ["0","#FFFFFF","0.50","#ff3300",0,.3,10,0.5];
RemoteMessage = ["dynamic_text",["","STR_CL_MINEFIELD_WARNING"],_params];
(_owner) publicVariableClient "RemoteMessage";
};
wai_AutoClaimAlert = {
private ["_unit","_owner","_mission","_type","_message","_name"];
_unit = _this select 0;
_mission = _this select 1;
_type = _this select 2;
if (typeName _unit == "ARRAY") then {
_name = _unit select 1;
} else {
_owner = owner _unit;
_name = name _unit;
};
_message = call {
if (_type == "Start") exitWith {["STR_CL_AUTOCLAIM_ANNOUNCE",_mission,ac_delay_time];};
if (_type == "Stop") exitWith {["STR_CL_AUTOCLAIM_NOCLAIM",_mission];};
if (_type == "Return") exitWith {["STR_CL_AUTOCLAIM_RETURN",ac_timeout];};
if (_type == "Reclaim") exitWith {"STR_CL_AUTOCLAIM_RECLAIM";};
if (_type == "Claimed") exitWith {["STR_CL_AUTOCLAIM_CLAIM",_name,_mission];};
if (_type == "Unclaim") exitWith {["STR_CL_AUTOCLAIM_ABANDON",_name,_mission];};
};
if (_type == "Claimed" || _type == "Unclaim") exitWith {
RemoteMessage = ["IWAC",_message];
publicVariable "RemoteMessage";
};
RemoteMessage = ["IWAC",_message];
(_owner) publicVariableClient "RemoteMessage";
};
wai_monitor_ai_vehicles = {
private "_vehicle";
{
_vehicle = _x;
if (alive _vehicle && ({alive _x} count crew _vehicle > 0)) then {
_vehicle setVehicleAmmo 1;
_vehicle setFuel 1;
} else {
_vehicle setDamage 1;
};
} count _this;
};
wai_fnc_remove = {
{
deleteVehicle _x;
} count _this;
};
wai_remove_vehicles = {
private ["_mission","_vehicles"];
_mission = _this select 0;
_vehicles = _this select 1;
{
if (_x getVariable ["mission" + dayz_serverKey, nil] == _mission) then {
deleteVehicle _x;
};
} count _vehicles;
};
wai_remove_ai = {
{
if (_x getVariable ["mission" + dayz_serverKey, nil] == _this) then {
deleteVehicle _x;
};
} count allUnits;
};
wai_generate_vehicle_key = {
private ["_isKeyOK","_crates","_keyColor","_keyNumber","_vehicle","_crate","_keySelected","_mission","_unit","_ailist","_characterID"];
_vehicle = _this select 0;
_mission = _this select 1;
_crates = _this select 2;
if (wai_vehicle_keys == "NoVehicleKey") exitWith {
_vehicle setVariable ["CharacterID","0",true];
_vehicle setVehicleLock "unlocked";
};
_keyColor = ["Green","Red","Blue","Yellow","Black"] call BIS_fnc_selectRandom;
_keyNumber = (ceil(random 2500)) + 1;
_keySelected = format["ItemKey%1%2",_keyColor,_keyNumber];
_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
_characterID = str(getNumber(configFile >> "CfgWeapons" >> _keySelected >> "keyid"));
if !(_isKeyOK) exitWith {
_vehicle setVariable ["CharacterID","0",true];
_vehicle setVehicleLock "unlocked";
diag_log format["WAI: Failed to generate a key for vehicle %1 at mission %2",_vehicle,_mission];
};
_vehicle setVariable ["CharacterID",_characterID,true];
if (wai_vehicle_keys == "KeyinVehicle") exitWith {
_vehicle addWeaponCargoGlobal [_keySelected,1];
_vehicle setVehicleLock "unlocked";
};
if (wai_vehicle_keys == "KeyinCrate") exitWith {
_crate = (_crates select 0) select 0;
_crate addWeaponCargoGlobal [_keySelected, 1];
};
if (wai_vehicle_keys == "KeyonAI") exitWith {
_ailist = [];
{
if ((_x getVariable ["mission" + dayz_serverKey,nil] == _mission) && (_x getVariable ["bodyName",nil] == "mission_ai") && !(_x getVariable ["noKey", false])) then {
_ailist set [count _ailist, _x];
};
} count allDead;
_unit = _ailist call BIS_fnc_selectRandom;
_unit addWeapon _keySelected;
if(wai_debug_mode) then {
diag_log format["There are %1 Dead AI for mission %2 vehicle key",_ailist,_mission];
diag_log format["Key added to %1 for vehicle %2",_unit,_vehicle];
};
};
};
wai_completion_check = {
private ["_completionType","_complete","_position","_mission","_killpercent","_objectivetarget"];
_mission = _this select 0;
_completionType = _this select 1;
_killpercent = _this select 2;
_position = _this select 3;
_complete = false;
call
{
if (_completionType select 0 == "crate") exitWith {
if(wai_kill_percent == 0) then {
_complete = [_position,20] call isNearPlayer;
} else {
if(((wai_mission_data select _mission) select 0) <= _killpercent) then {
_complete = [_position,20] call isNearPlayer;
};
};
};
if (_completionType select 0 == "kill") exitWith {
if(((wai_mission_data select _mission) select 0) == 0) then {
_complete = true;
};
};
if (_completionType select 0 == "assassinate") exitWith {
_objectivetarget = _completionType select 1;
{
if !(alive _x) exitWith {_complete = true;};
} count units _objectivetarget;
};
/* no missions are using this function at the moment
if (_completionType == "resource") exitWith {
_node = _completionType select 1;
_resource = _node getVariable ["Resource", 0];
if (_resource == 0) then {
if ([_position,80] call isNearPlayer) then {
_complete = true;
} else {
_timeout = true;
};
};
}; */
};
_complete
};
wai_clean_aircraft = {
private ["_veh","_position","_group"];
_veh = _this select 0;
_position = _this select 1;
_group = _this select 2;
uiSleep 60;
deleteVehicle _veh;
while {(count (wayPoints _group)) > 0} do {
deleteWaypoint ((wayPoints _group) select 0);
};
{
deleteVehicle _x;
} count (units _group);
uiSleep 5;
deleteGroup _group;
if(wai_debug_mode) then {diag_log "WAI: Aircraft Cleaned";};
};

View File

@ -0,0 +1,36 @@
private ["_wp","_skill","_mission","_wp_rad","_wp","_pos_x","_pos_y","_pos_z","_unitGroup","_position"];
_unitGroup = _this select 0;
_position = _this select 1;
_pos_x = _position select 0;
_pos_y = _position select 1;
_pos_z = _position select 2;
_wp_rad = 0;
if(count _this > 2) then {
_skill = _this select 2;
_wp_rad = call {
if (_skill == "easy") exitWith {20;};
if (_skill == "medium") exitWith {40;};
if (_skill == "hard") exitWith {80;};
if (_skill == "extreme") exitWith {120;};
if (_skill == "random") exitWith {random(100);};
};
};
// AI is on a building so limit the movement
if (_pos_z > 1) then {
_wp_rad = 0;
};
{
_wp = _unitGroup addWaypoint [_x,10];
_wp setWaypointType "MOVE";
} count [[_pos_x,(_pos_y+_wp_rad),0],[(_pos_x+_wp_rad),_pos_y,0],[_pos_x,(_pos_y-_wp_rad),0],[(_pos_x-_wp_rad),_pos_y,0]];
_wp = _unitGroup addWaypoint [[_pos_x,_pos_y,0],_wp_rad];
_wp setWaypointType "CYCLE";

View File

@ -0,0 +1,395 @@
private ["_rocket","_unarmed","_launcher","_starttodrop","_timebtwdrops","_flyinheight","_distance","_heliStartDir","_start_position","_diag_distance","_rndnum","_mission_data","_pos_x","_pos_y","_ainum","_missionrunning","_aitype","_helipos1","_geartools","_gearmagazines","_cleanheli","_drop","_helipos","_gunner2","_gunner","_player_present","_skillarray","_aicskill","_aiskin","_aigear","_wp","_helipatrol","_gear","_skin","_backpack","_mags","_gun","_triggerdis","_startingpos","_aiweapon","_mission","_heli_class","_aipack","_helicopter","_unitGroup","_pilot","_skill","_paranumber","_position","_wp1"];
if (!wai_enable_paradrops) exitWith {};
_position = _this select 0;
_pos_x = _position select 0;
_pos_y = _position select 1;
_triggerdis = _this select 1;
_heli_class = _this select 2;
_heliStartDir = _this select 3;
_distance = _this select 4;
_flyinheight = _this select 5;
_timebtwdrops = _this select 6;
_starttodrop = _this select 7;
_paranumber = _this select 8;
_skill = _this select 9;
_gun = _this select 10;
_mags = _this select 11;
_backpack = _this select 12;
_skin = _this select 13;
_gear = _this select 14;
_aitype = _this select 15;
_helipatrol = _this select 16;
_aipack = "";
_player_present = false;
if (count _this > 17) then {
_mission = _this select 17;
} else {
_mission = nil;
};
if (typeName _gun == "ARRAY") then {
_launcher = _gun select 1;
_gun = _gun select 0;
};
_aiweapon = [];
_aigear = [];
_aiskin = "";
_aicskill = [];
_skillarray = ["aimingAccuracy","aimingShake","aimingSpeed","endurance","spotDistance","spotTime","courage","reloadSpeed","commanding","general"];
_unarmed = false;
if(wai_debug_mode) then {diag_log "WAI: Paradrop waiting for player";};
// Wait until a player is within the trigger distance
while {!_player_present} do {
_player_present = [[_pos_x,_pos_y,0],_triggerdis] call isNearPlayer;
uiSleep 5;
};
_aiskin = call {
if (_skin == "random") exitWith {ai_all_skin select (floor (random (count ai_all_skin)));};
if (_skin == "hero") exitWith {ai_hero_skin select (floor (random (count ai_hero_skin)));};
if (_skin == "bandit") exitWith {ai_bandit_skin select (floor (random (count ai_bandit_skin)));};
if (_skin == "special") exitWith {ai_special_skin select (floor (random (count ai_special_skin)));};
_skin;
};
if(typeName _aiskin == "ARRAY") then {
_aiskin = _aiskin select (floor (random (count _aiskin)));
};
if(!isNil "_mission") then {
_missionrunning = (typeName (wai_mission_data select _mission) == "ARRAY");
} else {
_missionrunning = true;
};
if(!_missionrunning) exitWith {if (wai_debug_mode) then {diag_log format["WAI: Mission at %1 already ended, aborting para drop",_position];};};
if(wai_debug_mode) then {diag_log format ["WAI: Spawning a %1 with %2 units to be para dropped at %3",_heli_class,_paranumber,_position];};
if(_aitype == "Hero") then {
_unitGroup = createGroup RESISTANCE;
} else {
_unitGroup = createGroup EAST;
};
_pilot = _unitGroup createUnit [_aiskin,[0,0,0],[],1,"NONE"];
[_pilot] joinSilent _unitGroup;
// This random number is used to start the helicopter a random distance from the mission
_rndnum = (random ((_distance select 1) - (_distance select 0)) + (_distance select 0));
call
{
if (_heliStartDir == "North") exitWith {_helicopter = createVehicle [_heli_class,[(_position select 0),(_position select 1) + _rndnum,100],[],0,"FLY"];};
if (_heliStartDir == "South") exitWith {_helicopter = createVehicle [_heli_class,[(_position select 0),(_position select 1) - _rndnum,100],[],0,"FLY"];};
if (_heliStartDir == "East") exitWith {_helicopter = createVehicle [_heli_class,[(_position select 0) + _rndnum,(_position select 1),100],[],0,"FLY"];};
if (_heliStartDir == "West") exitWith {_helicopter = createVehicle [_heli_class,[(_position select 0) - _rndnum,(_position select 1),100],[],0,"FLY"];};
};
_start_position = position _helicopter;
if (wai_debug_mode) then {
_diag_distance = _helicopter distance _position;
diag_log format["WAI: the Paratrooper Drop has started %1 from the mission",_diag_distance];
};
//_helicopter setFuel 1;
_helicopter engineOn true;
//_helicopter setVehicleAmmo 1;
_helicopter flyInHeight _flyinheight;
_helicopter addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];
_pilot assignAsDriver _helicopter;
_pilot moveInDriver _helicopter;
_gunner = _unitGroup createUnit [_aiskin,[0,0,0],[],1,"NONE"];
_gunner assignAsGunner _helicopter;
_gunner moveInTurret [_helicopter,[0]];
[_gunner] joinSilent _unitGroup;
_gunner2 = _unitGroup createUnit [_aiskin,[0,0,0],[],1,"NONE"];
_gunner2 assignAsGunner _helicopter;
_gunner2 moveInTurret [_helicopter,[1]];
[_gunner2] joinSilent _unitGroup;
call {
if (_aitype == "Hero") exitWith {{ _x setVariable ["Hero",true]; _x setVariable ["humanity", ai_add_humanity]; } count [_pilot, _gunner, _gunner2];};
if (_aitype == "Bandit") exitWith {{ _x setVariable ["Bandit",true]; _x setVariable ["humanity", ai_remove_humanity]; } count [_pilot, _gunner, _gunner2];};
if (_aitype == "Special") exitWith {{ _x setVariable ["Special",true]; _x setVariable ["humanity", ai_special_humanity]; } count [_pilot, _gunner, _gunner2];};
};
{
_pilot setSkill [_x,1]
} count _skillarray;
{
_gunner setSkill [_x,0.7];
_gunner2 setSkill [_x,0.7];
} count _skillarray;
{
_x addWeapon "Makarov_DZ";
_x addMagazine "8Rnd_9x18_Makarov";
_x addMagazine "8Rnd_9x18_Makarov";
} count (units _unitgroup);
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_helicopter];
if (!isNil "_mission") then {
((wai_mission_data select _mission) select 1) set [count ((wai_mission_data select _mission) select 1), _unitGroup];
((wai_mission_data select _mission) select 4) set [count ((wai_mission_data select _mission) select 4), _helicopter];
} else {
(wai_static_data select 1) set [count (wai_static_data select 1), _unitGroup];
(wai_static_data select 2) set [count (wai_static_data select 2), _helicopter];
};
_unitGroup allowFleeing 0;
_unitGroup setBehaviour "CARELESS";
_unitGroup setSpeedMode "FULL";
if(_aitype == "Hero") then {
_unitGroup setCombatMode ai_hero_combatmode;
_unitGroup setBehaviour ai_hero_behaviour;
} else {
_unitGroup setCombatMode ai_bandit_combatmode;
_unitGroup setBehaviour ai_bandit_behaviour;
};
// Add waypoints to the chopper group.
_wp = _unitGroup addWaypoint [[(_position select 0), (_position select 1)], 0];
_wp setWaypointType "MOVE";
_wp setWaypointCompletionRadius 100;
_drop = true;
//_helipos = getPos _helicopter;
while {(alive _helicopter) && (_drop)} do {
private ["_magazine","_weapon","_weapon","_chute","_para","_pgroup"];
uiSleep 1;
_helipos = getPos _helicopter;
if (_helipos distance [(_position select 0),(_position select 1),100] <= _starttodrop) then {
if(_aitype == "Hero") then {
_pgroup = createGroup RESISTANCE;
} else {
_pgroup = createGroup EAST;
};
if (!isNil "_mission") then {
((wai_mission_data select _mission) select 1) set [count ((wai_mission_data select _mission) select 1), _pgroup];
} else {
(wai_static_data select 1) set [count (wai_static_data select 1), _pgroup];
};
for "_x" from 1 to _paranumber do {
_helipos = getPos _helicopter;
call {
if(typeName(_gun) == "SCALAR") then {
if(_gun == 0) exitWith {_aiweapon = ai_wep_random select (floor (random (count ai_wep_random)));};
if(_gun == 1) exitWith {_aiweapon = ai_wep_machine;};
if(_gun == 2) exitWith {_aiweapon = ai_wep_sniper;};
} else {
if(_gun == "random") exitWith {_aiweapon = ai_wep_random select (floor (random (count ai_wep_random)));};
if(_gun == "unarmed") exitWith {_unarmed = true;};
_aiweapon = _gun;
};
};
if (!_unarmed) then {
_weapon = if (typeName (_aiweapon) == "ARRAY") then {_aiweapon select (floor (random (count _aiweapon)))} else {_aiweapon};
if !(isClass (configFile >> "CfgWeapons" >> _weapon)) then {
diag_log text format ["WAI Error: Weapon classname (%1) is not valid!",_weapon];
_weapon = "M16A2_DZ"; // Replace with known good classname.
};
_magazine = _weapon call find_suitable_ammunition;
};
_aigear = call {
if (typeName(_gear) == "SCALAR") then {
if(_gear == 0) exitWith {ai_gear0;};
if(_gear == 1) exitWith {ai_gear1;};
if(_gear == 2) exitWith {ai_gear2;};
if(_gear == 3) exitWith {ai_gear3;};
if(_gear == 4) exitWith {ai_gear4;};
} else {
if(_gear == "random") exitWith {ai_gear_random select (floor (random (count ai_gear_random)));};
};
};
_gearmagazines = _aigear select 0;
_geartools = _aigear select 1;
call {
if(_backpack == "random") exitWith {_aipack = ai_packs select (floor (random (count ai_packs)));};
if(_backpack == "none") exitWith {};
_aipack = _backpack;
};
_aiskin = call {
if (_skin == "random") exitWith {ai_all_skin select (floor (random (count ai_all_skin)));};
if (_skin == "hero") exitWith {ai_hero_skin select (floor (random (count ai_hero_skin)));};
if (_skin == "bandit") exitWith {ai_bandit_skin select (floor (random (count ai_bandit_skin)));};
if (_skin == "special") exitWith {ai_special_skin select (floor (random (count ai_special_skin)));};
_skin;
};
//if(typeName _aiskin == "ARRAY") then {
//_aiskin = _aiskin select (floor (random (count _aiskin)));
//};
_para = _pgroup createUnit [_aiskin,[0,0,0],[],1,"FORM"];
_para enableAI "TARGET";
_para enableAI "AUTOTARGET";
_para enableAI "MOVE";
_para enableAI "ANIM";
_para enableAI "FSM";
removeAllWeapons _para;
removeAllItems _para;
_para addWeapon _weapon;
for "_i" from 1 to _mags do {
_para addMagazine _magazine;
};
if(_backpack != "none") then {
_para addBackpack _aipack;
};
{
_para addMagazine _x
} count _gearmagazines;
{
_para addWeapon _x
} count _geartools;
if (sunOrMoon != 1) then {
_para addWeapon "NVGoggles";
};
_aicskill = call {
if(_skill == "easy") exitWith {ai_skill_easy;};
if(_skill == "medium") exitWith {ai_skill_medium;};
if(_skill == "hard") exitWith {ai_skill_hard;};
if(_skill == "extreme") exitWith {ai_skill_extreme;};
if(_skill == "random") exitWith {ai_skill_random select (floor (random (count ai_skill_random)));};
ai_skill_random select (floor (random (count ai_skill_random)));
};
{
_para setSkill [(_x select 0),(_x select 1)]
} count _aicskill;
_para addEventHandler ["Killed",{[_this select 0, _this select 1] call on_kill;}];
_chute = createVehicle ["ParachuteWest", [(_helipos select 0), (_helipos select 1), (_helipos select 2)], [], 0, "NONE"];
_para moveInDriver _chute;
[_para] joinSilent _pgroup;
// Adjusting this number changes the spread of the AI para drops
uiSleep _timebtwdrops;
if(!isNil "_mission") then {
_mission_data = (wai_mission_data select _mission);
if (typeName _mission_data == "ARRAY") then {
_ainum = _mission_data select 0;
wai_mission_data select _mission set [0, (_ainum + 1)];
_para setVariable ["mission" + dayz_serverKey, _mission, false];
};
} else {
wai_static_data set [0, ((wai_static_data select 0) + 1)];
};
};
if (!isNil "_launcher" && wai_use_launchers) then {
call {
if (_launcher == "Random") exitWith { _launcher = (ai_launchers_AT + ai_launchers_AA) call BIS_fnc_selectRandom; };
if (_launcher == "at") exitWith {_launcher = ai_wep_launchers_AT select (floor (random (count ai_wep_launchers_AT)));};
if (_launcher == "aa") exitWith {_launcher = ai_wep_launchers_AA select (floor (random (count ai_wep_launchers_AA)));};
};
_rocket = _launcher call find_suitable_ammunition;
_para addMagazine _rocket;
_para addMagazine _rocket;
_para addWeapon _launcher;
};
call {
if (_aitype == "Hero") exitWith {{_x setVariable ["Hero",true,false]; _x setVariable ["humanity", ai_remove_humanity];} count (units _pgroup);};
if (_aitype == "Bandit") exitWith {{_x setVariable ["Bandit",true,false]; _x setVariable ["humanity", ai_add_humanity];} count (units _pgroup);};
if (_aitype == "Special") exitWith {{_x setVariable ["Special",true,false]; _x setVariable ["humanity", ai_special_humanity];} count (units _pgroup);};
};
_drop = false;
_pgroup selectLeader ((units _pgroup) select 0);
if(wai_debug_mode) then {diag_log format ["WAI: Spawned in %1 ai units for paradrop",_paranumber];};
[_pgroup,_position,_skill] call group_waypoints;
if(_aitype == "Hero") then {
_pgroup setCombatMode ai_hero_combatmode;
_pgroup setBehaviour ai_hero_behaviour;
} else {
_pgroup setCombatMode ai_bandit_combatmode;
_pgroup setBehaviour ai_bandit_behaviour;
};
};
};
if (_helipatrol) then {
_wp1 = _unitGroup addWaypoint [[(_position select 0),(_position select 1)], 100];
_wp1 setWaypointType "SAD";
_wp1 setWaypointCompletionRadius 150;
_unitGroup setBehaviour "AWARE";
_unitGroup setSpeedMode "FULL";
{
_x addEventHandler ["Killed",{[_this select 0, _this select 1] call on_kill;}];
} forEach (units _unitgroup);
} else {
{
_x doMove [(_start_position select 0), (_start_position select 1), 100]
} count (units _unitGroup);
_unitGroup setBehaviour "CARELESS";
_unitGroup setSpeedMode "FULL";
_cleanheli = true;
while {_cleanheli} do {
uiSleep 5;
_helipos1 = getPos _helicopter;
if ((_helipos1 distance [(_start_position select 0),(_start_position select 1),100] <= 2000) || (!alive _helicopter)) then {
deleteVehicle _helicopter;
{
deleteVehicle _x;
} count (units _unitgroup);
deleteGroup _unitGroup;
if(wai_debug_mode) then { diag_log "WAI: Paradrop helicopter cleaned"; };
_cleanheli = false;
};
};
};

View File

@ -0,0 +1,140 @@
private ["_start_position","_diag_distance","_rndnum","_mission","_aitype","_aiskin","_skin","_aicskill","_wpnum","_radius","_gunner2","_gunner","_skillarray","_startingpos","_heli_class","_startPos","_helicopter","_unitGroup","_pilot","_skill","_position","_wp"];
_position = _this select 0;
_radius = _this select 1;
_wpnum = _this select 2;
_heli_class = _this select 3;
_skill = _this select 4;
_skin = _this select 5;
_aitype = _this select 6;
if (count _this > 7) then {
_mission = _this select 7;
} else {
_mission = nil;
};
_skillarray = ["aimingAccuracy","aimingShake","aimingSpeed","endurance","spotDistance","spotTime","courage","reloadSpeed","commanding","general"];
call {
if(_skill == "easy") exitWith { _aicskill = ai_skill_easy; };
if(_skill == "medium") exitWith { _aicskill = ai_skill_medium; };
if(_skill == "hard") exitWith { _aicskill = ai_skill_hard; };
if(_skill == "extreme") exitWith { _aicskill = ai_skill_extreme; };
if(_skill == "random") exitWith { _aicskill = ai_skill_random call BIS_fnc_selectRandom; };
_aicskill = ai_skill_random call BIS_fnc_selectRandom;
};
call {
if (_skin == "random") exitWith { _aiskin = ai_all_skin call BIS_fnc_selectRandom; };
if (_skin == "hero") exitWith { _aiskin = ai_hero_skin call BIS_fnc_selectRandom; };
if (_skin == "bandit") exitWith { _aiskin = ai_bandit_skin call BIS_fnc_selectRandom; };
if (_skin == "special") exitWith { _aiskin = ai_special_skin call BIS_fnc_selectRandom; };
_aiskin = _skin;
};
if(typeName _aiskin == "ARRAY") then {
_aiskin = _aiskin call BIS_fnc_selectRandom;
};
if(_aitype == "Hero") then {
_unitGroup = createGroup RESISTANCE;
} else {
_unitGroup = createGroup EAST;
};
_pilot = _unitGroup createUnit [_aiskin, [0,0,0], [], 1, "NONE"];
[_pilot] joinSilent _unitGroup;
// This random number is used to start the helicopter from 3000 to 4000 meters from the mission.
_rndnum = 3000 + round (random 1000);
_helicopter = createVehicle [_heli_class,[(_position select 0) + _rndnum,(_position select 1),100],[],0,"FLY"];
_diag_distance = _helicopter distance _position;
if (wai_debug_mode) then {
diag_log format["WAI: the Heli Patrol has started %1 from the mission",_diag_distance];
};
_helicopter setFuel 1;
_helicopter engineOn true;
_helicopter setVehicleAmmo 1;
_helicopter flyInHeight 150;
_helicopter lock true;
_helicopter addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}];
_pilot assignAsDriver _helicopter;
_pilot moveInDriver _helicopter;
_gunner = _unitGroup createUnit [_aiskin, [0,0,0], [], 1, "NONE"];
_gunner assignAsGunner _helicopter;
_gunner moveInTurret [_helicopter,[0]];
[_gunner] joinSilent _unitGroup;
_gunner2 = _unitGroup createUnit [_aiskin, [0,0,0], [], 1, "NONE"];
_gunner2 assignAsGunner _helicopter;
_gunner2 moveInTurret [_helicopter,[1]];
[_gunner2] joinSilent _unitGroup;
call {
if (_aitype == "Hero") exitWith {{ _x setVariable ["Hero",true,false]; _x setVariable ["humanity", ai_remove_humanity];} count [_pilot, _gunner, _gunner2]; };
if (_aitype == "Bandit") exitWith {{ _x setVariable ["Bandit",true,false]; _x setVariable ["humanity", ai_add_humanity];} count [_pilot, _gunner, _gunner2]; };
if (_aitype == "Special") exitWith {{ _x setVariable ["Special",true,false]; _x setVariable ["humanity", ai_special_humanity];} count [_pilot, _gunner, _gunner2]; };
};
{
_pilot setSkill [_x,1];
} count _skillarray;
{
_gunner setSkill [(_x select 0),(_x select 1)];
_gunner2 setSkill [(_x select 0),(_x select 1)];
} count _aicskill;
{
_x addWeapon "Makarov_DZ";
_x addMagazine "8Rnd_9x18_Makarov";
_x addMagazine "8Rnd_9x18_Makarov";
} count (units _unitgroup);
{
_x addEventHandler ["Killed",{[_this select 0, _this select 1] call on_kill;}];
} forEach (units _unitgroup);
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_helicopter];
if (!isNil "_mission") then {
((wai_mission_data select _mission) select 1) set [count ((wai_mission_data select _mission) select 1), _unitGroup];
((wai_mission_data select _mission) select 4) set [count ((wai_mission_data select _mission) select 4), _helicopter];
} else {
(wai_static_data select 1) set [count (wai_static_data select 1), _unitGroup];
(wai_static_data select 2) set [count (wai_static_data select 2), _helicopter];
};
_unitGroup allowFleeing 0;
_unitGroup setBehaviour "AWARE";
_unitGroup setSpeedMode "FULL";
if(_aitype == "Hero") then {
_unitGroup setCombatMode ai_hero_combatmode;
_unitGroup setBehaviour ai_hero_behaviour;
} else {
_unitGroup setCombatMode ai_bandit_combatmode;
_unitGroup setBehaviour ai_bandit_behaviour;
};
if(_wpnum > 0) then {
for "_i" from 1 to _wpnum do {
_wp = _unitGroup addWaypoint [[(_position select 0),(_position select 1),0],_radius];
_wp setWaypointType "MOVE";
_wp setWaypointCompletionRadius 200;
};
};
_wp = _unitGroup addWaypoint [[(_position select 0),(_position select 1),0],100];
_wp setWaypointType "CYCLE";
_wp setWaypointCompletionRadius 200;
_unitGroup

View File

@ -0,0 +1,103 @@
private["_vehicle","_type","_inGear"];
#define GEAR(mag) if !(isNil "_inGear") then {_vehicle addMagazineCargoGlobal [mag,_inGear];};
#define TURRET(mag,num) _vehicle addMagazineTurret [mag,[num]];
_vehicle = _this select 0;
_type = _this select 1;
if (count _this > 2) then {
_inGear = _this select 2;
};
call {
if(_type == "Mi17_DZE") exitWith {
TURRET("100Rnd_762x54_PK",0)
TURRET("100Rnd_762x54_PK",1)
GEAR("100Rnd_762x54_PK")
};
if(_type == "UH1Y_DZE") exitWith {
TURRET("2000Rnd_762x51_M134",0)
TURRET("2000Rnd_762x51_M134",1)
GEAR("2000Rnd_762x51_M134")
};
if(_type == "UH1H_DZE") exitWith {
TURRET("100Rnd_762x51_M240",0)
TURRET("100Rnd_762x51_M240",1)
GEAR("100Rnd_762x51_M240")
};
if(_type == "CH_47F_EP1_DZE") exitWith {
TURRET("2000Rnd_762x51_M134",0)
TURRET("2000Rnd_762x51_M134",1)
TURRET("100Rnd_762x51_M240",2)
GEAR("2000Rnd_762x51_M134")
};
if(_type == "UH60M_EP1_DZE") exitWith {
TURRET("2000Rnd_762x51_M134",0)
TURRET("2000Rnd_762x51_M134",1)
GEAR("2000Rnd_762x51_M134")
};
if(_type == "HMMWV_M998A2_SOV_DES_EP1_DZE") exitWith {
TURRET("48Rnd_40mm_MK19",0)
TURRET("100Rnd_762x51_M240",1)
GEAR("48Rnd_40mm_MK19")
};
if(_type == "LandRover_Special_CZ_EP1_DZE") exitWith {
TURRET("29Rnd_30mm_AGS30",0)
TURRET("100Rnd_762x54_PK",1)
GEAR("29Rnd_30mm_AGS30")
};
if(_type == "GAZ_Vodnik_DZE") exitWith {
TURRET("100Rnd_762x54_PK",0)
TURRET("100Rnd_762x54_PK",1)
GEAR("100Rnd_762x54_PK")
};
if(_type == "HMMWV_M1151_M2_CZ_DES_EP1_DZE") exitWith {
TURRET("100Rnd_127x99_M2",0)
GEAR("100Rnd_127x99_M2")
};
if(_type == "LandRover_MG_TK_EP1_DZE") exitWith {
TURRET("100Rnd_127x99_M2",0)
GEAR("100Rnd_127x99_M2")
};
if(_type == "UAZ_MG_TK_EP1_DZE") exitWith {
TURRET("150Rnd_127x107_DSHKM",0)
GEAR("150Rnd_127x107_DSHKM")
};
if(_type == "ArmoredSUV_PMC_DZE") exitWith {
TURRET("2000Rnd_762x51_M134",0)
GEAR("2000Rnd_762x51_M134")
};
if(_type == "Offroad_DSHKM_Gue_DZE") exitWith {
TURRET("150Rnd_127x107_DSHKM",0)
GEAR("150Rnd_127x107_DSHKM")
};
if(_type == "Pickup_PK_TK_GUE_EP1_DZE") exitWith {
TURRET("100Rnd_762x54_PK",0)
GEAR("100Rnd_762x54_PK")
};
if(_type == "Pickup_PK_GUE_DZE") exitWith {
TURRET("100Rnd_762x54_PK",0)
GEAR("100Rnd_762x54_PK")
};
if(_type == "Pickup_PK_INS_DZE") exitWith {
TURRET("100Rnd_762x54_PK",0)
GEAR("100Rnd_762x54_PK")
};
};

View File

@ -0,0 +1,16 @@
private["_area_max","_area_min","_position","_num_mines","_mines"];
_position = _this select 0;
_area_min = _this select 1;
_area_max = _this select 2;
_num_mines = _this select 3;
_mines = [];
for "_x" from 1 to _num_mines do {
_mine_pos = [_position,_area_min,_area_max,10,0,2000,0] call BIS_fnc_findSafePos;
_mine = createVehicle ["Mine", _mine_pos, [], 0, "CAN_COLLIDE"];
_mines set [(count _mines), _mine];
};
_mines

View File

@ -0,0 +1,303 @@
private ["_mission","_position","_difficulty","_name","_missionType","_showMarker","_enableMines","_completionType","_msgstart","_msgwin","_msglose","_mines"];
_mission = _this select 0;
_position = _this select 1;
_difficulty = _this select 2;
_name = _this select 3;
_missionType = _this select 4;
_showMarker = _this select 5;
_enableMines = _this select 6;
_completionType = _this select 7;
_msgstart = (_this select 8) select 0;
_msgwin = (_this select 8) select 1;
_msglose = (_this select 8) select 2;
if(wai_debug_mode) then {diag_log format["WAI: Starting Mission number %1",_mission];};
if(wai_enable_minefield && _enableMines) then {
_mines = [_position,50,75,100] call minefield;
wai_mission_data select _mission set [2, _mines];
};
_color = call {
if(_difficulty == "Easy") exitWith {"ColorGreen"};
if(_difficulty == "Medium") exitWith {"ColorYellow"};
if(_difficulty == "Hard") exitWith {"ColorRed"};
if(_difficulty == "Extreme") exitWith {"ColorBlack"};
};
_name = call {
if(_missionType == "MainHero") exitWith {"Bandit " + _name;};
if(_missionType == "MainBandit") exitWith {"Hero " + _name;};
};
[_difficulty,_msgstart] call wai_server_message;
WAI_MarkerReady = true;
[_position,_mission,_name,_completionType,_color,_showMarker,_msgwin,_msglose,_enableMines,_missionType,_difficulty] spawn {
private ["_left","_leftTime","_claimTime","_acArray","_claimed","_acTime","_acdot","_acMarker","_timeStamp","_unitGroups","_playerArray","_enableMines","_aiVehicles","_aiVehArray","_baseclean","_msgwin","_msglose","_bomb","_position","_minefieldRadius","_timeout","_player_near","_complete","_starttime","_timeout_time","_max_ai","_killpercent","_mission","_missionType","_airemain","_text","_name","_completionType","_marker","_dot","_objectivetarget","_color","_crateLoot","_crate","_showMarker","_cleanunits"];
_position = _this select 0;
_mission = _this select 1;
_name = _this select 2;
_completionType = _this select 3;
_color = _this select 4;
_showMarker = _this select 5;
_msgwin = _this select 6;
_msglose = _this select 7;
_enableMines = _this select 8;
_missionType = _this select 9;
_difficulty = _this select 10;
_timeout = false;
_player_near = false;
_complete = false;
_starttime = diag_tickTime;
_timeout_time = (random((wai_mission_timeout select 1) - (wai_mission_timeout select 0)) + (wai_mission_timeout select 0)) * 60;
_max_ai = (wai_mission_data select _mission) select 0;
_unitGroups = (wai_mission_data select _mission) select 1;
_mines = (wai_mission_data select _mission) select 2;
_crates = (wai_mission_data select _mission) select 3;
_aiVehicles = (wai_mission_data select _mission) select 4;
_vehicles = (wai_mission_data select _mission) select 5;
_baseclean = (wai_mission_data select _mission) select 6;
_killpercent = _max_ai - (_max_ai * (wai_kill_percent / 100));
_playerArray = [];
_timeStamp = diag_tickTime;
_closestPlayer = objNull;
_acArray = [];
_claimed = false;
_acTime = diag_tickTime;
_claimTime = 0;
_left = false;
_leftTime = 0;
while {!_timeout && !_complete} do {
if (count _mines > 0) then {
{
if((isPlayer _x) && (vehicle _x != _x) && (vehicle _x distance _position < 275) && !(_x in _playerArray)) then {
_x call wai_minefield_warning;
_playerArray set [count _playerArray, _x];
};
if((isPlayer _x) && (vehicle _x != _x) && (vehicle _x distance _position < 75) && (alive _x) && ((([vehicle _x] call FNC_GetPos) select 2) < 1)) then {
_bomb = "Bo_GBU12_lgb" createVehicle ([vehicle _x] call FNC_GetPos);
uiSleep 3;
deleteVehicle _bomb;
};
} count playableUnits;
};
if ((diag_tickTime - _timeStamp) > 180 && (count _aiVehicles) > 0) then {
{
if (_x isKindOf "StaticWeapon") then {
(gunner _x) action ["getout",_x];
};
} forEach _aiVehicles;
_timeStamp = diag_tickTime;
};
if (use_wai_autoclaim && _showMarker) then {
#include "\z\addons\dayz_server\WAI\compile\auto_claim.sqf"
};
if (count _aiVehicles > 0) then {
_aiVehicles call wai_monitor_ai_vehicles;
};
if (_showMarker) then {
if (ai_show_count) then {
_aiCount = (wai_mission_data select _mission) select 0;
_text = format["%1 (%2 A.I.)",_name,_aiCount];
} else {
_text = _name;
};
_marker = createMarker [_missionType + str(_mission), _position];
_marker setMarkerColor _color;
_marker setMarkerShape "ELLIPSE";
_marker setMarkerBrush "Solid";
_marker setMarkerSize [300,300];
_dot = createMarker [_missionType + str(_mission) + "dot", _position];
_dot setMarkerColor "ColorBlack";
_dot setMarkerType "mil_dot";
_dot setMarkerText _text;
if (use_wai_autoclaim) then {
_acMarker = createMarker [_missionType + str(_mission) + "auto", _position];
_acMarker setMarkerShape "ELLIPSE";
_acMarker setMarkerBrush "Border";
_acMarker setMarkerColor "ColorRed";
_acMarker setMarkerSize [ac_alert_distance,ac_alert_distance];
if (_claimed) then {
_acdot = createMarker [_missionType + str(_mission) + "autodot", [(_position select 0) + 100, (_position select 1) + 100]];
_acdot setMarkerColor "ColorBlack";
_acdot setMarkerType "mil_objective";
if (_left) then {
_acdot setMarkerText format["%1 Claim Timeout [%2]",(_acArray select 1),_leftTime];
} else {
_acdot setMarkerText format["Claimed by %1",(name _closestPlayer)];
};
};
};
uiSleep 2;
deleteMarker _marker;
deleteMarker _dot;
if (!isNil "_acMarker") then {deleteMarker _acMarker;};
if (!isNil "_acdot") then {deleteMarker _acdot;};
} else {
uiSleep 2;
};
_player_near = [_position,wai_timeout_distance] call isNearPlayer;
if (diag_tickTime - _starttime >= _timeout_time && !_player_near) then {
_timeout = true;
} else {
if (_player_near) then {_starttime = diag_tickTime;};
};
_complete = [_mission,_completionType,_killpercent,_position] call wai_completion_check;
};
if (_complete) then {
if (count _vehicles > 0) then {
{
[_x,_mission,_crates] call wai_generate_vehicle_key;
} count _vehicles;
};
{
[(_x select 0),(_x select 1),_complete] call dynamic_crate;
} count _crates;
if (count _mines > 0) then {
_mines call wai_fnc_remove;
};
[_difficulty,_msgwin] call wai_server_message;
if (_missionType == "MainBandit") then {
b_missionsrunning = b_missionsrunning - 1;
wai_b_starttime = diag_tickTime;
} else {
h_missionsrunning = h_missionsrunning - 1;
wai_h_starttime = diag_tickTime;
};
diag_log format["WAI: [Mission: %1]: Ended at %2",_name,_position];
if (wai_clean_mission_time > 0) then {
private ["_finish_time","_cleaned","_playernear"];
_finish_time = diag_tickTime;
_cleaned = false;
while {!_cleaned} do {
uiSleep 3;
if (count _aiVehicles > 0) then {
_aiVehicles call wai_monitor_ai_vehicles;
};
if ((diag_tickTime - _finish_time >= 60*wai_clean_mission_time) || ({[_x,_name] call fnc_inString;} count wai_clean_when_clear) != 0) then {
if (count _aiVehicles > 0) then {
_aiVehicles call wai_fnc_remove;
};
_mission call wai_remove_ai;
if (count _vehicles > 0) then {
[_mission,_vehicles] call wai_remove_vehicles;
};
if (count _baseclean > 0) then {
_baseclean call wai_fnc_remove;
};
{
if (count units _x == 0) then {
deleteGroup _x;
};
} forEach _unitGroups;
wai_mission_markers = wai_mission_markers - [(_missionType + str(_mission))];
wai_mission_data set [_mission, -1];
if (wai_clean_mission_crate) then {
_playernear = [_position,75] call isNearPlayer;
if (!_playernear) then {
{
if ((typeOf (_x select 0)) in (crates_large + crates_medium + crates_small)) then {
deleteVehicle (_x select 0);
};
} count _crates;
_cleaned = true;
};
} else {
_cleaned = true;
};
};
};
};
};
if (_timeout) then {
if (count _mines > 0) then {
_mines call wai_fnc_remove;
};
{
deleteVehicle (_x select 0);
} count _crates;
if (count _aiVehicles > 0) then {
_aiVehicles call wai_fnc_remove;
};
_mission call wai_remove_ai;
if (count _vehicles > 0) then {
[_mission,_vehicles] call wai_remove_vehicles;
};
if (count _baseclean > 0) then {
_baseclean call wai_fnc_remove;
};
[_difficulty,_msglose] call wai_server_message;
if (_missionType == "MainBandit") then {
b_missionsrunning = b_missionsrunning - 1;
wai_b_starttime = diag_tickTime;
} else {
h_missionsrunning = h_missionsrunning - 1;
wai_h_starttime = diag_tickTime;
};
{
if (count units _x == 0) then {
deleteGroup _x;
};
} forEach _unitGroups;
wai_mission_markers = wai_mission_markers - [(_missionType + str(_mission))];
wai_mission_data set [_mission, -1];
diag_log format["WAI: [Mission: %1]: Timed out at %2",_name,_position];
};
};

View File

@ -0,0 +1,124 @@
private ["_rockets","_launcher","_type","_skin","_gain","_mission","_ainum","_unit","_player","_humanity","_banditkills","_humankills","_humanitygain","_cash"];
_unit = _this select 0;
_player = _this select 1;
//_type = _this select 2;
_launcher = secondaryWeapon _unit;
_mission = _unit getVariable ["mission" + dayz_serverKey, nil];
if (!isNil "_mission") then {
if (typeName(wai_mission_data select _mission) == "ARRAY") then {
wai_mission_data select _mission set [0, ((wai_mission_data select _mission) select 0) - 1];
};
} else {
wai_static_data set [0, ((wai_static_data select 0) - 1)];
};
_unit setVariable ["bodyName","mission_ai",false]; //Only needed on server to prevent immediate cleanup in sched_corpses.sqf
if (ai_hasMoney && Z_singleCurrency) then {
_cash = round(random ai_moneyMultiplier) * 50;
_unit setVariable["cashMoney",_cash ,true];
};
if(ai_add_skin) then {
_skin = (typeOf _unit);
_skin = "Skin_" + _skin;
if (isClass (configFile >> "CfgMagazines" >> _skin)) then {
[_unit,_skin] call BIS_fnc_invAdd;
};
};
if (isPlayer _player) then {
private ["_banditkills","_humanity","_humankills"];
if (ai_reward_veh_gunner) then {
_player = (effectiveCommander vehicle _player);
};
if (ai_killfeed && ai_humanity_gain) then {
_aitype = if (_unit getVariable ["Hero", false]) then {"Hero";} else {"Bandit";};
_humanityReward = if (_aitype == "Hero") then {format["-%1 Humanity",ai_remove_humanity];} else {format["+%1 Humanity",ai_add_humanity];};
_aiColor = if (_aitype == "Hero") then {"#3333ff";} else {"#ff0000";};
_params = [_aiColor,"0.50","#FFFFFF",-.4,.2,2,0.5];
RemoteMessage = ["ai_killfeed", [_aitype," AI Kill",_humanityReward],_params];
(owner _player) publicVariableClient "RemoteMessage";
};
_humanity = _player getVariable["humanity",0];
_banditkills = _player getVariable["banditKills",0];
_humankills = _player getVariable["humanKills",0];
if (ai_humanity_gain) then {
_gain = _unit getVariable ["humanity", 0];
call {
if (_unit getVariable ["Hero", false]) exitWith { _player setVariable ["humanity",(_humanity - _gain),true]; };
if (_unit getVariable ["Bandit", false]) exitWith { _player setVariable ["humanity",(_humanity + _gain),true]; };
if (_unit getVariable ["Special", false]) exitWith { if (_humanity < 0) then { _player setVariable ["humanity",(_humanity - _gain),true]; } else { _player setVariable ["humanity",(_humanity + _gain),true]; }; };
};
};
if (ai_kills_gain) then {
if (_unit getVariable ["Hero", false]) then {
_player setVariable ["humanKills",(_humankills + 1),true];
} else {
_player setVariable ["banditKills",(_banditkills + 1),true];
};
};
if (ai_clear_body) then {
{_unit removeMagazine _x;} count (magazines _unit);
{_unit removeWeapon _x;} count (weapons _unit);
};
if (ai_share_info) then {
{
if (((position _x) distance (position _unit)) <= ai_share_distance) then {
_x reveal [_player, 4.0];
};
} count allUnits;
};
} else {
if (ai_clean_roadkill) then {
removeBackpack _unit;
removeAllWeapons _unit;
{
_unit removeMagazine _x
} count magazines _unit;
} else {
if ((random 100) <= ai_rk_damageweapon) then {
removeAllWeapons _unit;
};
};
};
if(wai_remove_launcher && _launcher != "") then {
_rockets = _launcher call find_suitable_ammunition;
_unit removeWeapon _launcher;
{
if(_x == _rockets) then {
_unit removeMagazine _x;
};
} count magazines _unit;
};
if(_unit hasWeapon "NVGoggles" && floor(random 100) < 20) then {
_unit removeWeapon "NVGoggles";
};

View File

@ -0,0 +1,272 @@
private ["_location","_countWP","_wp","_mission","_position","_difficulty","_name","_missionType","_showMarker","_numWaypoints","_completionType","_msgstart","_msgwin","_msglose"];
_mission = _this select 0;
_position = _this select 1;
_difficulty = _this select 2;
_name = _this select 3;
_missionType = _this select 4;
_showMarker = _this select 5;
_numWaypoints = _this select 6;
_locations = _this select 7;
_completionType = _this select 8;
_msgstart = (_this select 9) select 0;
_msgwin = (_this select 9) select 1;
_msglose = (_this select 9) select 2;
_countWP = [];
_unitGroup = ((wai_mission_data select _mission) select 1) select 0;
if(wai_debug_mode) then {diag_log format["WAI: Starting Mission number %1",_mission];};
_color = call {
if (_difficulty == "Easy") exitWith {"ColorGreen"};
if (_difficulty == "Medium") exitWith {"ColorYellow"};
if (_difficulty == "Hard") exitWith {"ColorRed"};
if (_difficulty == "Extreme") exitWith {"ColorBlack"};
};
_name = call {
if (_missionType == "MainHero") exitWith {"Bandit " + _name;};
if (_missionType == "MainBandit") exitWith {"Hero " + _name;};
};
for "_i" from 0 to _numWaypoints - 1 do {
_location = _locations call BIS_fnc_selectRandom;
_countWP set [_i, _location];
_locations set [_i, "rem"];
_locations = _locations - ["rem"];
_wp = _unitGroup addWayPoint [position _location,0];
_wp setWaypointType "MOVE";
_wp setWaypointSpeed "LIMITED";
//_wp setWaypointSpeed "FULL";
_wp setWaypointBehaviour "CARELESS";
_wp setWaypointCombatMode "YELLOW";
_wp setWaypointCompletionRadius 300;
};
[_difficulty,_msgstart] call wai_server_message;
WAI_MarkerReady = true;
[_position,_mission,_name,_completionType,_color,_showMarker,_msgwin,_msglose,_missionType,_difficulty,_countWP] spawn {
private ["_horb","_crates","_wpReached","_startMarker","_vehicle","_leader","_countWP","_difficulty","_unitGroup","_msgwin","_msglose","_position","_timeout","_player_near","_complete","_starttime","_timeout_time","_max_ai","_killpercent","_mission","_missionType","_airemain","_text","_name","_completionType","_marker","_dot","_color","_showMarker"];
_position = _this select 0;
_mission = _this select 1;
_name = _this select 2;
_completionType = _this select 3;
_color = _this select 4;
_showMarker = _this select 5;
_msgwin = _this select 6;
_msglose = _this select 7;
_missionType = _this select 8;
_difficulty = _this select 9;
_countWP = _this select 10;
_startMarker = false;
_timeout = false;
_player_near = false;
_complete = false;
_starttime = diag_tickTime;
_timeout_time = (random((wai_mission_timeout select 1) - (wai_mission_timeout select 0)) + (wai_mission_timeout select 0)) * 60;
_max_ai = (wai_mission_data select _mission) select 0;
_unitGroup = ((wai_mission_data select _mission) select 1) select 0;
_crates = (wai_mission_data select _mission) select 3;
_vehicle = ((wai_mission_data select _mission) select 5) select 0;
_killpercent = _max_ai - (_max_ai * (wai_kill_percent / 100));
_leader = leader _unitgroup;
_vehicle setDamage 0;
_vehicle removeAllEventHandlers "HandleDamage";
_vehicle addEventHandler ["HandleDamage",{_this call fnc_veh_handleDam}];
_wpReached = true;
_disabled = false;
_currentWP = nil;
_index = 1;
{
if (_leader == _x) then {
_x assignAsDriver _vehicle;
_x moveInDriver _vehicle;
} else {
if ((_vehicle emptyPositions "GUNNER") > 0) then {
_x assignAsGunner _vehicle;
_x moveInGunner _vehicle;
} else {
_x moveInCargo _vehicle;
};
};
} count units _unitgroup;
while {!_timeout && !_complete} do {
if ((count _countWP == 0) && {_wpReached}) then {
_timeout = true;
};
if ((count _countWP > 0) && {_wpReached}) then {
if (!isNil "_currentWP") then {
_countWP set [0, "rem"];
_countWP = _countWP - ["rem"];
};
_unitGroup setCurrentWaypoint [_unitGroup, _index];
_currentWP = _countWP select 0;
_wpReached = false;
uiSleep 10;
[_difficulty,["STR_CL_PATROL_MOVE",(text _currentWP)]] call wai_server_message;
_index = _index + 1;
};
if (_showMarker && {_startMarker}) then {
if (ai_show_count) then {
_aiCount = (wai_mission_data select _mission) select 0;
_text = format["%1 (%2 A.I.)",_name,_aiCount];
} else {
_text = _name;
};
_marker = createMarker [_missionType + str(_mission), _position];
_marker setMarkerColor _color;
_marker setMarkerShape "ELLIPSE";
_marker setMarkerBrush "Solid";
_marker setMarkerSize [300,300];
_dot = createMarker [_missionType + str(_mission) + "dot", _position];
_dot setMarkerColor "ColorBlack";
_dot setMarkerType "mil_dot";
_dot setMarkerText _text;
uiSleep 2;
deleteMarker _marker;
deleteMarker _dot;
} else {
uiSleep 2;
};
if (count crew _vehicle > 0) then {
_vehicle setVehicleAmmo 1;
_vehicle setFuel 1;
};
if (!_disabled && (!(canMove _vehicle) || !(alive _leader))) then {
_horb = if (_missionType == "MainHero") then {"Hero"} else {"Bandit"};
[_difficulty,["STR_CL_PATROL_DISABLED",_horb]] call wai_server_message;
_disabled = true;
_startMarker = true;
_position = getPos _vehicle;
waitUntil {speed _vehicle < 10};
{
_x action ["eject",vehicle _x];
} count crew _vehicle;
_unitGroup2 = createGroup EAST; // Creating a new group seems to be the best solution here
{[_x] joinSilent _unitGroup2} forEach (units _unitGroup);
_unitGroup2 selectLeader ((units _unitGroup2) select 0);
_unitGroup2 setFormation "ECH LEFT";
_unitGroup2 setCombatMode "RED";
_unitGroup2 setBehaviour "COMBAT";
[_unitGroup2,_position,"easy"] call group_waypoints;
};
if (!_wpReached) then {
if (_vehicle distance (position _currentWP) < 300) then {
_wpReached = true;
[_difficulty,["STR_CL_PATROL_ARRIVE",text _currentWP]] call wai_server_message;
};
};
_player_near = [_position,wai_timeout_distance] call isNearPlayer;
if (diag_tickTime - _starttime >= _timeout_time && !_player_near) then {
_timeout = true;
} else {
if (_player_near) then {_starttime = diag_tickTime;};
};
_complete = [_mission,_completionType,_killpercent,_position] call wai_completion_check;
};
if (_complete) then {
[_vehicle,_mission,[[_vehicle]]] call wai_generate_vehicle_key;
_vehicle setVehicleLock "UNLOCKED";
{
[(_x select 0),(_x select 1)] call dynamic_crate;
} count _crates;
[_difficulty,_msgwin] call wai_server_message;
if (_missionType == "MainBandit") then {
b_missionsrunning = b_missionsrunning - 1;
wai_b_starttime = diag_tickTime;
} else {
h_missionsrunning = h_missionsrunning - 1;
wai_h_starttime = diag_tickTime;
};
diag_log format["WAI: [Mission: %1]: Ended at %2",_name,_position];
if (wai_clean_mission_time > 0) then {
private ["_finish_time","_cleaned","_playernear"];
_finish_time = diag_tickTime;
_cleaned = false;
while {!_cleaned} do {
uiSleep 3;
if (diag_tickTime - _finish_time >= 60*wai_clean_mission_time) then {
_mission call wai_remove_ai;
deleteVehicle _vehicle;
uiSleep 5;
deleteGroup _unitGroup;
if (!isNil "_unitGroup2") then {deleteGroup _unitGroup2;};
wai_mission_markers = wai_mission_markers - [(_missionType + str(_mission))];
wai_mission_data set [_mission, -1];
_cleaned = true;
};
};
};
};
if (_timeout) then {
_mission call wai_remove_ai;
deleteVehicle _vehicle;
[_difficulty,_msglose] call wai_server_message;
if (_missionType == "MainBandit") then {
b_missionsrunning = b_missionsrunning - 1;
wai_b_starttime = diag_tickTime;
} else {
h_missionsrunning = h_missionsrunning - 1;
wai_h_starttime = diag_tickTime;
};
uiSleep 5;
deleteGroup _unitGroup;
if (!isNil "_unitGroup2") then {deleteGroup _unitGroup2;};
wai_mission_markers = wai_mission_markers - [(_missionType + str(_mission))];
wai_mission_data set [_mission, -1];
diag_log format["WAI: [Mission: %1]: Timed out at %2",_name,_position];
};
};

View File

@ -0,0 +1,133 @@
isNearWater = {
private["_result","_position","_radius"];
_result = false;
_position = _this select 0;
_radius = _this select 1;
for "_i" from 0 to 359 step 45 do {
_position = [(_position select 0) + (sin(_i)*_radius), (_position select 1) + (cos(_i)*_radius)];
if (surfaceIsWater _position) exitWith {
_result = true;
};
};
_result
};
isNearTown = {
private["_result","_position","_radius","_locations"];
_result = false;
_position = _this select 0;
_radius = _this select 1;
_locations = [["NameCityCapital","NameCity","NameVillage"],[_position,_radius]] call BIS_fnc_locations;
if (count _locations > 0) then {
_result = true;
};
_result
};
isNearRoad = {
private["_result","_position","_radius","_roads"];
_result = false;
_position = _this select 0;
_radius = _this select 1;
_roads = _position nearRoads _radius;
if (count _roads > 0) then {
_result = true;
};
_result
};
isNearPlayer = {
private["_result","_position","_radius"];
_result = false;
_position = _this select 0;
_radius = _this select 1;
{
if ((isPlayer _x) && (_x distance _position <= _radius)) then {
_result = true;
};
} count playableUnits;
_result
};
// Player and mission proximity check used in single spawn point missions
wai_validSpotCheck = {
private ["_position","_validspot"];
_position = _this select 0;
_validspot = true;
if (_validspot && wai_avoid_missions != 0) then {
if(wai_debug_mode) then { diag_log("WAI DEBUG: FINDPOS: Checking nearby mission markers: " + str(wai_mission_markers)); };
{
if (getMarkerColor _x != "" && (_position distance (getMarkerPos _x) < wai_avoid_missions)) exitWith { if(wai_debug_mode) then {diag_log("WAI: Invalid Position (Marker: " + str(_x) + ")");}; _validspot = false; };
} count wai_mission_markers;
};
if (_validspot && {wai_avoid_players != 0}) then {
if ([_position,wai_avoid_players] call isNearPlayer) then {
if (wai_debug_mode) then {diag_log "WAI: Invalid Position (player)";};
_validspot = false;
};
};
if(_validspot) then {
if(wai_debug_mode) then { diag_log("WAI: valid position found at" + str(_position));};
};
_validspot
};
// Closest player check used in auto-claim
wai_isClosest = {
private ["_closest","_scandist","_dist","_position"];
_position = _this;
_closest = objNull;
_scandist = ac_alert_distance;
{
_dist = vehicle _x distance _position;
if (isPlayer _x && _dist < _scandist) then {
_closest = _x;
_scandist = _dist;
};
} count playableUnits;
_closest
};
wai_checkReturningPlayer = {
private["_acArray","_position","_playerUID","_returningPlayer"];
_position = _this select 0;
_acArray = _this select 1;
_playerUID = _acArray select 0;
_returningPlayer = objNull;
{
if ((isPlayer _x) && (_x distance _position <= ac_alert_distance) && (getplayerUID _x == _playerUID)) then {
_returningPlayer = _x;
};
} count playableUnits;
_returningPlayer
};

View File

@ -0,0 +1,225 @@
private ["_rocket","_launcher","_pos_x","_pos_y","_pos_z","_aiskin","_unarmed","_gain","_mission","_ainum","_aitype","_mission","_aipack","_aicskill","_position","_unitnumber","_skill","_gun","_mags","_backpack","_skin","_gear","_aiweapon","_aigear","_aiskin","_skillarray","_unitGroup","_weapon","_magazine","_gearmagazines","_geartools","_unit"];
_position = _this select 0;
_pos_x = _position select 0;
_pos_y = _position select 1;
_pos_z = _position select 2;
_unitnumber = _this select 1;
_skill = _this select 2;
_gun = _this select 3;
_mags = _this select 4;
_backpack = _this select 5;
_skin = _this select 6;
_gear = _this select 7;
_aitype = _this select 8;
if (typeName _gun == "ARRAY") then {
_launcher = _gun select 1;
_gun = _gun select 0;
};
if (typeName _aitype == "ARRAY") then {
_gain = _aitype select 1;
_aitype = _aitype select 0;
};
if (count _this > 9) then {
_mission = _this select 9;
} else {
_mission = nil;
};
_aiweapon = [];
_aigear = [];
_aiskin = "";
_aicskill = [];
_aipack = "";
_unarmed = false;
// If zero ai are chosen exit the script
if (_unitnumber == 0) exitWith {};
_unitGroup = if(_aitype == "Hero") then {createGroup RESISTANCE;} else {createGroup EAST;};
if (!isNil "_mission") then {
((wai_mission_data select _mission) select 1) set [count ((wai_mission_data select _mission) select 1), _unitGroup];
} else {
(wai_static_data select 1) set [count (wai_static_data select 1), _unitGroup];
};
if(_pos_z == 0) then {
if(floor(random 2) == 1) then {
_pos_x = _pos_x - (15 + random(10));
} else {
_pos_x = _pos_x + (15 + random(10));
};
if(floor(random 2) == 1) then {
_pos_y = _pos_y - (15 + random(10));
} else {
_pos_y = _pos_y + (15 + random(10));
};
};
for "_x" from 1 to _unitnumber do {
call {
if(typeName(_gun) == "SCALAR") then {
if(_gun == 0) exitWith {_aiweapon = ai_wep_random select (floor (random (count ai_wep_random)));};
if(_gun == 1) exitWith {_aiweapon = ai_wep_machine; };
if(_gun == 2) exitWith {_aiweapon = ai_wep_sniper; };
} else {
if(_gun == "random") exitWith {_aiweapon = ai_wep_random select (floor (random (count ai_wep_random)));};
if(_gun == "unarmed") exitWith {_unarmed = true; };
_aiweapon = _gun;
}
};
if (!_unarmed) then {
_weapon = if (typeName (_aiweapon) == "ARRAY") then {_aiweapon select (floor (random (count _aiweapon)))} else {_aiweapon};
if !(isClass (configFile >> "CfgWeapons" >> _weapon)) then {
diag_log text format ["WAI Error: Weapon classname (%1) is not valid!",_weapon];
_weapon = "M16A2_DZ"; // Replace with known good classname.
};
_magazine = _weapon call find_suitable_ammunition;
};
_aigear = call {
if(typeName(_gear) == "SCALAR") then {
if (_gear == 0) exitWith {ai_gear0;};
if (_gear == 1) exitWith {ai_gear1;};
if (_gear == 2) exitWith {ai_gear2;};
if (_gear == 3) exitWith {ai_gear3;};
if (_gear == 4) exitWith {ai_gear4;};
} else {
if (_gear == "random") exitWith {ai_gear_random select (floor (random (count ai_gear_random)));};
};
};
_gearmagazines = _aigear select 0;
_geartools = _aigear select 1;
_aiskin = call {
if (_skin == "random") exitWith {ai_all_skin select (floor (random (count ai_all_skin)));};
if (_skin == "hero") exitWith {ai_hero_skin select (floor (random (count ai_hero_skin)));};
if (_skin == "bandit") exitWith {ai_bandit_skin select (floor (random (count ai_bandit_skin)));};
if (_skin == "special") exitWith {ai_special_skin select (floor (random (count ai_special_skin)));};
_skin;
};
if(typeName _aiskin == "ARRAY") then {
_aiskin = _aiskin select (floor (random (count _aiskin)));
};
_unit = _unitGroup createUnit [_aiskin,_position,[],0,"CAN_COLLIDE"];
if (surfaceIsWater _position) then {
_unit setPosASL _position;
} else {
_unit setPosATL _position;
};
[_unit] joinSilent _unitGroup;
call {
if (_aitype == "hero") exitWith {_unit setVariable ["Hero",true]; _unit setVariable ["humanity", ai_remove_humanity];};
if (_aitype == "bandit") exitWith {_unit setVariable ["Bandit",true]; _unit setVariable ["humanity", ai_add_humanity];};
if (_aitype == "special") exitWith {_unit setVariable ["Special",true]; _unit setVariable ["humanity", ai_special_humanity];};
};
if (!isNil "_gain") then {_unit setVariable ["humanity", _gain];};
call {
if (_backpack == "random") exitWith {_aipack = ai_packs select (floor (random (count ai_packs)));};
if (_backpack == "none") exitWith {};
_aipack = _backpack;
};
_unit enableAI "TARGET";
_unit enableAI "AUTOTARGET";
_unit enableAI "MOVE";
_unit enableAI "ANIM";
_unit enableAI "FSM";
removeAllWeapons _unit;
removeAllItems _unit;
if (sunOrMoon != 1) then {
_unit addWeapon "NVGoggles";
};
if (!_unarmed) then {
for "_i" from 1 to _mags do {
_unit addMagazine _magazine;
};
_unit addWeapon _weapon;
_unit selectWeapon _weapon;
};
if(_backpack != "none") then {
_unit addBackpack _aipack;
};
{
_unit addMagazine _x
} count _gearmagazines;
{
_unit addWeapon _x
} count _geartools;
_aicskill = call {
if(_skill == "easy") exitWith {ai_skill_easy;};
if(_skill == "medium") exitWith {ai_skill_medium;};
if(_skill == "hard") exitWith {ai_skill_hard;};
if(_skill == "extreme") exitWith {ai_skill_extreme;};
if(_skill == "random") exitWith {ai_skill_random select (floor (random (count ai_skill_random)));};
ai_skill_random select (floor (random (count ai_skill_random)));
};
{
_unit setSkill [(_x select 0),(_x select 1)]
} count _aicskill;
_unit addEventHandler ["Killed",{[_this select 0, _this select 1] call on_kill;}];
if (!isNil "_mission") then {
wai_mission_data select _mission set [0, (((wai_mission_data select _mission) select 0) + 1)];
_unit setVariable ["mission" + dayz_serverKey, _mission, false];
} else {
wai_static_data set [0, ((wai_static_data select 0) + 1)];
};
};
if (!isNil "_launcher" && wai_use_launchers) then {
call {
if (_launcher == "Random") exitWith { _launcher = (ai_launchers_AT + ai_launchers_AA) call BIS_fnc_selectRandom; };
if (_launcher == "at") exitWith { _launcher = ai_wep_launchers_AT select (floor (random (count ai_wep_launchers_AT))); };
if (_launcher == "aa") exitWith { _launcher = ai_wep_launchers_AA select (floor (random (count ai_wep_launchers_AA))); };
};
_rocket = _launcher call find_suitable_ammunition;
_unit addMagazine _rocket;
_unit addMagazine _rocket;
_unit addWeapon _launcher;
};
_unitGroup setFormation "ECH LEFT";
_unitGroup selectLeader ((units _unitGroup) select 0);
if(_aitype == "Hero") then {
_unitGroup setCombatMode ai_hero_combatmode;
_unitGroup setBehaviour ai_hero_behaviour;
} else {
_unitGroup setCombatMode ai_bandit_combatmode;
_unitGroup setBehaviour ai_bandit_behaviour;
};
_unitGroup allowFleeing 0;
[_unitGroup,[_pos_x,_pos_y,_pos_z],_skill] call group_waypoints;
if(wai_debug_mode) then {diag_log format ["WAI: Spawned a group of %1 AI (%3) at %2",_unitnumber,_position,_aitype];};
_unitGroup // this variable is returned for the patrol mission and assassinate missions

View File

@ -0,0 +1,63 @@
// This is a modified version of the DayZ Epoch file fn_spawnObjects.sqf used to spawn WAI mission objects.
private ["_offset","_fires","_position","_object","_objects","_type","_pos","_mission","_destructables"];
_objects = _this select 0;
_pos = _this select 1;
_mission = _this select 2;
_fires = [
"Base_Fire_DZ",
"flamable_DZ",
"Land_Camp_Fire_DZ",
"Land_Campfire",
"Land_Campfire_burning",
"Land_Fire",
"Land_Fire_burning",
"Land_Fire_DZ",
"Land_Fire_barrel",
"Land_Fire_barrel_burning",
"Misc_TyreHeap"
];
// Override god mode on these objects so they can be destroyed if wai_godmode_objects enabled.
_destructables = [
"Gold_Vein_DZE",
"Iron_Vein_DZE",
"Silver_Vein_DZE",
"Supply_Crate_DZE"
];
{
_type = _x select 0;
_offset = _x select 1;
_position = [(_pos select 0) + (_offset select 0), (_pos select 1) + (_offset select 1), 0];
if (count _offset > 2) then {
_position set [2, (_offset select 2)];
};
_object = _type createVehicle [0,0,0];
if (_type == "MQ9PredatorB") then {
_object setVehicleLock "LOCKED";
};
if (count _x > 2) then {
_object setDir (_x select 2);
};
_object setPos _position;
_object setVectorUp surfaceNormal position _object;
if (wai_godmode_objects) then {
if !(_type in _destructables) then {
_object addEventHandler ["HandleDamage",{0}];
if !(_type in _fires) then {_object enableSimulation false;};
};
};
((wai_mission_data select _mission) select 6) set [count ((wai_mission_data select _mission) select 6), _object];
} forEach _objects;
_object

View File

@ -0,0 +1,211 @@
private ["_ainum","_unarmed","_aicskill","_aitype","_mission","_aipack","_class","_position2","_static","_position","_unitnumber","_skill","_gun","_mags","_backpack","_skin","_gear","_aiweapon","_aigear","_aiskin","_skillarray","_unitGroup","_weapon","_magazine","_gearmagazines","_geartools","_unit"];
if (!wai_enable_static_guns) exitWith {};
_position = _this select 0;
_class = _this select 1;
_skill = _this select 2;
_skin = _this select 3;
_aitype = _this select 4;
if (ai_static_useweapon) then {
_gun = _this select 5;
_mags = _this select 6;
_backpack = _this select 7;
_gear = _this select 8;
};
if ((count _this == 10) OR (count _this == 6)) then {
if (count _this == 10) then { _mission = _this select 9; };
if (count _this == 6) then { _mission = _this select 5; };
} else {
_mission = nil;
};
_aiweapon = [];
_aigear = [];
_aiskin = "";
_aipack = "";
_unarmed = false;
_unitnumber = count _position;
_unitGroup = if(_aitype == "Hero") then {createGroup RESISTANCE;} else {createGroup EAST;};
if (!isNil "_mission") then {
((wai_mission_data select _mission) select 1) set [count ((wai_mission_data select _mission) select 1), _unitGroup];
} else {
(wai_static_data select 1) set [count (wai_static_data select 1), _unitGroup];
};
{
call {
if(_skin == "random") exitWith { _aiskin = ai_all_skin call BIS_fnc_selectRandom;};
if(_skin == "hero") exitWith { _aiskin = ai_hero_skin call BIS_fnc_selectRandom;};
if(_skin == "bandit") exitWith { _aiskin = ai_bandit_skin call BIS_fnc_selectRandom;};
if(_skin == "special") exitWith { _aiskin = ai_special_skin call BIS_fnc_selectRandom;};
_aiskin = _skin;
};
if(typeName _aiskin == "ARRAY") then {
_aiskin = _aiskin call BIS_fnc_selectRandom;
};
if (_class == "Random") then {_class = ai_static_weapons call BIS_fnc_selectRandom;};
_unit = _unitGroup createUnit [_aiskin, [0,0,0], [], 10, "PRIVATE"];
_static = _class createVehicle _x;
if (surfaceIsWater _x) then {
_static setPosASL _x;
} else {
_static setPosATL _x;
};
[_unit] joinSilent _unitGroup;
call {
if (_aitype == "hero") exitWith {_unit setVariable ["Hero",true,false]; _unit setVariable ["humanity", ai_remove_humanity]; };
if (_aitype == "bandit") exitWith {_unit setVariable ["Bandit",true,false]; _unit setVariable ["humanity", ai_add_humanity]; };
if (_aitype == "special") exitWith {_unit setVariable ["Special",true,false]; _unit setVariable ["humanity", ai_special_humanity]; };
};
_unit enableAI "TARGET";
_unit enableAI "AUTOTARGET";
_unit enableAI "MOVE";
_unit enableAI "ANIM";
_unit enableAI "FSM";
removeAllWeapons _unit;
removeAllItems _unit;
if (ai_static_useweapon) then {
call {
if(typeName(_gun) == "SCALAR") then {
if(_gun == 0) exitWith { _aiweapon = ai_wep_random call BIS_fnc_selectRandom; };
if(_gun == 1) exitWith { _aiweapon = ai_wep_machine;};
if(_gun == 2) exitWith { _aiweapon = ai_wep_sniper;};
} else {
if(_gun == "random") exitWith { _aiweapon = ai_wep_random call BIS_fnc_selectRandom; };
if(_gun == "unarmed") exitWith { _unarmed = true; };
};
};
if (!_unarmed) then {
_weapon = if (typeName (_aiweapon) == "ARRAY") then {_aiweapon select (floor (random (count _aiweapon)))} else {_aiweapon};
_magazine = _weapon call find_suitable_ammunition;
};
_weapon = _aiweapon call BIS_fnc_selectRandom;
if !(isClass (configFile >> "CfgWeapons" >> _weapon)) then {
diag_log text format ["WAI Error: Weapon classname (%1) is not valid!",_weapon];
_weapon = "M16A2_DZ"; // Replace with known good classname.
};
_magazine = _weapon call find_suitable_ammunition;
_aigear = call {
if(typeName(_gear) == "SCALAR") then {
if(_gear == 0) exitWith {ai_gear0;};
if(_gear == 1) exitWith {ai_gear1;};
if(_gear == 2) exitWith {ai_gear2;};
if(_gear == 3) exitWith {ai_gear3;};
if(_gear == 4) exitWith {ai_gear4;};
} else {
if(_gear == "random") exitWith {ai_gear_random select (floor (random (count ai_gear_random)));};
};
};
call {
if(_backpack == "random") exitWith {_aipack = ai_packs call BIS_fnc_selectRandom;};
if(_backpack == "none") exitWith {};
_aipack = _backpack;
};
_gearmagazines = _aigear select 0;
_geartools = _aigear select 1;
if (!_unarmed) then {
for "_i" from 1 to _mags do {
_unit addMagazine _magazine;
};
_unit addWeapon _weapon;
};
if (_backpack != "none") then {
_unit addBackpack _aipack;
};
{
_unit addMagazine _x
} count _gearmagazines;
{
_unit addWeapon _x
} count _geartools;
};
if (ai_static_skills) then {
{
_unit setSkill [(_x select 0),(_x select 1)]
} count ai_static_array;
} else {
_aicskill = call {
if (_skill == "easy") exitWith {ai_skill_easy;};
if (_skill == "medium") exitWith {ai_skill_medium;};
if (_skill == "hard") exitWith {ai_skill_hard;};
if (_skill == "extreme") exitWith {ai_skill_extreme;};
if (_skill == "random") exitWith {ai_skill_random call BIS_fnc_selectRandom; };
ai_skill_random call BIS_fnc_selectRandom;
};
{
_unit setSkill [(_x select 0),(_x select 1)]
} count _aicskill;
};
_unit addEventHandler ["Killed",{[_this select 0, _this select 1] call on_kill;}];
_static addEventHandler ["GetOut",{
_unit = _this select 2;
_static = _this select 0;
if (alive _unit) then {_unit moveInGunner _static};
}];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_static];
if (sunOrMoon != 1) then {
_unit addWeapon "NVGoggles";
};
_unit moveInGunner _static;
_unit setVariable ["noKey",true];
if (!isNil "_mission") then {
_ainum = (wai_mission_data select _mission) select 0;
wai_mission_data select _mission set [0, (_ainum + 1)];
((wai_mission_data select _mission) select 4) set [count ((wai_mission_data select _mission) select 4), _static];
_static setVariable ["mission" + dayz_serverKey, _mission, false];
_unit setVariable ["mission" + dayz_serverKey, _mission, false];
} else {
wai_static_data set [0, ((wai_static_data select 0) + 1)];
(wai_static_data select 2) set [count (wai_static_data select 2), _static];
};
} forEach _position;
_unitGroup selectLeader ((units _unitGroup) select 0);
if(_aitype == "Hero") then {
_unitGroup setCombatMode ai_hero_combatmode;
_unitGroup setBehaviour ai_hero_behaviour;
} else {
_unitGroup setCombatMode ai_bandit_combatmode;
_unitGroup setBehaviour ai_bandit_behaviour;
};
if (wai_debug_mode) then {diag_log format ["WAI: Spawned in %1 %2",_unitnumber,_class];};

View File

@ -0,0 +1,66 @@
// For Reference: wai_static_data = [0,[],[],[]]; [AI Count, UnitGroups, Vehicles to Monitor, crates]
private ["_unitGroups","_aiVehicles","_staticArray","_timeStamp","_running","_crates"];
_timeStamp = diag_tickTime;
_running = true;
// The loop has to wait until there are existing groups to monitor
// 10 seconds initial sleep to allow crates array to populate
waitUntil {uiSleep 10; (count (wai_static_data select 1)) > 0};
// Spawn loot in crates
_crates = wai_static_data select 3;
if (count _crates > 0) then {
{
[(_x select 0),(_x select 1)] call dynamic_crate;
} count _crates;
};
diag_log "WAI: Initializing static missions";
while {_running} do {
// Refuel and Rearm the AI vehicles until they are destroyed
_aiVehicles = wai_static_data select 2;
if(count _aiVehicles > 0) then {
{
if (alive _x && ({alive _x} count crew _x > 0)) then {
_x setVehicleAmmo 1;
_x setFuel 1;
} else {_x setDamage 1;};
} count _aiVehicles;
};
// Static gun glitch fix
if ((diag_tickTime - _timeStamp) > 180 && (count _aiVehicles) > 0) then {
{
if (_x isKindOf "StaticWeapon") then {
(gunner _x) action ["getout",_x];
};
} forEach _aiVehicles;
_timeStamp = diag_tickTime;
};
_unitGroups = wai_static_data select 1;
{
// delete empty groups
if (count units _x == 0) then {
deleteGroup _x
};
// remove null groups from the array
if (isNull _x) then {
_unitGroups = _unitGroups - [_x];
};
} forEach _unitGroups;
//diag_log _unitGroups; // Used for testing
// When all null groups have been removed from the array, shut the loop down
if (count _unitGroups == 0) then {_running = false;};
uiSleep 5;
};
diag_log "WAI: All Static Spawns have been killed.";

View File

@ -0,0 +1,148 @@
if (!wai_enable_patrols) exitWith {};
local _position = _this select 0;
local _startingpos = _this select 1;
local _radius = _this select 2;
local _wpnum = _this select 3;
local _veh_class = _this select 4;
local _skill = _this select 5;
local _skin = _this select 6;
local _aitype = _this select 7;
local _mission = nil;
if (count _this > 8) then {
_mission = _this select 8;
};
local _unitGroup = grpNull;
local _wp = [];
local _aicskill = call {
if(_skill == "easy") exitWith {ai_skill_easy;};
if(_skill == "medium") exitWith {ai_skill_medium;};
if(_skill == "hard") exitWith {ai_skill_hard;};
if(_skill == "extreme") exitWith {ai_skill_extreme;};
if(_skill == "random") exitWith {ai_skill_random call BIS_fnc_selectRandom;};
ai_skill_random call BIS_fnc_selectRandom;
};
local _aiskin = call {
if(_skin == "random") exitWith {ai_all_skin call BIS_fnc_selectRandom;};
if(_skin == "hero") exitWith {ai_hero_skin call BIS_fnc_selectRandom;};
if(_skin == "bandit") exitWith {ai_bandit_skin call BIS_fnc_selectRandom;};
if(_skin == "special") exitWith {ai_special_skin call BIS_fnc_selectRandom;};
_skin;
};
if(typeName _aiskin == "ARRAY") then {
_aiskin = _aiskin call BIS_fnc_selectRandom;
};
if(_aitype == "Hero") then {
_unitGroup = createGroup RESISTANCE;
} else {
_unitGroup = createGroup EAST;
};
local _driver = _unitGroup createUnit [_aiskin, [0,0,0], [], 1, "NONE"];
[_driver] joinSilent _unitGroup;
call {
if (_aitype == "hero") exitWith {_driver setVariable ["Hero",true,false]; _driver setVariable ["humanity", ai_remove_humanity];};
if (_aitype == "bandit") exitWith {_driver setVariable ["Bandit",true,false]; _driver setVariable ["humanity", ai_add_humanity];};
if (_aitype == "special") exitWith {_driver setVariable ["Special",true,false]; _driver setVariable ["humanity", ai_special_humanity];};
};
local _vehicle = createVehicle [_veh_class, [(_startingpos select 0),(_startingpos select 1), 0], [], 0, "CAN_COLLIDE"];
_vehicle setFuel 1;
_vehicle engineOn true;
_vehicle setVehicleAmmo 1;
_vehicle allowCrewInImmobile true;
_vehicle lock true;
_vehicle addEventHandler ["GetOut",{
local _veh = _this select 0;
local _role = _this select 1;
local _unit = _this select 2;
if (_role == "driver") then {
_unit moveInDriver _veh;
} else {
_unit moveInTurret [_veh,[0]];
};
}];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_vehicle];
_driver assignAsDriver _vehicle;
_driver moveInDriver _vehicle;
local _gunner = _unitGroup createUnit [_aiskin, [0,0,0], [], 1, "NONE"];
_gunner assignAsGunner _vehicle;
_gunner moveInTurret [_vehicle,[0]];
[_gunner] joinSilent _unitGroup;
[_driver, _gunner] orderGetIn true;
call {
if (_aitype == "hero") exitWith {_gunner setVariable ["Hero",true,false]; _gunner setVariable ["humanity", ai_remove_humanity];};
if (_aitype == "bandit") exitWith {_gunner setVariable ["Bandit",true,false]; _gunner setVariable ["humanity", ai_add_humanity];};
if (_aitype == "special") exitWith {_gunner setVariable ["Special",true,false]; _gunner setVariable ["humanity", ai_special_humanity];};
};
{
_gunner setSkill [(_x select 0),(_x select 1)];
} count _aicskill;
{
_driver setSkill [_x,1];
} count ["aimingAccuracy","aimingShake","aimingSpeed","endurance","spotDistance","spotTime","courage","reloadSpeed","commanding","general"];
{
_x addWeapon "Makarov_DZ";
_x addMagazine "8Rnd_9x18_Makarov";
_x addMagazine "8Rnd_9x18_Makarov";
} count (units _unitgroup);
{
_x addEventHandler ["Killed",{[_this select 0, _this select 1, "vehicle"] call on_kill;}];
} forEach (units _unitgroup);
if (!isNil "_mission") then {
_vehicle setVariable ["mission" + dayz_serverKey, _mission, false];
((wai_mission_data select _mission) select 1) set [count ((wai_mission_data select _mission) select 1), _unitGroup];
((wai_mission_data select _mission) select 4) set [count ((wai_mission_data select _mission) select 4), _vehicle];
{
_ainum = (wai_mission_data select _mission) select 0;
wai_mission_data select _mission set [0, (_ainum + 1)];
_x setVariable ["mission" + dayz_serverKey, _mission, false];
_x setVariable ["noKey",true];
} count (crew _vehicle);
} else {
{wai_static_data set [0, ((wai_static_data select 0) + 1)];} count (crew _vehicle);
(wai_static_data select 1) set [count (wai_static_data select 1), _unitGroup];
(wai_static_data select 2) set [count (wai_static_data select 2), _vehicle];
};
_unitGroup allowFleeing 0;
if(_aitype == "Hero") then {
_unitGroup setCombatMode ai_hero_combatmode;
_unitGroup setBehaviour ai_hero_behaviour;
} else {
_unitGroup setCombatMode ai_bandit_combatmode;
_unitGroup setBehaviour ai_bandit_behaviour;
};
if(_wpnum > 0) then {
for "_x" from 1 to _wpnum do
{
_wp = _unitGroup addWaypoint [[(_position select 0),(_position select 1),0],_radius];
_wp setWaypointType "SAD";
_wp setWaypointCompletionRadius 200;
};
};
_wp = _unitGroup addWaypoint [[(_position select 0),(_position select 1),0],100];
_wp setWaypointType "CYCLE";
_wp setWaypointCompletionRadius 200;
_unitGroup

View File

@ -0,0 +1,282 @@
/* GENERAL CONFIG */
wai_debug_mode = false; // enable debug
wai_user_spawnpoints = false; // setting this to true will disable the dynamic mission spawning system and enable server owners to define their own mission spawn points in WAI\configs\spawnpoints.sqf.
wai_use_blacklist = true; // You can edit the blacklist per map in file WAI\configs\blacklist.sqf.
/* END GENERAL CONFIG */
/* AI CONFIG */
ai_show_count = true; //this will show the ai count in the mission markers.
ai_hasMoney = false; //If you have ZSC installed then setting this to true will place random amounts of coins in 50 coin increments in ai wallets.
ai_moneyMultiplier = 200; //This value is multiplied by 50 to set the max amount of ZSC coins in AI wallets. ex. 200x50=10000 max coins.
ai_clear_body = false; // instantly clear bodies
ai_cleanup_time = 120; // time to clear bodies in minutes. Set to -1 to disable AI cleanup.
ai_clean_roadkill = false; // clean bodies that are roadkills
ai_rk_damageweapon = 30; // percentage of chance a roadkill will destroy weapon AI is carrying
ai_bandit_combatmode = "RED"; // combat mode of bandit AI
ai_bandit_behaviour = "COMBAT"; // behavior of bandit AI
ai_hero_combatmode = "RED"; // combat mode of hero AI
ai_hero_behaviour = "COMBAT"; // behavior of hero AI
ai_share_info = true; // AI share info on player position
ai_share_distance = 300; // distance from killed AI for AI to share your rough position
ai_kills_gain = true; // add kill to bandit/human kill score
ai_humanity_gain = true; // gain humanity for killing AI
ai_add_humanity = 50; // amount of humanity gained for killing a bandit AI
ai_remove_humanity = 50; // amount of humanity lost for killing a hero AI
ai_reward_veh_gunner = true; // Allows the gunner or "effectiveCommander" of a vehicle to get humanity and kill rewards
ai_killfeed = false; // Sends personal messages when the player kills an ai - may not be good for network performance
ai_skill_extreme = [["aimingAccuracy",1.00],["aimingShake",1.00],["aimingSpeed",1.00],["endurance",1.00],["spotDistance",1.00],["spotTime",1.00],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]]; // Extreme
ai_skill_hard = [["aimingAccuracy",0.80],["aimingShake",0.80],["aimingSpeed",0.80],["endurance",1.00],["spotDistance",0.80],["spotTime",0.80],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]]; // Hard
ai_skill_medium = [["aimingAccuracy",0.60],["aimingShake",0.60],["aimingSpeed",0.60],["endurance",1.00],["spotDistance",0.60],["spotTime",0.60],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]]; // Medium
ai_skill_easy = [["aimingAccuracy",0.40],["aimingShake",0.50],["aimingSpeed",0.50],["endurance",1.00],["spotDistance",0.50],["spotTime",0.50],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]]; // Easy
ai_skill_random = [ai_skill_extreme,ai_skill_hard,ai_skill_hard,ai_skill_hard,ai_skill_hard,ai_skill_medium,ai_skill_medium,ai_skill_medium,ai_skill_medium,ai_skill_easy];
ai_static_useweapon = true; // Allows AI on static guns to have a loadout
ai_static_weapons = ["KORD_high_TK_EP1","DSHKM_Ins","M2StaticMG"]; // static guns
ai_static_skills = false; // Allows you to set custom array for AI on static weapons. (true: On false: Off)
ai_static_array = [["aimingAccuracy",0.20],["aimingShake",0.70],["aimingSpeed",0.75],["endurance",1.00],["spotDistance",0.70],["spotTime",0.50],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]];
ai_gear0 = [["ItemBandage","ItemBandage","ItemAntibiotic"],["ItemRadio","ItemMachete","ItemCrowbar"]];
ai_gear1 = [["ItemBandage","ItemSodaPepsi","ItemMorphine"],["Binocular_Vector"]];
ai_gear2 = [["ItemDocument","FoodCanFrankBeans","ItemHeatPack"],["ItemToolbox"]];
ai_gear3 = [["ItemWaterbottle","ItemBloodbag"],["ItemCompass","ItemCrowbar"]];
ai_gear4 = [["ItemBandage","ItemEpinephrine","ItemPainkiller"],["ItemGPS","ItemKeyKit"]];
ai_gear_random = [ai_gear0,ai_gear1,ai_gear2,ai_gear3,ai_gear4];
// Weapons
ai_wep_ak = ["AK74_Kobra_DZ","AK74_Kobra_SD_DZ","AK74_GL_Kobra_DZ","AK74_GL_Kobra_SD_DZ","AK74_DZ","AK74_SD_DZ","AK74_GL_DZ","AK74_GL_SD_DZ","AK74_PSO1_DZ","AK74_PSO1_SD_DZ","AK74_GL_PSO1_DZ","AK74_GL_PSO1_SD_DZ","AK107_Kobra_DZ","AK107_DZ","AK107_GL_DZ","AK107_PSO_DZ","AK107_GL_PSO_DZ","AK107_GL_Kobra_DZ","AN94_DZ","AN94_GL_DZ","AKS74U_Kobra_DZ","AKS74U_Kobra_SD_DZ","AKS74U_DZ","AKS74U_SD_DZ","AKM_DZ","AKM_Kobra_DZ","AKM_PSO1_DZ","AKS_Gold_DZ","AKS_Silver_DZ","AKS_DZ"];
ai_wep_rk95 = ["RK95_DZ","RK95_SD_DZ","RK95_CCO_SD_DZ","RK95_ACOG_SD_DZ","RK95_CCO_DZ","RK95_ACOG_DZ"];
ai_wep_groza = ["Groza9_DZ","Groza9_Sniper_DZ","Groza9_GL_DZ","Groza9_GL_Sniper_DZ","Groza9_SD_DZ","Groza9_Sniper_SD_DZ","Groza1_DZ","Groza1_Sniper_DZ","Groza1_SD_DZ","Groza1_Sniper_SD_DZ"];
ai_wep_scar = ["SCAR_H_AK_DZ","SCAR_H_AK_CCO_DZ","SCAR_H_B_AK_CCO_DZ","SCAR_H_AK_HOLO_DZ","SCAR_H_AK_ACOG_DZ"];
ai_wep_sniper = ["WA2000_DZ","Barrett_MRAD_Iron_DZ","Barrett_MRAD_CCO_DZ","Barrett_MRAD_Sniper_DZ","MSR_DZ","MSR_SD_DZ","MSR_NV_DZ","MSR_NV_SD_DZ","XM2010_DZ","XM2010_SD_DZ","XM2010_NV_DZ","XM2010_NV_SD_DZ","XM2010_TWS_DZ","XM2010_TWS_SD_DZ","Anzio_20_DZ","BAF_AS50_scoped_DZ","m107_DZ","M4SPR_DZE","M200_CheyTac_DZ","M200_CheyTac_SD_DZ","L115A3_DZ","L115A3_2_DZ","KSVK_DZE","VSS_vintorez_DZE","M24_DZ","M24_Gh_DZ","M24_DES_DZ","M40A3_Gh_DZ","M40A3_DZ","CZ750_DZ","M110_NV_DZ","MK17_Sniper_DZ","MK17_Sniper_SD_DZ","MK14_Sniper_DZ","MK14_Sniper_SD_DZ","M21_DZ","M21A5_DZ","M21A5_SD_DZ","HK417_Sniper_DZ","HK417_Sniper_SD_DZ","M1A_SC16_BL_Sniper_DZ","M1A_SC2_BL_Sniper_DZ","M1A_SC16_TAN_Sniper_DZ","DMR_DZ","DMR_SKN","DMR_Gh_DZ","DMR_DZE","DMR_Gh_DZE","RSASS_DZ","RSASS_TWS_DZ","RSASS_SD_DZ","RSASS_TWS_SD_DZ","FNFAL_DZ","FNFAL_CCO_DZ","FNFAL_Holo_DZ","FNFAL_ANPVS4_DZ","FN_FAL_ANPVS4_DZE","G3_DZ"];
ai_wep_g36 = ["G36K_Camo_DZ","G36K_Camo_SD_DZ","G36A_Camo_DZ","G36A_Camo_SD_DZ","G36C_DZ","G36C_SD_DZ","G36C_CCO_DZ","G36C_CCO_SD_DZ","G36C_Holo_DZ","G36C_Holo_SD_DZ","G36C_ACOG_DZ","G36C_ACOG_SD_DZ","G36C_Camo_DZ","G36C_Camo_Holo_SD_DZ"];
ai_wep_m4 = ["M4A1_DZ","M4A1_FL_DZ","M4A1_MFL_DZ","M4A1_SD_DZ","M4A1_SD_FL_DZ","M4A1_SD_MFL_DZ","M4A1_GL_DZ","M4A1_GL_FL_DZ","M4A1_GL_MFL_DZ","M4A1_GL_SD_DZ","M4A1_GL_SD_FL_DZ","M4A1_GL_SD_MFL_DZ","M4A1_CCO_DZ","M4A1_CCO_FL_DZ","M4A1_CCO_MFL_DZ","M4A1_CCO_SD_DZ","M4A1_CCO_SD_FL_DZ","M4A1_CCO_SD_MFL_DZ","M4A1_GL_CCO_DZ","M4A1_GL_CCO_FL_DZ","M4A1_GL_CCO_MFL_DZ","M4A1_GL_CCO_SD_DZ","M4A1_GL_CCO_SD_FL_DZ","M4A1_GL_CCO_SD_MFL_DZ","M4A1_Holo_DZ","M4A1_Holo_FL_DZ","M4A1_Holo_MFL_DZ","M4A1_Holo_SD_DZ","M4A1_Holo_SD_FL_DZ","M4A1_Holo_SD_MFL_DZ","M4A1_GL_Holo_DZ","M4A1_GL_Holo_FL_DZ","M4A1_GL_Holo_MFL_DZ","M4A1_GL_Holo_SD_DZ","M4A1_GL_Holo_SD_FL_DZ","M4A1_GL_Holo_SD_MFL_DZ","M4A1_ACOG_DZ","M4A1_ACOG_FL_DZ","M4A1_ACOG_MFL_DZ","M4A1_ACOG_SD_DZ","M4A1_ACOG_SD_FL_DZ","M4A1_ACOG_SD_MFL_DZ","M4A1_GL_ACOG_DZ","M4A1_GL_ACOG_FL_DZ","M4A1_GL_ACOG_MFL_DZ","M4A1_GL_ACOG_SD_DZ","M4A1_GL_ACOG_SD_FL_DZ","M4A1_GL_ACOG_SD_MFL_DZ","M4A1_Rusty_DZ","M4A1_Camo_CCO_DZ","M4A1_Camo_CCO_SD_DZ","M4A1_Camo_Holo_GL_DZ","M4A1_Camo_Holo_GL_SD_DZ","M4A3_DES_CCO_DZ","M4A3_ACOG_GL_DZ","M4A3_Camo_DZ","M4A3_Camo_ACOG_DZ"];
ai_wep_hk416 = ["HK416_DZ","HK416_SD_DZ","HK416_GL_DZ","HK416_GL_SD_DZ","HK416_CCO_DZ","HK416_CCO_SD_DZ","HK416_GL_CCO_DZ","HK416_GL_CCO_SD_DZ","HK416_Holo_DZ","HK416_Holo_SD_DZ","HK416_GL_Holo_DZ","HK416C_DZ","HK416C_GL_DZ","HK416C_CCO_DZ","HK416C_GL_CCO_DZ","HK416C_Holo_DZ","HK416C_GL_Holo_DZ","HK416C_ACOG_DZ","HK416C_GL_ACOG_DZ"];
ai_wep_steyrAug = ["SteyrAug_A3_Green_DZ","SteyrAug_A3_Black_DZ","SteyrAug_A3_Blue_DZ","SteyrAug_A3_ACOG_Green_DZ","SteyrAug_A3_ACOG_Black_DZ","SteyrAug_A3_ACOG_Blue_DZ","SteyrAug_A3_Holo_Green_DZ","SteyrAug_A3_Holo_Black_DZ","SteyrAug_A3_Holo_Blue_DZ","SteyrAug_A3_GL_Green_DZ","SteyrAug_A3_GL_Black_DZ","SteyrAug_A3_GL_Blue_DZ","SteyrAug_A3_ACOG_GL_Green_DZ","SteyrAug_A3_ACOG_GL_Black_DZ","SteyrAug_A3_ACOG_GL_Blue_DZ","SteyrAug_A3_Holo_GL_Green_DZ","SteyrAug_A3_Holo_GL_Black_DZ","SteyrAug_A3_Holo_GL_Blue_DZ"];
ai_wep_hk53 = ["HK53A3_DZ","HK53A3_CCO_DZ","HK53A3_Holo_DZ"];
ai_wep_magpulPDR = ["PDR_DZ","PDR_CCO_DZ","PDR_Holo_DZ"];
ai_wep_famas = ["Famas_DZ","Famas_CCO_DZ","Famas_Holo_DZ","Famas_SD_DZ","Famas_CCO_SD_DZ","Famas_Holo_SD_DZ"];
ai_wep_acr = ["ACR_WDL_DZ","ACR_WDL_SD_DZ","ACR_WDL_GL_DZ","ACR_WDL_GL_SD_DZ","ACR_WDL_CCO_DZ","ACR_WDL_CCO_SD_DZ","ACR_WDL_CCO_GL_DZ","ACR_WDL_CCO_GL_SD_DZ","ACR_WDL_Holo_DZ","ACR_WDL_Holo_SD_DZ","ACR_WDL_Holo_GL_DZ","ACR_WDL_Holo_GL_SD_DZ","ACR_WDL_ACOG_DZ","ACR_WDL_ACOG_SD_DZ","ACR_WDL_ACOG_GL_DZ","ACR_WDL_ACOG_GL_SD_DZ","ACR_WDL_TWS_DZ","ACR_WDL_TWS_GL_DZ","ACR_WDL_TWS_SD_DZ","ACR_WDL_TWS_GL_SD_DZ","ACR_WDL_NV_DZ","ACR_WDL_NV_SD_DZ","ACR_WDL_NV_GL_DZ","ACR_WDL_NV_GL_SD_DZ","ACR_BL_DZ","ACR_BL_SD_DZ","ACR_BL_GL_DZ","ACR_BL_GL_SD_DZ","ACR_BL_CCO_DZ","ACR_BL_CCO_SD_DZ","ACR_BL_CCO_GL_DZ","ACR_BL_CCO_GL_SD_DZ","ACR_BL_Holo_DZ","ACR_BL_Holo_SD_DZ","ACR_BL_Holo_GL_DZ","ACR_BL_Holo_GL_SD_DZ","ACR_BL_ACOG_DZ","ACR_BL_ACOG_SD_DZ","ACR_BL_ACOG_GL_DZ","ACR_BL_ACOG_GL_SD_DZ","ACR_BL_TWS_DZ","ACR_BL_TWS_GL_DZ","ACR_BL_TWS_SD_DZ","ACR_BL_TWS_GL_SD_DZ","ACR_BL_NV_DZ","ACR_BL_NV_SD_DZ","ACR_BL_NV_GL_DZ","ACR_BL_NV_GL_SD_DZ","ACR_DES_DZ","ACR_DES_SD_DZ","ACR_DES_GL_DZ","ACR_DES_GL_SD_DZ","ACR_DES_CCO_DZ","ACR_DES_CCO_SD_DZ","ACR_DES_CCO_GL_DZ","ACR_DES_CCO_GL_SD_DZ","ACR_DES_Holo_DZ","ACR_DES_Holo_SD_DZ","ACR_DES_Holo_GL_DZ","ACR_DES_Holo_GL_SD_DZ","ACR_DES_ACOG_DZ","ACR_DES_ACOG_SD_DZ","ACR_DES_ACOG_GL_DZ","ACR_DES_ACOG_GL_SD_DZ","ACR_DES_TWS_DZ","ACR_DES_TWS_GL_DZ","ACR_DES_TWS_SD_DZ","ACR_DES_TWS_GL_SD_DZ","ACR_DES_NV_DZ","ACR_DES_NV_SD_DZ","ACR_DES_NV_GL_DZ","ACR_DES_NV_GL_SD_DZ","ACR_SNOW_DZ","ACR_SNOW_SD_DZ","ACR_SNOW_GL_DZ","ACR_SNOW_GL_SD_DZ","ACR_SNOW_CCO_DZ","ACR_SNOW_CCO_SD_DZ","ACR_SNOW_CCO_GL_DZ","ACR_SNOW_CCO_GL_SD_DZ","ACR_SNOW_Holo_DZ","ACR_SNOW_Holo_SD_DZ","ACR_SNOW_Holo_GL_DZ","ACR_SNOW_Holo_GL_SD_DZ","ACR_SNOW_ACOG_DZ","ACR_SNOW_ACOG_SD_DZ","ACR_SNOW_ACOG_GL_DZ","ACR_SNOW_ACOG_GL_SD_DZ","ACR_SNOW_TWS_DZ","ACR_SNOW_TWS_GL_DZ","ACR_SNOW_TWS_SD_DZ","ACR_SNOW_TWS_GL_SD_DZ","ACR_SNOW_NV_DZ","ACR_SNOW_NV_SD_DZ","ACR_SNOW_NV_GL_DZ","ACR_SNOW_NV_GL_SD_DZ"];
ai_wep_kac = ["KAC_PDW_DZ","KAC_PDW_CCO_DZ","KAC_PDW_HOLO_DZ","KAC_PDW_ACOG_DZ"];
ai_wep_tavor = ["CTAR21_DZ","CTAR21_CCO_DZ","CTAR21_ACOG_DZ"];
ai_wep_masada = ["Masada_DZ","Masada_SD_DZ","Masada_CCO_DZ","Masada_CCO_SD_DZ","Masada_Holo_DZ","Masada_Holo_SD_DZ","Masada_ACOG_DZ","Masada_ACOG_SD_DZ","Masada_BL_DZ","Masada_BL_SD_DZ","Masada_BL_CCO_DZ","Masada_BL_CCO_SD_DZ","Masada_BL_Holo_DZ","Masada_BL_Holo_SD_DZ","Masada_BL_ACOG_DZ","Masada_BL_ACOG_SD_DZ"];
ai_wep_mk16 = ["MK16_DZ","MK16_CCO_DZ","MK16_Holo_DZ","MK16_ACOG_DZ","MK16_GL_DZ","MK16_GL_CCO_DZ","MK16_GL_Holo_DZ","MK16_GL_ACOG_DZ","MK16_CCO_SD_DZ","MK16_Holo_SD_DZ","MK16_ACOG_SD_DZ","MK16_GL_CCO_SD_DZ","MK16_GL_Holo_SD_DZ","MK16_GL_ACOG_SD_DZ","MK16_BL_CCO_DZ","MK16_BL_GL_ACOG_DZ","MK16_BL_Holo_SD_DZ","MK16_BL_GL_CCO_SD_DZ"];
ai_wep_xm8 = ["XM8_DZ","XM8_DES_DZ","XM8_GREY_DZ","XM8_GREY_2_DZ","XM8_GL_DZ","XM8_DES_GL_DZ","XM8_GREY_GL_DZ","XM8_Compact_DZ","XM8_DES_Compact_DZ","XM8_GREY_Compact_DZ","XM8_GREY_2_Compact_DZ","XM8_Sharpsh_DZ","XM8_DES_Sharpsh_DZ","XM8_GREY_Sharpsh_DZ","XM8_SAW_DZ","XM8_DES_SAW_DZ","XM8_GREY_SAW_DZ","XM8_SD_DZ"];
ai_wep_m14 = ["M14_DZ","M14_Gh_DZ","M14_CCO_DZ","M14_CCO_Gh_DZ","M14_Holo_DZ","M14_Holo_Gh_DZ","M1A_SC16_BL_DZ","M1A_SC16_BL_ACOG_DZ","M1A_SC16_BL_CCO_DZ","M1A_SC16_BL_HOLO_DZ","M1A_SC16_BL_PU_DZ","M1A_SC16_TAN_DZ","M1A_SC16_TAN_ACOG_DZ","M1A_SC16_TAN_CCO_DZ","M1A_SC16_TAN_HOLO_DZ","M1A_SC16_TAN_PU_DZ","M1A_SC2_BL_DZ","M1A_SC2_BL_ACOG_DZ","M1A_SC2_BL_CCO_DZ","M1A_SC2_BL_HOLO_DZ","M1A_SC2_BL_PU_DZ"];
ai_wep_hk417 = ["HK417_DZ","HK417_SD_DZ","HK417_CCO_DZ","HK417_CCO_SD_DZ","HK417_Holo_DZ","HK417_Holo_SD_DZ","HK417_ACOG_DZ","HK417_ACOG_SD_DZ","HK417C_DZ","HK417C_GL_DZ","HK417C_CCO_DZ","HK417C_GL_CCO_DZ","HK417C_Holo_DZ","HK417C_GL_Holo_DZ","HK417C_ACOG_DZ","HK417C_GL_ACOG_DZ"];
ai_wep_mk14 = ["MK14_DZ","MK14_CCO_DZ","MK14_Holo_DZ","MK14_ACOG_DZ","MK14_SD_DZ","MK14_CCO_SD_DZ","MK14_Holo_SD_DZ","MK14_ACOG_SD_DZ"];
ai_wep_mk17 = ["MK17_DZ","MK17_CCO_DZ","MK17_Holo_DZ","MK17_ACOG_DZ","MK17_GL_DZ","MK17_GL_CCO_DZ","MK17_GL_Holo_DZ","MK17_GL_ACOG_DZ","MK17_CCO_SD_DZ","MK17_Holo_SD_DZ","MK17_ACOG_SD_DZ","MK17_GL_CCO_SD_DZ","MK17_GL_Holo_SD_DZ","MK17_BL_Holo_DZ","MK17_BL_GL_ACOG_DZ","MK17_BL_CCO_SD_DZ","MK17_BL_GL_Holo_SD_DZ"];
ai_wep_cz805 = ["CZ805_A1_DZ","CZ805_A1_GL_DZ","CZ805_A2_DZ","CZ805_A2_SD_DZ","CZ805_B_GL_DZ"];
ai_wep_shotgun = ["MR43_DZ","Winchester1866_DZ","Remington870_DZ","Remington870_FL_DZ","Remington870_MFL_DZ","Saiga12K_DZ","USAS12_DZ","AA12_DZ","M1014_DZ","M1014_CCO_DZ","M1014_Holo_DZ"];
ai_wep_svd = ["SVD_PSO1_DZ","SVD_PSO1_Gh_DZ","SVD_DZ","SVD_Gh_DZ","SVD_PSO1_Gh_DES_DZ","SVD_NSPU_DZ","SVD_Gold_DZ","SVU_PSO1_DZ"];
ai_wep_mosin = ["Mosin_DZ","Mosin_FL_DZ","Mosin_MFL_DZ","Mosin_Belt_DZ","Mosin_Belt_FL_DZ","Mosin_Belt_MFL_DZ","Mosin_PU_DZ","Mosin_PU_FL_DZ","Mosin_PU_MFL_DZ","Mosin_PU_Belt_DZ","Mosin_PU_Belt_FL_DZ","Mosin_PU_Belt_MFL_DZ"];
ai_wep_m16 = ["M16A2_DZ","M16A2_GL_DZ","M16A2_Rusty_DZ","M16A4_DZ","M16A4_FL_DZ","M16A4_MFL_DZ","M16A4_GL_DZ","M16A4_GL_FL_DZ","M16A4_GL_MFL_DZ","M16A4_CCO_DZ","M16A4_CCO_FL_DZ","M16A4_CCO_MFL_DZ","M16A4_GL_CCO_DZ","M16A4_GL_CCO_FL_DZ","M16A4_GL_CCO_MFL_DZ","M16A4_Holo_DZ","M16A4_Holo_FL_DZ","M16A4_Holo_MFL_DZ","M16A4_GL_Holo_DZ","M16A4_GL_Holo_FL_DZ","M16A4_GL_Holo_MFL_DZ","M16A4_ACOG_DZ","M16A4_ACOG_FL_DZ","M16A4_ACOG_MFL_DZ","M16A4_GL_ACOG_DZ","M16A4_GL_ACOG_FL_DZ","M16A4_GL_ACOG_MFL_DZ"];
ai_wep_sa58 = ["SA58_DZ","SA58_RIS_DZ","SA58_RIS_FL_DZ","SA58_RIS_MFL_DZ","SA58_CCO_DZ","SA58_CCO_FL_DZ","SA58_CCO_MFL_DZ","SA58_Holo_DZ","SA58_Holo_FL_DZ","SA58_Holo_MFL_DZ","SA58_ACOG_DZ","SA58_ACOG_FL_DZ","SA58_ACOG_MFL_DZ","Sa58V_DZ","Sa58V_Camo_CCO_DZ","Sa58V_Camo_ACOG_DZ"];
ai_wep_l85 = ["L85A2_DZ","L85A2_FL_DZ","L85A2_MFL_DZ","L85A2_SD_DZ","L85A2_SD_FL_DZ","L85A2_SD_MFL_DZ","L85A2_CCO_DZ","L85A2_CCO_FL_DZ","L85A2_CCO_MFL_DZ","L85A2_CCO_SD_DZ","L85A2_CCO_SD_FL_DZ","L85A2_CCO_SD_MFL_DZ","L85A2_Holo_DZ","L85A2_Holo_FL_DZ","L85A2_Holo_MFL_DZ","L85A2_Holo_SD_DZ","L85A2_Holo_SD_FL_DZ","L85A2_Holo_SD_MFL_DZ","L85A2_ACOG_DZ","L85A2_ACOG_FL_DZ","L85A2_ACOG_MFL_DZ","L85A2_ACOG_SD_DZ","L85A2_ACOG_SD_FL_DZ","L85A2_ACOG_SD_MFL_DZ","BAF_L85A2_RIS_TWS_DZ"];
ai_wep_pistol = ["M9_DZ","M9_SD_DZ","M9_Camo_DZ","M9_Camo_SD_DZ","M93R_DZ","P99_Black_DZ","P99_Black_SD_DZ","P99_Green_DZ","P99_Green_SD_DZ","P99_Silver_DZ","P99_Silver_SD_DZ","BrowningHP_DZ","P226_DZ","P226_Silver_DZ","P38_DZ","PPK_DZ","MK22_DZ","MK22_2_DZ","MK22_SD_DZ","MK22_2_SD_DZ","G17_DZ","G17_FL_DZ","G17_MFL_DZ","G17_SD_DZ","G17_SD_FL_DZ","G17_SD_MFL_DZ","G18_DZ","M1911_DZ","M1911_2_DZ","Kimber_M1911_DZ","Kimber_M1911_SD_DZ","USP_DZ","USP_SD_DZ","Makarov_DZ","Makarov_SD_DZ","Tokarew_TT33_DZ","Ruger_MK2_DZ","APS_DZ","APS_SD_DZ","PDW_DZ","PDW_SD_DZ","TEC9_DZ","Mac10_DZ","Revolver_DZ","Revolver_Gold_DZ","Colt_Anaconda_DZ","Colt_Anaconda_Gold_DZ","Colt_Bull_DZ","Colt_Python_DZ","Colt_Revolver_DZ","CZ75P_DZ","CZ75D_DZ","CZ75SP_DZ","CZ75SP_SD_DZ","DesertEagle_DZ","DesertEagle_Gold_DZ","DesertEagle_Silver_DZ","DesertEagle_Modern_DZ","Sa61_DZ"];
ai_wep_smg = ["Bizon_DZ","Bizon_Kobra_DZ","Bizon_SD_DZ","Bizon_Kobra_SD_DZ","MP5_DZ","MP5_SD_DZ","Kriss_DZ","Kriss_CCO_DZ","Kriss_Holo_DZ","Kriss_SD_DZ","Kriss_CCO_SD_DZ","Kriss_Holo_SD_DZ","Scorpion_Evo3_DZ","Scorpion_Evo3_CCO_DZ","Scorpion_Evo3_CCO_SD_DZ","MP7_DZ","MP7_FL_DZ","MP7_MFL_DZ","MP7_Holo_DZ","MP7_Holo_FL_DZ","MP7_Holo_MFL_DZ","MP7_CCO_DZ","MP7_CCO_FL_DZ","MP7_CCO_MFL_DZ","MP7_ACOG_DZ","MP7_ACOG_FL_DZ","MP7_ACOG_MFL_DZ","MP7_SD_DZ","MP7_SD_FL_DZ","MP7_SD_MFL_DZ","MP7_Holo_SD_DZ","MP7_Holo_SD_FL_DZ","MP7_Holo_SD_MFL_DZ","MP7_CCO_SD_DZ","MP7_CCO_SD_FL_DZ","MP7_CCO_SD_MFL_DZ","MP7_ACOG_SD_DZ","MP7_ACOG_SD_FL_DZ","MP7_ACOG_SD_MFL_DZ","TMP_DZ","TMP_CCO_DZ","TMP_Holo_DZ","TMP_SD_DZ","TMP_CCO_SD_DZ","TMP_Holo_SD_DZ","UMP_DZ","UMP_CCO_DZ","UMP_Holo_DZ","UMP_SD_DZ","UMP_CCO_SD_DZ","UMP_Holo_SD_DZ","P90_DZ","P90_CCO_DZ","P90_Holo_DZ","P90_SD_DZ","P90_CCO_SD_DZ","P90_Holo_SD_DZ","Sten_MK_DZ","MAT49_DZ","M31_DZ","VAL_DZ","VAL_Kobra_DZ","VAL_PSO1_DZ"];
ai_wep_machine = ["RPK_DZ","RPK_Kobra_DZ","RPK_PSO1_DZ","MG36_DZ","MG36_Camo_DZ","M249_CCO_DZ","M249_DZ","M249_Holo_DZ","M249_EP1_DZ","M249_m145_EP1_DZE","L110A1_CCO_DZ","L110A1_Holo_DZ","L110A1_DZ","BAF_L110A1_Aim_DZE","M240_DZ","M240_CCO_DZ","M240_Holo_DZ","m240_scoped_EP1_DZE","M60A4_EP1_DZE","Mk43_DZ","MK43_Holo_DZ","MK43_ACOG_DZ","MK43_M145_DZ","Mk48_CCO_DZ","Mk48_DZ","Mk48_Holo_DZ","Mk48_DES_CCO_DZ","PKM_DZ","Pecheneg_DZ","UK59_DZ","RPK74_Kobra_DZ","RPK74_DZ","RPK74_PSO1_DZ","L86A2_LSW_DZ"];
ai_wep_tws = ["MSR_TWS_DZ","MSR_TWS_SD_DZ","AKS_74_GOSHAWK","BAF_AS50_TWS","BAF_L85A2_RIS_TWS_DZ","M249_TWS_EP1_Small","m107_TWS_EP1_Small","m8_tws","m8_tws_sd","SCAR_L_STD_EGLM_TWS","SCAR_H_STD_TWS_SD","M110_TWS_EP1"];
// Random Weapons // By default, most of the mission crates and ai spawn weapons out of the group below. You can remove any weapon array entries from the list if you don't wish to include them.
ai_wep_random = [ai_wep_ak,ai_wep_rk95,ai_wep_groza,ai_wep_scar,ai_wep_sniper,ai_wep_g36,ai_wep_m4,ai_wep_hk416,ai_wep_steyrAug,ai_wep_hk53,ai_wep_magpulPDR,ai_wep_famas,ai_wep_acr,ai_wep_kac,ai_wep_tavor,ai_wep_masada,ai_wep_mk16,ai_wep_xm8,ai_wep_m14,ai_wep_hk417,ai_wep_mk14,ai_wep_mk17,ai_wep_cz805,ai_wep_shotgun,ai_wep_svd,ai_wep_mosin,ai_wep_m16,ai_wep_sa58,ai_wep_l85,ai_wep_smg,ai_wep_machine];
ai_wep_launchers_AT = ["M136","RPG18","JAVELIN", "Strela","Igla","STINGER"];
ai_wep_launchers_AA = ["Strela","Igla","STINGER"];
ai_packs = ["Patrol_Pack_DZE1","GymBag_Camo_DZE1","GymBag_Green_DZE1","Czech_Vest_Pouch_DZE1","Assault_Pack_DZE1","TerminalPack_DZE1","TinyPack_DZE1","ALICE_Pack_DZE1","TK_Assault_Pack_DZE1","School_Bag_DZE1","CompactPack_DZE1","British_ACU_DZE1","GunBag_DZE1","PartyPack_DZE1","NightPack_DZE1","SurvivorPack_DZE1","AirwavesPack_DZE1","CzechBackpack_DZE1","CzechBackpack_Camping_DZE1","CzechBackpack_OD_DZE1","CzechBackpack_DES_DZE1","CzechBackpack_3DES_DZE1","CzechBackpack_WDL_DZE1","CzechBackpack_MAR_DZE1","CzechBackpack_DMAR_DZE1","CzechBackpack_UCP_DZE1","CzechBackpack_6DES_DZE1","CzechBackpack_TAK_DZE1","CzechBackpack_NVG_DZE1","CzechBackpack_BLK_DZE1","CzechBackpack_DPM_DZE1","CzechBackpack_FIN_DZE1","CzechBackpack_MTC_DZE1","CzechBackpack_NOR_DZE1","CzechBackpack_WIN_DZE1","CzechBackpack_ATC_DZE1","CzechBackpack_MTL_DZE1","CzechBackpack_FTN_DZE1","WandererBackpack_DZE1","LegendBackpack_DZE1","CoyoteBackpack_DZE1","CoyoteBackpackDes_DZE1","CoyoteBackpackWdl_DZE1","CoyoteBackpack_Camping_DZE1","LargeGunBag_DZE1"];
ai_hero_skin = ["Soldier_Sniper_PMC_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ","FR_Rodriguez_DZ","FR_Marksman_DZ","FR_R_DZ","FR_Sapper_DZ","FR_TL_DZ","FR_OHara_DZ","USMC_Soldier_MG_DZ","US_Soldier_EP1_DZ","UN_CDF_Soldier_Guard_EP1_DZ","GER_Soldier_TL_EP1_DZ","BAF_Soldier_Officer_MTP_DZ","BAF_Soldier_N_MTP_DZ"];
ai_bandit_skin = ["Ins_Soldier_GL_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","GUE_Commander_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_2_DZ","GUE_Soldier_CO_DZ","BanditW1_DZ","BanditW2_DZ","Bandit1_DZ","Bandit2_DZ","MVD_Soldier_DZ","Ins_Soldier_2_DZ","CDF_Soldier_DZ","RUS_Soldier1_DZ"];
ai_special_skin = ["Functionary2_EP1"];
ai_all_skin = [ai_hero_skin,ai_bandit_skin,ai_special_skin];
ai_add_skin = true; // adds unit skin to inventory on death. Should set to false if you have takeclothes installed.
/* END AI CONFIG */
/* WAI MISSIONS CONFIG */
wai_mission_markers = ["DZMSMajMarker","DZMSMinMarker","DZMSBMajMarker","DZMSBMinMarker"]; // List of DZMS mission markers to check
wai_avoid_samespot = true; // Checks to see that a selected mission spawn point has not been used already - 200m check.
wai_avoid_missions = 2000; // avoid spawning missions this close to other missions, these are defined in wai_mission_markers
wai_avoid_safezones = 1500; // avoid spawning missions this close to safezones
wai_avoid_town = 0; // avoid spawning missions this close to towns, *** doesn't function with infiSTAR enabled ***
wai_avoid_road = 0; // avoid spawning missions this close to roads
wai_avoid_water = 50; // avoid spawning missions this close to water
wai_avoid_players = 500; // avoid spawning missions this close to a player
wai_avoid_plots = 100; // avoid spawning missions near player plots
wai_mission_timer = [2,15]; // time between missions. Default: 5-15 minutes
wai_mission_timeout = [15,30]; // time each mission takes to timeout if inactive. Default: 15-30 minutes
wai_timeout_distance = 1200; // if a player is this close to a mission then it won't timeout
wai_clean_mission_time = 40; // time in minutes after a mission is complete to clean mission buildings. Set to -1 to disable mission cleanup. Default: 30 minutes
wai_clean_mission_crate = true; // include the mission crates with the mission cleanup. If a player is within 75 meters of the crates the cleanup script will wait. Does not apply to missions that timeout.
wai_clean_when_clear = ["Road Block"]; // These mission names will get cleaned instantly overriding wai_clean_mission_time
wai_godmode_objects = true; // prevents mission objects from taking damage
wai_mission_fuel = [5,60]; // fuel inside mission spawned vehicles [min%,max%]
wai_vehicle_damage = [20,70]; // damages to spawn vehicles with [min%,max%]
wai_keep_vehicles = false; // save vehicles to database and keep them after restart
wai_godmode_vehicles = false; // mission vehicles do not take damage until players enter them
wai_vehicle_keys = "NoVehicleKey"; // Options: "KeyonAI", "KeyinVehicle", "KeyinCrate", "NoVehicleKey".
wai_vehicle_message = true; // Shows a warning message to the player when entering a mission vehicle
wai_crates_smoke = false; // pop smoke on crate when mission is finished during daytime
wai_crates_flares = false; // pop flare on crate when mission is finished during nighttime
wai_players_online = 1; // number of players online before mission starts
wai_kill_percent = 100; // percentage of AI players that must be killed at "crate" missions to be able to trigger completion
wai_high_value_chance = 10; // chance in percent you find a high value item in the crate.
wai_num_mags = [3,6]; // Number of magazines per weapon in the crate [min,max]
wai_enable_minefield = false; // enable minefields to better defend missions
wai_enable_static_guns = true; // Enables or disables static gun placements at missions that have them.
wai_enable_paradrops = false; // Enables or disables paratrooper drops at missions that have them.
wai_enable_patrols = true; // Enables or disables armored vehicle patrols at missions that have them.
wai_use_launchers = true; // add a rocket launcher to each spawned AI group
wai_remove_launcher = false; // remove rocket launcher from AI on death
wai_mission_announce = "DynamicText"; // Options: "Radio", "DynamicText", "titleText"
wai_hero_limit = 4; // define how many hero missions can run at once
wai_bandit_limit = 4; // define how many bandit missions can run at once
// Mission Arrays
// [mission name, chance to spawn] Chance to spawn is 0-1. Example - If you only want your mission to have a 25% chance to spawn enter .25
wai_hero_missions = [
["patrol",1],
["black_hawk_crash",1],
["armed_vehicle",1],
["base",1],
["captured_mv22",1],
["scout_patrol",1],
["ikea_convoy",1],
["medi_camp",1],
["broken_down_ural",1],
["sniper_extraction",1],
["mayors_mansion",1],
["weapon_cache",1],
["gem_tower",1],
["cannibal_cave",1],
["crop_raider",1],
["drone_pilot",1],
["slaughter_house",1],
["drugbust",1],
["armybase",1],
["abandoned_trader",1],
["lumberjack",1],
["presidents_mansion",1],
["tankcolumn",1],
["macdonald",1],
["radioshack",1],
["junkyard",1],
["outpost",1],
["farmer",1],
["firestation",1],
["vehicle_drop",1],
["apc",1],
["castle_grayskull",1],
["wuhan_lab",1]
//["fallen_satellite",1],
//["oil_depot",1],
//["refugee",1],
//["gold_mine",1],
//["cargo",1]
];
wai_bandit_missions = [
["patrol",1],
["black_hawk_crash",1],
["armed_vehicle",1],
["base",1],
["captured_mv22",1],
["scout_patrol",1],
["ikea_convoy",1],
["medi_camp",1],
["broken_down_ural",1],
["sniper_extraction",1],
["mayors_mansion",1],
["weapon_cache",1],
["gem_tower",1],
["cannibal_cave",1],
["crop_raider",1],
["drone_pilot",1],
["slaughter_house",1],
["drugbust",1],
["armybase",1],
["abandoned_trader",1],
["lumberjack",1],
["presidents_mansion",1],
["tankcolumn",1],
["macdonald",1],
["radioshack",1],
["junkyard",1],
["outpost",1],
["farmer",1],
["firestation",1],
["vehicle_drop",1],
["apc",1],
["castle_grayskull",1],
["wuhan_lab",1]
//["fallen_satellite",1],
//["oil_depot",1],
//["refugee",1],
//["gold_mine",1],
//["cargo",1]
];
// Vehicle arrays
armed_vehicle = ["ArmoredSUV_PMC_DZE","GAZ_Vodnik_DZE","HMMWV_M1151_M2_CZ_DES_EP1_DZE","HMMWV_M998A2_SOV_DES_EP1_DZE","LandRover_MG_TK_EP1_DZE","LandRover_Special_CZ_EP1_DZE","Offroad_DSHKM_Gue_DZE","UAZ_MG_TK_EP1_DZE","Pickup_PK_GUE_DZE","Pickup_PK_INS_DZE","Pickup_PK_TK_GUE_EP1_DZE"];
armed_chopper = ["CH_47F_EP1_DZE","UH1H_DZE","Mi17_DZE","UH60M_EP1_DZE","UH1Y_DZE","MH60S_DZE"];
civil_chopper = ["AH6X_DZ","BAF_Merlin_DZE","MH6J_DZ","Mi17_Civilian_DZ"];
military_unarmed = ["GAZ_Vodnik_MedEvac_DZE","HMMWV_Ambulance_DZE","HMMWV_Ambulance_CZ_DES_EP1_DZE","HMMWV_DES_EP1_DZE","HMMWV_DZ","HMMWV_M1035_DES_EP1_DZE","LandRover_CZ_EP1_DZE","LandRover_TK_CIV_EP1_DZE","UAZ_CDF_DZE","UAZ_INS_DZE","UAZ_RU_DZE","UAZ_Unarmed_TK_CIV_EP1_DZE","UAZ_Unarmed_TK_EP1_DZE","UAZ_Unarmed_UN_EP1_DZE"];
cargo_trucks = ["Kamaz_DZE","MTVR_DES_EP1_DZE","Ural_INS_DZE","Ural_CDF_DZE","Ural_TK_CIV_EP1_DZE","Ural_UN_EP1_DZE","V3S_Open_TK_CIV_EP1_DZE","V3S_Open_TK_EP1_DZE"];
refuel_trucks = ["KamazRefuel_DZ","MtvrRefuel_DES_EP1_DZ","UralRefuel_TK_EP1_DZ","V3S_Refuel_TK_GUE_EP1_DZ"];
civil_vehicles = ["hilux1_civil_1_open_DZE","hilux1_civil_2_covered_DZE","hilux1_civil_3_open_DZE","SUV_Blue","SUV_Camo","SUV_Charcoal","SUV_Green","SUV_Orange","SUV_Pink","SUV_Red","SUV_Silver","SUV_TK_CIV_EP1_DZE","SUV_White","SUV_Yellow"];
// Dynamic crate array
crates_large = ["USVehicleBox","RUVehicleBox","TKVehicleBox_EP1"];
crates_medium = ["USBasicWeaponsBox","RUBasicWeaponsBox","USSpecialWeaponsBox","USSpecialWeapons_EP1","RUSpecialWeaponsBox","SpecialWeaponsBox","TKSpecialWeapons_EP1","UNBasicWeapons_EP1"];
crates_small = ["GuerillaCacheBox","RULaunchersBox","RUBasicAmmunitionBox","RUOrdnanceBox","USBasicAmmunitionBox","USLaunchersBox","USOrdnanceBox","USOrdnanceBox_EP1","USLaunchers_EP1","USBasicWeapons_EP1","USBasicAmmunitionBox_EP1","UNBasicAmmunitionBox_EP1","TKOrdnanceBox_EP1","TKLaunchers_EP1","TKBasicAmmunitionBox_EP1","GuerillaCacheBox_EP1","GERBasicWeapons_EP1"];
// Crate Arrays
crate_weapons_buildables = ["ChainSaw","ChainSawB","ChainSawG","ChainSawP","ChainSawR"];
crate_tools = ["ItemKeyKit","Binocular","Binocular_Vector","ItemCompass","ItemCrowbar","ItemEtool","ItemFishingPole","ItemFlashlightRed","ItemGPS","ItemHatchet","ItemKnife","ItemMachete","ItemMatchbox","ItemToolbox","NVGoggles"];
crate_tools_buildable = ["ItemToolbox","ItemEtool","ItemCrowbar","ItemKnife"];
crate_tools_sniper = ["ItemCompass","Binocular","Binocular_Vector","NVGoggles","ItemGPS"];
crate_items_misc = ["ItemGoldBar","ItemGoldBar10oz"];
crate_items_high_value = ["ItemBriefcase100oz","ItemVault","plot_pole_kit","ItemHotwireKit"];
crate_items_food = ["ItemWaterbottle","FoodNutmix","FoodPistachio","FoodMRE","ItemSodaOrangeSherbet","ItemSodaRbull","ItemSodaR4z0r","ItemSodaMdew","ItemSodaPepsi","ItemSodaCoke","FoodbaconCooked","FoodCanBakedBeans","FoodCanFrankBeans","FoodCanPasta","FoodCanSardines","FoodchickenCooked","FoodmuttonCooked","FoodrabbitCooked","FishCookedTrout","FishCookedTuna","FishCookedSeaBass"];
crate_items_buildables = ["forest_large_net_kit","cinder_garage_kit",["PartPlywoodPack",5],"ItemSandbagExLarge5X","park_bench_kit","ItemComboLock",["CinderBlocks",10],"ItemCanvas","ItemComboLock",["ItemLightBulb",5],"ItemLockbox",["ItemSandbag",10],["ItemTankTrap",10],["ItemWire",10],["MortarBucket",10],["PartPlankPack",5],"PartWoodPile"];
crate_items_vehicle_repair = ["PartEngine","PartFueltank","PartGeneric","PartGlass","PartVRotor","PartWheel"];
crate_items_medical = ["ItemWaterbottle","ItemAntibiotic","ItemBloodbag","ItemEpinephrine","ItemHeatPack","ItemMorphine","ItemBandage","FoodCanFrankBeans","FoodCanPasta"];
crate_items_chainbullets = ["2000Rnd_762x51_M134","200Rnd_762x51_M240","100Rnd_127x99_M2","150Rnd_127x107_DSHKM"];
crate_items_sniper = [["ItemPainkiller",5],"Skin_Sniper1_DZ","Skin_CZ_Soldier_Sniper_EP1_DZ","Skin_GUE_Soldier_Sniper_DZ"];
crate_items_president = ["ItemDocument","ItemGoldBar10oz"];
crate_items_gems = ["ItemRuby","ItemCitrine","ItemEmerald","ItemAmethyst","ItemSapphire","ItemObsidian","ItemTopaz"];
crate_items_crop_raider = ["ItemKiloHemp"];
crate_items_wood = [["ItemWoodFloorQuarter",5],["ItemWoodStairs",2],["ItemWoodLadder",2],["ItemWoodWallThird",5],"ItemWoodWallGarageDoor",["ItemWoodWallLg",3],"ItemWoodWallWithDoorLg","wood_ramp_kit"];
crate_backpacks_all = ["Patrol_Pack_DZE1","GymBag_Camo_DZE1","GymBag_Green_DZE1","Czech_Vest_Pouch_DZE1","Assault_Pack_DZE1","TerminalPack_DZE1","TinyPack_DZE1","ALICE_Pack_DZE1","TK_Assault_Pack_DZE1","School_Bag_DZE1","CompactPack_DZE1","British_ACU_DZE1","GunBag_DZE1","PartyPack_DZE1","NightPack_DZE1","SurvivorPack_DZE1","AirwavesPack_DZE1","CzechBackpack_DZE1","CzechBackpack_Camping_DZE1","CzechBackpack_OD_DZE1","CzechBackpack_DES_DZE1","CzechBackpack_3DES_DZE1","CzechBackpack_WDL_DZE1","CzechBackpack_MAR_DZE1","CzechBackpack_DMAR_DZE1","CzechBackpack_UCP_DZE1","CzechBackpack_6DES_DZE1","CzechBackpack_TAK_DZE1","CzechBackpack_NVG_DZE1","CzechBackpack_BLK_DZE1","CzechBackpack_DPM_DZE1","CzechBackpack_FIN_DZE1","CzechBackpack_MTC_DZE1","CzechBackpack_NOR_DZE1","CzechBackpack_WIN_DZE1","CzechBackpack_ATC_DZE1","CzechBackpack_MTL_DZE1","CzechBackpack_FTN_DZE1","WandererBackpack_DZE1","LegendBackpack_DZE1","CoyoteBackpack_DZE1","CoyoteBackpackDes_DZE1","CoyoteBackpackWdl_DZE1","CoyoteBackpack_Camping_DZE1","LargeGunBag_DZE1"];
crate_backpacks_large = ["CzechBackpack_DZE1","CzechBackpack_Camping_DZE1","CzechBackpack_OD_DZE1","CzechBackpack_DES_DZE1","CzechBackpack_3DES_DZE1","CzechBackpack_WDL_DZE1","CzechBackpack_MAR_DZE1","CzechBackpack_DMAR_DZE1","CzechBackpack_UCP_DZE1","CzechBackpack_6DES_DZE1","CzechBackpack_TAK_DZE1","CzechBackpack_NVG_DZE1","CzechBackpack_BLK_DZE1","CzechBackpack_DPM_DZE1","CzechBackpack_FIN_DZE1","CzechBackpack_MTC_DZE1","CzechBackpack_NOR_DZE1","CzechBackpack_WIN_DZE1","CzechBackpack_ATC_DZE1","CzechBackpack_MTL_DZE1","CzechBackpack_FTN_DZE1","WandererBackpack_DZE1","LegendBackpack_DZE1","CoyoteBackpack_DZE1","CoyoteBackpackDes_DZE1","CoyoteBackpackWdl_DZE1","CoyoteBackpack_Camping_DZE1","LargeGunBag_DZE1"];
// Random Items // By default, most of the mission crates spawn items out of the list of arrays below. You can remove or add any array entries in the list.
crate_items_random = [crate_items_food,crate_items_vehicle_repair,crate_items_medical,crate_items_chainbullets,crate_items_crop_raider,crate_items_misc];
/* END WAI MISSIONS CONFIG */
/* AUTO-CLAIM CONFIG */
use_wai_autoclaim = false; // Turn on the auto-claim feature. You should increase wai_avoid_missions to more than the distance below
ac_alert_distance = 1000; // Distance from the mission that auto-claim uses to alert closest player
ac_delay_time = 30; // Time that the auto-claim waits until it declares a claim and places a marker - time in seconds
ac_timeout = 60; // If the claimer leaves the mission area he/she has this much time to return - time in seconds
/* END AUTO-CLAIM CONFIG */
/* STATIC MISSIONS CONFIG */
wai_static_missions = false; // use static mission file
wai_custom_per_world = true; // use a custom mission file per world
/* END STATIC MISSIONS CONFIG */
WAIconfigloaded = true;

View File

@ -0,0 +1,17 @@
wai_blacklist = call {
if (toLower worldName == "chernarus") exitWith {[
[[0,16000,0],[1000,-0,0]], // Left edge of map
[[0,16000,0],[16000.0,14580.3,0]] // Top edge of map
];};
if (toLower worldName == "panthera2") exitWith {[
[[235,686,0],[758,160,0]] // Debug Island
];};
[];
};
if (count wai_blacklist > 0) then {
diag_log "WAI: blacklist Loaded";
} else {
diag_log "WAI: You are on an unsupported map! No blacklist available.";
};

View File

@ -0,0 +1,137 @@
// This file contains loot array definitions per mission
// Array format [long guns, tools, items, pistols, backpacks] - Either a number or a custom array.
// First array is for Hero missions, second is for bandit missions. Change the values to preferences.
// [[Hero Loot Array],
// [Bandit Loot Array]]
/***** Easy Missions *****/
Loot_UralAttack = [
[4,8,36,3,1], // Hero
[4,8,36,3,1] // Bandit
];
Loot_Farmer = [
[6,5,[40,crate_items_medical],3,1], // Hero
[6,5,[40,crate_items_medical],3,1] // Bandit
];
Loot_MediCamp = [
[0,0,[70,crate_items_medical],3,1], // Hero
[0,0,[70,crate_items_medical],3,1] // Bandit
];
Loot_Outpost = [
[6,4,40,2,1], // Hero
[6,4,40,2,1] // Bandit
];
Loot_ScoutPatrol = [
[4,8,36,2,1], // Hero
[4,8,36,2,1] // Bandit
];
Loot_SlaughterHouse = [
[6,5,[6,crate_items_chainbullets],2,1], // Hero
[6,5,[6,crate_items_chainbullets],2,1] // Bandit
];
/***** Medium Missions *****/
Loot_AbandonedTrader = [
[8,5,15,3,1], // Hero
[8,5,15,3,1] // Bandit
];
Loot_ArmedVehicle = [
[0,0,[25,crate_items_chainbullets],0,1], // Hero
[0,0,[25,crate_items_chainbullets],0,1] // Bandit
];
Loot_BHC = [ // Black Hawk Crash
[5,5,10,3,1], // Hero
[5,5,10,3,1] // Bandit
];
Loot_DrugBust = [
[5,5,[10,crate_items_crop_raider],3,1], // Hero
[5,5,[10,crate_items_crop_raider],3,1] // Bandit
];
Loot_Junkyard = [
[14,5,1,3,1], // Hero
[14,5,1,3,1] // Bandit
];
Loot_Patrol = [
[3,0,[2,["ItemBriefcase100oz"]],0,1], // Hero
[3,0,[2,["ItemBriefcase100oz"]],0,1] // Bandit
];
Loot_VehicleDrop = [
[3,0,[2,["ItemBriefcase100oz"]],0,1], // Hero
[3,0,[2,["ItemBriefcase100oz"]],0,1] // Bandit
];
Loot_WeaponCache = [
[10,4,0,3,1], // Hero
[10,4,0,3,1] // Bandit
];
/***** Hard Missions *****/
Loot_ArmyBase = [
[10,5,10,3,2], // Hero
[10,5,10,3,2] // Bandit
];
Loot_Base = [
[[16,ai_wep_sniper],[8,crate_tools_sniper],[3,crate_items_high_value],3,[4,crate_backpacks_large]], // Hero
[[16,ai_wep_sniper],[8,crate_tools_sniper],[3,crate_items_high_value],3,[4,crate_backpacks_large]] // Bandit
];
Loot_CannibalCave = [
[10,8,[2,crate_items_high_value],3,[2,crate_backpacks_large]], // Hero
[10,8,[2,crate_items_high_value],3,[2,crate_backpacks_large]] // Bandit
];
Loot_CapturedMV22 = [
[0,0,[80,crate_items_medical],3,1], // Hero
[0,0,[80,crate_items_medical],3,1] // Bandit
];
Loot_CropRaider = [
[6,5,[15,crate_items_crop_raider],3,3], // Hero
[6,5,[15,crate_items_crop_raider],3,3] // Bandit
];
Loot_DronePilot = [
[14,[8,crate_tools_sniper],[2,crate_items_high_value],3,[2,crate_backpacks_large]], // Hero
[14,[8,crate_tools_sniper],[2,crate_items_high_value],3,[2,crate_backpacks_large]] // Bandit
];
Loot_GemTower = [
[8,5,[4,crate_items_gems],3,2], // Hero
[8,5,[4,crate_items_gems],3,2] // Bandit
];
Loot_IkeaConvoy = [
[[1,crate_weapons_buildables],[4,crate_tools_buildable],[30,crate_items_buildables],3,4], // Hero
[[1,crate_weapons_buildables],[4,crate_tools_buildable],[30,crate_items_buildables],3,4] // Bandit
];
Loot_LumberJack = [
[6,[8,crate_tools_sniper],[15,crate_items_wood],3,[4,crate_backpacks_large]], // Hero
[6,[8,crate_tools_sniper],[15,crate_items_wood],3,[4,crate_backpacks_large]] // Bandit
];
Loot_MacDonald = [
[9,5,[15,crate_items_crop_raider],3,2], // Hero
[9,5,[15,crate_items_crop_raider],3,2] // Bandit
];
Loot_Radioshack = [
[10,5,30,3,2], // Hero
[10,5,30,3,2] // Bandit
];
Loot_Extraction = [
[[10,ai_wep_sniper],[4,crate_tools_sniper],[4,crate_items_sniper],3,2], // Hero
[[10,ai_wep_sniper],[4,crate_tools_sniper],[4,crate_items_sniper],3,2] // Bandit
];
Loot_TankColumn = [
[12,5,30,3,2], // Hero
[12,5,30,3,2] // Bandit
];
/***** Extreme Missions *****/
Loot_Firestation1 = [ // Fire Station Crate 1
[0,0,[4,crate_items_high_value],0,1], // Hero
[0,0,[4,crate_items_high_value],0,1] // Bandit
];
Loot_Firestation2 = [ // Fire Station Crate 2
[[10,ai_wep_sniper],3,20,3,1], // Hero
[[10,ai_wep_sniper],3,20,3,1] // Bandit
];
Loot_Mayors = [
[10,5,[4,crate_items_high_value],3,[2,crate_backpacks_large]], // Hero
[10,5,[4,crate_items_high_value],3,[2,crate_backpacks_large]] // Bandit
];
Loot_Presidents = [
[0,0,[40,crate_items_president],0,1], // Hero
[0,0,[40,crate_items_president],0,1] // Bandit
];

View File

@ -0,0 +1,24 @@
// This file is not loaded unless the OverWatch mod is detected.
// OverWatch Weapons
ai_wep_owpistol = ["RH_m9","RH_m9c","RH_m93r","RH_M9sd","RH_m9csd","RH_browninghp","vil_B_HP","RH_anac","RH_anacg","RH_python","RH_deagle","RH_Deagleg","RH_Deaglem","RH_Deaglemzb","RH_Deaglemz","RH_Deagles","vil_Glock","RH_g17","vil_Glock_o","RH_g17sd","RH_g18","RH_g19","RH_g19t","RH_tec9","RH_m1911","RH_m1911sd","RH_m1911old","RH_mk22","RH_mk22sd","RH_mk22v","RH_mk22vsd","RH_p38","RH_ppk","RH_mk2","RH_p226","RH_p226s","RH_bull","RH_tt33","RH_usp","RH_uspm","RH_uspsd","vil_USP45","vil_USP45SD","vil_USP","vil_USPSD","RH_vz61"]; // Overwatch Pistol Variants
ai_wep_owak = ["vil_AEK2","vil_AEK_GL","vil_AeK_3","vil_AeK_23","vil_AeK_3_K","vil_AK_105","Vil_AK_105_c","vil_AK_101","vil_AK_103","vil_AK_107","Vil_AK_107_c","vil_ak12","vil_ak12_ap","vil_ak12_gp","vil_AK_47","vil_AK_47_49","vil_AK_47_m1","vil_AK_47","vil_AK_74_N","vil_AK_74P","vil_AK_74m","vil_AK_74m_p29","vil_AK_74m_EOT_Alfa","vil_AK_74m_gp_29","vil_AK_74m_gp","vil_AK_74m_EOT","vil_AK_74m_EOT_FSB","vil_AK_74m_EOT_FSB_60","vil_AK_74m_EOT_FSB_45","vil_AK_74m_c","vil_AK_74m_k","vil_AK_74m_PSO","vil_AKM","vil_AKM_GL","vil_AKMS","vil_AKMS_GP25","vil_AKMSB","vil_AKS_47","vil_AKS_74","vil_AKS_74_gp","vil_AKS_74p_gp","vil_AKS_74p","vil_AKS_74p_45","vil_AKs_74_u","vil_AKs_74_u45","Vil_AKS_74_UB","Vil_AKS_74_UN_kobra","vil_AMD63","vil_AMD","vil_Abakan","vil_Abakan_P29","vil_Abakan_gp","vil_AK_nato_m1","vil_ASH82","vil_MPi","vil_PMI74S","vil_PMI","vil_PMIS","vil_type88_1","vil_M64","vil_M70","vil_M70B","vil_AK_nato_m80"]; // Overwatch AK Variants
ai_wep_owspare = ["vil_Galil","vil_Galil_arm","vil_SKS","gms_k98","gms_k98_knife","gms_k98_rg","gms_k98zf39"];
ai_wep_owacrsd = ["FHQ_ACR_BLK_CCO_GL_SD","FHQ_ACR_TAN_CCO_GL_SD","FHQ_ACR_SNW_CCO_GL_SD","FHQ_ACR_WDL_CCO_GL_SD","FHQ_ACR_BLK_CCO_SD","FHQ_ACR_TAN_CCO_SD","FHQ_ACR_SNW_CCO_SD","FHQ_ACR_WDL_CCO_SD","FHQ_ACR_BLK_G33_GL_SD","FHQ_ACR_TAN_G33_GL_SD","FHQ_ACR_SNW_G33_GL_SD","FHQ_ACR_WDL_G33_GL_SD","FHQ_ACR_BLK_G33_SD","FHQ_ACR_TAN_G33_SD","FHQ_ACR_SNW_G33_SD","FHQ_ACR_WDL_G33_SD","FHQ_ACR_BLK_HAMR_GL_SD","FHQ_ACR_TAN_HAMR_GL_SD","FHQ_ACR_SNW_HAMR_GL_SD","FHQ_ACR_WDL_HAMR_GL_SD","FHQ_ACR_BLK_HAMR_SD","FHQ_ACR_TAN_HAMR_SD","FHQ_ACR_SNW_HAMR_SD","FHQ_ACR_WDL_HAMR_SD","FHQ_ACR_BLK_HWS_GL_SD","FHQ_ACR_TAN_HWS_GL_SD","FHQ_ACR_SNW_HWS_GL_SD","FHQ_ACR_WDL_HWS_GL_SD","FHQ_ACR_BLK_HWS_SD","FHQ_ACR_TAN_HWS_SD","FHQ_ACR_SNW_HWS_SD","FHQ_ACR_WDL_HWS_SD","FHQ_ACR_BLK_IRN_GL_SD","FHQ_ACR_TAN_IRN_GL_SD","FHQ_ACR_SNW_IRN_GL_SD","FHQ_ACR_WDL_IRN_GL_SD","FHQ_ACR_BLK_RCO_GL_SD","FHQ_ACR_TAN_RCO_GL_SD","FHQ_ACR_SNW_RCO_GL_SD","FHQ_ACR_WDL_RCO_GL_SD","FHQ_ACR_BLK_RCO_SD","FHQ_ACR_TAN_RCO_SD","FHQ_ACR_SNW_RCO_SD","FHQ_ACR_WDL_RCO_SD","FHQ_ACR_BLK_IRN_SD","FHQ_ACR_TAN_IRN_SD","FHQ_ACR_SNW_IRN_SD","FHQ_ACR_WDL_IRN_SD"]; // Overwatch ACRSD Variants
ai_wep_owacr = ["FHQ_ACR_BLK_IRN","FHQ_ACR_TAN_IRN","FHQ_ACR_SNW_IRN","FHQ_ACR_WDL_IRN","FHQ_ACR_BLK_CCO","FHQ_ACR_TAN_CCO","FHQ_ACR_SNW_CCO","FHQ_ACR_WDL_CCO","FHQ_ACR_BLK_CCO_GL","FHQ_ACR_TAN_CCO_GL","FHQ_ACR_SNW_CCO_GL","FHQ_ACR_WDL_CCO_GL","FHQ_ACR_BLK_G33","FHQ_ACR_TAN_G33","FHQ_ACR_SNW_G33","FHQ_ACR_WDL_G33","FHQ_ACR_BLK_G33_GL","FHQ_ACR_TAN_G33_GL","FHQ_ACR_SNW_G33_GL","FHQ_ACR_WDL_G33_GL","FHQ_ACR_BLK_HAMR","FHQ_ACR_TAN_HAMR","FHQ_ACR_SNW_HAMR","FHQ_ACR_WDL_HAMR","FHQ_ACR_BLK_HAMR_GL","FHQ_ACR_TAN_HAMR_GL","FHQ_ACR_SNW_HAMR_GL","FHQ_ACR_WDL_HAMR_GL","FHQ_ACR_BLK_HWS","FHQ_ACR_TAN_HWS","FHQ_ACR_SNW_HWS","FHQ_ACR_WDL_HWS","FHQ_ACR_BLK_HWS_GL","FHQ_ACR_TAN_HWS_GL","FHQ_ACR_SNW_HWS_GL","FHQ_ACR_WDL_HWS_GL","FHQ_ACR_BLK_IRN_GL","FHQ_ACR_TAN_IRN_GL","FHQ_ACR_SNW_IRN_GL","FHQ_ACR_WDL_IRN_GL","FHQ_ACR_BLK_RCO","FHQ_ACR_TAN_RCO","FHQ_ACR_SNW_RCO","FHQ_ACR_WDL_RCO","FHQ_ACR_BLK_RCO_GL","FHQ_ACR_TAN_RCO_GL","FHQ_ACR_SNW_RCO_GL","FHQ_ACR_WDL_RCO_GL"]; // Overwatch ACR Variants
ai_wep_owscar = ["SCAR_L_CQC_CCO_SD","SCAR_L_CQC","SCAR_L_CQC_Holo","SCAR_L_CQC_EGLM_Holo","SCAR_L_STD_EGLM_RCO","SCAR_L_STD_HOLO","SCAR_L_STD_Mk4CQT","SCAR_H_CQC_CCO","SCAR_H_CQC_CCO_SD","SCAR_H_STD_EGLM_Spect","SCAR_H_LNG_Sniper","SCAR_H_LNG_Sniper_SD"]; // Overwatch SCAR Variants
ai_wep_owsmg = ["vil_9a91","vil_9a91_c","vil_9a91_csd","vil_VAL","vil_VAL_C","vil_Groza_HG","vil_Groza_GL","vil_Groza_SC","vil_Groza_SD","vil_Vikhr","vil_vsk94","vil_MP5_EOTech","vil_MP5SD_EOTech","vil_uzimini","vil_uzimini_SD","vil_uzi","vil_uzi_c","vil_uzi_SD"]; // Overwatch SMG Variants
ai_wep_owsniper = ["USSR_cheytacM200","USSR_cheytacM200_sd","vil_SVD_63","vil_SVD_N","vil_SVD_M","vil_SVD_P21","vil_SVD_S","FHQ_MSR_DESERT","FHQ_MSR_NV_DESERT","FHQ_MSR_NV_SD_DESERT","FHQ_MSR_SD_DESERT","FHQ_RSASS_TAN","FHQ_RSASS_SD_TAN","vil_SV_98_69","vil_SV_98","vil_SV_98_SD","vil_SVDK","FHQ_XM2010_DESERT","FHQ_XM2010_NV_DESERT","FHQ_XM2010_NV_SD_DESERT","FHQ_XM2010_SD_DESERT"]; // Overwatch Sniper Variants
ai_wep_owtar = ["RH_ctar21","RH_ctar21glacog","RH_ctar21m","RH_ctar21mgl","RH_star21"]; // Overwatch TAR Variants
ai_wep_owg3 = ["vil_AG3","vil_G3a2","vil_G3a3","vil_G3an","vil_G3anb","vil_G3SG1","vil_G3sg1b","vil_G3TGS","vil_G3TGSb","vil_G3ZF","vil_G3zfb","vil_G3a4","vil_G3a4b"]; // Overwatch G3 Variants
ai_wep_owmas = ["RH_masacog","RH_masaim","RH_masbaim","RH_masb","RH_masbeotech","RH_mas","RH_massd","RH_massdacog","RH_masbsdacog","RH_massdaim","RH_masbsdaim","RH_masbsd","RH_massdeotech","RH_masbsdeotech"]; // Overwatch MAS Variants
ai_wep_owlmg = ["vil_RPK75_Romania","vil_M240_B","vil_M249_Para","skavil_M60","skavil_M60e3","vil_Mg3","vil_MG4","vil_MG4E","vil_PKP","vil_PKP_EOT","vil_PK","vil_PKM","vil_RPD","vil_RPK","vil_RPK75","vil_RPK74","vil_RPK74M","vil_RPK74M_P29","vil_RPK75_M72","vil_zastava_m84"]; // Overwatch LMG Variants
ai_wep_owhk417 = ["RH_hk417","RH_hk417acog","RH_hk417aim","RH_hk417s","RH_hk417sacog","RH_hk417saim","RH_hk417seotech","RH_hk417eotech","RH_hk417sd","RH_hk417sdacog","RH_hk417sdaim","RH_hk417sdeotech","RH_hk417sdsp","RH_hk417sp","RH_hk417sglacog","RH_hk417sgl","RH_hk417sglaim","RH_hk417sgleotech"]; // Overwatch HK417 Variants
ai_wep_owhk416 = ["RH_hk416","RH_hk416glacog","RH_hk416gl","RH_hk416aim","RH_hk416glaim","RH_hk416s","RH_hk416sacog","RH_hk416sglacog","RH_hk416saim","RH_hk416sglaim","RH_hk416seotech","RH_hk416sgleotech","RH_hk416sgl","RH_hk416eotech","RH_hk416gleotech","RH_hk416sd","RH_hk416sdgl","RH_hk416sdglaim","RH_hk416sdeotech","RH_hk416sdgleotech"]; // Overwatch HK416
ai_wep_owg36 = ["vil_AG36KA4","vil_AG36KV","vil_G36KSKdes","vil_G36KA4","vil_G36KSKES","vil_G36KSKdesES","vil_G36KES","vil_G36KVZ","vil_G36KSK","vil_G36VA4Eot","vil_G36KV3","vil_G36KVA4","vil_G36KV3Des","vil_G36VA4","vil_AG36","vil_G36a2","vil_AG36A2","vil_G36CC","vil_G36E"]; // Overwatch G36 Variants
ai_wep_owdmr = ["vil_HK417s","vil_M110","vil_M110sd","RH_m14","vil_M14G","RH_m14acog","RH_m14aim","RH_m14eot","RH_m1s","RH_m1sacog","RH_m1saim","RH_m1seot","RH_m1sshd","RH_m1ssp","RH_m1st","RH_m1stacog","RH_m1staim","RH_m1steot","RH_m1stshd","RH_m1stsp","RH_m21","vil_M21G","RH_sc2","RH_sc2acog","RH_sc2aim","RH_sc2eot","RH_sc2shd","RH_sc2sp","vil_SR25","vil_SR25SD"]; // Overwatch DMR Variants
//This will overwrite the variable of the same name in config.sqf
ai_wep_random = [ai_wep_g36,ai_wep_m16,ai_wep_m4,ai_wep_sa58,ai_wep_l85,ai_wep_ak,ai_wep_sniper,ai_wep_machine,ai_wep_owacr,ai_wep_owak,ai_wep_owspare,ai_wep_owacrsd,ai_wep_owscar,ai_wep_owsmg,ai_wep_owsniper,ai_wep_owtar,ai_wep_owg3,ai_wep_owmas,ai_wep_owlmg,ai_wep_owhk417,ai_wep_owhk416,ai_wep_owg36,ai_wep_owdmr];
diag_log "WAI: Overpoch Config File Loaded";

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,77 @@
WAI_Overpoch = isClass (configFile >> "CfgWeapons" >> "USSR_cheytacM200");
// Compile all Functions
spawn_group = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\spawn_group.sqf";
spawn_static = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\spawn_static.sqf";
group_waypoints = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\group_waypoints.sqf";
heli_para = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\heli_para.sqf";
heli_patrol = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\heli_patrol.sqf";
vehicle_patrol = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\vehicle_patrol.sqf";
on_kill = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\on_kill.sqf";
dynamic_crate = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\dynamic_crate.sqf";
static_spawn_manager = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\static_spawn_manager.sqf";
find_position = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\find_position.sqf";
load_ammo = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\load_ammo.sqf";
patrol_winorfail = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\patrol_winorfail.sqf";
mission_winorfail = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\mission_winorfail.sqf";
minefield = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\minefield.sqf";
custom_publish = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\custom_publish_vehicle.sqf";
wai_spawnObjects = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\spawn_objects.sqf";
wai_air_drop = compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\airdrop_winorfail.sqf";
call compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\position_functions.sqf";
call compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\compile\functions.sqf";
if(isNil("DZMSInstalled")) then {
createCenter EAST;
createCenter RESISTANCE;
WEST setFriend [EAST,0];
WEST setFriend [RESISTANCE,0];
EAST setFriend [WEST,0];
EAST setFriend [RESISTANCE,0];
RESISTANCE setFriend [EAST,0];
RESISTANCE setFriend [WEST,0];
} else {
createCenter RESISTANCE;
EAST setFriend [RESISTANCE,0];
WEST setFriend [RESISTANCE,0];
RESISTANCE setFriend [EAST,0];
RESISTANCE setFriend [WEST,0];
};
WAIconfigloaded = false;
wai_markedPos = [];
wai_static_data = [0,[],[],[]]; // [AI Count, UnitGroups, Vehicles to Monitor, Crates]
WAI_MarkerReady = true;
wai_mission_data = [];
h_missionsrunning = 0;
b_missionsrunning = 0;
wai_h_starttime = diag_tickTime;
wai_b_starttime = diag_tickTime;
call compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\config.sqf";
call compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\configs\mission_loot.sqf";
if (WAI_Overpoch) then {
call compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\configs\overwatch.sqf";
};
if (wai_user_spawnpoints) then {
call compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\configs\spawnpoints.sqf";
};
if (wai_use_blacklist) then {
call compile preprocessFileLineNumbers "\z\addons\dayz_server\WAI\configs\blacklist.sqf";
};
if(wai_static_missions) then {
execVM "\z\addons\dayz_server\WAI\static\init.sqf";
};

View File

@ -0,0 +1,184 @@
// Updated mission example for DayZ Epoch 1.0.6+. Please review missions in the hero and bandit folder for additional examples.
// Include local variables in this list
private ["_messages","_missionType","_aiType","_mission","_position","_num"];
// Get mission number, important we do this early
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
// Get a safe position 80 meters from the nearest object. You can change this number.
_position = [80] call find_position;
// Sends a message to the server's rpt file
diag_log format["WAI: Mission Test Mission started at %1",_position];
// Crate Spawning Format - [loot, position, crate type(array or class name), [x-offset, y-offset,z-coordinate(optional)],direction(optional)]
// Multiple crates can be spawned. See Firestation mission for example.
// See lines 203-205 in config.sqf for crate classname arrays
// Dynamic loot array example
// Parameters: 0: _crate
// 1: Max number of long guns OR [MAX number of long guns,gun_array]
// 2: Max number of tools OR [MAX number of tools,tool_array]
// 3: Max number of items OR [MAX number of items,item_array]
// 4: Max number of pistols OR [MAX number of pistol,pistol_array]
// 5: Max number of backpacks OR [MAX number of backpacks,backpack_array]
//[16,[8,crate_tools_sniper],[3,crate_items_high_value],3,[4,crate_backpacks_large]] - example of calling custom arrays instead of default
// Save loot array to a variable
_loot = [[1,crate_weapons_buildables],[4,crate_tools_buildable],[30,crate_items_buildables],3,4];
//Spawn Crate with loot variable in first position.
[[
[_loot,crates_large,[0,0]] // [loot variable, crate array, 2d offsets]
],_position,_mission] call wai_spawnCrate;
//Spawn Crate with fixed classname and loot array not previously save to variable. It works either way.
[[
[[8,5,15,3,2],"USBasicWeaponsBox",[.3,0,-.01],30] // [[loot array, crate classname, 3d offests], direction]
],_position,_mission] call wai_spawnCrate;
// Mission object Spawning Format - [class name, [x-offset, y-offset,z-offset(optional)],direction(optional)]
// Offsets are modifications to the [x,y,z] coordinates relative to the [0,0,0] mission center position.
// If no z-coordinate or direction are provided, then the function will set them to 0.
_baserunover = [[
["land_fortified_nest_big",[-40,0],90],
["land_fortified_nest_big",[40,0],270],
["land_fortified_nest_big",[0,-40]],
["land_fortified_nest_big",[0,40],180],
["Land_Fort_Watchtower",[-10,0]],
["Land_Fort_Watchtower",[10,0],180],
["Land_Fort_Watchtower",[0,-10],270],
["Land_Fort_Watchtower",[0,10],90]
],_position,_mission] call wai_spawnObjects;
// Group Spawn Examples
// Parameters: 0: Position
// 1: Unit Count
// 2: Unit Skill ("easy","medium","hard","extreme" or "random")
// 3: Guns (gun or [gun,launcher])
// Guns options : (0 = ai_wep_assault, 1 = ai_wep_machine, 2 = ai_wep_sniper, "random" = random weapon, "Unarmed" = no weapon)
// Launcher options: (at = ai_wep_launchers_AT, aa = ai_wep_launchers_AA or "classname")
// 4: Magazine Count
// 5: Backpack ("random" or "classname")
// 6: Skin ("Hero","bandit","random","special" or "classname")
// 7: Gear (0:ai_gear0, 1:ai_gear1, 2:ai_gear2, 3:ai_gear3, 4:ai_gear4 or "random")
// 8: AI Type ("bandit","Hero","special" or ["type", #] format to overwrite default gain amount) ***Used to determine humanity gain or loss***
// 9: Mission variable from line 7 (_mission)
_num = round (random 3) + 4;
[[_position select 0, _position select 1, 0],_num,"extreme",["random","at"],4,"random","bandit","random",["bandit",150],_mission] call spawn_group;
[[_position select 0, _position select 1, 0],4,"hard","random",4,"random","bandit","random","bandit",_mission] call spawn_group;
[[_position select 0, _position select 1, 0],4,"random","random",4,"random","bandit","random","bandit",_mission] call spawn_group;
[[_position select 0, _position select 1, 0],4,"random","random",4,"random","bandit","random","bandit",_mission] call spawn_group;
[[_position select 0, _position select 1, 0],4,"random","random",4,"random","bandit","random","bandit",_mission] call spawn_group;
// Humvee Patrol Example
// Parameters: 0: Patrol position
// 1: Starting position
// 2: Patrol radius
// 3: Number of Waypoints
// 4: Vehicle classname
// 5: Unit Skill ("easy","medium","hard","extreme" or "random")
// 6: Skin ("Hero","bandit","random","special" or "classname")
// 7: AI Type ("bandit","Hero" or "special") ***Used to determine humanity gain or loss***
// 8: Mission Variable from line 7 (_mission)
[[(_position select 0) + 100, _position select 1, 0],[(_position select 0) + 100, _position select 1, 0],50,2,"HMMWV_Armored","random","bandit","bandit",_mission] call vehicle_patrol;
// Static Turret Examples
// Parameters: 0: Spawn positions
// 1: Classname ("classname" or "random" to pick from ai_static_weapons)
// 2: Unit Skill ("easy","medium","hard","extreme" or "random") ***NO effect if ai_static_skills = true;***
// 3: Skin ("Hero","bandit","random","special" or "classname")
// 4: AI Type ("bandit","Hero" or "special") ***Used to determine humanity gain or loss***
// 5: Gun (0:ai_wep_assault 1:ai_wep_machine 2:ai_wep_sniper or "random") ***NO effect if ai_static_useweapon = false;***
// 6: Magazine Count ***NO effect if ai_static_useweapon = false;***
// 7: Backpack ("random" or "classname") ***NO effect if ai_static_useweapon = false;***
// 8: Gear (0:ai_gear0, 1:ai_gear1, 2:ai_gear2, 3:ai_gear3, 4:ai_gear4 or "random") ***NO effect if ai_static_useweapon = false;***
// 9: Mission variable from line 7 (_mission)
};
[[
[(_position select 0) - 10, (_position select 1) + 10, 0],
[(_position select 0) + 10, (_position select 1) - 10, 0],
[(_position select 0) + 10, (_position select 1) + 10, 0],
[(_position select 0) - 10, (_position select 1) - 10, 0]
],"M2StaticMG","easy","bandit","bandit",0,2,"random","random",_mission] call spawn_static;
// Heli Paradrop Example
// Parameters: 0: Paradrop position
// 1: Trigger radius
// 2: Vehicle classname
// 3: Direction of approach for the helicopter. Options: "North","South","East","West"
// 4: Random distance from the mission the helicopter should start. [min distance, max distance].
// 5: Fly in height of the helicopter. Be careful that the height is not too low or the AI might die when they hit the ground
// 6: Time in seconds between each deployed paratrooper. Higher number means paradropped AI will be more spread apart. Time of 0 means they all jump out rapidly.
// 7: Distance from the mission the helicopter should start dropping paratroopers
// 8: Amount of paratroopers
// 9: Unit Skill ("easy","medium","hard","extreme" or "random") ***NO effect if ai_static_skills = true;***
// 10: Gun (0:ai_wep_assault 1:ai_wep_machine 2:ai_wep_sniper or "random")
// 11: Magazine Count
// 12: Backpack ("random" or "classname")
// 13: Skin ("Hero","bandit","random","special" or "classname")
// 14: Gear (0:ai_gear0, 1:ai_gear1, 2:ai_gear2, 3:ai_gear3, 4:ai_gear4 or "random")
// 15: AI Type ("bandit","Hero" or "special") ***Used to determine humanity gain or loss***
// 16: Heli stay and fight after troop deployment? (true or false)
// 17: Mission variable from line 7 (_mission)
[_position,400,"UH60M_EP1_DZE","East",[3000,4000],150,1.0,200,10,"Random","Random",4,"Random","Hero","Random","Hero",false,_mission] spawn heli_para;
// Assassination target example
// This is the same as normal group spawns but we assign it to a variable instead for use in the trigger below (if there are multiple units in this group you'll need to kill them all)
_unitGroup = [[_position select 0, _position select 1, 0],1,"hard","random",4,"random","special","random","bandit",_mission] call spawn_group;
// Spawn Mission Vehicle Example
// Parameters: 0: Classname or Array from config.sqf
// 1: Position
// 2: Mission variable
// 3: Fixed vehicle position? If false the mission will pick a random position for the vehicle
// 4: Optional direction. If no number provided the mission will select a random direction
["MV22_DZ",[(_position select 0) - 20.5,(_position select 1) - 5.2,0], _mission,true,-82.5] call custom_publish; // with declared vehicle class, optional fixed position, and optional direction
[cargo_trucks,_position,_mission] call custom_publish; // with vehicle array, random position, and random direction
_vehicle = [cargo_trucks,_position,_mission] call custom_publish; // Same as above but saved to variable if necessary
// Mission messages examples - they go into an array
"A Mission has spawned, hurry up to claim the loot!", // mission announcement - this message displays when the mission starts
"The mission was complete/objective reached", // mission success - this message displays when the mission is completed by a player
"The mission timed out and nobody was in the vicinity" // mission fail - this message displays when a mission times out.
// Example with localized message strings
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_MISSIONNAME_ANNOUNCE","STR_CL_HERO_MISSIONNAME_WIN","STR_CL_HERO_MISSIONNAME_FAIL"];
} else {
["STR_CL_BANDIT_MISSIONNAME_ANNOUNCE","STR_CL_BANDIT_MISSIONNAME_WIN","STR_CL_BANDIT_MISSIONNAME_FAIL"];
};
// Array of options to send to mission_winorfail with non-localized announcements
[
_mission, // Mission Variable - This is a number.
_position, // Position of mission
"Hard", // Difficulty "Easy", "Medium", "Hard", "Extreme",
"Name of Mission", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission?
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup], : crate - you have to get within 20 meters of the crate and kill at least the number of ai defined by variable wai_kill_percent in config.sqf. kill = you have to kill all of the AI. assassinate - you have to kill a special ai (see Mayor's Mansion mission).
_messages
] call mission_winorfail;
// Array of options to send to mission_winorfail with localized announcements. You have to create localized strings in the community stringtable for this to work
[
_mission, // Mission number
_position, // Position of mission
"Hard", // Difficulty
"Lunch break Convoy", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,192 @@
// Updated single location mission example for DayZ Epoch 1.0.6+ by JasonTM. Please review missions in the hero and bandit folders for additional examples.
// Include local variables in this list
private ["_messages","_missionType","_aiType","_baserunover","_mission","_directions","_position","_crate","_crate_type","_num"];
// Get mission number, important we do this early
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
// Declare your static spawn point. You can also use static positions for your buildings, vehicles, and crate.
// Normally with the z coordinate you will just use 0 because 0 means that it is on the ground.
// Round the coordinates you get from the editor to whole numbers to make it easier. Ex. 1783.42963 is just 1783.
_position = [x, y, 0];
// If this is a hero mission use this line - delete if not
if !([_position] call wai_validSpotCheck) exitWith {h_missionsrunning = h_missionsrunning - 1; wai_mission_data set [_mission, -1]; WAI_MarkerReady = true;};
// if this is a bandit mission use this line - delete if not
if !([_position] call wai_validSpotCheck) exitWith {b_missionsrunning = b_missionsrunning - 1; wai_mission_data set [_mission, -1]; WAI_MarkerReady = true;};
// Sends a message to the server's rpt file
diag_log format["WAI: Mission Test Mission started at %1",_position];
// Crate Spawning Format - [loot, position, crate type(array or class name), [x-offset, y-offset,z-coordinate(optional)],direction(optional)]
// Multiple crates can be spawned. See Firestation mission for example.
// See lines 203-205 in config.sqf for crate classname arrays
// Dynamic loot array example
// Parameters: 0: _crate
// 1: Max number of long guns OR [MAX number of long guns,gun_array]
// 2: Max number of tools OR [MAX number of tools,tool_array]
// 3: Max number of items OR [MAX number of items,item_array]
// 4: Max number of pistols OR [MAX number of pistol,pistol_array]
// 5: Max number of backpacks OR [MAX number of backpacks,backpack_array]
//[16,[8,crate_tools_sniper],[3,crate_items_high_value],3,[4,crate_backpacks_large]] - example of calling custom arrays instead of default
// Save loot array to a variable
_loot = [[1,crate_weapons_buildables],[4,crate_tools_buildable],[30,crate_items_buildables],3,4];
//Spawn Crate with loot variable in first position.
[[
[_loot,crates_large,[0,0]] // [loot variable, crate array, 2d offsets]
],_position,_mission] call wai_spawnCrate;
//Spawn Crate with fixed classname and loot array not previously save to variable. It works either way.
[[
[[8,5,15,3,2],"USBasicWeaponsBox",[.3,0,-.01],30] // [[loot array, crate classname, 3d offests], direction]
],_position,_mission] call wai_spawnCrate;
// Mission object Spawning Format - [class name, [x-offset, y-offset,z-offset(optional)],direction(optional)]
// Offsets are modifications to the [x,y,z] coordinates relative to the [0,0,0] mission center position.
// If no z-coordinate or direction are provided, then the function will set them to 0.
_baserunover = [[
["land_fortified_nest_big",[-40,0],90],
["land_fortified_nest_big",[40,0],270],
["land_fortified_nest_big",[0,-40]],
["land_fortified_nest_big",[0,40],180],
["Land_Fort_Watchtower",[-10,0]],
["Land_Fort_Watchtower",[10,0],180],
["Land_Fort_Watchtower",[0,-10],270],
["Land_Fort_Watchtower",[0,10],90]
],_position,_mission] call wai_spawnObjects;
// Group Spawn Examples
// Parameters: 0: Position
// 1: Unit Count
// 2: Unit Skill ("easy","medium","hard","extreme" or "random")
// 3: Guns (gun or [gun,launcher])
// Guns options : (0 = ai_wep_assault, 1 = ai_wep_machine, 2 = ai_wep_sniper, "random" = random weapon, "Unarmed" = no weapon)
// Launcher options: (at = ai_wep_launchers_AT, aa = ai_wep_launchers_AA or "classname")
// 4: Magazine Count
// 5: Backpack ("random" or "classname")
// 6: Skin ("Hero","bandit","random","special" or "classname")
// 7: Gear (0:ai_gear0, 1:ai_gear1, 2:ai_gear2, 3:ai_gear3, 4:ai_gear4 or "random")
// 8: AI Type ("bandit","Hero","special" or ["type", #] format to overwrite default gain amount) ***Used to determine humanity gain or loss***
// 9: Mission variable from line 9 (_mission)
_num = round (random 3) + 4;
[[_position select 0, _position select 1, 0],_num,"extreme",["random","at"],4,"random","bandit","random",["bandit",150],_mission] call spawn_group;
[[_position select 0, _position select 1, 0],4,"hard","random",4,"random","bandit","random","bandit",_mission] call spawn_group;
[[_position select 0, _position select 1, 0],4,"random","random",4,"random","bandit","random","bandit",_mission] call spawn_group;
[[_position select 0, _position select 1, 0],4,"random","random",4,"random","bandit","random","bandit",_mission] call spawn_group;
[[_position select 0, _position select 1, 0],4,"random","random",4,"random","bandit","random","bandit",_mission] call spawn_group;
// Humvee Patrol Example
// Parameters: 0: Patrol position
// 1: Starting position
// 2: Patrol radius
// 3: Number of Waypoints
// 4: Vehicle classname
// 5: Unit Skill ("easy","medium","hard","extreme" or "random")
// 6: Skin ("Hero","bandit","random","special" or "classname")
// 7: AI Type ("bandit","Hero" or "special") ***Used to determine humanity gain or loss***
// 8: Mission Variable
[[(_position select 0) + 100, _position select 1, 0],[(_position select 0) + 100, _position select 1, 0],50,2,"HMMWV_Armored","random","bandit","bandit",_mission] call vehicle_patrol;
// Static Turret Examples
// Parameters: 0: Spawn positions
// 1: Classname ("classname" or "random" to pick from ai_static_weapons)
// 2: Unit Skill ("easy","medium","hard","extreme" or "random") ***NO effect if ai_static_skills = true;***
// 3: Skin ("Hero","bandit","random","special" or "classname")
// 4: AI Type ("bandit","Hero" or "special") ***Used to determine humanity gain or loss***
// 5: Gun (0:ai_wep_assault 1:ai_wep_machine 2:ai_wep_sniper or "random") ***NO effect if ai_static_useweapon = false;***
// 6: Magazine Count ***NO effect if ai_static_useweapon = false;***
// 7: Backpack ("random" or "classname") ***NO effect if ai_static_useweapon = false;***
// 8: Gear (0:ai_gear0, 1:ai_gear1, 2:ai_gear2, 3:ai_gear3, 4:ai_gear4 or "random") ***NO effect if ai_static_useweapon = false;***
// 9: Mission variable from line 7 (_mission)
[[
[(_position select 0) - 10, (_position select 1) + 10, 0],
[(_position select 0) + 10, (_position select 1) - 10, 0],
[(_position select 0) + 10, (_position select 1) + 10, 0],
[(_position select 0) - 10, (_position select 1) - 10, 0]
],"M2StaticMG","easy","bandit","bandit",0,2,"random","random",_mission] call spawn_static;
// Heli Paradrop Example
// Parameters: 0: Paradrop position
// 1: Trigger radius
// 2: Vehicle classname
// 3: Direction of approach for the helicopter. Options: "North","South","East","West"
// 4: Random distance from the mission the helicopter should start. [min distance, max distance].
// 5: Fly in height of the helicopter. Be careful that the height is not too low or the AI might die when they hit the ground
// 6: Time in seconds between each deployed paratrooper. Higher number means paradropped AI will be more spread apart. Time of 0 means they all jump out rapidly.
// 7: Distance from the mission the helicopter should start dropping paratroopers
// 8: Amount of paratroopers
// 9: Unit Skill ("easy","medium","hard","extreme" or "random") ***NO effect if ai_static_skills = true;***
// 10: Gun (0:ai_wep_assault 1:ai_wep_machine 2:ai_wep_sniper or "random")
// 11: Magazine Count
// 12: Backpack ("random" or "classname")
// 13: Skin ("Hero","bandit","random","special" or "classname")
// 14: Gear (0:ai_gear0, 1:ai_gear1, 2:ai_gear2, 3:ai_gear3, 4:ai_gear4 or "random")
// 15: AI Type ("bandit","Hero" or "special") ***Used to determine humanity gain or loss***
// 16: Heli stay and fight after troop deployment? (true or false)
// 17: Mission variable from line 7 (_mission)
[_position,400,"UH60M_EP1_DZE","East",[3000,4000],150,1.0,200,10,"Random","Random",4,"Random","Hero","Random","Hero",false,_mission] spawn heli_para;
// Assassination target example
// This is the same as normal group spawns but we assign it to a variable instead for use in the trigger below (if there are multiple units in this group you'll need to kill them all)
_unitGroup = [[_position select 0, _position select 1, 0],1,"hard","random",4,"random","special","random","bandit",_mission] call spawn_group;
// Spawn Mission Vehicle Example
// Parameters: 0: Classname or Array from config.sqf
// 1: Position
// 2: Mission variable
// 3: Fixed vehicle position? If false the mission will pick a random position for the vehicle
// 4: Optional direction. If no number provided the mission will select a random direction
["MV22_DZ",[(_position select 0) - 20.5,(_position select 1) - 5.2,0], _mission,true,-82.5] call custom_publish; // with declared vehicle class, optional fixed position, and optional direction
[cargo_trucks,_position,_mission] call custom_publish; // with vehicle array, random position, and random direction
_vehicle = [cargo_trucks,_position,_mission] call custom_publish; // Same as above but saved to variable if necessary
// Mission messages examples - they go into an array
"A Mission has spawned, hurry up to claim the loot!", // mission announcement - this message displays when the mission starts
"The mission was complete/objective reached", // mission success - this message displays when the mission is completed by a player
"The mission timed out and nobody was in the vicinity" // mission fail - this message displays when a mission times out.
// Example with localized message strings
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_MISSIONNAME_ANNOUNCE","STR_CL_HERO_MISSIONNAME_WIN","STR_CL_HERO_MISSIONNAME_FAIL"];
} else {
["STR_CL_BANDIT_MISSIONNAME_ANNOUNCE","STR_CL_BANDIT_MISSIONNAME_WIN","STR_CL_BANDIT_MISSIONNAME_FAIL"];
};
// Array of options to send to mission_winorfail with non-localized announcements
[
_mission, // Mission Variable - This is a number.
_position, // Position of mission
"Hard", // Difficulty "Easy", "Medium", "Hard", "Extreme",
"Name of Mission", // Name of Mission
_missionType, // Mission Type: Hero or Bandit
true, // show mission marker?
true, // make minefields available for this mission?
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup], : crate - you have to get within 20 meters of the crate and kill at least the number of ai defined by variable wai_kill_percent in config.sqf. kill = you have to kill all of the AI. assassinate - you have to kill a special ai (see Mayor's Mansion mission).
_messages
] call mission_winorfail;
// Array of options to send to mission_winorfail with localized announcements. You have to create localized strings in the community stringtable for this to work
[
_mission, // Mission number
_position, // Position of mission
"Hard", // Difficulty
"Lunch break Convoy", // Name of Mission
_missionType, // Mission Type: Hero or Bandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,69 @@
private ["_mission","_position","_rndnum","_messages","_aiType","_missionType","_loot"];
// Get mission number, important we do this early
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[%2] Abandoned Trader]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_AbandonedTrader select 0;} else {Loot_AbandonedTrader select 1;};
//Spawn Crates
[[
[_loot,crates_medium,[.3,0]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["Land_Misc_Garb_Heap_EP1",[-0.9,4.2,-0.01]],
["Land_Misc_Garb_Heap_EP1",[-18,1.5,-0.01]],
["Land_Shed_W03_EP1",[-4,4.7,-0.01]],
["Land_Shed_M01_EP1",[-10,5,-0.01]],
["Land_Market_shelter_EP1",[-10,-0.4,-0.01]],
["Land_Market_stalls_02_EP1",[-10,-5.8,-0.01],-2.5],
["Land_Market_stalls_01_EP1",[11,5,-0.01],-0.34],
["Land_Market_stalls_02_EP1",[10,-5.8,-0.01]],
["Land_Market_shelter_EP1",[10,-0.4,-0.01],2.32],
["Land_transport_crates_EP1",[22,2,-0.01],-43.88],
["Fort_Crate_wood",[18,-1,-0.01]],
["UralWreck",[27,-3,-0.01],-67.9033],
["Land_Canister_EP1",[18,1.4,-0.01],28.73],
["MAP_ground_garbage_square5",[13.6,-2,-0.01]],
["MAP_ground_garbage_square5",[-16,-2,-0.01]],
["MAP_ground_garbage_long",[-0.4,-2,-0.01]],
["MAP_garbage_misc",[-8,-2,-0.01]]
],_position,_mission] call wai_spawnObjects;
//Troops
[_position,5,"Medium",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Medium","Random",4,"Random","Hero","Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 4);
[_position,_rndnum,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 4);
[_position,_rndnum,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Static Guns
[[
[(_position select 0) + 0.1, (_position select 1) + 20, 0],
[(_position select 0) + 0.1, (_position select 1) - 20, 0]
],"M2StaticMG","Easy",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_ABANDONEDTRADER_ANNOUNCE","STR_CL_HERO_ABANDONEDTRADER_WIN","STR_CL_HERO_ABANDONEDTRADER_FAIL"];
} else {
["STR_CL_BANDIT_ABANDONEDTRADER_ANNOUNCE","STR_CL_BANDIT_ABANDONEDTRADER_WIN","STR_CL_BANDIT_ABANDONEDTRADER_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Medium", // Difficulty
"Abandoned Trader", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,97 @@
local _mission = count WAI_MissionData -1;
local _aiType = _this select 0; // "Bandit" or "Hero"
local _position = [30] call WAI_FindPos;
local _vehclass = WAI_APC call BIS_fnc_selectRandom; //Armed Land Vehicle
local _vehname = getText (configFile >> "CfgVehicles" >> _vehclass >> "displayName");
local _name = format["Disabled %1",_vehname];
local _startTime = diag_tickTime;
local _difficulty = "Medium";
local _localized = ["STR_CL_MISSION_BANDIT", "STR_CL_MISSION_HERO"] select (_aiType == "Hero");
local _localName = ["STR_CL_ARMEDVEHICLE_TITLE",_vehname];
local _text = [_localized,_localName];
diag_log format["WAI: %1 %2 started at %3.",_aiType,_name,_position];
local _messages = if (_aiType == "Hero") then {
["STR_CL_HERO_ARMEDVEHICLE_ANNOUNCE","STR_CL_HERO_ARMEDVEHICLE_WIN","STR_CL_HERO_ARMEDVEHICLE_FAIL"];
} else {
["STR_CL_BANDIT_ARMEDVEHICLE_ANNOUNCE","STR_CL_BANDIT_ARMEDVEHICLE_WIN","STR_CL_BANDIT_ARMEDVEHICLE_FAIL"];
};
////////////////////// Do not edit this section ///////////////////////////
local _markers = [1,1,1,1];
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
_markers set [0, [_position, "WAI" + str(_mission), "ColorYellow", "", "ELLIPSE", "Solid", [300,300], [], 0]];
_markers set [1, [_position, "WAI" + str(_mission) + "dot", "ColorBlack", "mil_dot", "", "", [], _text, 0]];
if (WAI_AutoClaim) then {_markers set [2, [_position, "WAI" + str(_mission) + "auto", "ColorRed", "", "ELLIPSE", "Border", [WAI_AcAlertDistance,WAI_AcAlertDistance], [], 0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
_markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
WAI_MarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _position];
local _posIndex = count DZE_MissionPositions - 1;
// Send announcement
[_difficulty,(_messages select 0)] call WAI_Message;
// Wait until a player is within range or timeout is reached.
local _timeout = false;
local _claimPlayer = objNull;
while {WAI_WaitForPlayer && !_timeout && {isNull _claimPlayer}} do {
_claimPlayer = [_position, WAI_TimeoutDist] call isClosestPlayer;
if (diag_tickTime - _startTime >= (WAI_Timeout * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call WAI_AbortMission;
[_difficulty,(_messages select 2)] call WAI_Message;
diag_log format["WAI: %1 %2 aborted.",_aiType,_name,_position];
};
//////////////////////////////// End //////////////////////////////////////
//Spawn Crates
[[
[[0,0,[20,WAI_VehAmmo],0,1],WAI_CrateMd,[0,5]]
],_position,_mission] call WAI_SpawnCrate;
//Troops
[_position, 5, _difficulty, "Random", "AT", "Random", _aiType, "Random", _aiType, _mission] call WAI_SpawnGroup;
[_position, 5, _difficulty, "Random", "AA", "Random", "Hero", "Random", _aiType, _mission] call WAI_SpawnGroup;
[_position,(ceil random 4),_difficulty,"Random","","Random",_aiType,"Random",_aiType,_mission] call WAI_SpawnGroup;
[_position,(ceil random 4),_difficulty,"Random","","Random",_aiType,"Random",_aiType,_mission] call WAI_SpawnGroup;
//Static Guns
[[
[(_position select 0) + 29,(_position select 1) + 7, 0],
[(_position select 0) + 13,(_position select 1) + 42, 0],
[(_position select 0),(_position select 1) + 10, 0]
],"Random",_difficulty,_aiType,_aiType,"Random","Random","Random",_mission] call WAI_SpawnStatic;
//Spawn vehicles
local _vehicle = [_vehclass,_position,_mission] call WAI_PublishVeh;
[_vehicle,_vehclass,2] call WAI_LoadAmmo;
[
_mission, // Mission number
_position, // Position of mission
_difficulty, // Difficulty
_name, // Name of Mission
_localName, // localized marker text
_aiType, // "Bandit" or "Hero"
_markerIndex,
_posIndex,
_claimPlayer,
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] spawn WAI_MissionMonitor;

View File

@ -0,0 +1,55 @@
private ["_mission","_rndnum","_vehname","_position","_vehclass","_messages","_aiType","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
//Armed Land Vehicle
_vehclass = armed_vehicle call BIS_fnc_selectRandom;
_vehname = getText (configFile >> "CfgVehicles" >> _vehclass >> "displayName");
diag_log format["WAI: [Mission:[%2] Armed Vehicle]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_ArmedVehicle select 0;} else {Loot_ArmedVehicle select 1;};
//Spawn Crates
[[
[_loot,crates_small,[0,5]]
],_position,_mission] call wai_spawnCrate;
//Troops
[_position,5,"Medium",["Random","AT"],3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Medium","Random",3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 4);
[_position,_rndnum,"Medium","Random",3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 4);
[_position,_rndnum,"Medium","Random",3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Static Guns
[[[(_position select 0),(_position select 1) + 10, 0]],"Random","Medium",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
//Spawn vehicles
[_vehclass,_position,_mission] call custom_publish;
if(wai_debug_mode) then {
diag_log format["WAI: [%2] armed_vehicle spawned a %1",_vehname,_missionType];
};
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_ARMEDVEHICLE_ANNOUNCE","STR_CL_HERO_ARMEDVEHICLE_WIN","STR_CL_HERO_ARMEDVEHICLE_FAIL"];
} else {
["STR_CL_BANDIT_ARMEDVEHICLE_ANNOUNCE","STR_CL_BANDIT_ARMEDVEHICLE_WIN","STR_CL_BANDIT_ARMEDVEHICLE_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Medium", // Difficulty
format["Disabled %1",_vehname], // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,92 @@
private ["_rndnum","_mission","_position","_aiType","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[%2] ARMY Base]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_ArmyBase select 0;} else {Loot_ArmyBase select 1;};
//Spawn Crates
[[
[_loot,crates_small,[1.2,0]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["WarfareBCamp",[-1,-12.4,-0.12]],
["Base_WarfareBBarrier10xTall",[15,-16,-0.64]],
["Base_WarfareBBarrier10xTall",[-15,-16,-0.64]],
["Base_WarfareBBarrier10xTall",[15,16,-0.64]],
["Base_WarfareBBarrier10xTall",[-15,16,-0.64]],
["MAP_posed",[17,11]],
["MAP_posed",[-20,11]],
["MAP_fort_artillery_nest",[-1,-31,-0.56],-178.615],
["MAP_Fortress_02",[-27,-13]],
["MAP_Fortress_02",[25,-13],-89.16],
["MAP_fortified_nest_big",[26,13],-180.55],
["MAP_fortified_nest_big",[-26,13],-179.808],
["MAP_Barbedwire",[10,-20]],
["MAP_Barbedwire",[-11,-20]],
["MAP_Barbedwire",[16,-20]],
["MAP_Barbedwire",[-17,-20]],
["WarfareBDepot",[-0.02,20,-0.1],-179.832],
["T72Wreck",[29,-30],82.75],
["T72WreckTurret",[20,-36]],
["MAP_T34",[2,5],-71.49],
["Land_Fort_Watchtower_EP1",[26,-4],-180.097],
["Land_Fort_Watchtower_EP1",[-28,-6],0.999],
["Land_transport_crates_EP1",[-18,-9],52.43],
["MAP_Barel4",[-16,-10]],
["MAP_Barel1",[-16,-11]],
["MAP_t_picea3f",[-8,-6]],
["MAP_t_picea3f",[16,20]],
["MAP_t_pinusS2f",[14,9]],
["MAP_t_pinusS2f",[-3,-6],-99.19],
["MAP_t_picea3f",[10,-13]],
["MAP_t_pinusN2s",[14,-8]],
["MAP_t_pinusN2s",[12,19],-73.36],
["MAP_t_pinusN2s",[-21,-13],52.65],
["MAP_t_pinusS2f",[-34,12]],
["MAP_t_picea3f",[-13,21]],
["MAP_t_picea2s",[-17,21]],
["MAP_t_picea2s",[13,-12]],
["MAP_t_picea1s",[30,-0.01]],
["MAP_t_picea2s",[-47,-21]],
["MAP_t_picea2s",[34,-48]],
["MAP_t_pinusN2s",[31,-52]],
["MAP_t_pinusS2f",[12,-5]],
["Land_Fire_barrel_burning",[-0.01,-0.01]]
],_position,_mission] call wai_spawnObjects;
//Troops
[[(_position select 0) - 12, (_position select 1) + 2, 0],5,"Hard",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 2, (_position select 1) + 2, 0],5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 14, (_position select 1) - 35, 0],5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) + 13, (_position select 1) + 35, 0],_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) + 13, (_position select 1) + 35, 0],_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Humvee Patrol
[[(_position select 0) - 22, (_position select 1) - 56, 0],[(_position select 0) + 22, (_position select 1) + 56, 0],50,2,"HMMWV_Armored","Hard",_aiType,_aiType,_mission] call vehicle_patrol;
//Static Guns
[[
[(_position select 0) - 0.01, (_position select 1) + 41, 0],
[(_position select 0) + 0.1, (_position select 1) - 25, 0]
],"M2StaticMG","Hard",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
[
_mission, // Mission number
_position, // Position of mission
"Hard", // Difficulty
"Army Base", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
["STR_CL_GENERAL_ARMYBASE_ANNOUNCE","STR_CL_GENERAL_ARMYBASE_WIN","STR_CL_GENERAL_ARMYBASE_FAIL"]
] call mission_winorfail;

View File

@ -0,0 +1,69 @@
private ["_mission","_position","_rndnum","_aiType","_messages","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [80] call find_position;
diag_log format["WAI: [Mission:[%2] Base]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_Base select 0;} else {Loot_Base select 1;};
//Spawn Crates
[[
[_loot,crates_large,[0,0]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["land_fortified_nest_big",[-40,0],90],
["land_fortified_nest_big",[40,0],270],
["land_fortified_nest_big",[0,-40]],
["land_fortified_nest_big",[0,40],180],
["Land_Fort_Watchtower",[-10,0]],
["Land_Fort_Watchtower",[10,0],180],
["Land_Fort_Watchtower",[0,-10],270],
["Land_Fort_Watchtower",[0,10],90]
],_position,_mission] call wai_spawnObjects;
//Troops
[_position,5,"Hard",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[_position,_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[_position,_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Humvee Patrol
[[(_position select 0) + 100, _position select 1, 0],[(_position select 0) + 100, _position select 1, 0],50,2,"HMMWV_Armored","Hard",_aiType,_aiType,_mission] call vehicle_patrol;
//Static Guns
[[
[(_position select 0) - 10, (_position select 1) + 10, 0],
[(_position select 0) + 10, (_position select 1) - 10, 0],
[(_position select 0) + 10, (_position select 1) + 10, 0],
[(_position select 0) - 10, (_position select 1) - 10, 0]
],"M2StaticMG","Hard",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
//Heli Paradrop
[_position,400,"UH1H_DZ","East",[3000,4000],150,1.0,200,10,"Hard","Random",4,"Random",_aiType,"Random",_aiType,true,_mission] spawn heli_para;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_BANDITBASE_ANNOUNCE","STR_CL_HERO_BANDITBASE_WIN","STR_CL_HERO_BANDITBASE_FAIL"];
} else {
["STR_CL_BANDIT_HEROBASE_ANNOUNCE","STR_CL_BANDIT_HEROBASE_WIN","STR_CL_BANDIT_HEROBASE_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Hard", // Difficulty
"Base", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,52 @@
private ["_mission","_position","_rndnum","_aiType","_messages","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[%2] Black Hawk Crash]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_BHC select 0;} else {Loot_BHC select 1;};
//Spawn Crates
[[
[_loot,crates_medium,[0,0]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["UH60_ARMY_Wreck_burned_DZ",[5,5]]
],_position,_mission] call wai_spawnObjects;
//Troops
[_position,5,"Medium",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 4);
[_position,_rndnum,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 4);
[_position,_rndnum,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Static Guns
[[
[(_position select 0) + 25, (_position select 1) + 25, 0],
[(_position select 0) - 25, (_position select 1) - 25, 0]
],"M2StaticMG","Easy",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_BHCRASH_ANNOUNCE","STR_CL_HERO_BHCRASH_WIN","STR_CL_HERO_BHCRASH_FAIL"];
} else {
["STR_CL_BANDIT_BHCRASH_ANNOUNCE","STR_CL_BANDIT_BHCRASH_WIN","STR_CL_BANDIT_BHCRASH_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Medium", // Difficulty
"Black Hawk Crash", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,46 @@
private ["_mission","_position","_rndnum","_messages","_aiType","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[%2] Ural Attack]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_UralAttack select 0;} else {Loot_UralAttack select 1;};
//Spawn Crates
[[
[_loot,crates_medium,[-5,-5]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["UralWreck",[0,0]]
],_position,_mission] call wai_spawnObjects;
//Troops
_rndnum = round (random 5);
[_position,5,"Easy",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 3);
[_position,_rndnum,"Easy","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 3);
[_position,_rndnum,"Easy","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_URAL_ANNOUNCE","STR_CL_HERO_URAL_WIN","STR_CL_HERO_URAL_FAIL"];
} else {
["STR_CL_BANDIT_URAL_ANNOUNCE","STR_CL_BANDIT_URAL_WIN","STR_CL_BANDIT_URAL_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Easy", // Difficulty
"Ural Attack", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["kill"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,63 @@
private ["_mission","_position","_rndnum","_aiType","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [80] call find_position;
diag_log format["WAI: Mission:[%2] Cannibal started at %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_CannibalCave select 0;} else {Loot_CannibalCave select 1;};
//Spawn Crates
[[
[_loot,crates_large,[5,7]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["MAP_R2_RockWall",[10,28,-4.15]],
["MAP_R2_RockWall",[-23,9,-6.55],-96.315],
["MAP_R2_RockWall",[25,4,-7.74],262.32],
["MAP_R2_RockWall",[1,7,10.81],-29.29],
["MAP_R2_RockWall",[18,-11,-5.509],-222.72],
["MAP_R2_RockWall",[-22,6,-11.55],-44.01],
["MAP_t_picea2s",[-13,-32,-0.1]],
["MAP_t_picea2s",[-17,6,-0.2]],
["MAP_t_pinusN2s",[-24,-53,-0.2]],
["MAP_t_pinusN1s",[-22,-42,-0.2]],
["MAP_t_picea1s",[-22.3,-35,-0.2]],
["MAP_t_picea2s",[-33,-53,-0.2]],
["MAP_t_picea2s",[-3,-43,-0.2]],
["MAP_t_picea2s",[28,-39,-0.2]],
["MAP_t_picea2s",[13,43,-0.2]],
["MAP_t_picea1s",[57,11,-0.2]],
["MAP_t_quercus3s",[31,49.3,-0.2]],
["MAP_t_quercus3s",[-47,20,-0.2]],
["MAP_R2_Rock1",[-47,-45,-14.29]],
["Land_Campfire_burning",[-0.01,-0.01]],
["Mass_grave",[-6,-7,-0.02],-50.94],
["SKODAWreck",[-11,-46],151.15],
["datsun01Wreck",[-2,-60],34.54],
["UralWreck",[-41.3,-26],19.15]
],_position,_mission] call wai_spawnObjects;
[[(_position select 0) + 12, (_position select 1) + 42.5, .01],5,"extreme",["random","AT"],4,"random",_aiType,"random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 11, (_position select 1) + 41, .01],5,"hard","random",4,"random",_aiType,"random",_aiType,_mission] call spawn_group;
[[(_position select 0) - 12, (_position select 1) - 43, .01],5,"random","random",4,"random",_aiType,"random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) - 13, (_position select 1) - 43, .01],_rndnum,"random","random",4,"random",_aiType,"random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) - 20, (_position select 1) - 43, .01],_rndnum,"random","random",4,"random",_aiType,"random",_aiType,_mission] call spawn_group;
[
_mission,
_position, // Position of mission
"Hard", // Difficulty
"Cannibal Cave", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
["STR_CL_GENERAL_CANNIBALCAVE_ANNOUNCE","STR_CL_GENERAL_CANNIBALCAVE_WIN","STR_CL_GENERAL_CANNIBALCAVE_FAIL"]
] call mission_winorfail;

View File

@ -0,0 +1,66 @@
private ["_mission","_position","_rndnum","_loot","_aiType","_messages","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[%2] Captured MV22]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_CapturedMV22 select 0;} else {Loot_CapturedMV22 select 1;};
//Spawn Crates
[[
[_loot,"USBasicWeaponsBox",[11.2,12.2,.1]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["USMC_WarfareBFieldhHospital",[12.7,6.5],-210],
["Barrack2",[16,-11],150],
["Misc_cargo_cont_small",[2.8,17.4],12.5],
["Barrack2",[9,-15],150],
["Misc_cargo_cont_small",[6.7,18.3],12.5]
],_position,_mission] call wai_spawnObjects;
//Troops
[[_position select 0,_position select 1,0],5,"Hard",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 33,(_position select 1) - 7,0.1],5,"Hard","Random",4,"Random","RU_Doctor","Random",[_aiType,100],_mission] call spawn_group;
[[(_position select 0) - 33,(_position select 1) - 18,0.1],5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) + 1,(_position select 1) + 29,0.1],_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) + 1,(_position select 1) + 29,0.1],_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Static Guns
[[
[(_position select 0) - 9.3, (_position select 1) + 11.2, 0],
[(_position select 0) - 6, (_position select 1) - 21.4, 0]
],"M2StaticMG","Hard",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
//Spawn vehicles
["MV22_DZ",[(_position select 0) - 20.5,(_position select 1) - 5.2,0], _mission,true,-82.5] call custom_publish;
if(wai_debug_mode) then {
diag_log format["WAI: [%2] captured_mv22 spawned a MV22 at %1", _position,_missionType];
};
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_MV22_ANNOUNCE","STR_CL_HERO_MV22_WIN","STR_CL_HERO_MV22_FAIL"];
} else {
["STR_CL_BANDIT_MV22_ANNOUNCE","STR_CL_BANDIT_MV22_WIN","STR_CL_BANDIT_MV22_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Hard", // Difficulty
"Captured MV22", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,77 @@
private ["_rndnum","_crate_type","_mission","_position","_crate","_baserunover","_baserunover0","_baserunover1","_baserunover2","_baserunover3","_baserunover4","_baserunover5","_baserunover6","_baserunover7","_baserunover8","_baserunover9","_baserunover10","_baserunover11","_baserunover12","_baserunover13","_baserunover14","_baserunover15","_baserunover16","_baserunover17","_baserunover18","_baserunover19","_baserunover20","_baserunover21","_baserunover22"];
// Get mission number, important we do this early
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[Hero] Cargo]: Starting... %1",_position];
//Setup the crate
_crate_type = crates_small call BIS_fnc_selectRandom;
_crate = createVehicle [_crate_type,[(_position select 0) + 0.2,(_position select 1),0], [], 0, "CAN_COLLIDE"];
_crate call wai_crate_setup;
//Buildings
_baserunover0 = createVehicle ["MAP_Misc_Cargo1Bo",[(_position select 0)+14, (_position select 1) -10, 0],[], 0, "CAN_COLLIDE"];
_baserunover1 = createVehicle ["MAP_Misc_Cargo2A",[(_position select 0) +18, (_position select 1) -10, 0],[], 0, "CAN_COLLIDE"];
_baserunover2 = createVehicle ["MAP_Misc_Cargo2B",[(_position select 0) +20, (_position select 1) - 3, 0],[], 0, "CAN_COLLIDE"];
_baserunover3 = createVehicle ["MAP_Misc_Cargo2C", [(_position select 0) +14, (_position select 1) +1, 0],[], 0, "CAN_COLLIDE"];
_baserunover4 = createVehicle ["MAP_Misc_Cargo2C", [(_position select 0) +21, (_position select 1) -17, 0],[], 0, "CAN_COLLIDE"];
_baserunover5 = createVehicle ["MAP_Misc_Cargo1G", [(_position select 0) +9, (_position select 1) -1, 0],[], 0, "CAN_COLLIDE"];
_baserunover6 = createVehicle ["MAP_Misc_Cargo1E",[(_position select 0) + 11, (_position select 1) +7, 0],[], 0, "CAN_COLLIDE"];
_baserunover7 = createVehicle ["MAP_Misc_Cargo1C",[(_position select 0) +2, (_position select 1) -15, 0],[], 0, "CAN_COLLIDE"];
_baserunover8 = createVehicle ["MAP_Misc_Cargo1B",[(_position select 0) +6, (_position select 1) -8, 0],[], 0, "CAN_COLLIDE"];
_baserunover9 = createVehicle ["MAP_Misc_Cargo2E", [(_position select 0) +3.5, (_position select 1) +6, 0],[], 0, "CAN_COLLIDE"];
_baserunover10 = createVehicle ["MAP_Misc_Cargo2D", [(_position select 0) -2, (_position select 1) -10, 0],[], 0, "CAN_COLLIDE"];
_baserunover11 = createVehicle ["MAP_Misc_Cargo1F", [(_position select 0) -11, (_position select 1) +10, 0],[], 0, "CAN_COLLIDE"];
_baserunover12 = createVehicle ["MAP_Misc_Cargo1E",[(_position select 0) -9, (_position select 1) -4, 0],[], 0, "CAN_COLLIDE"];
_baserunover13 = createVehicle ["MAP_Misc_Cargo1D",[(_position select 0) +21, (_position select 1) +6, 0],[], 0, "CAN_COLLIDE"];
_baserunover14 = createVehicle ["MAP_Misc_Cargo1Bo",[(_position select 0) -6, (_position select 1) +6, 0],[], 0, "CAN_COLLIDE"];
_baserunover15 = createVehicle ["MAP_Misc_Cargo1B",[(_position select 0) -19, (_position select 1) -7, 0],[], 0, "CAN_COLLIDE"];
_baserunover16 = createVehicle ["MAP_Misc_Cargo1A",[(_position select 0) -15, (_position select 1) -1, 0],[], 0, "CAN_COLLIDE"];
_baserunover17 = createVehicle ["MAP_Misc_Cargo1G", [(_position select 0) -4, (_position select 1) +16, 0],[], 0, "CAN_COLLIDE"];
_baserunover18 = createVehicle ["MAP_Misc_Cargo2C", [(_position select 0) +7, (_position select 1) +11, 0],[], 0, "CAN_COLLIDE"];
_baserunover19 = createVehicle ["MAP_Misc_Cargo2B", [(_position select 0) +4, (_position select 1) -24, 0],[], 0, "CAN_COLLIDE"];
_baserunover20 = createVehicle ["MAP_Misc_Cargo2C",[(_position select 0) +4, (_position select 1) +20, 0],[], 0, "CAN_COLLIDE"];
_baserunover21 = createVehicle ["MAP_Misc_Cargo2A",[(_position select 0) -12, (_position select 1) -13, 0],[], 0, "CAN_COLLIDE"];
_baserunover22 = createVehicle ["MAP_A_CraneCon",[(_position select 0) -21, (_position select 1) +10, 0],[], 0, "CAN_COLLIDE"];
_baserunover = [_baserunover0,_baserunover1,_baserunover2,_baserunover3,_baserunover4,_baserunover5,_baserunover6,_baserunover7,_baserunover8,_baserunover9,_baserunover10,_baserunover11,_baserunover12,_baserunover13,_baserunover14,_baserunover15,_baserunover16,_baserunover17,_baserunover18,_baserunover19,_baserunover20,_baserunover21,_baserunover22];
_directions = [0,-89,2,0,119,39,86,0,111,-40,0,0,0,-48,-139,-41,14,109,-114,-74,-44,-22,0];
{ _x setDir (_directions select _forEachIndex) } forEach _baserunover;
{ _x setVectorUp surfaceNormal position _x; } count _baserunover;
//Troops
_rndnum = round (random 5);
[[(_position select 0) +3, (_position select 1) +25, 0],5,"Hard",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) -27, (_position select 1) -4, 0],5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) +33, (_position select 1) -2, 0],5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) +10, (_position select 1) -37, 0],_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Humvee Patrol
[[(_position select 0) +60, _position select 1, 0],[(_position select 0) -60, _position select 1, 0],50,2,"HMMWV_Armored","Hard",_aiType,_aiType,_mission] call vehicle_patrol;
//Static Guns
[[[(_position select 0) +80, (_position select 1) -28, 0]],"KORD_high_TK_EP1","Easy",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
[[[(_position select 0) +27, (_position select 1) -40, 0]],"KORD_high_TK_EP1","Easy",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
// Array of mission variables to send
[
_mission, // Mission number
_position, // Position of mission
"Medium", // Difficulty
"Cargo", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
_crate, // crate object info
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
[_baserunover], // cleanup objects
"STR_CL_HERO_CARGO_ANNOUNCE", // mission announcement
"STR_CL_HERO_CARGO_WIN", // mission success
"STR_CL_HERO_CARGO_FAIL", // mission fail
[10,5,20,3,2] // Dynamic crate array
] call mission_winorfail;

View File

@ -0,0 +1,168 @@
local _mission = count WAI_MissionData -1;
local _aiType = _this select 0; // "Bandit" or "Hero"
local _hero = _aiType == "Hero";
local _name = "Castle Grayskull";
local _supportedMaps = ["chernarus","chernarus_winter"]; // The default positions listed below are for Chernarus. If you wish to use this mission on another map then you must gather your own list of flat terrain positions.
local _flatPositions = [[4277.94,9457.53],[4144.92,9439.12],[4229.24,9749.14],[3314.31,10614.7],[2152.91,10467.1],[1956.85,10338.3],[4138.71,12630.3],[3999.11,12659.3],[3733.19,14063.7],[3505.19,14168.2],[5191.49,13994.6],[5986.83,14403.1],[6282.33,14097.3],[6497.14,13582.8],[14255.6,14169.6],[13231.9,10718.3],[12080.6,9895.28],[10612.5,8441.86],[8737.68,9200.67],[7137.15,9483.91],[7406.85,3487.04],[7139.72,5321.27],[5227.21,2202.33],[4149.34,2772.77],[1143.01,2439.9],[1230.53,2526.4],[1157.66,4245.54],[1246.03,4612.52],[4436.68,8472.96],[4748.81,5867.21],[5852.48,11010.3]]; // Chernarus
local _position = [_flatPositions] call isValidSpot;
if (count _position < 1 || {!(toLower worldName in _supportedMaps)}) exitWith {
if (_hero) then {
WAI_HeroRunning = WAI_HeroRunning - 1; WAI_MissionData set [_mission, -1]; WAI_MarkerReady = true;
} else {
WAI_BanditRunning = WAI_BanditRunning - 1; WAI_MissionData set [_mission, -1]; WAI_MarkerReady = true;
};
};
local _startTime = diag_tickTime;
local _difficulty = "Extreme";
local _localized = ["STR_CL_MISSION_BANDIT", "STR_CL_MISSION_HERO"] select _hero;
local _localName = "STR_CL_GRAYSKULL_TITLE";
diag_log format["[WAI]: %1 %2 started at %3.",_aiType,_name,_position];
local _messages = ["STR_CL_GRAYSKULL_ANNOUNCE","STR_CL_GRAYSKULL_WIN","STR_CL_GRAYSKULL_FAIL"];
////////////////////// Do not edit this section ///////////////////////////
local _markers = [1,1,1,1];
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
_markers set [0, [_position, "WAI" + str(_mission), "ColorBlack", "", "ELLIPSE", "Solid", [300,300], [], 0]];
_markers set [1, [_position, "WAI" + str(_mission) + "dot", "ColorBlack", "mil_dot", "", "", [], [_localized,_localName], 0]];
if (WAI_AutoClaim) then {_markers set [2, [_position, "WAI" + str(_mission) + "auto", "ColorRed", "", "ELLIPSE", "Border", [WAI_AcAlertDistance,WAI_AcAlertDistance], [], 0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
_markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
WAI_MarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _position];
local _posIndex = count DZE_MissionPositions - 1;
// Send announcement
[_difficulty,(_messages select 0)] call WAI_Message;
// Wait until a player is within range or timeout is reached.
local _timeout = false;
local _claimPlayer = objNull;
while {WAI_WaitForPlayer && !_timeout && {isNull _claimPlayer}} do {
_claimPlayer = [_position, WAI_TimeoutDist] call isClosestPlayer;
if (diag_tickTime - _startTime >= (WAI_Timeout * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call WAI_AbortMission;
[_difficulty,(_messages select 2)] call WAI_Message;
diag_log format["WAI: %1 %2 aborted.",_aiType,_name,_position];
};
//////////////////////////////// End //////////////////////////////////////
// Spawn Objects
local _objects = [[
["MAP_A_Castle_Bergfrit",[0, 0, 0],-118],
["Land_A_Castle_Donjon",[-9.9136, -56.3155, -6.9],150],
["Land_A_Castle_Donjon",[48.269, -23.5899, -6.9],150],
["Land_A_Castle_Gate",[19.6933, -39.376, 0.16360788],150],
["Land_A_Castle_Stairs_A",[-3.2178, -9.418, -0.15027224],-27],
["Land_A_Castle_Wall1_20",[35.7534, -31.0733, -1.0470082],150],
["Land_A_Castle_Wall1_20",[-22.2061, 31.915, 0],-30],
["Land_A_Castle_Wall2_30",[-19.3956,-39.5801, -0.5399434],-120],
["Land_A_Castle_Wall2_30",[38.3569, -9.7383, -0.53297883],-300],
["Land_A_Castle_Bastion",[-42.6607, 20.5839, 0],-76],
["Land_A_Castle_Bastion",[-0.7754, 41.1093, 0],33],
["Land_A_Castle_WallS_End",[11.0483, -8.8145, 0]],
["Land_A_Castle_Wall2_End_2",[-28.252, -15.7022, 0],60],
["Land_A_Castle_Wall2_End_2",[25.1665, 13.6259, 0],53],
["Land_A_Castle_Wall2_Corner_2",[10.893, 25.8378, 0],7],
["Land_A_Castle_Wall2_Corner_2",[-35.1402, 2.0625, 0],-107],
["Land_A_Castle_Wall2_End",[-15.6451, -1.5752, 0],-30],
["Land_A_Castle_Wall2_End",[-12.125, 12.2656, 0],60],
["Land_A_Castle_Bergfrit",[0, 0, 0],-118],
["Land_A_Castle_Wall1_20_Turn_ruins",[1.5449, -49.2315, -1.810002],-18],
["Land_fortified_nest_big",[-4.6485, 11.4218, 0],-29],
["Land_Fort_Watchtower",[31.0649, -20.5664, 0],-120],
["Land_Fort_Watchtower",[-2.4654, -40.1768, 0],-120],
["Land_Fort_Watchtower",[17.6709, 5.6084, 0],-210],
["Land_HBarrier_large",[-20.0684, 9.3222, -0.16],-114],
["Land_HBarrier_large",[-8.1246, 29.4492, -0.16],30],
["Land_HBarrier_large",[0.5297, -31.6856, -0.16],-67],
["Land_HBarrier_large",[21.2143, -20.9278, -0.16],5],
["Land_HBarrier_large",[-29.604, 17.0527, -0.16],-74],
["Land_fort_artillery_nest",[-32.8667, 50.4794, 0.4],-30],
["Land_fort_artillery_nest",[42.645, 18.2978, 0.4],58],
["Land_fort_artillery_nest",[-48.6299, -29.17, 0.4],-120],
["Land_fort_artillery_nest",[18.1303, 64.9013, 0.4],34],
["Land_fort_artillery_nest",[-72.543, 15.9394, 0.4],-90],
["Land_fort_artillery_nest",[11.02, -81.7247, 0.4],-180],
["Land_fort_artillery_nest",[59.4721, -53.6338, 0.4],-240]
],_position,_mission] call WAI_SpawnObjects;
//Spawn Crates
local _loot1 = [Loot_GraySkull1 select 1, Loot_GraySkull1 select 0] select _hero;
local _loot2 = [Loot_GraySkull2 select 1, Loot_GraySkull2 select 0] select _hero;
local _loot3 = [Loot_GraySkull3 select 1, Loot_GraySkull3 select 0] select _hero;
local _loot4 = [Loot_GraySkull4 select 1, Loot_GraySkull4 select 0] select _hero;
[[ // Crate in the tower
[_loot1, WAI_CrateMd, [0,0], -32]
],((_objects select 0) modelToWorld [0.341797,-1.85889,8.7569]),_mission] call WAI_SpawnCrate;
[[
[_loot2, WAI_CrateMd, [31.7817, -20.461], -34],
[_loot3, WAI_CrateMd, [17.4746, 6.5839], -118],
[_loot4, WAI_CrateMd, [-1.4278, -40.1006], -30]
],_position,_mission] call WAI_SpawnCrate;
// External Troops
[[(_position select 0) + 37, (_position select 1) + 15, 0],5,_difficulty,"Random","AA","Random",WAI_ApocalypticSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
[[(_position select 0) + 15, (_position select 1) + 60, 0],5,_difficulty,"Random","AT","Random",WAI_ApocalypticSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
[[(_position select 0) - 30, (_position select 1) + 45, 0],5,_difficulty,"Random","","Random",WAI_ApocalypticSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
//[[(_position select 0) - 66, (_position select 1) + 15, 0],5,_difficulty,"Random","","Random",WAI_ApocalypticSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
//[[(_position select 0) - 43, (_position select 1) - 26, 0],5,_difficulty,"Random","","Random",WAI_ApocalypticSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
//[[(_position select 0) + 10, (_position select 1) - 77, 0],5,_difficulty,"Random","","Random",WAI_ApocalypticSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
//[[(_position select 0) + 55, (_position select 1) - 51, 0],5,_difficulty,"Random","","Random",WAI_ApocalypticSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
// Internal Troops - these use "SENTRY" waypoint type
[[(_position select 0) - 10, (_position select 1) - 29, .25],5,_difficulty,"Random","AT","Random",WAI_ApocalypticSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
[[(_position select 0) + 22, (_position select 1) - 11, .25],5,_difficulty,"Random","AA","Random",WAI_ApocalypticSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
[[(_position select 0) - 1, (_position select 1) + 39, .25],5,_difficulty,"Random","","Random",WAI_ApocalypticSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
//[[(_position select 0) - 16, (_position select 1) + 25, .25],5,_difficulty,"Random","","Random",WAI_ApocalypticSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
//[[(_position select 0) - 17, (_position select 1) + 3, .25],5,_difficulty,"Random","","Random",WAI_ApocalypticSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
// Vehicle Patrol
[[(_position select 0) + 100, _position select 1, 0],[(_position select 0) + 100, _position select 1, 0],50,2,"BAF_Jackal2_L2A1_D_DZ","Random",_aiType,_aiType,_mission] call WAI_VehPatrol;
[WAI_UnarmedTrackedVeh,[(_position select 0) - 9.7, (_position select 1) - 8],_mission, true, -209] call WAI_PublishVeh;
//Static guns
[[
[(_position select 0) + 27.3671, (_position select 1) - 30.6905, 0],
((_objects select 2) modelToWorld [-6.04492,6.05078,13.6449]),
[(_position select 0) - 55.6475, (_position select 1) + 33.6943, 0],
[(_position select 0) - 5.6695, (_position select 1) + 59.6269, 0],
((_objects select 1) modelToWorld [6.00293,6.05811,13.7865]),
[(_position select 0) - 39.3331, (_position select 1) + 19.7656, 0],
[(_position select 0) - 2.6773, (_position select 1) + 7.0332, 0]
],"Random",_difficulty,WAI_ApocalypticSkin,_aiType,"Random","Random","Random",_mission] call WAI_SpawnStatic;
[
_mission, // Mission number
_position, // Position of mission
_difficulty, // Difficulty
_name, // Name of Mission
_localName,
_aiType, // "Bandit" or "Hero"
_markerIndex,
_posIndex,
_claimPlayer,
true, // show mission marker?
false, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] spawn WAI_MissionMonitor;

View File

@ -0,0 +1,77 @@
private ["_mission","_position","_rndnum","_aiType","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [80] call find_position;
diag_log format["WAI: [Mission:[%2] Hippy Commune]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_CropRaider select 0;} else {Loot_CropRaider select 1;};
//Spawn Crates
[[
[_loot,crates_small,[2,0,.1]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["fiberplant",[-10.8,-16.3]],
["fiberplant",[16.2,-17.6]],
["fiberplant",[-17.3,21]],
["fiberplant",[28.6,29]],
["fiberplant",[-29.8,-31.1]],
["fiberplant",[30.2,-33]],
["fiberplant",[-32,28.7]],
["fiberplant",[-32,-1.1]],
["fiberplant",[1.3,-28]],
["fiberplant",[27,2]],
["fiberplant",[-0.3,26]],
["fiberplant",[35.9,39]],
["fiberplant",[-39,-40.3]],
["fiberplant",[-36.9,-38.6]],
["fiberplant",[38,-38.9]],
["fiberplant",[-37,39.7]],
["fiberplant",[-0.1,42.3]],
["fiberplant",[42.1,-0.1]],
["fiberplant",[0.1,-40.2]],
["hruzdum",[-0.01,-0.01]],
["fiberplant",[-10,-11]],
["fiberplant",[13,12.2]],
["fiberplant",[12.3,-10.6]],
["fiberplant",[-11.3,12.7]],
["fiberplant",[15,10]]
],_position,_mission] call wai_spawnObjects;
//Group Spawning
[[(_position select 0) + 9, (_position select 1) - 13, 0],5,"Hard",["Random","AT"],4,"Random","Rocker3_DZ","Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 13, (_position select 1) + 15, 0],5,"Hard","Random",4,"Random","Rocker1_DZ","Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 13, (_position select 1) + 15, 0],5,"Hard","Random",4,"Random","Rocker1_DZ","Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) - 13, (_position select 1) + 15, 0],_rndnum,"Hard","Random",4,"Random","Policeman","Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[_position select 0, _position select 1, 0],_rndnum,"Hard","Random",4,"Random","Policeman","Random",_aiType,_mission] call spawn_group;
//Humvee Patrol
[[(_position select 0) + 55, _position select 1, 0],[(_position select 0) + 50, _position select 1, 0],50,2,"HMMWV_Armored","Hard",_aiType,_aiType,_mission] call vehicle_patrol;
//Static Guns
[[
[(_position select 0) - 48, (_position select 1) + 0.1, 0],
[(_position select 0) + 2, (_position select 1) + 48, 0]
],"M2StaticMG","Hard","Policeman",_aiType,0,2,"Random","Random",_mission] call spawn_static;
//Heli Paradrop
[_position,200,"UH1H_DZ","East",[3000,4000],150,1.0,200,10,"Hard","Random",4,"Random",_aiType,"Random",_aiType,true,_mission] spawn heli_para;
[
_mission, // Mission number
_position, // Position of mission
"Hard", // Difficulty
"Crop Raider", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
["STR_CL_GENERAL_CROPRAIDER_ANNOUNCE","STR_CL_GENERAL_CROPRAIDER_WIN","STR_CL_GENERAL_CROPRAIDER_FAIL"]
] call mission_winorfail;

View File

@ -0,0 +1,69 @@
private ["_mission","_position","_rndnum","_aiType","_messages","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [80] call find_position;
diag_log format["WAI: [Mission:[%2] Drone Pilot]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_DronePilot select 0;} else {Loot_DronePilot select 1;};
//Spawn Crates
[[
[_loot,crates_large,[2,0]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["MQ9PredatorB",[11,-28]],
["TK_WarfareBUAVterminal_EP1",[-6,-15],-153.81],
["Land_budova4_in",[-13,3.5]],
["Land_Vysilac_FM",[-10,-7]],
["MAP_runway_poj_draha",[10,5]],
["ClutterCutter_EP1",[10,36]],
["ClutterCutter_EP1",[10,30]],
["ClutterCutter_EP1",[10,24]],
["ClutterCutter_EP1",[10,18]],
["ClutterCutter_EP1",[10,12]],
["ClutterCutter_EP1",[10,6]],
["ClutterCutter_EP1",[10,0.1]],
["ClutterCutter_EP1",[10,-6]],
["ClutterCutter_EP1",[10,-12]],
["ClutterCutter_EP1",[10,-18]],
["ClutterCutter_EP1",[10,-24]],
["ClutterCutter_EP1",[-4,-5]]
],_position,_mission] call wai_spawnObjects;
// Troops
[[(_position select 0) + 17, (_position select 1) - 18, 0],5,"Hard",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) - 11, (_position select 1) + 9, 0],5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 15, (_position select 1) - 15, 0],5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) + 2, (_position select 1) + 18, 0],_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) + 2, (_position select 1) + 18, 0],_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Humvee Patrol
[[(_position select 0) + 55, _position select 1, 0],[(_position select 0) + 17, _position select 1, 0],50,2,"HMMWV_Armored","Hard",_aiType,_aiType,_mission] call vehicle_patrol;
//Static Guns
[[[(_position select 0) - 7, (_position select 1) + 19, 0]],"KORD_high_TK_EP1","Hard",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_DRONE_ANNOUNCE","STR_CL_HERO_DRONE_WIN","STR_CL_HERO_DRONE_FAIL"];
} else {
["STR_CL_BANDIT_DRONEPILOT_ANNOUNCE","STR_CL_BANDIT_DRONEPILOT_WIN","STR_CL_BANDIT_DRONEPILOT_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Hard", // Difficulty
"Drone Pilot", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,69 @@
private ["_rndnum","_mission","_position","_aiType","_messages","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[%2] Drug Bust]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_DrugBust select 0;} else {Loot_DrugBust select 1;};
//Spawn Crates
[[
[_loot,crates_medium,[2.3,-3,.1]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["Land_dum_zboreny",[-0.01,0.02,-0.1]],
["Land_Misc_Garb_Heap_EP1",[5.6,3.4,-0.01]],
["MAP_Kitchenstove_Elec",[2,5,-0.1]],
["MAP_P_toilet_b_02",[-4.4,-3.3,-0.01],-90.84],
["MAP_P_bath",[-4.9,-5,-0.01]],
["MAP_armchair",[-1.7,-4.6,-0.01],179.92],
["MAP_SmallTable",[2.6,1.4,-0.15]],
["MAP_kitchen_chair_a",[2.5,2.2,-0.01]],
["Land_Boots_EP1",[8.4,-1.5,-0.01],-170.27],
["Land_Blankets_EP1",[-6.3,4.8,0.01],-170.27],
["Land_Bench_EP1",[-3.2,-2.2,0.015]],
["Land_Water_pipe_EP1",[-1.4,-3,0.01],105.15],
["Land_Bag_EP1",[-5.9,1.9,0.01]],
["LADAWreck",[-8,-4,-0.01],-119.578],
["SKODAWreck",[11,-3,-0.01]],
["MAP_tv_a",[-2.7,-0.1,0.01]],
["MAP_Dkamna_uhli",[-0.01,5,-0.1]],
["MAP_Skrin_opalena",[1.2,0.1,0.05]],
["MAP_Dhangar_whiteskrin",[0.9,1.6,0.05],91.19],
["MAP_garbage_paleta",[5.3,-2,-0.01]],
["MAP_t_salix2s",[-0.01,15,-0.01],47.639],
["MAP_t_salix2s",[-0.01,-17,-0.01]],
["MAP_t_salix2s",[25,-0.01,-0.01]],
["MAP_t_salix2s",[-24,-0.01,-0.01]]
],_position,_mission] call wai_spawnObjects;
//Troops
[[(_position select 0) - 12, (_position select 1) - 15,0],5,"Medium",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 12, (_position select 1) + 15,0],5,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 4);
[[(_position select 0), (_position select 1), 0],_rndnum,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 4);
[[(_position select 0), (_position select 1), 0],_rndnum,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_DRUGBUST_ANNOUNCE","STR_CL_HERO_DRUGBUST_WIN","STR_CL_HERO_DRUGBUST_FAIL"];
} else {
["STR_CL_BANDIT_DRUGBUST_ANNOUNCE","STR_CL_BANDIT_DRUGBUST_WIN","STR_CL_BANDIT_DRUGBUST_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Medium", // Difficulty
"Drug Bust", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,65 @@
private ["_crate_type","_mission","_position","_crate","_rndnum","_baserunover","_baserunover0","_baserunover1","_baserunover2","_baserunover3","_baserunover4","_baserunover5"];
// Get mission number, important we do this early
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[Hero] Fallen Satellite]: Starting... %1",_position];
//Setup the crate
_crate_type = crates_small call BIS_fnc_selectRandom;
_crate = createVehicle [_crate_type,[5935.9839,12235.38,0],[],0,"CAN_COLLIDE"];
_crate call wai_crate_setup;
//Buildings
_baserunover0 = createVehicle ["Satelit",[(_position select 0) - 8.41, (_position select 1) + 3.37, -0.013],[], 0, "CAN_COLLIDE"];
_baserunover1 = createVehicle ["MAP_rubble_metal_plates_03",[(_position select 0) - 8.1, (_position select 1) - 3.8, 0.01],[], 0, "CAN_COLLIDE"];
_baserunover2 = createVehicle ["MAP_rubble_metal_plates_01",[(_position select 0) - 6.8, (_position select 1) - 1.6, -0.015],[], 0, "CAN_COLLIDE"];
_baserunover3 = createVehicle ["Land_Dirthump01",[(_position select 0) - 7.4, (_position select 1) -2.8, -1.96],[], 0, "CAN_COLLIDE"];
_baserunover4 = createVehicle ["Land_Dirthump01",[(_position select 0) - 6.6, (_position select 1) -2.8, -1.99],[], 0, "CAN_COLLIDE"];
_baserunover5 = createVehicle ["Land_Fire_barrel_burning",[(_position select 0) -6.1, (_position select 1) -3.8, -0.85],[], 0, "CAN_COLLIDE"];
// Adding buildings to one variable just for tidiness
_baserunover = [_baserunover0,_baserunover1,_baserunover2,_baserunover3,_baserunover4,_baserunover5];
// Set some directions for our buildings
_directions = [0,0,61.76,-2.706,-66.12,0];
{ _x setDir (_directions select _forEachIndex) } forEach _baserunover;
// Make buildings flat on terrain surface
{ _x setVectorUp surfaceNormal position _x; } count _baserunover;
//Troops
_rndnum = round (random 5);
[[(_position select 0) - 22, (_position select 1) +7,0],5,"Easy",["Random","AT"],3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) +15, (_position select 1) -19,0],5,"Easy","Random",3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) +15, (_position select 1) +3,0],4,"Easy","Random",3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) - 16, (_position select 1) -13,0],_rndnum,"Easy","Random",3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Static Guns
[[
[(_position select 0) - 8, (_position select 1) + 12, 0.1],
[(_position select 0) - 4.7, (_position select 1) - 16, 0.1]
],"M2StaticMG","Easy",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
// Array of mission variables to send
[
_mission, // Mission number
_position, // Position of mission
"Medium", // Difficulty
"Fallen Satellite", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
_crate, // crate object info
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
[], // cleanup objects
"STR_CL_HERO_FALLENSATELLITE_ANNOUNCE", // mission announcement
"STR_CL_HERO_FALLENSATELLITE_WIN", // mission success
"STR_CL_HERO_FALLENSATELLITE_FAIL", // mission fail
[10,4,0,3,2] // Dynamic crate array
] call mission_winorfail;

View File

@ -0,0 +1,58 @@
private ["_rndnum","_mission","_position","_messages","_aiType","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[%2] Farmer]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_Farmer select 0;} else {Loot_Farmer select 1;};
//Spawn Crates
[[
[_loot,crates_medium,[.3,0,.4]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["MAP_HouseV2_01A",[-37,15],-107],
["MAP_Farm_WTower",[-17,32]],
["MAP_sara_stodola3",[12,36.5],20.6],
["MAP_Misc_Cargo1C",[17,4],5.9],
["MAP_Misc_Cargo1C",[15,12],-41.2],
["MAP_t_picea2s",[-17.5,9]],
["MAP_t_picea2s",[-1,-13]],
["MAP_t_picea2s",[-8.5,51.5]],
["MAP_t_picea2s",[18.5,-9.4]],
["Haystack",[7,24.5],15.3],
["MAP_stodola_old_open",[0,-2,0.4],-80.8]
],_position,_mission] call wai_spawnObjects;
//Troops
[[(_position select 0) -17,(_position select 1) +29,0],5,"Easy",["Random","AT"],4,"Random","RU_Villager2","Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 3);
[[(_position select 0) -12,(_position select 1) +20,0],_rndnum,"Random","Random",4,"Random","Citizen2_EP1","Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 3);
[[(_position select 0) -17,(_position select 1) +29,0],_rndnum,"Easy",["Random","AT"],4,"Random","RU_Villager2","Random",_aiType,_mission] call spawn_group;
//Spawn vehicles
["Tractor_DZE",[(_position select 0) -6.5, (_position select 1) +12.7],_mission,true,46.7] call custom_publish;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_FARMER_ANNOUNCE","STR_CL_HERO_FARMER_WIN","STR_CL_HERO_FARMER_FAIL"];
} else {
["STR_CL_BANDIT_FARMER_ANNOUNCE","STR_CL_BANDIT_FARMER_WIN","STR_CL_BANDIT_FARMER_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Easy", // Difficulty
"Farmer", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["kill"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,69 @@
private ["_rndnum","_mission","_position","_messages","_aiType","_missionType","_loot1","_loot2"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [50] call find_position;
diag_log format["WAI: [Mission:[%2] Fire Station]: Starting... %1",_position,_missionType];
_loot1 = if (_missionType == "MainHero") then {Loot_Firestation1 select 0;} else {Loot_Firestation1 select 1;};
_loot2 = if (_missionType == "MainHero") then {Loot_Firestation2 select 0;} else {Loot_Firestation2 select 1;};
//Spawn Crates
[[
[_loot1,crates_large,[-3.6,-4.4],-30],
[_loot2,crates_large,[2,-1.1],-30]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["MAP_a_stationhouse",[0,0],-210],
["Land_fort_bagfence_round",[3.5,-20],68],
["Land_fort_bagfence_round",[-1,-23.3],219]
],_position,_mission] call wai_spawnObjects;
//Troops
[_position,5,"Extreme",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Extreme","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Extreme","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Extreme","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[_position,_rndnum,"Extreme","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[_position,_rndnum,"Extreme","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
// Spawn Vehicle
[armed_vehicle,[(_position select 0) -9.5, (_position select 1) -6.8],_mission,true,-29] call custom_publish;
//Humvee Patrol
[[(_position select 0) + 100, _position select 1, 0],[(_position select 0) + 100, _position select 1, 0],50,2,"HMMWV_Armored","Random",_aiType,_aiType,_mission] call vehicle_patrol;
//Heli Paradrop
[_position,400,"UH60M_EP1_DZE","East",[3000,4000],150,1.0,200,10,"Random","Random",4,"Random",_aiType,"Random",_aiType,false,_mission] spawn heli_para;
//Static guns
[[
[(_position select 0) + 4.9, (_position select 1) + 6.5, 17.94],
[(_position select 0) - 12.8, (_position select 1) - 4.2, 4.97],
[(_position select 0) + 0.9, (_position select 1) - 20.9, 0],
[(_position select 0) + 23.5, (_position select 1) + 1.1, 8.94]
],"M2StaticMG","Extreme",_aiType,_aiType,1,2,"Random","Random",_mission] call spawn_static;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_FIRESTATION_ANNOUNCE","STR_CL_HERO_FIRESTATION_WIN","STR_CL_HERO_FIRESTATION_FAIL"];
} else {
["STR_CL_BANDIT_FIRESTATION_ANNOUNCE","STR_CL_BANDIT_FIRESTATION_WIN","STR_CL_BANDIT_FIRESTATION_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Extreme", // Difficulty
"Fire Station", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,55 @@
private ["_mission","_position","_aiType","_rndnum","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [80] call find_position;
diag_log format["WAI: [Mission:[%2] Gem Tower]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_GemTower select 0;} else {Loot_GemTower select 1;};
//Spawn Crates
[[
[_loot,crates_medium,[-20,11]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["Land_Misc_Coltan_Heap_EP1",[-3.41,16.4,-2.5],-82.16],
["Land_Ind_SiloVelke_01",[-0.01,-0.01,-0.25]],
["Land_Ind_SiloVelke_01",[-21,-0.4,-0.25],182.209],
["Land_Misc_Coltan_Heap_EP1",[-31,12,-2],8.27],
["Land_A_Castle_Bastion",[-21,11,-0.2]],
["Land_Misc_Coltan_Heap_EP1",[-26,34,-2]]
],_position,_mission] call wai_spawnObjects;
//Troops
[[(_position select 0) + 29, (_position select 1) - 21, 0],5,"Hard",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 21, (_position select 1) + 19, 0],5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) - 23, (_position select 1) - 19, 0],5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) - 12, (_position select 1) + 23, 0],_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) - 12, (_position select 1) + 23, 0],_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Humvee Patrol
[[(_position select 0) + 50, _position select 1, 0],[(_position select 0) - 60, _position select 1, 0],50,2,"HMMWV_Armored","Hard",_aiType,_aiType,_mission] call vehicle_patrol;
//Static Guns
[[
[(_position select 0) - 1, (_position select 1) + 39, 0],
[(_position select 0) + 33, (_position select 1) - 21, 0]
],"KORD_high_TK_EP1","Easy",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
[
_mission, // Mission number
_position, // Position of mission
"Hard", // Difficulty
"Gem Tower", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
["STR_CL_GENERAL_GEMTOWER_ANNOUNCE","STR_CL_GENERAL_GEMTOWER_WIN","STR_CL_GENERAL_GEMTOWER_FAIL"]
] call mission_winorfail;

View File

@ -0,0 +1,84 @@
private ["_rndnum","_crate_type","_mission","_position","_crate","_baserunover","_baserunover0","_baserunover1","_baserunover2","_baserunover3","_baserunover4","_baserunover5","_baserunover6","_baserunover7","_baserunover8","_baserunover9","_baserunover10","_baserunover11","_baserunover12","_baserunover13","_baserunover14","_baserunover15","_baserunover16","_baserunover17","_baserunover18","_baserunover19","_baserunover20","_baserunover21","_baserunover22","_baserunover23","_baserunover24","_baserunover25","_baserunover26","_baserunover27","_baserunover28","_baserunover29","_baserunover30"];
// Get mission number, important we do this early
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[Hero] Gold Mine]: Starting... %1",_position];
//Setup the crate
_crate_type = crates_small call BIS_fnc_selectRandom;
_crate = createVehicle [_crate_type,[(_position select 0) + 0.2,(_position select 1),0], [], 0, "CAN_COLLIDE"];
_crate call wai_crate_setup;
//Buildings
_baserunover0 = createVehicle ["MAP_R2_RockWall",[(_position select 0) -24, (_position select 1) +11,-7.1],[], 0, "CAN_COLLIDE"];
_baserunover1 = createVehicle ["MAP_R2_RockWall",[(_position select 0) +6, (_position select 1) +16, -5.9],[], 0, "CAN_COLLIDE"];
_baserunover2 = createVehicle ["MAP_R2_RockWall",[(_position select 0) + 30, (_position select 1) + 3, -7.1],[], 0, "CAN_COLLIDE"];
_baserunover3 = createVehicle ["MAP_R2_RockWall", [(_position select 0) +45, (_position select 1) -18, -7.1],[], 0, "CAN_COLLIDE"];
_baserunover4 = createVehicle ["MAP_R2_RockWall", [(_position select 0) - 29, (_position select 1) -12, -7.1],[], 0, "CAN_COLLIDE"];
_baserunover5 = createVehicle ["MAP_R2_RockWall", [(_position select 0) - 0.1, (_position select 1) +15, +16.85],[], 0, "CAN_COLLIDE"];
_baserunover6 = createVehicle ["MAP_R2_RockWall",[(_position select 0) + 19, (_position select 1) -9, +17.6],[], 0, "CAN_COLLIDE"];
_baserunover7 = createVehicle ["MAP_R2_RockWall",[(_position select 0) -11, (_position select 1) -3, +14.8],[], 0, "CAN_COLLIDE"];
_baserunover8 = createVehicle ["MAP_R2_RockWall",[(_position select 0) -3, (_position select 1) -9, +20.37],[], 0, "CAN_COLLIDE"];
_baserunover9 = createVehicle ["MAP_R2_RockWall", [(_position select 0) -29, (_position select 1) -27, -7.1],[], 0, "CAN_COLLIDE"];
_baserunover10 = createVehicle ["MAP_R2_RockWall", [(_position select 0) -20, (_position select 1) -36, -7.1],[], 0, "CAN_COLLIDE"];
_baserunover11 = createVehicle ["MAP_R2_RockWall", [(_position select 0) - 2, (_position select 1) - 25, +16.2],[], 0, "CAN_COLLIDE"];
_baserunover12 = createVehicle ["MAP_R2_RockWall",[(_position select 0) + 11, (_position select 1) - 30, +16.2],[], 0, "CAN_COLLIDE"];
_baserunover13 = createVehicle ["MAP_R2_RockTower",[(_position select 0) +7, (_position select 1) - 24, -20.4],[], 0, "CAN_COLLIDE"];
_baserunover14 = createVehicle ["MAP_R2_Boulder2",[(_position select 0) +14, (_position select 1) - 27, -0.015],[], 0, "CAN_COLLIDE"];
_baserunover15 = createVehicle ["MAP_R2_Boulder1",[(_position select 0) +18, (_position select 1) - 37, -0.015],[], 0, "CAN_COLLIDE"];
_baserunover16 = createVehicle ["MAP_R2_Rock1",[(_position select 0) - 2, (_position select 1) - 7, -25.05],[], 0, "CAN_COLLIDE"];
_baserunover17 = createVehicle ["MAP_Ind_HammerMill", [(_position select 0) +30, (_position select 1) - 53,-6.1],[], 0, "CAN_COLLIDE"];
_baserunover18 = createVehicle ["UralWreck", [(_position select 0) +34, (_position select 1) -59,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover19 = createVehicle ["MAP_Ind_Conveyer", [(_position select 0) + 22, (_position select 1) -45, 0.1],[], 0, "CAN_COLLIDE"];
_baserunover20 = createVehicle ["Land_Dirthump01",[(_position select 0) +13, (_position select 1) - 38,-1.41],[], 0, "CAN_COLLIDE"];
_baserunover21 = createVehicle ["Land_Dirthump01",[(_position select 0) +13, (_position select 1) - 39,-1.45],[], 0, "CAN_COLLIDE"];
_baserunover22 = createVehicle ["MAP_R2_RockTower",[(_position select 0) + 60, (_position select 1) -55,-26.69],[], 0, "CAN_COLLIDE"];
_baserunover23 = createVehicle ["MAP_R2_RockTower", [(_position select 0) + 12, (_position select 1) -121,-0.02],[], 0, "CAN_COLLIDE"];
_baserunover24 = createVehicle ["Gold_Vein_DZE", [(_position select 0) +13, (_position select 1) -14,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover25 = createVehicle ["Gold_Vein_DZE", [(_position select 0) - 6, (_position select 1) - 25,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover26 = createVehicle ["Gold_Vein_DZE",[(_position select 0) - 8, (_position select 1) -17,-0.01],[], 0, "CAN_COLLIDE"];
_baserunover27 = createVehicle ["fiberplant",[(_position select 0) +7, (_position select 1) -1,-0.02],[], 0, "CAN_COLLIDE"];
_baserunover28 = createVehicle ["fiberplant",[(_position select 0) +5, (_position select 1) -6,-0.02],[], 0, "CAN_COLLIDE"];
_baserunover29 = createVehicle ["fiberplant",[(_position select 0) - 13, (_position select 1) -21,-0.02],[], 0, "CAN_COLLIDE"];
_baserunover30 = createVehicle ["fiberplant", [(_position select 0) + 19, (_position select 1) -21,-0.02],[], 0, "CAN_COLLIDE"];
_baserunover = [_baserunover0,_baserunover1,_baserunover2,_baserunover3,_baserunover4,_baserunover5,_baserunover6,_baserunover7,_baserunover8,_baserunover9,_baserunover10,_baserunover11,_baserunover12,_baserunover13,_baserunover14,_baserunover15,_baserunover16,_baserunover17,_baserunover18,_baserunover19,_baserunover20,_baserunover21,_baserunover22,_baserunover23,_baserunover24,_baserunover25,_baserunover26,_baserunover27,_baserunover28,_baserunover29,_baserunover30];
_directions = [-85.388,-151.6,40.18,131.1,-258.57,0,-128.72,165.8,0,66.4,23.5,-13.9,-28.07,0,0,0,-4.74,-69.97,14.54,116.29,92.4,42.23,0,98.4,0,0,0,0,0,0,0];
{ _x setDir (_directions select _forEachIndex) } forEach _baserunover;
{ _x setVectorUp surfaceNormal position _x; } count _baserunover;
//Troops
_rndnum = round (random 5);
[[(_position select 0) +20, (_position select 1) - 54, 0],5,"Medium",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) - 15, (_position select 1) - 70, 0],5,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 60, (_position select 1) - 38, 0],4,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 33, (_position select 1) + 20, 0],_rndnum,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Static Guns
[[
[(_position select 0) + 44, (_position select 1) - 55, 0],
[(_position select 0) + 4, (_position select 1) - 70, 0]
],"M2StaticMG","Hard",_aiType,_aiType,1,2,"Random","Random",_mission] call spawn_static;
// Array of mission variables to send
[
_mission, // Mission number
_position, // Position of mission
"Medium", // Difficulty
"Gold Mine", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
_crate, // crate object info
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
[_baserunover], // cleanup objects
"STR_CL_HERO_GOLDMINE_ANNOUNCE", // mission announcement
"STR_CL_HERO_GOLDMINE_WIN", // mission success
"STR_CL_HERO_GOLDMINE_FAIL", // mission fail
[10,5,20,3,2] // Dynamic crate array
] call mission_winorfail;

View File

@ -0,0 +1,56 @@
private ["_rndnum","_mission","_position","_aiType","_messages","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [40] call find_position;
diag_log format["WAI: [Mission:[%2] Lunch break Convoy]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_IkeaConvoy select 0;} else {Loot_IkeaConvoy select 1;};
//Spawn Crates
[[
[_loot,crates_large,[0,0]]
],_position,_mission] call wai_spawnCrate;
//Troops
[_position,5,"Hard",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[_position,_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[_position,_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Static Guns
[[
[(_position select 0) - 30, (_position select 1) + 4, 0],
[(_position select 0) + 10, (_position select 1) - 30, 0],
[(_position select 0) + 8, (_position select 1) + 30, 0]
],"M2StaticMG","Hard",_aiType,_aiType,1,2,"Random","Random",_mission] call spawn_static;
//Heli Para Drop
[_position,400,"BAF_Merlin_HC3_D","North",[3000,4000],150,1.0,200,10,"Random","Random",4,"Random",_aiType,"Random",_aiType,false,_mission] spawn heli_para;
[cargo_trucks,[(_position select 0) + 19,(_position select 1) + 11],_mission,true,90] call custom_publish;
[refuel_trucks,[(_position select 0) - 14,(_position select 1) - 14],_mission,true,-90] call custom_publish;
[military_unarmed,[(_position select 0) - 20,(_position select 1) - 6],_mission,true,-90] call custom_publish;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_IKEA_ANNOUNCE","STR_CL_HERO_IKEA_WIN","STR_CL_HERO_IKEA_FAIL"];
} else {
["STR_CL_BANDIT_IKEA_ANNOUNCE","STR_CL_BANDIT_IKEA_WIN","STR_CL_BANDIT_IKEA_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Hard", // Difficulty
"IKEA Convoy", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,77 @@
private ["_rndnum","_mission","_position","_aiType","_messages","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[%2] Junk Yard]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_Junkyard select 0;} else {Loot_Junkyard select 1;};
//Spawn Crates
[[
[_loot,crates_small,[.2,0]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["Mi8Wreck",[31,-12.4,-0.12]],
["UralWreck",[-7,-9,-0.04],-49.99],
["UralWreck",[23,4,-0.04],201.46],
["UralWreck",[-7,23,-0.04],80.879],
["HMMWVWreck",[-8,7,-0.04],44.77],
["BMP2Wreck",[-4,24,-0.02],-89],
["T72Wreck",[11,-13,-0.02],27],
["UralWreck",[14,10,-0.02],162],
["T72Wreck",[4,16,-0.02]],
["UH60_ARMY_Wreck_DZ",[7,1.3,-0.02],-41],
["Land_Dirthump01",[9,1,-1.59],25],
["Land_Dirthump01",[8,0.2,-1.59],53],
["Mi8Wreck",[5,-34,-0.02],94],
["BRDMWreck",[-1,-20,-0.12],-1.7],
["T72Wreck",[-9,-21,-0.02],-75],
["Mi8Wreck",[-21,-5,-0.02],-24],
["Land_Misc_Rubble_EP1",[-10.02,7,-0.1]],
["Land_Shed_W03_EP1",[-7,-1.4,-0.02],-99],
["Land_Misc_Garb_Heap_EP1",[-6,1,-0.02]],
["Land_Misc_Garb_Heap_EP1",[18,10,-0.02]],
["Land_Misc_Garb_Heap_EP1",[-10,-12,-0.02]],
["MAP_garbage_misc",[5,-21,-0.02]],
["MAP_garbage_misc",[7,18,-0.02],-178],
["MAP_garbage_paleta",[-12,14,-0.02],-91],
["MAP_Kitchenstove_Elec",[-11,1.5,-0.02],146],
["MAP_tv_a",[-12,-0.01,-0.02],108],
["MAP_washing_machine",[-11,-1,-0.02],100],
["MAP_P_toilet_b_02",[-16,0.01,-0.02],36],
["Land_Misc_Garb_Heap_EP1",[-17,-3,-0.02],93],
["MAP_garbage_paleta",[-11,-0.01,-0.02],21],
["Land_Fire_barrel_burning",[-13,-3,-0.02]],
["Land_Fire_barrel_burning",[2,-9,-0.02]]
],_position,_mission] call wai_spawnObjects;
//Troops
[[(_position select 0) - 2, (_position select 1) - 5, 0],5,"Medium",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) - 19, (_position select 1) + 19, 0],5,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 4);
[[(_position select 0) + 17, (_position select 1) + 21, 0],_rndnum,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 4);
[[(_position select 0) + 17, (_position select 1) + 21, 0],_rndnum,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_JUNKYARD_ANNOUNCE","STR_CL_HERO_JUNKYARD_WIN","STR_CL_HERO_JUNKYARD_FAIL"];
} else {
["STR_CL_BANDIT_JUNKYARD_ANNOUNCE","STR_CL_BANDIT_JUNKYARD_WIN","STR_CL_BANDIT_JUNKYARD_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Medium", // Difficulty
"Junk Yard", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,55 @@
private ["_mission","_position","_loot","_rndnum","_aiType","_messages","_missionType"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [80] call find_position;
diag_log format["WAI: Mission:[%2] Lumber Mill started at %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_LumberJack select 0;} else {Loot_LumberJack select 1;};
//Spawn Crates
[[
[_loot,crates_large,[5,7]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["Land_Ind_SawMill",[-2.4,24]],
["Land_Ind_Timbers",[11,8.6,-.1]],
["Land_Ind_Timbers",[16,12,-.1],-10.45],
["Land_Ind_Timbers",[6,-15],104.95],
["Misc_palletsfoiled",[5,-9,-0.009]],
["Misc_palletsfoiled_heap",[9,-8,-0.05]],
["Land_water_tank",[-10,-7]],
["UralWreck",[-17,5],59.2],
["MAP_t_quercus3s",[22,25,-0.2]]
],_position,_mission] call wai_spawnObjects;
// Troops
[[(_position select 0) + 12, (_position select 1) + 22.5, 0],5,"extreme",["random","at"],4,"random",_aiType,"random",[_aiType,150],_mission] call spawn_group;
[[(_position select 0) + 21, (_position select 1) + 11, 0],5,"hard","random",4,"random",_aiType,"random",_aiType,_mission] call spawn_group;
[[(_position select 0) - 1.12, (_position select 1) - 0.43, 0],5,"random","random",4,"random",_aiType,"random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) - 13, (_position select 1) - 23, 0],_rndnum,"random","random",4,"random",_aiType,"random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) - 13, (_position select 1) - 23, 0],_rndnum,"random","random",4,"random",_aiType,"random",_aiType,_mission] call spawn_group;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_LUMBER_ANNOUNCE","STR_CL_HERO_LUMBER_WIN","STR_CL_HERO_LUMBER_FAIL"];
} else {
["STR_CL_BANDIT_LUMBERMILL_ANNOUNCE","STR_CL_BANDIT_LUMBERMILL_WIN","STR_CL_BANDIT_LUMBERMILL_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Hard", // Difficulty
"Lumber Mill", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,61 @@
private ["_rndnum","_mission","_position","_aiType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[%2] The Farm]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_MacDonald select 0;} else {Loot_MacDonald select 1;};
//Spawn Crates
[[
[_loot,crates_small,[.02,0,.15]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["MAP_sara_stodola",[4,-5,-0.12]],
["MAP_HouseV_2T2",[18,-11,-0.14]],
["MAP_t_quercus3s",[32.4,-32,-0.14]],
["MAP_t_quercus2f",[14,-3,-0.14]],
["MAP_t_pinusN2s",[-12,5,-0.14]],
["datsun01Wreck",[-10,-1,-0.02]],
["Haystack",[-1,-32,-0.02]],
["Haystack_small",[-25,-36,-0.16]],
["Haystack_small",[33,-43,-0.02]],
["Haystack_small",[10,-49,-0.02]],
["Haystack_small",[13,60,-0.02]],
["Haystack_small",[-33,-51,-0.02]],
["Haystack_small",[20,-67,-0.02]],
["Land_Shed_wooden",[10,-24,-0.02]],
["fiberplant",[12,-23,-0.02]]
],_position,_mission] call wai_spawnObjects;
//Troops
[[(_position select 0) - 1, (_position select 1) - 10, 0],5,"Hard",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) - 2, (_position select 1) - 50, 0],5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) - 1, (_position select 1) + 11, 0],5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) - 1, (_position select 1) + 11, 0],_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) - 1, (_position select 1) + 11, 0],_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Humvee Patrol
[[(_position select 0) - 27, (_position select 1) - 18, 0],[(_position select 0) + 32, (_position select 1) + 1, 0],50,2,"Offroad_DSHKM_Gue_DZ","Hard",_aiType,_aiType,_mission] call vehicle_patrol;
//Static Guns
[[[(_position select 0) - 12, (_position select 1) - 18, 0]],"M2StaticMG","Hard",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
[
_mission, // Mission number
_position, // Position of mission
"Hard", // Difficulty
"The Farm", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
["STR_CL_GENERAL_FARM_ANNOUNCE","STR_CL_GENERAL_FARM_WIN","STR_CL_GENERAL_FARM_FAIL"]
] call mission_winorfail;

View File

@ -0,0 +1,75 @@
private ["_rndnum","_room","_mayor_himself","_mission","_position","_mansion","_mayor","_aiType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [40] call find_position;
diag_log format["WAI: [Mission:[%2] Mayors Mansion]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_Mayors select 0;} else {Loot_Mayors select 1;};
//Spawn Crates
[[
[_loot,crates_large,[0,0,.25]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
_mansion = [[
["Land_A_Villa_EP1",[0,0]]
],_position,_mission] call wai_spawnObjects;
//Troops
[_position,5,"Extreme",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Extreme","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Extreme","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Extreme","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[_position,_rndnum,"Extreme","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[_position,_rndnum,"Extreme","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//The Mayor Himself
_mayor = [_position,1,"Extreme","Random",4,"Random","Special","Random",[_aiType,300],_mission] call spawn_group;
_mayor_himself = (units _mayor) select 0;
//Put the Mayor in his room
_room = (6 + ceil(random(3)));
_mayor_himself disableAI "MOVE";
_mayor_himself setPos (_mansion buildingPos _room);
//Let him move once player is near
_mayor_himself spawn {
private ["_mayor","_player_near"];
_mayor = _this;
_player_near = false;
while {!_player_near} do {
_player_near = [(position _mayor),30] call isNearPlayer;
uiSleep 1;
};
_mayor enableAI "MOVE";
};
//Humvee Patrol
[[(_position select 0) + 100, _position select 1, 0],[(_position select 0) + 100, _position select 1, 0],50,2,"HMMWV_Armored","Random",_aiType,_aiType,_mission] call vehicle_patrol;
//Heli Paradrop
[_position,400,"UH60M_EP1_DZE","North",[3000,4000],150,1.0,100,10,"Random","Random",4,"Random",_aiType,"Random",_aiType,false,_mission] spawn heli_para;
//Static mounted guns
[[
[(_position select 0) - 15, (_position select 1) + 15, 8],
[(_position select 0) + 15, (_position select 1) - 15, 8]
],"M2StaticMG","Extreme",_aiType,_aiType,1,2,"Random","Random",_mission] call spawn_static;
[
_mission, // Mission number
_position, // Position of mission
"Extreme", // Difficulty
"Mayors Mansion", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["assassinate",_mayor], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
["STR_CL_MAYOR_ANNOUNCE","STR_CL_MAYOR_WIN","STR_CL_MAYOR_FAIL"]
] call mission_winorfail;

View File

@ -0,0 +1,50 @@
private ["_rndnum","_mission","_position","_aiType","_messages","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[%2] Medical Supply Camp]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_MediCamp select 0;} else {Loot_MediCamp select 1;};
//Spawn Crates
[[
[_loot,"USVehicleBox",[0,0],60]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["MAP_fort_watchtower",[1.5,12.6],-210],
["MAP_MASH",[-17,5.3],60],
["MAP_Stan_east",[-16.5,15.9],-30],
["USMC_WarfareBFieldhHospital",[3,-4.4],60],
["MAP_Stan_east",[-10,19.6],-30],
["MAP_MASH",[-14,-0.4],60]
],_position,_mission] call wai_spawnObjects;
//Troops
[[(_position select 0) - 7.5,(_position select 1) + 7.9,0],5,"Easy",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 3);
[[(_position select 0) - 26,(_position select 1) - 2.4,0],_rndnum,"Easy","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 3);
[[(_position select 0) - 26,(_position select 1) - 2.4,0],_rndnum,"Easy","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_MSC_ANNOUNCE","STR_CL_HERO_MSC_WIN","STR_CL_HERO_MSC_FAIL"];
} else {
["STR_CL_BANDIT_MSC_ANNOUNCE","STR_CL_BANDIT_MSC_WIN","STR_CL_BANDIT_MSC_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Easy", // Difficulty
"Medical Supply Camp", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["kill"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,73 @@
private ["_rndnum","_crate_type","_mission","_position","_crate","_baserunover","_baserunover0","_baserunover1","_baserunover2","_baserunover3","_baserunover4","_baserunover5","_baserunover6","_baserunover7","_baserunover8","_baserunover9","_baserunover10","_baserunover11","_baserunover12","_baserunover13","_baserunover14","_baserunover15"];
// Get mission number, important we do this early
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[Hero] Oil Depot]: Starting... %1",_position];
//Setup the crate
_crate_type = crates_small call BIS_fnc_selectRandom;
_crate = createVehicle [_crate_type,[(_position select 0) + 0.2,(_position select 1),0], [], 0, "CAN_COLLIDE"];
_crate call wai_crate_setup;
//Buildings
_baserunover0 = createVehicle ["MAP_Ind_TankBig",[(_position select 0) - 9.5, (_position select 1) +7,-0.15],[], 0, "CAN_COLLIDE"];
_baserunover1 = createVehicle ["MAP_Ind_TankBig",[(_position select 0) + 11, (_position select 1) +4,-0.15],[], 0, "CAN_COLLIDE"];
_baserunover2 = createVehicle ["MAP_Ind_TankBig",[(_position select 0) +8, (_position select 1) -6,-0.15],[], 0, "CAN_COLLIDE"];
_baserunover3 = createVehicle ["MAP_Ind_TankBig",[(_position select 0) -11, (_position select 1) -12,-0.15],[], 0, "CAN_COLLIDE"];
_baserunover4 = createVehicle ["MAP_Ind_TankBig",[(_position select 0) -28.5, (_position select 1) -1.2,-0.15],[], 0, "CAN_COLLIDE"];
_baserunover5 = createVehicle ["MAP_Ind_TankBig",[(_position select 0) - 26.2, (_position select 1) +20,-0.15],[], 0, "CAN_COLLIDE"];
_baserunover6 = createVehicle ["MAP_Ind_TankBig",[(_position select 0) - 6, (_position select 1) +28,-0.015],[], 0, "CAN_COLLIDE"];
_baserunover7 = createVehicle ["GUE_WarfareBVehicleServicePoint",[(_position select 0) -30, (_position select 1) -15,-0.015],[], 0, "CAN_COLLIDE"];
_baserunover8 = createVehicle ["GUE_WarfareBVehicleServicePoint",[(_position select 0) +21, (_position select 1) +3,-0.015],[], 0, "CAN_COLLIDE"];
_baserunover9 = createVehicle ["GUE_WarfareBVehicleServicePoint",[(_position select 0) - 7, (_position select 1) +43,-0.015],[], 0, "CAN_COLLIDE"];
_baserunover10 = createVehicle ["Barrels",[(_position select 0) +0.1, (_position select 1) +6,-0.015],[], 0, "CAN_COLLIDE"];
_baserunover11 = createVehicle ["Barrels",[(_position select 0) - 17, (_position select 1) +15,-0.015],[], 0, "CAN_COLLIDE"];
_baserunover12 = createVehicle ["Barrels",[(_position select 0) +18, (_position select 1) -2,-0.015],[], 0, "CAN_COLLIDE"];
_baserunover13 = createVehicle ["Barrel1",[(_position select 0) -16, (_position select 1) -2,-0.015],[], 0, "CAN_COLLIDE"];
_baserunover14 = createVehicle ["Barrel1",[(_position select 0) +3, (_position select 1) +6,-0.015],[], 0, "CAN_COLLIDE"];
_baserunover15 = createVehicle ["Barrel1",[(_position select 0) -11.6, (_position select 1) +18,-0.015],[], 0, "CAN_COLLIDE"];
// Adding buildings to one variable just for tidiness
_baserunover = [_baserunover0,_baserunover1,_baserunover2,_baserunover3,_baserunover4,_baserunover5,_baserunover6,_baserunover7,_baserunover8,_baserunover9,_baserunover10,_baserunover11,_baserunover12,_baserunover13,_baserunover14,_baserunover15];
// Set some directions for our buildings
_directions = [0,0,0,0,0,0,0,-176.24,122.11,-0.11,82.81,-0.5,-48,0,0,0];
{ _x setDir (_directions select _forEachIndex) } forEach _baserunover;
// Make buildings flat on terrain surface
{ _x setVectorUp surfaceNormal position _x; } count _baserunover;
//Troops
_rndnum = round (random 5);
[[(_position select 0) - 25, (_position select 1) - 21, 0],5,"Medium",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 32, (_position select 1) + 2, 0],5,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 9, (_position select 1) +40, 0],4,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) -41, (_position select 1) +6, 0],_rndnum,"Medium","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Static Guns
[[[(_position select 0) +6.2, (_position select 1) -28, 0]],"KORD_high_TK_EP1","Easy",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
[[[(_position select 0) -26, (_position select 1) +47, 0]],"KORD_high_TK_EP1","Easy",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
// Array of mission variables to send
[
_mission, // Mission number
_position, // Position of mission
"Medium", // Difficulty
"Oil Depot", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
_crate, // crate object info
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
[_baserunover], // cleanup objects
"STR_CL_HERO_OIL_ANNOUNCE", // mission announcement
"STR_CL_HERO_OIL_WIN", // mission success
"STR_CL_HERO_OIL_FAIL", // mission fail
[10,5,20,3,2] // Dynamic crate array
] call mission_winorfail;

View File

@ -0,0 +1,51 @@
private ["_rndnum","_mission","_position","_aiType","_messages","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[%2] Hero Outpost]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_Outpost select 0;} else {Loot_Outpost select 1;};
//Spawn Crates
[[
[_loot,crates_large,[0,0]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["MAP_76n6_ClamShell",[-6,25],172],
["MAP_budova4_in",[-29,18],0.24],
["MAP_budova4_in",[-29,8],0.24],
["MAP_Mil_Barracks_L",[-23,-13],-119],
["MAP_CamoNetB_NATO",[1.6,0],-203],
["MAP_fort_watchtower",[19,11],-185],
["MAP_fort_watchtower",[4,-20],-103]
],_position,_mission] call wai_spawnObjects;
//Troops
[[(_position select 0) + 2,_position select 1,0],5,"Easy",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 3);
[[(_position select 0) - 2,_position select 1,0],_rndnum,"Easy","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 3);
[[(_position select 0),(_position select 1) + 15,0],_rndnum,"Easy","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_BANDITOUTPOST_ANNOUNCE","STR_CL_HERO_BANDITOUTPOST_WIN","STR_CL_HERO_BANDITOUTPOST_FAIL"];
} else {
["STR_CL_BANDIT_HEROOUTPOST_ANNOUNCE","STR_CL_BANDIT_HEROOUTPOST_WIN","STR_CL_BANDIT_HEROOUTPOST_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Easy", // Difficulty
"Outpost", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["kill"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,60 @@
private ["_mission","_vehname","_vehicle","_position","_vehclass","_name","_locations","_location","_blacklist","_messages","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_loot = if (_missionType == "MainHero") then {Loot_Patrol select 0;} else {Loot_Patrol select 1;};
//Armed Land Vehicle
_vehclass = armed_vehicle call BIS_fnc_selectRandom;
_vehname = getText (configFile >> "CfgVehicles" >> _vehclass >> "displayName");
_locations = nearestLocations [getMarkerPos "center", ["NameCityCapital","NameCity","NameVillage"],15000];
_location = _locations call BIS_fnc_selectRandom;
_position = position _location;
_name = text _location;
_blacklist = ["Stary Sobor"];
{
if ((text _x) == (text _location) || (text _x) in _blacklist) then {
_locations set [_forEachIndex, "rem"];
_locations = _locations - ["rem"];
};
} forEach _locations;
diag_log format["WAI: [Mission:[%2] Patrol]: Starting... %1",_position,_missionType];
//Spawn units
[[(_position select 0) + 4,(_position select 1),0.1],3,"Hard","Random",3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Spawn vehicles
_vehicle = [_vehclass,_position,_mission] call custom_publish;
// load the guns
[_vehicle,_vehclass] call load_ammo;
((wai_mission_data select _mission) select 3) set [count ((wai_mission_data select _mission) select 3), [_vehicle,_loot]];
if(wai_debug_mode) then {
diag_log format["WAI: [%2] patrol spawned a %1",_vehname,_missionType];
};
_messages = if (_missionType == "MainHero") then {
[["STR_CL_HERO_PATROL_ANNOUNCE",_name],"STR_CL_HERO_PATROL_WIN","STR_CL_HERO_PATROL_FAIL"];
} else {
[["STR_CL_BANDIT_PATROL_ANNOUNCE",_name],"STR_CL_BANDIT_PATROL_WIN","STR_CL_BANDIT_PATROL_FAIL"];
};
[
_mission,
_position, // Position of mission
"Medium", // Difficulty
format["Patrol %1",_vehname], // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
3, // Number of wayPoints
_locations, // WayPoints
["kill"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call patrol_winorfail;

View File

@ -0,0 +1,74 @@
private ["_rndnum","_president_himself","_mission","_position","_president","_firstlady","_aiType","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [50] call find_position;
diag_log format["WAI: [Mission:[%2] Presidents in Town]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_Presidents select 0;} else {Loot_Presidents select 1;};
//Spawn Crates
[[
[_loot,crates_large,[0,0,.25]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["Land_A_Office01",[0,0]]
],_position,_mission] call wai_spawnObjects;
//Troops
[_position,5,"Extreme",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Extreme","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Extreme","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Extreme","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[_position,_rndnum,"Extreme","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[_position,_rndnum,"Extreme","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//The President Himself
_president = [[((_position select 0) + 5), _position select 1, 4.1],1,"Extreme","Random",4,"none","Special","Random",[_aiType,500],_mission] call spawn_group;
_firstlady = [[((_position select 0) + 5), _position select 1, 4.1],1,"Extreme","Unarmed",4,"none","Secretary1","Random",[_aiType,0],_mission] call spawn_group;
_president_himself = (units _president) select 0;
_president_himself disableAI "MOVE";
//Let him move once player is near
_president_himself spawn {
private ["_president","_player_near"];
_president = _this;
_player_near = false;
while {!_player_near} do {
_player_near = [(position _president),50] call isNearPlayer;
uiSleep 1;
};
_president enableAI "MOVE";
};
//Humvee Patrol
[[(_position select 0) + 100, _position select 1, 0],[(_position select 0) + 100, _position select 1, 0],50,2,"HMMWV_Armored","Random",_aiType,_aiType,_mission] call vehicle_patrol;
//Heli Paradrop
[_position,400,"UH60M_EP1_DZE","East",[3000,4000],150,1.0,200,10,"Random","Random",4,"Random",_aiType,"Random",_aiType,false,_mission] spawn heli_para;
//Static guns
[[
[(_position select 0) - 13.135, (_position select 1) + 5.025, 5.27],
[(_position select 0) + 14.225, (_position select 1) + 5.025, 5.27],
[(_position select 0) + 1.97, (_position select 1) - 2.368, 10.54]
],"M2StaticMG","Extreme",_aiType,_aiType,1,2,"Random","Random",_mission] call spawn_static;
[
_mission, // Mission number
_position, // Position of mission
"Extreme", // Difficulty
"President's in Town", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["assassinate",_president], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
["STR_CL_PRESIDENT_ANNOUNCE","STR_CL_PRESIDENT_WIN","STR_CL_PRESIDENT_FAIL"]
] call mission_winorfail;

View File

@ -0,0 +1,61 @@
private ["_mission","_position","_rndnum","_aiType","_messages","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [80] call find_position;
diag_log format["WAI: Mission:[%2] Radio Tower started at %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_Radioshack select 0;} else {Loot_Radioshack select 1;};
//Spawn Crates
[[
[_loot,"UNBasicWeapons_EP1",[.01,.01]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["Land_cihlovej_dum_in",[-3,-1]],
["Land_Com_tower_ep1",[5,-2]],
["LADAWreck",[-7.5,-3]],
["FoldTable",[-1.2,-4]],
["FoldChair",[-1,-3]],
["SmallTV",[-1.7,-4,0.82]],
["SatPhone",[-0.8,-4,0.82],-201.34],
["MAP_t_picea2s",[-4.5,7]],
["MAP_t_picea2s",[13,10]],
["MAP_t_pinusN2s",[3,9]],
["MAP_t_pinusN1s",[8,17]],
["MAP_t_picea1s",[7,10]],
["MAP_t_picea2s",[34,-29]],
["MAP_t_fraxinus2s",[-14,1]],
["MAP_t_carpinus2s",[28,-13]]
],_position,_mission] call wai_spawnObjects;
// Troops
[[(_position select 0) - 1.2, (_position select 1) - 20, 0],5,"extreme",["random","at"],4,"random",_aiType,"random",[_aiType,150],_mission] call spawn_group;
[[(_position select 0) - 4, (_position select 1) + 16, 0],5,"hard","random",4,"random",_aiType,"random",_aiType,_mission] call spawn_group;
[[(_position select 0) - 17, (_position select 1) - 4, 0],5,"random","random",4,"random",_aiType,"random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) + 14, (_position select 1) - 3, 0],_rndnum,"random","random",4,"random",_aiType,"random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) + 14, (_position select 1) - 3, 0],_rndnum,"random","random",4,"random",_aiType,"random",_aiType,_mission] call spawn_group;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_RADIO_ANNOUNCE","STR_CL_HERO_RADIO_WIN","STR_CL_HERO_RADIO_FAIL"];
} else {
["STR_CL_BANDIT_RADIOTOWER_ANNOUNCE","STR_CL_BANDIT_RADIOTOWER_WIN","STR_CL_BANDIT_RADIOTOWER_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Hard", // Difficulty
"Radio Tower", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,64 @@
private ["_crate_type","_mission","_position","_crate","_rndnum","_baserunover","_baserunover0","_baserunover1","_baserunover2","_baserunover3","_baserunover4","_baserunover5","_baserunover6","_baserunover7","_baserunover8","_baserunover9","_baserunover10"];
// Get mission number, important we do this early
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [80] call find_position;
diag_log format["WAI: [Mission:[Hero] Refugee Camp]: Starting... %1",_position];
//Setup the crate
_crate_type = crates_large call BIS_fnc_selectrandom; // Choose between crates_large, crates_medium and crates_small
_crate = createVehicle [_crate_type,[(_position select 0) - 0.01, (_position select 1) - 0.01,-0.15],[],0,"CAN_COLLIDE"];
_crate call wai_crate_setup;
//Buildings
_baserunover0 = createVehicle ["MAP_Astan",[(_position select 0) - 3, (_position select 1) -5.4,-0.15],[], 0, "CAN_COLLIDE"];
_baserunover1 = createVehicle ["MAP_A_tent",[(_position select 0) + 3.8, (_position select 1) -1,-0.15],[], 0, "CAN_COLLIDE"];
_baserunover2 = createVehicle ["Land_Campfire_burning",[(_position select 0) - 2, (_position select 1) -1,-0.15],[], 0, "CAN_COLLIDE"];
_baserunover3 = createVehicle ["Fuel_can",[(_position select 0) +0.1, (_position select 1) +3,-0.15],[], 0, "CAN_COLLIDE"];
_baserunover4 = createVehicle ["Land_Blankets_EP1",[(_position select 0) - 4, (_position select 1) +0.4,-0.15],[], 0, "CAN_COLLIDE"];
_baserunover5 = createVehicle ["Park_bench1",[(_position select 0) - 1, (_position select 1) +4,-0.15],[], 0, "CAN_COLLIDE"];
_baserunover6 = createVehicle ["MAP_Astan",[(_position select 0) - 4, (_position select 1) +10,-0.015],[], 0, "CAN_COLLIDE"];
_baserunover7 = createVehicle ["Land_Bag_EP1",[(_position select 0) +1, (_position select 1) +7,-0.015],[], 0, "CAN_COLLIDE"];
_baserunover8 = createVehicle ["Land_A_tent",[(_position select 0) - 10, (_position select 1) -6,-0.015],[], 0, "CAN_COLLIDE"];
_baserunover9 = createVehicle ["LADAWreck",[(_position select 0) - 11, (_position select 1) +2,-0.015],[], 0, "CAN_COLLIDE"];
_baserunover10 = createVehicle ["Land_transport_cart_EP1",[(_position select 0) - 9, (_position select 1) +7,-0.015],[], 0, "CAN_COLLIDE"];
// Adding buildings to one variable just for tidiness
_baserunover = [_baserunover0,_baserunover1,_baserunover2,_baserunover3,_baserunover4,_baserunover5,_baserunover6,_baserunover7,_baserunover8,_baserunover9,_baserunover10];
// Set some directions for our buildings
_directions = [0,64,0,0,0,0,128,0,-166.5,16.4,23];
{ _x setDir (_directions select _forEachIndex) } forEach _baserunover;
// Make buildings flat on terrain surface
{ _x setVectorUp surfaceNormal position _x; } count _baserunover;
//Troops
_rndnum = round (random 5);
[[(_position select 0) - 13, (_position select 1) - 7,0],5,"Easy",["Random","AT"],3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 7, (_position select 1) + 15,0],5,"Easy","Random",3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 4, (_position select 1)- 14,0],_rndnum,"Easy","Random",3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
// Array of mission variables to send
[
_mission, // Mission number
_position, // Position of mission
"Medium", // Difficulty
"Refugee Camp", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
_crate, // crate object info
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
[], // cleanup objects
"STR_CL_HERO_REFUGEE_ANNOUNCE", // mission announcement
"STR_CL_HERO_REFUGEE_WIN", // mission success
"STR_CL_HERO_REFUGEE_FAIL", // mission fail
[10,4,0,3,2] // Dynamic crate array
] call mission_winorfail;

View File

@ -0,0 +1,43 @@
private ["_mission","_position","_rndnum","_aiType","_messages","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[%2] Scout Patrol]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_ScoutPatrol select 0;} else {Loot_ScoutPatrol select 1;};
// Spawn crates
[[
[_loot,crates_medium,[0,0]]
],_position,_mission] call wai_spawnCrate;
//Troops
[_position,5,"Easy",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 3);
[_position,_rndnum,"Easy","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 3);
[_position,_rndnum,"Easy","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Spawn vehicle
[civil_vehicles,_position,_mission] call custom_publish;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_BANDITPATROL_ANNOUNCE","STR_CL_HERO_BANDITPATROL_WIN","STR_CL_HERO_BANDITPATROL_FAIL"];
} else {
["STR_CL_BANDIT_HEROPATROL_ANNOUNCE","STR_CL_BANDIT_HEROPATROL_WIN","STR_CL_BANDIT_HEROPATROL_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Easy", // Difficulty
"Scout Patrol", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["kill"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,51 @@
private ["_rndnum","_mission","_position","_aiType","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[%2] Slaughter House]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_SlaughterHouse select 0;} else {Loot_SlaughterHouse select 1;};
//Spawn Crates
[[
[_loot,crates_medium,[2.5,0,.1]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["Land_aif_tovarna1",[-0.01,-0.01,-0.02]],
["Land_stand_meat_EP1",[-4,2,-0.02],0.3693],
["Land_stand_meat_EP1",[-2,2,-0.02],0.3693],
["Land_stand_meat_EP1",[0.001,2,-0.02],0.3693],
["Land_stand_meat_EP1",[-1,2,-0.02],0.3693],
["Land_stand_meat_EP1",[2,2,-0.02],0.3693],
["Land_stand_meat_EP1",[4,2,-0.02],0.3693],
["Mass_grave",[-3,20,-0.02]],
["Mass_grave",[4,18,-0.02]],
["Mass_grave",[0,-15,-0.02]],
["Axe_woodblock",[-4,-14,-0.02],-25],
["Land_Table_EP1",[2,-2,-0.02]],
["MAP_icebox",[-2,-0.01,-0.02]]
],_position,_mission] call wai_spawnObjects;
//Troops
[[(_position select 0) + 9, (_position select 1) - 13, 0],5,"Easy",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 3);
[[(_position select 0) + 13, (_position select 1) + 15, 0],_rndnum,"Easy","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 3);
[[(_position select 0) + 13, (_position select 1) + 15, 0],_rndnum,"Easy","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[
_mission, // Mission number
_position, // Position of mission
"Easy", // Difficulty
"Slaughter House", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
["STR_CL_GENERAL_SLAUGHTERHOUSE_ANNOUNCE","STR_CL_GENERAL_SLAUGHTERHOUSE_WIN","STR_CL_GENERAL_SLAUGHTERHOUSE_FAIL"]
] call mission_winorfail;

View File

@ -0,0 +1,62 @@
private ["_rndnum","_mission","_vehname","_vehicle","_position","_vehclass","_aiType","_messages","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
//Military Chopper
_vehclass = armed_chopper call BIS_fnc_selectRandom;
_vehname = getText (configFile >> "CfgVehicles" >> _vehclass >> "displayName");
diag_log format["WAI: [Mission:[%2] Sniper Extraction]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_Extraction select 0;} else {Loot_Extraction select 1;};
//Spawn Crates
[[
[_loot,crates_medium,[0,10]]
],_position,_mission] call wai_spawnCrate;
//Troops
[_position,5,"Hard",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[_position,_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[_position,_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Static Guns
[[
[(_position select 0) + 30, (_position select 1) - 30, 0],
[(_position select 0) + 30, (_position select 1) + 30, 0],
[(_position select 0) - 30, (_position select 1) - 30, 0],
[(_position select 0) - 30, (_position select 1) + 30, 0]
],"M2StaticMG","Hard",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
//Spawn vehicle
[_vehclass,_position,_mission] call custom_publish;
if(wai_debug_mode) then {
diag_log format["WAI: [%2] sniper_extraction spawned a %1",_vehname,_missionType];
};
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_MILCHOPPER_ANNOUNCE","STR_CL_HERO_MILCHOPPER_WIN","STR_CL_HERO_MILCHOPPER_FAIL"];
} else {
["STR_CL_BANDIT_EXTRACTION_ANNOUNCE","STR_CL_BANDIT_EXTRACTION_WIN","STR_CL_BANDIT_EXTRACTION_FAIL"];
};
// Array of mission variables to send
[
_mission, // Mission number
_position, // Position of mission
"Hard", // Difficulty
format["Sniper Extraction %1", _vehname], // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,67 @@
private ["_rndnum","_mission","_position","_aiType","_messages","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[%2] Tank Column]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_TankColumn select 0;} else {Loot_TankColumn select 1;};
//Spawn Crates
[[
[_loot,crates_small,[.02,0]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["MAP_T34",[2.2,-12],91.28],
["MAP_T34",[12.2,-12],92.01],
["MAP_T34",[21,-13],108.4],
["MAP_T34",[29,-16],112.3],
["GUE_WarfareBVehicleServicePoint",[10,-19]],
["MAP_Hlidac_budka",[10,-7]],
["Land_tent_east",[-0.3,0.3],90],
["MAP_t_picea2s",[-3,12]],
["MAP_t_pinusN1s",[-12,3]],
["MAP_t_pinusN2s",[-10,13,-0.02]],
["MAP_t_acer2s",[9,2]],
["Land_Fire_barrel_burning",[-9,-1]]
],_position,_mission] call wai_spawnObjects;
//Troops
[[(_position select 0) - 7, (_position select 1) - 10, 0],5,"Hard",["Random","AT"],4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 16, (_position select 1) - 5, 0],5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) + 4, (_position select 1) + 18, 0],5,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) + 4, (_position select 1) + 18, 0],_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 5);
[[(_position select 0) + 4, (_position select 1) + 18, 0],_rndnum,"Hard","Random",4,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Humvee Patrol
[[(_position select 0) + 22, (_position select 1) + 32, 0],[(_position select 0) + 15, (_position select 1) - 33, 0],50,2,"HMMWV_Armored","Hard",_aiType,_aiType,_mission] call vehicle_patrol;
//Static Guns
[[
[(_position select 0) + 8, (_position select 1) - 29, 0],
[(_position select 0) + 12, (_position select 1) + 24, 0]
],"M2StaticMG","Hard",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_TANK_ANNOUNCE","STR_CL_HERO_TANK_WIN","STR_CL_HERO_TANK_FAIL"];
} else {
["STR_CL_BANDIT_TANK_ANNOUNCE","STR_CL_BANDIT_TANK_WIN","STR_CL_BANDIT_TANK_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Hard", // Difficulty
"Tank Column", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,48 @@
private ["_missionType","_messages","_aiType","_mission","_rndnum","_vehname","_position","_vehclass","_plane","_startArray","_startPos","_dropzone","_aigroup","_pilot","_wp","_complete","_timeout","_vehDropped","_vehicle","_parachute","_missionType","_color"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
//Armed Land Vehicle
_vehclass = armed_vehicle call BIS_fnc_selectRandom;
_vehname = getText (configFile >> "CfgVehicles" >> _vehclass >> "displayName");
// Plane
_airClass = ["C130J_US_EP1_DZ","MV22_DZ"] call BIS_fnc_selectRandom;
_airName = getText (configFile >> "CfgVehicles" >> _airClass >> "displayName");
diag_log format["WAI: [Mission:[%3] %1 Vehicle Drop]: Starting... %2",_airName,_position,_missionType];
//Troops
[_position,5,"Medium",["Random","AT"],3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[_position,5,"Medium","Random",3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 4);
[_position,_rndnum,"Medium","Random",3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 4);
[_position,_rndnum,"Medium","Random",3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
if(wai_debug_mode) then {
diag_log format["WAI: [%3] %1 Vehicle Drop spawned a %2",_airName,_vehname,_missionType];
};
_messages = if (_missionType == "MainHero") then {
[["STR_CL_HERO_AIRDROP_ANNOUNCE",_airName,_vehname],["STR_CL_HERO_AIRDROP_CRASH",_airName],["STR_CL_HERO_AIRDROP_DROP",_vehname],["STR_CL_HERO_AIRDROP_WIN",_vehname],["STR_CL_HERO_AIRDROP_FAIL",_vehname]];
} else {
[["STR_CL_BANDIT_AIRDROP_ANNOUNCE",_airName,_vehname],["STR_CL_BANDIT_AIRDROP_CRASH",_airName],["STR_CL_BANDIT_AIRDROP_DROP",_vehname],["STR_CL_BANDIT_AIRDROP_WIN",_vehname],["STR_CL_BANDIT_AIRDROP_FAIL",_vehname]];
};
[
_mission, // Mission number
_position, // Position of mission
"Medium", // Difficulty
format["%1 Air Drop",_airName], // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_airClass, // Class of plane to deliver the vehicle
_vehclass, // Class of vehicle to air drop
_messages
] call wai_air_drop;

View File

@ -0,0 +1,58 @@
private ["_mission","_position","_rndnum","_aiType","_messages","_missionType","_loot"];
_mission = count wai_mission_data -1;
_missionType = _this select 0; // Type of mission: "MainHero" or "MainBandit"
_aiType = _this select 1; // Type of AI - opposite of mission type
_position = [30] call find_position;
diag_log format["WAI: [Mission:[%2] Weapons Cache]: Starting... %1",_position,_missionType];
_loot = if (_missionType == "MainHero") then {Loot_WeaponCache select 0;} else {Loot_WeaponCache select 1;};
// Spawn crates
[[
[_loot,crates_large,[0,0]]
],_position,_mission] call wai_spawnCrate;
// Spawn Objects
[[
["Land_fortified_nest_big_EP1",[-14,23.5],-210],
["Land_fortified_nest_big_EP1",[12,-24,-0.01],-390],
["Land_HBarrier_large",[-18,1,-0.3],90],
["Land_HBarrier_large",[-8,-16,-0.3],30],
["Land_HBarrier_large",[18,-1.5,-0.3],90],
["Land_HBarrier_large",[7,16,-0.3],30],
["DesertLargeCamoNet_DZ",[-1,0],-26]
],_position,_mission] call wai_spawnObjects;
//Troops
[[(_position select 0) + 6.5,(_position select 1) - 12,0],5,"Easy",["Random","AT"],3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
[[(_position select 0) - 8,(_position select 1) + 14,0],5,"Easy","Random",3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 4);
[[(_position select 0) - 21,(_position select 1) - 12.5,0],_rndnum,"Easy","Random",3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
_rndnum = ceil (random 4);
[[(_position select 0) - 21,(_position select 1) - 12.5,0],_rndnum,"Easy","Random",3,"Random",_aiType,"Random",_aiType,_mission] call spawn_group;
//Static Guns
[[
[(_position select 0) + 18, (_position select 1) - 13, 0],
[(_position select 0) - 19.5, (_position select 1) + 12, 0]
],"M2StaticMG","Easy",_aiType,_aiType,0,2,"Random","Random",_mission] call spawn_static;
_messages = if (_missionType == "MainHero") then {
["STR_CL_HERO_WEAPONCACHE_ANNOUNCE","STR_CL_HERO_WEAPONCACHE_WIN","STR_CL_HERO_WEAPONCACHE_FAIL"];
} else {
["STR_CL_BANDIT_WEAPONCACHE_ANNOUNCE","STR_CL_BANDIT_WEAPONCACHE_WIN","STR_CL_BANDIT_WEAPONCACHE_FAIL"];
};
[
_mission, // Mission number
_position, // Position of mission
"Medium", // Difficulty
"Weapon Cache", // Name of Mission
_missionType, // Mission Type: MainHero or MainBandit
true, // show mission marker?
true, // make minefields available for this mission
["crate"], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] call mission_winorfail;

View File

@ -0,0 +1,182 @@
local _mission = count WAI_MissionData -1;
local _aiType = _this select 0; // "Bandit" or "Hero"
local _name = "Wuhan Lab";
local _supportedMaps = ["chernarus","chernarus_winter"]; // The default positions listed below are for Chernarus. If you wish to use this mission on another map then you must gather your own list of flat terrain positions.
local _flatPositions = [[4277.94,9457.53],[4144.92,9439.12],[4229.24,9749.14],[3314.31,10614.7],[2152.91,10467.1],[1956.85,10338.3],[4138.71,12630.3],[3999.11,12659.3],[3733.19,14063.7],[3505.19,14168.2],[5191.49,13994.6],[5986.83,14403.1],[6282.33,14097.3],[6497.14,13582.8],[14255.6,14169.6],[13231.9,10718.3],[12080.6,9895.28],[10612.5,8441.86],[8737.68,9200.67],[7137.15,9483.91],[7406.85,3487.04],[7139.72,5321.27],[5227.21,2202.33],[4149.34,2772.77],[1143.01,2439.9],[1230.53,2526.4],[1157.66,4245.54],[1246.03,4612.52],[4436.68,8472.96],[4748.81,5867.21],[5852.48,11010.3]]; // Chernarus
local _position = [_flatPositions] call isValidSpot;
if (count _position < 1 || {!(toLower worldName in _supportedMaps)}) exitWith {
if (_aiType == "Hero") then {
WAI_HeroRunning = WAI_HeroRunning - 1; WAI_MissionData set [_mission, -1]; WAI_MarkerReady = true;
} else {
WAI_BanditRunning = WAI_BanditRunning - 1; WAI_MissionData set [_mission, -1]; WAI_MarkerReady = true;
};
};
local _startTime = diag_tickTime;
local _difficulty = "Extreme";
local _localized = ["STR_CL_MISSION_BANDIT", "STR_CL_MISSION_HERO"] select (_aiType == "Hero");
local _localName = "STR_CL_WUHAN_TITLE";
diag_log format["[WAI]: %1 %2 started at %3.",_aiType,_name,_position];
local _messages = ["STR_CL_WUHAN_ANNOUNCE","STR_CL_WUHAN_WIN","STR_CL_WUHAN_FAIL"];
////////////////////// Do not edit this section ///////////////////////////
local _markers = [1,1,1,1];
//[position,createMarker,setMarkerColor,setMarkerType,setMarkerShape,setMarkerBrush,setMarkerSize,setMarkerText,setMarkerAlpha]
_markers set [0, [_position, "WAI" + str(_mission), "ColorBlack", "", "ELLIPSE", "Solid", [300,300], [], 0]];
_markers set [1, [_position, "WAI" + str(_mission) + "dot", "ColorBlack", "mil_dot", "", "", [], [_localized,_localName], 0]];
if (WAI_AutoClaim) then {_markers set [2, [_position, "WAI" + str(_mission) + "auto", "ColorRed", "", "ELLIPSE", "Border", [WAI_AcAlertDistance,WAI_AcAlertDistance], [], 0]];};
DZE_ServerMarkerArray set [count DZE_ServerMarkerArray, _markers]; // Markers added to global array for JIP player requests.
_markerIndex = count DZE_ServerMarkerArray - 1;
PVDZ_ServerMarkerSend = ["start",_markers];
publicVariable "PVDZ_ServerMarkerSend";
WAI_MarkerReady = true;
// Add the mission's position to the global array so that other missions do not spawn near it.
DZE_MissionPositions set [count DZE_MissionPositions, _position];
local _posIndex = count DZE_MissionPositions - 1;
// Send announcement
[_difficulty,(_messages select 0)] call WAI_Message;
// Wait until a player is within range or timeout is reached.
local _timeout = false;
local _claimPlayer = objNull;
while {WAI_WaitForPlayer && !_timeout && {isNull _claimPlayer}} do {
_claimPlayer = [_position, WAI_TimeoutDist] call isClosestPlayer;
if (diag_tickTime - _startTime >= (WAI_Timeout * 60)) then {
_timeout = true;
};
uiSleep 1;
};
if (_timeout) exitWith {
[_mission, _aiType, _markerIndex, _posIndex] call WAI_AbortMission;
[_difficulty,(_messages select 2)] call WAI_Message;
diag_log format["WAI: %1 %2 aborted.",_aiType,_name,_position];
};
//////////////////////////////// End //////////////////////////////////////
// Random position for doctor and loot crate pair.
local _pos1 = [[0.791992,-2.81055,-6.12189],[1.79688,-1.57813,-6.12915]];
local _pos2 = [[-8.97363,10.8223,-6.01758],[-6.66406,13.3125,-6.1272]];
local _pos3 = [[2.0957,11.3994,-6.0177],[3.22754,13.25,-6.1203]];
local _pos4 = [[1.17383,7.71289,-6.12878],[-0.625,8.07324,-6.1272]];
local _pos5 = [[4.36523,4.60059,-6.01764],[3.87012,8.42773,-6.12732]];
local _pos6 = [[5.82227,13.2188,-6.12933],[5.83398,10.6621,-6.01636]];
local _pos7 = [[12.3428,13.1719,-6.1283],[12.2422,10.1768,-6.01428]];
local _pos8 = [[11.7949,6.40527,-6.11945],[8.39355,4.33887,-6.02197]];
local _random = [_pos1,_pos2,_pos3,_pos4,_pos5,_pos6,_pos7,_pos8] call BIS_fnc_selectRandom;
local _drPos = _random select 0;
local _cratePos = _random select 1;
// Spawn Objects
local _objects = [[
["Land_Fort_Watchtower",[-4.4077, -60.0694, 0],-120],
["Land_Fort_Watchtower",[56.2158, -25.0235, 0],-120],
["Land_MBG_Warehouse",[12.1426, -16.8252, 0],150],
["Land_fortified_nest_big",[0,0,-0.15467919],-30.100697],
["Land_MBG_Shoothouse_1",[13.271, -19.3584, 0.28743303],60],
["Land_MBG_Cinderwall_5",[4.0615, -33.7168, 0],60], // MBG_Cinderwall_5_InEditor
["Land_MBG_Cinderwall_5",[1.5293, -29.4073, 0],60],
["Land_MBG_Cinderwall_5",[-1.0054, -25.0909, 0],60],
["Land_MBG_Cinderwall_5",[-3.5005, -20.8243, 0],60],
["Land_MBG_Killhouse_3",[-22.3096, -0.5235, 0],-120],
["Land_MBG_Killhouse_4",[-13.5767, 30.7295, 0],150],
["Land_MBG_Killhouse_3",[15.9302, 20.9648, 0],-300],
["Land_MBG_Cinderwall_5_Corner",[3.478, 37.1357, 0],150], // MBG_Cinderwall_5_Corner_InEditor
["Land_MBG_Cinderwall_5_Gate",[-0.2002, 36.3154, 0],-30], // MBG_Cinderwall_5_Gate_InEditor
["Land_MBG_Cinderwall_5_Gate",[-26.4517, 21.4033, 0],-30],
["Land_MBG_Cinderwall_5_Corner",[-29.0083, 18.5996, 0],60],
["Land_MBG_Cinderwall_5",[-28.1431, 14.999, 0],60],
["Land_MBG_Cinderwall_5",[6.2939, 34.4404, 0],60],
["Land_MBG_Cinderwall_5",[-4.4482, 33.8613, 0],-30],
["Land_MBG_Cinderwall_5",[-22.2583, 23.8632, 0],-30],
["MAP_Misc_Cargo1B",[24.9292, 0.9345, 0],-30],
["MAP_Misc_Cargo1B",[34.9565, -15.6846, 0],-30],
["MAP_Misc_Cargo1B",[6.5254, -41.9004, 0],60],
["Land_fort_bagfence_round",[-37.1982, 23.5771, -0.14746886],-70],
["Land_fort_bagfence_round",[3.3857, 45.7832, -0.14746886],14],
["Land_fortified_nest_small",[-9.4155, -0.4756, -0.14746886],183],
["MetalFloor4x_DZ",[8.9087, -26.669, 3.24],-30],
["MetalFloor4x_DZ",[18.0439, -21.3194, 3.24],-30],
["MetalFloor4x_DZ",[4.6528, -19.3653, 3.24],-30],
["MetalFloor4x_DZ",[13.7612, -14.1309, 3.24],-30],
["MetalFloor4x_DZ",[21.3423, -19.4834, 3.24],-30],
["MetalFloor4x_DZ",[17.272, -12.2481, 3.24],-30],
["Base_WarfareBBarrier10xTall",[26.7978, 41.8203, 0],60],
["Base_WarfareBBarrier10xTall",[39.0347, 20.0703, 0],60],
["Base_WarfareBBarrier10xTall",[51.9346, -2.4209, 0],60],
["Base_WarfareBBarrier10xTall",[-50.4038, 0.7959, 0],60],
["Base_WarfareBBarrier10xTall",[-36.96, -21.9727, 0],60],
["Base_WarfareBBarrier10xTall",[-23.4951, -44.9912, 0],60],
["Base_WarfareBBarrier10xTall",[30.8892, -53.1153, 0],-30],
["Base_WarfareBBarrier10xTall",[-26.7476, 52.0547, 0],150]
],_position,_mission] call WAI_SpawnObjects;
//Spawn Crates
local _loot = if (_aiType == "Hero") then {Loot_Wuhan select 0;} else {Loot_Wuhan select 1;};
[[
[_loot,WAI_CrateSm,[0,0]]
],((_objects select 2) modelToWorld _cratePos),_mission] call WAI_SpawnCrate;
// The doctor
local _drGrp = [((_objects select 2) modelToWorld _drPos),1,"Easy","Random","","none","Gardener_DZ","Random",[_aiType,500],_mission] call WAI_SpawnGroup;
_drGrp setVariable ["DoNotFreeze", true];
local _doctor = leader _drGrp;
_doctor disableAI "MOVE";
// External Troops
[[(_position select 0) - 26.7149, (_position select 1) + 44.2705, 0],5,_difficulty,"Random","AA","Random",WAI_ScientistSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
[[(_position select 0) - 35.6089, (_position select 1) - 11.2735, 0],5,_difficulty,"Random","","Random",WAI_ScientistSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
[[(_position select 0) - 26.1333, (_position select 1) - 45.6035, 0],5,_difficulty,"Random","","Random",WAI_ScientistSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
//[[(_position select 0) + 34.8667, (_position select 1) + 7.6396, 0],5,_difficulty,"Random","","Random",WAI_ScientistSkin,"Random",_aiType,_mission] call WAI_SpawnGroup;
// Internal Troops - these use "SENTRY" waypoint type
//[[(_position select 0) - 14.0933, (_position select 1) + 8.5674, .25],5,_difficulty,"Random","AT","Random","RU_Doctor","Random",_aiType,_mission] call WAI_SpawnGroup;
[[(_position select 0) + 4.646, (_position select 1) + 18.4238, .25],5,_difficulty,"Random","","Random","RU_Doctor","Random",_aiType,_mission] call WAI_SpawnGroup;
[[(_position select 0) + 2.5156, (_position select 1) - 10.1075, .25],5,_difficulty,"Random","","Random","RU_Doctor","Random",_aiType,_mission] call WAI_SpawnGroup;
[[(_position select 0) + 28.0249, (_position select 1) - 12.8565, .25],5,_difficulty,"Random","","Random","RU_Doctor","Random",_aiType,_mission] call WAI_SpawnGroup;
//[[(_position select 0) + 14.7788, (_position select 1) - 20.7061, .25],5,_difficulty,"Random","","Random","RU_Doctor","Random",_aiType,_mission] call WAI_SpawnGroup;
// Vehicle Patrol
[[(_position select 0) + 100, _position select 1, 0],[(_position select 0) + 100, _position select 1, 0],50,2,"T810A_PKT_DES_ACR_DZ","Random",_aiType,_aiType,_mission] call WAI_VehPatrol;
//Static guns
[[
((_objects select 0) modelToWorld [-0.0166016,2.62402,0.558044]),
((_objects select 1) modelToWorld [-0.0166016,2.62402,0.558044]),
[(_position select 0) - 35.5835, (_position select 1) + 23.0283, 0],
[(_position select 0) + 2.835, (_position select 1) + 44.1552, 0],
((_objects select 2) modelToWorld [15.1514,-2.4043,-6.13165]),
[(_position select 0) - 10.0166, (_position select 1) + 0.2011, 0],
((_objects select 2) modelToWorld [19.4072,16.3848,-6.10211])
],"KORD_high",_difficulty,_aiType,_aiType,"Random","Random","Random",_mission] call WAI_SpawnStatic;
// Spawn Vehicles
local _vehicle = [WAI_APC,[(_position select 0) + 5.4551, (_position select 1) + 5.9316], _mission, true, -30] call WAI_PublishVeh;
[_vehicle,(typeOf _vehicle),2] call WAI_LoadAmmo;
uiSleep 1; // the warehouse needs to be fully spawned in to place the heli on the roof.
_vehicle = [WAI_ArmedHeli,[(_position select 0) + 2.1392, (_position select 1) - 21.5498, 11.75], _mission, true, -30] call WAI_PublishVeh;
[_vehicle,(typeOf _vehicle),2] call WAI_LoadAmmo;
[
_mission, // Mission number
_position, // Position of mission
_difficulty, // Difficulty
_name, // Name of Mission
_localName,
_aiType, // "Bandit" or "Hero"
_markerIndex,
_posIndex,
_claimPlayer,
true, // show mission marker?
false, // make minefields available for this mission
["assassinate",_doctor], // Completion type: ["crate"], ["kill"], or ["assassinate", _unitGroup],
_messages
] spawn WAI_MissionMonitor;

View File

@ -0,0 +1,210 @@
//Custom Spawns file//
// These custom spawns are for use in static mission locations. You can set markers in mission.sqm if you want them.
/*
Custom group spawns Eg.
[
[953.237,4486.48,0.001], // Position
4, // Number Of units
"Random", // Skill level of unit (easy, medium, hard, extreme, Random)
"Random", or ["Random","at"], // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
4, // Number of magazines
"Random", // Backpack classname, use "Random" or classname here
"Random", // Skin classname, use "Random" or classname here
"Random", // Gearset number. "Random" for random gear set
"Bandit" // AI Type, "Hero" or "Bandit".
] call spawn_group;
Place your custom group spawns below
*/
/*
Custom static weapon spawns Eg. (with multiple positions)
[
[ // Position(s) (can be multiple)
[911.21,4532.76,2.62],
[921.21,4542.76,2.62]
],
"M2StaticMG", // Classname of turret
"easy", // Skill level of unit (easy, medium, hard, extreme, Random)
"Bandit2_DZ", // Skin classname, use "Random" or classname here
"Bandit", // AI Type, "Hero" or "Bandit".
"Random", // Primary gun set number. "Random" for random weapon set
2, // Number of magazines
"Random", // Backpack classname, use "Random" or classname here
"Random" // Gearset classname, use "Random" or classname here
] call spawn_static;
Place your custom static weapon spawns below
*/
/*
Custom Chopper Patrol spawn Eg.
[
[725.391,4526.06,0], // Position to patrol
700, // Radius of patrol
10, // Number of waypoints to give
"UH1H_DZ", // Classname of vehicle (make sure it has driver and two gunners)
"Random", // Skill level of units (easy, medium, hard, extreme, Random)
"Random", // Skin classname, use "Random" or classname here
"Bandit" // AI Type, "Hero" or "Bandit".
] call heli_patrol;
Place your heli patrols below
*/
/*
Custom Vehicle patrol spawns Eg. (Watch out they are stupid)
[
[725.391,4526.06,0], // Position to patrol
[725.391,4526.06,0], // Position to spawn at
200, // Radius of patrol
10, // Number of waypoints to give
"HMMWV_Armored", // Classname of vehicle (make sure it has driver and gunner)
"Random", // Skill level of units (easy, medium, hard, extreme, Random)
"Random", // Skin classname, use "Random" or classname here
"Bandit" // AI Type, "Hero" or "Bandit".
] call vehicle_patrol;
Place your vehicle patrols below this line
*/
/*
Custom Boat patrol spawns
[
[725.391,4526.06,0], // Position to patrol
[725.391,4526.06,0], // Position to spawn at
150, // Radius of patrol. Your spawn point should be at least this distance from shore.
10, // Number of waypoints to give
"RHIB", // Classname of armed boat (make sure it has driver and gunner)
"Random", // Skill level of units (easy, medium, hard, extreme, Random)
"Random", // Skin classname, use "Random" or classname here
"Bandit" // AI Type, "Hero" or "Bandit".
] call vehicle_patrol;
Place your boat patrols below this line
*/
/* Uncomment this section for Skalisty Island Boat Patrols
[
[13117.2,2866.65,0], // Position to patrol
[13117.2,2866.65,0], // Position to spawn at, can be same as patrol location
150, // Radius of patrol
10, // Number of waypoints to give
"RHIB", // Classname of armed boat (make sure it has driver and gunner)
"Random", // Skill level of units (easy, medium, hard, extreme, Random)
"Random", // Skin classname, use "Random" or classname here
"Bandit" // AI Type, "Hero" or "Bandit".
] call vehicle_patrol;
[
[13552.5,2566.86,0], // Position to patrol
[13552.5,2566.86,0], // Position to spawn at, can be same as patrol location
150, // Radius of patrol
10, // Number of waypoints to give
"RHIB", // Classname of armed boat (make sure it has driver and gunner)
"Random", // Skill level of units (easy, medium, hard, extreme, Random)
"Random", // Skin classname, use "Random" or classname here
"Bandit" // AI Type, "Hero" or "Bandit".
] call vehicle_patrol;
[
[13908.3,3259.23,0], // Position to patrol
[13908.3,3259.23,0], // Position to spawn at, can be same as patrol location
150, // Radius of patrol
10, // Number of waypoints to give
"RHIB", // Classname of armed boat (make sure it has driver and gunner)
"Random", // Skill level of units (easy, medium, hard, extreme, Random)
"Random", // Skin classname, use "Random" or classname here
"Bandit" // AI Type, "Hero" or "Bandit".
] call vehicle_patrol;
*/
/*
Paradropped unit custom spawn Eg.
[
[911.21545,4532.7612,2.6292224], // Position that units will be dropped by
400, // Radius from drop position a player has to be to spawn chopper
"UH1H_DZ", // Classname of chopper (Make sure it has 2 gunner seats!)
"North", // Direction of approach for the helicopter. Options: "North","South","East","West"
[3000,4000], // Random distance from the mission the helicopter should start. [min distance, max distance].
150, // Fly in height of the helicopter. Be careful that the height is not too low or the AI might die when they hit the ground
1.0, // Time in seconds between each deployed paratrooper. Higher number means paradropped AI will be more spread apart. Time of 0 means they all jump out rapidly.
200, // Distance from the mission the helicopter should start dropping paratroopers
5, // Number of units to be para dropped
"Random", // Skill level of units (easy, medium, hard, extreme, Random)
"Random", or ["Random","at"], // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
4, // Number of magazines
"Random", // Backpack classname, use "Random" or classname here
"Bandit2_DZ", // Skin classname, use "Random" or classname here
"Random", // Gearset number. "Random" for random gear set.
"Bandit", // AI Type, "Hero" or "Bandit".
true // true: Aircraft will stay at position and fight. false: Heli will leave if not under fire.
] spawn heli_para;
Place your paradrop spawns under this line
*/
/* Custom Crate Spawns
_position = [911.21545,4532.7612,0]; // Position of the crate
_loot =
[
0, // Max number of long guns OR [MAX number of long guns,gun_array]
0, // Max number of tools OR [MAX number of tools,tool_array]
0, // Max number of items OR [MAX number of items,item_array]
0, // Max number of pistols OR [MAX number of pistol,pistol_array]
0 // Max number of backpacks OR [MAX number of backpacks,backpack_array]
];
// Spawn one crate - Best option for static positions because offsets are not needed.
[[
[_loot,crates_large,[0,0]] // [loot variable, crate array, 2d offsets]
],_position] call wai_spawnCrate;
// Multiple crate spawning option
[[
[_loot,"USVehicleBox",[0,0]], // [loot variable, crate classname, 2d offsets]
[[0,0,[3,crate_items_crop_raider],0,0],crates_large,[0,0,0]], // [loot variable, crate array, 3d offsets]
[[0,0,0,0,0],crates_large,[0,0],60] // [loot array, crate array, 2d offsets, optional direction]
],_position] call wai_spawnCrate;
Place your crate spawns under this line
*/
diag_log format["WAI: Static mission for %1 loaded", missionName];

View File

@ -0,0 +1,171 @@
//Custom Spawns file//
// These custom spawns are for use in static mission locations. You can set markers in mission.sqm if you want them.
/*
Custom group spawns Eg.
[
[953.237,4486.48,0.001], // Position
4, // Number Of units
"Random", // Skill level of unit (easy, medium, hard, extreme, Random)
"Random", or ["Random","at"], // Primary gun set number or gun and rocket launcher. Syntax is "Random", for gun only or ["Random","AT"], for gun and launcher
4, // Number of magazines
"Random", // Backpack classname, use "Random" or classname here
"Random", // Skin classname, use "Random" or classname here
"Random", // Gearset number. "Random" for random gear set
"Bandit" // AI Type, "Hero" or "Bandit".
] call spawn_group;
Place your custom group spawns below
*/
/*
Custom static weapon spawns Eg. (with mutiple positions)
[
[ // Position(s) (can be multiple)
[911.21,4532.76,2.62],
[921.21,4542.76,2.62]
],
"M2StaticMG", // Classname of turret
"easy", // Skill level of unit (easy, medium, hard, extreme, Random)
"Bandit2_DZ", // Skin classname, use "Random" or classname here
"Bandit", // AI Type, "Hero" or "Bandit".
"Random", // Primary gun set number. "Random" for random weapon set
2, // Number of magazines
"Random", // Backpack classname, use "Random" or classname here
"Random" // Gearset classname, use "Random" or classname here
] call spawn_static;
Place your custom static weapon spawns below
*/
/*
Custom Chopper Patrol spawn Eg.
[
[725.391,4526.06,0], // Position to patrol
2000, // Radius of patrol
10, // Number of waypoints to give
"UH1H_DZ", // Classname of vehicle (make sure it has driver and two gunners)
"Random", // Skill level of units (easy, medium, hard, extreme, Random)
"Random", // Skin classname, use "Random" or classname here
"Bandit" // AI Type, "Hero" or "Bandit".
] call heli_patrol;
Place your heli patrols below
*/
/*
Custom Vehicle patrol spawns Eg. (Watch out they are stupid)
[
[725.391,4526.06,0], // Position to patrol
[725.391,4526.06,0], // Position to spawn at
200, // Radius of patrol
10, // Number of waypoints to give
"HMMWV_Armored", // Classname of vehicle (make sure it has driver and gunner)
"Random", // Skill level of units (easy, medium, hard, extreme, Random)
"Random", // Skin classname, use "Random" or classname here
"Bandit" // AI Type, "Hero" or "Bandit".
] call vehicle_patrol;
Place your vehicle patrols below this line
*/
/*
Custom Boat patrol spawns
[
[725.391,4526.06,0], // Position to patrol
[725.391,4526.06,0], // Position to spawn at
150, // Radius of patrol. Your spawn point should be at least this distance from shore.
10, // Number of waypoints to give
"RHIB", // Classname of armed boat (make sure it has driver and gunner)
"Random", // Skill level of units (easy, medium, hard, extreme, Random)
"Random", // Skin classname, use "Random" or classname here
"Bandit" // AI Type, "Hero" or "Bandit".
] call vehicle_patrol;
Place your boat patrols below this line
*/
/*
Paradropped unit custom spawn Eg.
[
[911.21545,4532.7612,2.6292224], // Position that units will be dropped by
400, // Radius from drop position a player has to be to spawn chopper
"UH1H_DZ", // Classname of chopper (Make sure it has 2 gunner seats!)
"North", // Direction of approach for the helicopter. Options: "North","South","East","West"
[3000,4000], // Random distance from the mission the helicopter should start. [min distance, max distance].
150, // Fly in height of the helicopter. Be careful that the height is not too low or the AI might die when they hit the ground
1.0, // Time in seconds between each deployed paratrooper. Higher number means paradropped AI will be more spread apart. Time of 0 means they all jump out rapidly.
200, // Distance from the mission the helicopter should start dropping paratroopers
5, // Number of units to be para dropped
"Random", // Skill level of units (easy, medium, hard, extreme, Random)
"Random", or ["Random","at"], // Primary gun set number and rocket launcher. "Random" for random weapon set, "at" for anti-tank, "aa" for anti-air launcher
4, // Number of magazines
"Random", // Backpack classname, use "Random" or classname here
"Bandit2_DZ", // Skin classname, use "Random" or classname here
"Random", // Gearset number. "Random" for random gear set.
"Bandit", // AI Type, "Hero" or "Bandit".
true // true: Aircraft will stay at position and fight. false: Heli will leave if not under fire.
] spawn heli_para;
Place your paradrop spawns under this line
*/
/* Custom Crate Spawns
_position = [911.21545,4532.7612,0]; // Position of the crate
_loot =
[
0, // Max number of long guns OR [MAX number of long guns,gun_array]
0, // Max number of tools OR [MAX number of tools,tool_array]
0, // Max number of items OR [MAX number of items,item_array]
0, // Max number of pistols OR [MAX number of pistol,pistol_array]
0 // Max number of backpacks OR [MAX number of backpacks,backpack_array]
];
// Spawn one crate - Best option for static positions because offsets are not needed.
[[
[_loot,crates_large,[0,0]] // [loot variable, crate array, 2d offsets]
],_position] call wai_spawnCrate;
// Multiple crate spawning option
[[
[_loot,"USVehicleBox",[0,0]], // [loot variable, crate classname, 2d offsets]
[[0,0,[3,crate_items_crop_raider],0,0],crates_large,[0,0,0]], // [loot variable, crate array, 3d offsets]
[[0,0,0,0,0],crates_large,[0,0],60] // [loot array, crate array, 2d offsets, optional direction]
],_position] call wai_spawnCrate;
Place your crate spawns under this line
*/
diag_log "WAI: Static mission loaded";

View File

@ -0,0 +1,9 @@
if(wai_custom_per_world) then {
ExecVM format["\z\addons\dayz_server\WAI\static\%1.sqf",toLower(worldName)];
} else {
ExecVM "\z\addons\dayz_server\WAI\static\default.sqf";
};
[] spawn static_spawn_manager;
wai_staticloaded = true;