Skip to content

Commit

Permalink
Merge pull request #52 from jabberzac/dev
Browse files Browse the repository at this point in the history
0.6.1
  • Loading branch information
armazac authored Nov 18, 2016
2 parents dc249f5 + 6d7f452 commit 2271784
Show file tree
Hide file tree
Showing 126 changed files with 3,260 additions and 1,266 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ _posnow = position _target;
_timenow = time;

private _cleanup = {
private _group = _this select 0;
private _cop = _this select 1;
private _target = _this select 2;
_group setBehaviour "SAFE";
_group call initGendarmPatrol;
_cop setVariable ["OT_searching",false,true];
Expand All @@ -82,7 +85,7 @@ if((_target distance _posnow) > 2) then {
waitUntil {sleep 1;(_cop distance _target) < 2 or (_target distance _posnow) > 2 or (time - _timenow) > 120};
if((_target distance _posnow) > 2) then {
_target setCaptive false;
[] call _cleanup;
[_group,_cop,_target] call _cleanup;
};
};
};
Expand All @@ -100,7 +103,7 @@ if((isplayer _target and !captive _target) or (!alive _cop) or ((time - _timenow
if((_target distance _posnow) > 2) exitWith {
if(isplayer _target) then {
_target setCaptive false;
[] call _cleanup;
[_group,_cop,_target] call _cleanup;
};
};

Expand All @@ -111,7 +114,7 @@ if(isplayer _target) then {
private _foundweapons = false;
{
_cls = _x select 0;
if(_cls in OT_allWeapons + OT_allMagazines + OT_illegalHeadgear + OT_illegalVests + OT_allStaticBackpacks) then {
if(_cls in OT_allWeapons + OT_allMagazines + OT_illegalHeadgear + OT_illegalVests + OT_allStaticBackpacks + OT_allOptics) then {
_count = _x select 1;
for "_i" from 1 to _count do {
_target removeItem _cls;
Expand All @@ -133,17 +136,12 @@ if(isplayer _target) then {
if(_foundweapons) then {
"NATO: What's this??!?" remoteExec ["notify_talk",_target,false];
_target setCaptive false;
{
if(side _x == west) then {
_x reveal [_target,1.5];
sleep 0.2;
};
}foreach(_target nearentities ["Man",500]);
_target spawn revealToNATO;
}else{
"NATO: We found some illegal items and confiscated them, be on your way" remoteExec ["notify_talk",_target,false];
};
}else{
"NATO: Thank you for your co-operation" remoteExec ["notify_talk",_target,false];
};
};
[] call _cleanup;
[_group,_cop,_target] call _cleanup;
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ while {_count < _numgroups} do {
_town = _this select 2;
_tskid = _this select 3;

_timeout = time + 600;

_first = _soldiers select ((count _soldiers) - 1);
waitUntil {(_first distance _attackpos) < 1000};
waitUntil {sleep 1;((_first distance _attackpos) < 1000) or (time > _timeout)};

_townpop = server getVariable [format["population%1",_town],0];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ if((_ao select [0,1]) in ["A","E","I","O","a","e","i","o"]) then {_an = "An"};
_tskid = _this select 3;
_airgroups = _this select 4;

_timeout = time + 600;

_first = _soldiers select ((count _soldiers) - 1);
waitUntil {(_first distance _attackpos) < 1000};
waitUntil {sleep 1;((_first distance _attackpos) < 1000) or (time > _timeout)};

private ["_size","_active","_alive"];
_size = count _soldiers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,10 @@ sleep 20;
_tskid = _this select 3;
_airgroups = _this select 4;

_timeout = time + 600;

_first = _soldiers select ((count _soldiers) - 1);
waitUntil {(_first distance _attackpos) < 1000};
waitUntil {sleep 1;((_first distance _attackpos) < 1000) or (time > _timeout)};

_townpop = server getVariable [format["population%1",_town],0];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ removeBackpack _unit;
removeHeadgear _unit;
removeVest _unit;

{[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit]};
{[_unit, "NoVoice"] remoteExec ["setSpeaker", 0, _unit]};
{[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setAIFace", 0, _unit]};
{[_unit, "NoVoice"] remoteExec ["setAISpeaker", 0, _unit]};

_unit forceAddUniform (OT_clothes_carDealers call BIS_fnc_selectRandom);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ while {!(isNull _group) and count (units _group) > 0} do {
_vehs pushBack [_unit,_x];
};
if !(_unit in _inrange) then {
_inrange pushback _unit;
if((isPlayer _unit) and (captive _unit)) then {
if(_iscar) then {
"Please approach the checkpoint slowly, do NOT exit your vehicle" remoteExec ["notify_talk",_unit,false];
}else{
"Please approach the checkpoint for a search, citizen" remoteExec ["notify_talk",_unit,true];
};
if(_unit call unitSeenNATO) then {
_inrange pushback _unit;
if((isPlayer _unit) and (captive _unit)) then {
if(_iscar) then {
"Please approach the checkpoint slowly, do NOT exit your vehicle" remoteExec ["notify_talk",_unit,false];
}else{
"Please approach the checkpoint for a search, citizen" remoteExec ["notify_talk",_unit,true];
};
};
};
};
}foreach(_start nearentities [["Man","LandVehicle"],_outerRange]);
Expand Down Expand Up @@ -90,7 +92,7 @@ while {!(isNull _group) and count (units _group) > 0} do {
};
{
_cls = _x select 0;
if(_cls in OT_allWeapons + OT_allMagazines + OT_illegalHeadgear + OT_illegalVests + OT_allStaticBackpacks) then {
if(_cls in OT_allWeapons + OT_allMagazines + OT_illegalHeadgear + OT_illegalVests + OT_allStaticBackpacks + OT_allOptics) then {
_count = _x select 1;
for "_i" from 1 to _count do {
_target removeItem _cls;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ removeVest _unit;

_unit setVariable ["NOAI",true,false];

[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, "NoVoice"] remoteExec ["setSpeaker", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setAIFace", 0, _unit];
[_unit, "NoVoice"] remoteExec ["setAISpeaker", 0, _unit];

_unit forceAddUniform (OT_clothes_locals call BIS_fnc_selectRandom);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ _unit addEventHandler ["HandleDamage", {
};
}];

[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setAIFace", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setAISpeaker", 0, _unit];
_unit forceAddUniform (OT_CRIM_Clothes call BIS_fnc_selectRandom);


Expand All @@ -30,7 +30,10 @@ _unit addHeadgear "H_Bandanna_khk_hs";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit addVest (OT_allExpensiveVests call BIS_fnc_selectRandom);
_unit linkItem "ItemRadio";
if(OT_hasTFAR) then {
_unit linkItem "tf_fadak";
}else{
;
_hour = date select 3;
if(_hour < 8 or _hour > 15) then {
_unit linkItem "NVGoggles_OPFOR";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ _unit addEventHandler ["HandleDamage", {
};
}];

[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setAIFace", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setAISpeaker", 0, _unit];
_unit forceAddUniform (OT_CRIM_Clothes call BIS_fnc_selectRandom);

removeAllItems _unit;
Expand All @@ -31,7 +31,11 @@ if((random 100) > 50) then {
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit addVest (OT_allProtectiveVests call BIS_fnc_selectRandom);
_unit linkItem "ItemRadio";
if(OT_hasTFAR) then {
_unit linkItem "tf_fadak";
}else{
_unit linkItem "ItemRadio";
};
_hour = date select 3;
if(_hour < 8 or _hour > 15) then {
_unit linkItem "NVGoggles_OPFOR";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ private _lastname = OT_lastNames_local call BIS_fnc_selectRandom;
private _fullname = [format["%1 %2",_firstname,_lastname],_firstname,_lastname];
[_unit,_fullname] remoteExec ["setCivName",0,false];

[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, "NoVoice"] remoteExec ["setSpeaker", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setAIFace", 0, _unit];
[_unit, "NoVoice"] remoteExec ["setAISpeaker", 0, _unit];

removeAllWeapons _unit;
removeAllAssignedItems _unit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ private _lastname = OT_lastNames_local call BIS_fnc_selectRandom;
private _fullname = [format["%1 %2",_firstname,_lastname],_firstname,_lastname];
[_unit,_fullname] remoteExec ["setCivName",0,false];

[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, "NoVoice"] remoteExec ["setSpeaker", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setAIFace", 0, _unit];
[_unit, "NoVoice"] remoteExec ["setAISpeaker", 0, _unit];

removeAllWeapons _unit;
removeAllAssignedItems _unit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ _unit addEventHandler ["HandleDamage", {
};
}];

[_unit, OT_face_localBoss] remoteExec ["setFace", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit];
[_unit, OT_face_localBoss] remoteExec ["setAIFace", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setAISpeaker", 0, _unit];
_unit forceAddUniform OT_clothes_mob;

removeAllItems _unit;
Expand All @@ -35,7 +35,11 @@ _unit addHeadgear "H_Booniehat_khk_hs";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit addVest (OT_allExpensiveVests call BIS_fnc_selectRandom);
_unit linkItem "ItemRadio";
if(OT_hasTFAR) then {
_unit linkItem "tf_fadak";
}else{
_unit linkItem "ItemRadio";
};
_hour = date select 3;
if(_hour < 8 or _hour > 15) then {
_unit linkItem "O_NVGoggles_ghex_F";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ _unit addEventHandler ["HandleDamage", {
};
}];

[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setAIFace", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setAISpeaker", 0, _unit];
_unit forceAddUniform OT_clothes_mob;

removeAllItems _unit;
Expand All @@ -35,7 +35,11 @@ _unit addHeadgear "H_Booniehat_khk";
_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit addVest (OT_allProtectiveVests call BIS_fnc_selectRandom);
_unit linkItem "ItemRadio";
if(OT_hasTFAR) then {
_unit linkItem "tf_fadak";
}else{
_unit linkItem "ItemRadio";
};
_hour = date select 3;
if(_hour < 8 or _hour > 15) then {
_unit linkItem "O_NVGoggles_ghex_F";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _tt = _myunits select 0;
if(vehicle _tt != _tt) then {
_sorted = [vehicle _tt];
}else{
_objects = _tt nearEntities [["LandVehicle",OT_item_Storage,OT_items_distroStorage select 0],20];
_objects = _tt nearEntities [["Car",OT_item_Storage,OT_items_distroStorage select 0],20];
if(count _objects == 0) exitWith {
"Cannot find any containers or vehicles within 20m of first selected unit" call notify_minor;
};
Expand All @@ -17,14 +17,17 @@ if(vehicle _tt != _tt) then {
if(count _sorted == 0) exitWith {};
_target = _sorted select 0;

_tt groupChat format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicle_GetName];
format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicle_GetName] call notify_minor;

{
[_x,_target] spawn {
[_x,_target] spawn {
_active = true;
_wasincar = false;
_car = objNull;

_unit = _this select 0;
_unit setBehaviour "SAFE";
[[_unit,""],"switchMove",TRUE,FALSE] spawn BIS_fnc_MP;

if((vehicle _unit) != _unit) then {
_car = (vehicle _unit);
Expand All @@ -40,9 +43,12 @@ _tt groupChat format["Looting nearby bodies into the %1",(typeof _target) call I
waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 2) or (_timeOut < time) or (unitReady _unit)};
if(!alive _unit or (isNull _t) or (_timeOut < time)) exitWith {};

[_unit,_t] call dumpStuff;
if !([_unit,_t] call dumpStuff) then {
_unit globalchat "This vehicle is full, cancelling loot order";
_active = false;
};

while {true} do {
while {true and _active} do {
_deadguys = [];
{
if !((_x distance player > 100) or (alive _x) or (_x getVariable ["looted",false])) then {
Expand All @@ -62,10 +68,10 @@ _tt groupChat format["Looting nearby bodies into the %1",(typeof _target) call I

[_deadguy,_unit] call takeStuff;
[_deadguy] spawn {
sleep 600;
sleep 30;
_n = _this select 0;
if!(isNil "_n") then {
deleteVehicle (_this select 0);
hideBody (_this select 0);
}
};
sleep 2;
Expand Down Expand Up @@ -101,10 +107,14 @@ _tt groupChat format["Looting nearby bodies into the %1",(typeof _target) call I
waitUntil {sleep 1; (!alive _unit) or (isNull _t) or (_unit distance _t < 2) or (_timeOut < time) or (unitReady _unit)};
if((!alive _unit) or (_timeOut < time)) exitWith {};

[_unit,_t] call dumpStuff;
if !([_unit,_t] call dumpStuff) exitWith {
_unit globalchat "This vehicle is full, cancelling loot order";
_active = false;
};

sleep 1;
};
while {true} do {
while {true and _active} do {
_got = false;
_weapon = objNull;
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ _unit forceAddUniform (OT_clothes_police call BIS_fnc_selectRandom);
_unit addVest OT_vest_police;
_unit addHeadgear OT_hat_police;

[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setAIFace", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setAISpeaker", 0, _unit];

_unit setVariable ["polgarrison",_town,false];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ removeVest _unit;

_unit setVariable ["owner","self"];

[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, "NoVoice"] remoteExec ["setSpeaker", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setAIFace", 0, _unit];
[_unit, "NoVoice"] remoteExec ["setAISpeaker", 0, _unit];

_unit forceAddUniform OT_clothes_priest;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ _civ = _this select 0;
removeAllActions _civ;
_civ removeAllEventHandlers "FiredNear";

[_civ, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit];
[_civ, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setAISpeaker", 0, _civ];

_civ setSkill 1.0;
_civ setRank "PRIVATE";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ _unit = _this select 0;

_building = _this select 1;

[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit];
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setAIFace", 0, _unit];
[_unit, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setAISpeaker", 0, _unit];

removeAllAssignedItems _unit;

_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit linkItem "ItemRadio";
if(OT_hasTFAR) then {
_unit linkItem "tf_anprc152";
}else{
_unit linkItem "ItemRadio";
};

if(OT_hasAce) then {
_unit addItemToVest "ACE_fieldDressing";
Expand Down
Loading

0 comments on commit 2271784

Please sign in to comment.