diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/NATOsearch.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/NATOsearch.sqf index efb32e3a..07c5b454 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/NATOsearch.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/NATOsearch.sqf @@ -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]; @@ -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; }; }; }; @@ -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; }; }; @@ -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; @@ -133,12 +136,7 @@ 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]; }; @@ -146,4 +144,4 @@ if(isplayer _target) then { "NATO: Thank you for your co-operation" remoteExec ["notify_talk",_target,false]; }; }; -[] call _cleanup; +[_group,_cop,_target] call _cleanup; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOattack.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOattack.sqf index b411ece7..da35741c 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOattack.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOattack.sqf @@ -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]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOcounter.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOcounter.sqf index cb16e1aa..57dd9dad 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOcounter.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOcounter.sqf @@ -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; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOretakeTown.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOretakeTown.sqf index 019813ae..b9512daf 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOretakeTown.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOretakeTown.sqf @@ -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]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/carDealer.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/carDealer.sqf index e6119336..d43070a2 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/carDealer.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/carDealer.sqf @@ -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); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/checkpoint.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/checkpoint.sqf index 141e485d..e63b9b5e 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/checkpoint.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/checkpoint.sqf @@ -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]); @@ -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; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/civilian.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/civilian.sqf index 70bdd250..fa2e1e47 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/civilian.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/civilian.sqf @@ -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); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/crimLeader.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/crimLeader.sqf index 2ab73d3a..f1744f14 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/crimLeader.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/crimLeader.sqf @@ -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); @@ -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"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/criminal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/criminal.sqf index 12bd362d..8778209b 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/criminal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/criminal.sqf @@ -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; @@ -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"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/gunDealer.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/gunDealer.sqf index 082e3d70..3bf010b9 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/gunDealer.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/gunDealer.sqf @@ -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; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/harbor.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/harbor.sqf index 97d25c1d..6c9f5859 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/harbor.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/harbor.sqf @@ -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; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/mobBoss.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/mobBoss.sqf index 58319ea7..80a23e5c 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/mobBoss.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/mobBoss.sqf @@ -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; @@ -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"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/mobster.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/mobster.sqf index 191ed766..bb3e8a17 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/mobster.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/mobster.sqf @@ -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; @@ -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"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/orders/loot.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/orders/loot.sqf index f6b14ec6..e28f9554 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/orders/loot.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/orders/loot.sqf @@ -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; }; @@ -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); @@ -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 { @@ -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; @@ -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; { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/police.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/police.sqf index 7e47957b..c48928da 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/police.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/police.sqf @@ -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]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/priest.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/priest.sqf index 1157c9fa..72a79c61 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/priest.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/priest.sqf @@ -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; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/recruit.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/recruit.sqf index 5f00ffa0..f99b6ef6 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/recruit.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/recruit.sqf @@ -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"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/security.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/security.sqf index 7ab412f3..53fc9104 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/security.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/security.sqf @@ -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"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/shopkeeper.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/shopkeeper.sqf index c32bc258..d39119fb 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/shopkeeper.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/shopkeeper.sqf @@ -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; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/sniper.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/sniper.sqf index 4da5e082..3c1000e1 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/sniper.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/sniper.sqf @@ -1,7 +1,7 @@ private _unit = _this select 0; -[_unit, (OT_faces_western call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _unit]; -[_unit, (OT_voices_western call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _unit]; +[_unit, (OT_faces_western call BIS_fnc_selectRandom)] remoteExec ["setAIFace", 0, _unit]; +[_unit, (OT_voices_western call BIS_fnc_selectRandom)] remoteExec ["setAISpeaker", 0, _unit]; if(OT_hasACE) then { _unit addItemToUniform "ACE_rangeCard"; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buyClothesDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buyClothesDialog.sqf index 18379932..6a4c58c6 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buyClothesDialog.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buyClothesDialog.sqf @@ -10,7 +10,7 @@ lbClear 1500; _c = _cls splitString "_"; _side = _c select 1; - if((_side == "C" or _side == "I") and _cls != "U_I_Soldier_VR") then { + if((_cls == "V_RebreatherIA" or _side == "C" or _side == "I") and _cls != "U_I_Soldier_VR") then { _price = [_town,_cls,_standing] call getPrice; _name = ""; _pic = ""; @@ -22,4 +22,4 @@ lbClear 1500; lbSetValue [1500,_idx,_price]; lbSetData [1500,_idx,_cls]; }; -}foreach(OT_allClothing); \ No newline at end of file +}foreach(OT_allClothing + ["V_RebreatherIA"]); \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buyVehicleDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buyVehicleDialog.sqf new file mode 100644 index 00000000..02e5153f --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buyVehicleDialog.sqf @@ -0,0 +1,38 @@ + +private _town = player call nearestTown; +_standing = player getVariable format['rep%1',_town]; + +private _items = OT_vehicles; + +private _ob = (getpos player) call nearestObjective; +_ob params ["_obpos","_obname"]; +if(_obpos distance player < 250) then { + if(_obname in (server getVariable ["NATOabandoned",[]])) then { + _town = "Tanoa"; + _standing = 100; + if(_obname in OT_allAirports) then { + _items = OT_helis + OT_vehicles; + }else{ + _items = OT_vehicles + OT_boats; + }; + } +}; + +createDialog "OT_dialog_buy"; +{ + _cls = _x select 0; + _price = [_town,_cls,_standing] call getPrice; + if("fuel depot" in (server getVariable "OT_NATOabandoned")) then { + _price = round(_price * 0.5); + }; + _idx = lbAdd [1500,format["%1",_cls call ISSE_Cfg_Vehicle_GetName]]; + lbSetPicture [1500,_idx,_cls call ISSE_Cfg_Vehicle_GetPic]; + lbSetData [1500,_idx,_cls]; + lbSetValue [1500,_idx,_price]; +}foreach(_items); + +_price = [_town,OT_item_UAV,_standing] call getPrice; +_idx = lbAdd [1500,format["Quadcopter"]]; +lbSetPicture [1500,_idx,OT_item_UAV call ISSE_Cfg_Vehicle_GetPic]; +lbSetData [1500,_idx,OT_item_UAV]; +lbSetValue [1500,_idx,_price]; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/characterSheet.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/characterSheet.sqf index 4ad36093..f75fc1ec 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/characterSheet.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/characterSheet.sqf @@ -9,8 +9,13 @@ private _fitness = player getVariable ["OT_fitness",1]; private _ctrl = (findDisplay 8003) displayCtrl 1100; _ctrl ctrlSetStructuredText parseText format["Fitness
Level %1
Increases the distance you can sprint",_fitness]; -getFitnessPrice = { - private _fitness = player getVariable ["OT_fitness",1]; +private _trade = player getVariable ["OT_trade",1]; +_ctrl = (findDisplay 8003) displayCtrl 1101; +_ctrl ctrlSetStructuredText parseText format["Trade
Level %1
Ability to negotiate better purchasing prices",_trade]; + +getPerkPrice = { + private _perk = _this select 0; + private _fitness = player getVariable [format["OT_%1",_perk],1]; private _price = 10; if(_fitness == 2) then { _price = 100; @@ -24,35 +29,52 @@ getFitnessPrice = { _price; }; -private _price = [] call getFitnessPrice; +private _price = ["fitness"] call getPerkPrice; ctrlSetText [1600,format["Increase Level (-%1 Influence)",_price]]; +_price = ["trade"] call getPerkPrice; +ctrlSetText [1601,format["Increase Level (-%1 Influence)",_price]]; + if(_fitness == 5) then { ctrlShow [1600,false]; }; -buyFitness = { +if(_trade == 5) then { + ctrlShow [1601,false]; +}; + +buyPerk = { + _perk = _this select 0; disableSerialization; - private _fitness = player getVariable ["OT_fitness",1]; - private _price = [] call getFitnessPrice; + private _fitness = player getVariable [format["OT_%1",_perk],1]; + private _price = [_perk] call getPerkPrice; private _inf = player getVariable ["influence",0]; if(_inf < _price) exitWith {"You do not have enough influence" call notify_minor}; _fitness = _fitness + 1; - player setVariable ["OT_fitness",_fitness,true]; - if(_fitness == 5) then { - ctrlEnable [1600,false]; + player setVariable [format["OT_%1",_perk],_fitness,true]; + _idc = 1600; + _idcc = 1100; + if(_perk == "trade") then {_idc = 1601;_idcc = 1101}; + + if(_fitness == 5) then { + ctrlEnable [_idc,false]; }; player setVariable ["influence",_inf - _price,true]; - private _ctrl = (findDisplay 8003) displayCtrl 1100; - _ctrl ctrlSetStructuredText parseText format["Fitness
Level %1
Increases the distance you can sprint",_fitness]; - _price = [] call getFitnessPrice; - ctrlSetText [1600,format["Increase Level (-%1 Influence)",_price]]; + private _ctrl = (findDisplay 8003) displayCtrl _idcc; + _txt = format["Fitness
Level %1
Increases the distance you can sprint",_fitness]; + if(_perk == "trade") then { + _txt = format["Trade
Level %1
Ability to negotiate better purchasing prices",_fitness]; + }; + + _ctrl ctrlSetStructuredText parseText _txt; + _price = [_perk] call getPerkPrice; + ctrlSetText [_idc,format["Increase Level (-%1 Influence)",_price]]; if(_fitness == 5) then { - ctrlShow [1600,false]; + ctrlShow [_idc,false]; }; }; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/importDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/importDialog.sqf new file mode 100644 index 00000000..814c0a0e --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/importDialog.sqf @@ -0,0 +1,51 @@ +if(count (player nearObjects [OT_portBuilding,30]) == 0) exitWith {}; +private _town = player call nearestTown; +_items = OT_allItems + OT_allBackpacks + ["V_RebreatherIA"]; +if(_town in (server getVariable ["NATOabandoned",[]])) then { + _items = OT_allItems + OT_allBackpacks + ["V_RebreatherIA"] + OT_allWeapons + OT_allMagazines + OT_allStaticBackpacks + OT_allOptics + OT_allVests + OT_allHelmets; +}else{ + hint format ["Only legal items may be imported while NATO controls %1",_town]; +}; + +private _cursel = lbCurSel 1500; +lbClear 1500; +_done = []; + +_numitems = 0; +{ + _cls = _x; + if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) then { + _cls = [_x] call BIS_fnc_baseWeapon; + }; + + if !(_cls in _done) then { + _done pushback _cls; + _price = ["Tanoa",_cls,100] call getPrice; + _name = ""; + _pic = ""; + + if(_price > 0) then { + _numitems = _numitems + 1; + if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) then { + _name = _cls call ISSE_Cfg_Weapons_GetName; + _pic = _cls call ISSE_Cfg_Weapons_GetPic; + }; + if(_cls isKindOf ["Default",configFile >> "CfgMagazines"]) then { + _name = _cls call ISSE_Cfg_Magazine_GetName; + _pic = _cls call ISSE_Cfg_Magazine_GetPic; + }; + if(_cls isKindOf "Bag_Base") then { + _name = _cls call ISSE_Cfg_Vehicle_GetName; + _pic = _cls call ISSE_Cfg_Vehicle_GetPic; + }; + + _idx = lbAdd [1500,format["%1",_name]]; + lbSetPicture [1500,_idx,_pic]; + lbSetValue [1500,_idx,_price]; + lbSetData [1500,_idx,_cls]; + }; + }; +}foreach(_items); + +if(_cursel >= _numitems) then {_cursel = 0}; +lbSetCurSel [1500, _cursel]; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/inputDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/inputDialog.sqf new file mode 100644 index 00000000..71f0e040 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/inputDialog.sqf @@ -0,0 +1,11 @@ +private _text = _this select 0; +private _default = _this select 1; + +createDialog "OT_dialog_input"; +uiSleep 0.01; +disableSerialization; + +private _ctrl = (findDisplay 8001) displayCtrl 1100; + +_ctrl ctrlSetStructuredText parseText _text; +ctrlSetText [1400,format["%1",_default]]; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/loadoutDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/loadoutDialog.sqf new file mode 100644 index 00000000..04febe42 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/loadoutDialog.sqf @@ -0,0 +1,13 @@ +disableSerialization; +OT_context = _this select 0; +createDialog "OT_dialog_loadout"; + +lbClear 1500; +{ + _cls = _x; + + _idx = lbAdd [1500,_cls]; + lbSetValue [1500,_idx,0]; + lbSetData [1500,_idx,_cls]; +}foreach(profilenamespace getvariable ["OT_loadouts",[]]); + diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf index 2400e398..b7db27b7 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf @@ -92,8 +92,19 @@ if(typename _b == "ARRAY") then { Founded by %2 ",_building getVariable "name",_ownername]; }; + ctrlSetText [1608,format["Sell ($%1)",[_sell, 1, 0, true] call CBA_fnc_formatNumber]]; + if(typeof _building == OT_warehouse) exitWith { + ctrlEnable [1609,true]; + ctrlSetText [1609,"Procurement"]; + + _buildingTxt = format[" + Warehouse
+ Owned by %1 + ",_ownername]; + }; + if(_building getVariable ["leased",false]) then { ctrlEnable [1609,false]; ctrlEnable [1610,false]; @@ -119,14 +130,43 @@ if(typename _b == "ARRAY") then { Owned by %2 ",_name,_ownername]; }; + if(typeof _building == OT_barracks) then { + _owner = _building getVariable "owner"; + _ownername = server getVariable format["name%1",_owner]; + ctrlSetText [1608,"Sell"]; + ctrlEnable [1608,false]; + ctrlEnable [1609,true]; + ctrlSetText [1609,"Recruit"]; + //ctrlEnable [1609,false]; + //ctrlEnable [1610,false]; + + _buildingTxt = format[" + Barracks
+ Built by %1 + ",_ownername]; + }; }else{ ctrlSetText [1608,format["Buy ($%1)",[_price, 1, 0, true] call CBA_fnc_formatNumber]]; ctrlEnable [1609,false]; ctrlEnable [1610,false]; + if(typeof _building == OT_warehouse) exitWith { + _buildingTxt = "Warehouse"; + }; _buildingTxt = format[" %1
Lease Value: $%2/hr ",_name,[_lease, 1, 0, true] call CBA_fnc_formatNumber]; + + if(typeof _building == OT_barracks) then { + ctrlSetText [1608,"Sell"]; + ctrlEnable [1608,false]; + ctrlEnable [1609,false]; + ctrlEnable [1610,false]; + + _buildingTxt = format[" + Barracks
+ ",_ownername]; + }; }; if(typeof _building == OT_policeStation) then { @@ -135,7 +175,7 @@ if(typename _b == "ARRAY") then { ctrlSetText [1608,"Sell"]; ctrlEnable [1608,false]; ctrlSetText [1609,"Manage"]; - //ctrlEnable [1609,false]; + ctrlEnable [1609,true]; //ctrlEnable [1610,false]; _buildingTxt = format[" @@ -143,10 +183,48 @@ if(typename _b == "ARRAY") then { Built by %1 ",_ownername]; }; + + if(typeof _building == "Land_Cargo_House_V4_F") then { + _owner = _building getVariable "owner"; + _ownername = server getVariable format["name%1",_owner]; + ctrlSetText [1608,"Sell"]; + ctrlEnable [1608,false]; + ctrlEnable [1609,false]; + //ctrlEnable [1610,false]; + + _buildingTxt = format[" + Workshop
+ Built by %1 + ",_ownername]; + }; }else{ - ctrlEnable [1608,false]; - ctrlEnable [1609,false]; - ctrlEnable [1610,false]; + private _ob = (getpos player) call nearestObjective; + _ob params ["_obpos","_obname"]; + if(_obpos distance player < 250) then { + if(_obname in (server getVariable ["NATOabandoned",[]])) then { + ctrlSetText [1201,"\A3\ui_f\data\map\markers\flags\Tanoa_ca.paa"]; + _buildingTxt = format[" + %1
+ Under resistance control + ",_obname]; + ctrlEnable [1609,true]; + }else{ + ctrlSetText [1201,"\A3\ui_f\data\map\markers\flags\nato_ca.paa"]; + _buildingTxt = format[" + %1
+ Under NATO control + ",_obname]; + ctrlEnable [1609,false]; + }; + ctrlSetText [1608,"Sell"]; + ctrlEnable [1608,false]; + ctrlSetText [1609,"Procurement"]; + ctrlEnable [1610,false]; + }else{ + ctrlEnable [1608,false]; + ctrlEnable [1609,false]; + ctrlEnable [1610,false]; + }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/recruitDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/recruitDialog.sqf new file mode 100644 index 00000000..7adc7b2a --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/recruitDialog.sqf @@ -0,0 +1,29 @@ +disableSerialization; + +_base = (getpos player) call nearestObjective; +if (isNil "_base") exitWith {}; +if !((_base select 1) in (server getvariable "NATOabandoned")) exitWith {"This barracks is under NATO control" call notify_minor}; + +private _price = floor((["Tanoa","CIV",0] call getPrice) * 1.5); + +createDialog "OT_dialog_buy"; +ctrlSetText [1600,"Recruit"]; +lbClear 1500; +{ + _cls = _x select 0; + _comp = _x select 1; + _cost = (_price * count _comp); + + _idx = lbAdd [1500,_cls]; + lbSetValue [1500,_idx,_cost]; + lbSetData [1500,_idx,_cls]; +}foreach(OT_squadables); +{ + _cls = _x select 0; + _name = _cls call ISSE_Cfg_Vehicle_GetName; + + _idx = lbAdd [1500,_name]; + lbSetValue [1500,_idx,_price]; + lbSetData [1500,_idx,_cls]; +}foreach(OT_recruitables); + diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/sellDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/sellDialog.sqf index 32bfa93b..b218200f 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/sellDialog.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/sellDialog.sqf @@ -31,12 +31,17 @@ private _numitems = 0; _name = ""; _pic = ""; - if(_cls isKindOf "Bag_Base") then { - _name = _cls call ISSE_Cfg_Vehicle_GetName; - _pic = _cls call ISSE_Cfg_Vehicle_GetPic; - }else{ + if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) then { _name = _cls call ISSE_Cfg_Weapons_GetName; _pic = _cls call ISSE_Cfg_Weapons_GetPic; + }; + if(_cls isKindOf ["Default",configFile >> "CfgMagazines"]) then { + _name = _cls call ISSE_Cfg_Magazine_GetName; + _pic = _cls call ISSE_Cfg_Magazine_GetPic; + }; + if(_cls isKindOf "Bag_Base") then { + _name = _cls call ISSE_Cfg_Vehicle_GetName; + _pic = _cls call ISSE_Cfg_Vehicle_GetPic; }; _idx = lbAdd [1500,format["%1 x %2 ($%3)",_num,_name,_price]]; lbSetPicture [1500,_idx,_pic]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/warehouseDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/warehouseDialog.sqf new file mode 100644 index 00000000..c4acfb0e --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/warehouseDialog.sqf @@ -0,0 +1,39 @@ +private _cursel = lbCurSel 1500; +lbClear 1500; +_sorted = [allVariables warehouse,[],{_x},"ASCEND"] call BIS_fnc_SortBy; +_numitems = 0; +{ + _d = warehouse getVariable [_x,[_x,0]]; + _cls = _d select 0; + _num = _d select 1; + _name = ""; + _pic = ""; + + if(_num > 0) then { + _numitems = _numitems + 1; + if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) then { + _name = _cls call ISSE_Cfg_Weapons_GetName; + _pic = _cls call ISSE_Cfg_Weapons_GetPic; + }; + if(_cls isKindOf ["Default",configFile >> "CfgMagazines"]) then { + _name = _cls call ISSE_Cfg_Magazine_GetName; + _pic = _cls call ISSE_Cfg_Magazine_GetPic; + }; + if(_cls isKindOf "Bag_Base") then { + _name = _cls call ISSE_Cfg_Vehicle_GetName; + _pic = _cls call ISSE_Cfg_Vehicle_GetPic; + }; + if(isClass (configFile >> "CfgGlasses" >> _cls)) then { + _name = gettext(configFile >> "CfgGlasses" >> _cls >> "displayName"); + _pic = gettext(configFile >> "CfgGlasses" >> _cls >> "picture"); + }; + + _idx = lbAdd [1500,format["%1 x %2",_num,_name]]; + lbSetPicture [1500,_idx,_pic]; + lbSetValue [1500,_idx,_num]; + lbSetData [1500,_idx,_cls]; + }; +}foreach(_sorted); + +if(_cursel >= _numitems) then {_cursel = 0}; +lbSetCurSel [1500, _cursel]; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buy.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buy.sqf index 3cc20049..b800fb2c 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buy.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buy.sqf @@ -5,12 +5,18 @@ _cls = lbData [1500,_idx]; _town = (getPos player) call nearestTown; _standing = player getVariable format['rep%1',_town]; -_price = [_town,_cls,_standing] call getPrice; +_price = lbValue [1500,_idx]; _money = player getVariable "money"; if(_money < _price) exitWith {"You cannot afford that!" call notify_minor}; call { + if(_cls isKindOf "Man") exitWith { + [_cls,getpos player,group player] call recruitSoldier; + }; + if(_cls in OT_allSquads) exitWith { + [_cls,getpos player] call recruitSquad; + }; if(_cls == OT_item_UAV) exitWith { _pos = (getpos player) findEmptyPosition [5,100,_cls]; if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call notify_minor}; @@ -40,7 +46,7 @@ call { playSound "3DEN_notificationDefault"; hint "To use a UAV, scroll your mouse wheel to 'Open UAV Terminal' then right click your green copter on the ground and 'Connect terminal to UAV'"; }; - if(_cls isKindOf "LandVehicle") exitWith { + if(_cls in OT_allVehicles) exitWith { _pos = (getpos player) findEmptyPosition [5,100,_cls]; if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call notify_minor}; @@ -53,7 +59,7 @@ call { clearItemCargoGlobal _veh; player reveal _veh; - format["You bought a %1",_cls call ISSE_Cfg_Vehicle_GetName] call notify_minor; + format["You bought a %1 for $%2",_cls call ISSE_Cfg_Vehicle_GetName,_price] call notify_minor; playSound "3DEN_notificationDefault"; }; if(_cls isKindOf "Ship") exitWith { @@ -73,17 +79,29 @@ call { playSound "3DEN_notificationDefault"; }; if(_cls in OT_allClothing) exitWith { - player setVariable ["money",_money-_price,true]; + [-_price] call money; - if(backpack player != "") then { - player addItem _cls; + if((backpack player != "") and (player canAdd _cls)) then { + player addItemToBackpack _cls; + "Clothing added to your backpack" call notify_minor; }else{ player forceAddUniform _cls; }; playSound "3DEN_notificationDefault"; }; + if(_cls == "V_RebreatherIA") exitWith { + [-_price] call money; + + if((backpack player != "") and (player canAdd _cls)) then { + player addItemToBackpack _cls; + "Rebreather added to your backpack" call notify_minor; + }else{ + player addVest _cls; + }; + playSound "3DEN_notificationDefault"; + }; if((_cls isKindOf ["Launcher",configFile >> "CfgWeapons"]) or (_cls isKindOf ["Rifle",configFile >> "CfgWeapons"])) exitWith { - player setVariable ["money",_money-_price,true]; + [-_price] call money; _box = false; { @@ -101,7 +119,7 @@ call { playSound "3DEN_notificationDefault"; }; if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) exitWith { - player setVariable ["money",_money-_price,true]; + [-_price] call money; player addMagazine _cls; playSound "3DEN_notificationDefault"; }; @@ -112,9 +130,13 @@ call { if!([player,_cls] call canFit) exitWith {"There is not enough room in your inventory" call notify_minor;_handled = false}; }; - if(_handled) then { + if(_handled) then { + _b = player getVariable ["shopping",objNull]; + _bp = _b getVariable "shop"; + if(isNil "_bp") exitWith {}; + playSound "3DEN_notificationDefault"; - if (_cls in OT_illegalItems) exitWith { + if (_cls in OT_illegalItems) exitWith { player setVariable ["money",_money-_price,true]; player addItem _cls; }; @@ -122,8 +144,6 @@ call { player setVariable ["money",_money-_price,true]; player addBackpack _cls; }; - _b = player getVariable ["shopping",objNull]; - _bp = _b getVariable "shop"; _s = []; _active = server getVariable [format["activeshopsin%1",_town],[]]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyBuilding.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyBuilding.sqf index fd14db57..e59ab315 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyBuilding.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyBuilding.sqf @@ -44,6 +44,13 @@ if(_handled) then { _mrk setMarkerColor "ColorWhite"; _mrk setMarkerAlpha 0; _mrk setMarkerAlphaLocal 1; + + if(typeof _building == OT_warehouse) then { + _mrk setMarkerType "mil_box"; + _mrk setMarkerColor "ColorGUER"; + _mrk setMarkerAlpha 1; + }; + _owned pushback ([_building] call fnc_getBuildID); [player,"Building Purchased",format["Bought: %1 in %2 for $%3",getText(configFile >> "CfgVehicles" >> (typeof _building) >> "displayName"),(getpos _building) call nearestTown,_price]] call BIS_fnc_createLogRecord; if(_price > 10000) then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/exportAll.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/exportAll.sqf new file mode 100644 index 00000000..40230451 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/exportAll.sqf @@ -0,0 +1,44 @@ +_target = vehicle player; + +if(_target == player) exitWith {}; + +if(count (player nearObjects [OT_portBuilding,30]) == 0) exitWith {}; + +private _town = player call nearestTown; +_doillegal = false; +if(_town in (server getVariable ["NATOabandoned",[]])) then { + _doillegal = true; +}else{ + hint format ["Only legal items may be exported while NATO controls %1",_town]; +}; + +"Exporting inventory" call notify_minor; +[5,false] call progressBar; +sleep 5; +_total = 0; +{ + _count = 0; + _cls = _x select 0; + _num = _x select 1; + if(_doillegal or _cls in (OT_allItems + OT_allBackpacks)) then { + _costprice = ["Tanoa",_cls,0] call getSellPrice; + _total = _total + (_costprice * _num); + call { + if(_cls isKindOf ["Rifle",configFile >> "CfgWeapons"]) exitWith { + [_target, _cls, _num] call CBA_fnc_removeWeaponCargoGlobal; + }; + if(_cls isKindOf ["Launcher",configFile >> "CfgWeapons"]) exitWith { + [_target, _cls, _num] call CBA_fnc_removeWeaponCargoGlobal; + }; + if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) exitWith { + [_target, _cls, _num] call CBA_fnc_removeMagazineCargoGlobal; + }; + if(_cls isKindOf "Bag_Base") exitWith { + [_target, _cls, _num] call CBA_fnc_removeBackpackCargoGlobal; + }; + [_target, _cls, _num] call CBA_fnc_removeItemCargoGlobal; + }; + }; +}foreach(_target call unitStock); + +[_total] call money; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fastTravel.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fastTravel.sqf index 553f6bbd..30e0e3b8 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fastTravel.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fastTravel.sqf @@ -1,4 +1,5 @@ if !(captive player) exitWith {"You cannot fast travel while wanted" call notify_minor}; +if !("ItemMap" in assignedItems player) exitWith {"You need a map to fast travel" call notify_minor}; if((vehicle player) != player) then { if (driver (vehicle player) != player) exitWith {"You are not the driver of this vehicle" call notify_minor}; @@ -9,10 +10,9 @@ if((vehicle player) != player) then { openMap true; ["fastTravel", "onMapSingleClick", { - if(_pos distance player < 150) exitWith { - "You cannot fast travel less than 150m. Just walk!" call notify_minor; - openMap false; - }; + private _starttown = player call nearestTown; + private _region = server getVariable format["region_%1",_starttown]; + private _handled = false; _buildings = _pos nearObjects [OT_item_Tent,30]; @@ -25,6 +25,25 @@ openMap true; _handled = true; }; }; + + _ob = _pos call nearestObjective; + _valid = true; + _ob params ["_obpos","_obname"]; + _validob = (_obpos distance _pos < 50) and (_obname in OT_allAirports); + if !(_validob) then { + if (!OT_adminMode and !([_pos,_region] call fnc_isInMarker)) then { + _valid = false; + "You cannot fast travel between islands unless your destination is a controlled airfield" call notify_minor; + openMap false; + }; + }; + if(!_valid) exitWith {}; + if(_pos distance player < 150) exitWith { + "You cannot fast travel less than 150m. Just walk!" call notify_minor; + openMap false; + }; + + if(OT_adminMode) then {_handled = true}; if !(_handled) then { @@ -68,5 +87,8 @@ openMap true; openMap false; }; }; - ["fastTravel", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler; }, nil] call BIS_fnc_addStackedEventHandler; + +waitUntil {!visibleMap}; + +["fastTravel", "onMapSingleClick"] call BIS_fnc_removeStackedEventHandler; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/import.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/import.sqf new file mode 100644 index 00000000..1e9236e8 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/import.sqf @@ -0,0 +1,34 @@ +if (OT_taking) exitWith {}; + +OT_taking = true; +private _idx = lbCurSel 1500; +private _cls = lbData [1500,_idx]; +private _num = _this select 0; +private _price = ["Tanoa",_cls,100] call getPrice; +_total = (_num * _price); +private _veh = (vehicle player); + +if((player getVariable ["money",0]) < _total) exitWith {format["You need $%1",[_total, 1, 0, true] call CBA_fnc_formatNumber] call notify_minor;OT_taking = false}; +if ((!(_veh isKindOf "Truck_F")) and (!(_veh canAdd [_cls,_num]))) exitWith {hint "This vehicle cannot fit that, use a truck for more storage";OT_taking = false}; + +_count = 0; + + +call { + if(_cls isKindOf ["Rifle",configFile >> "CfgWeapons"]) exitWith { + _veh addWeaponCargoGlobal [_cls,_num]; + }; + if(_cls isKindOf ["Launcher",configFile >> "CfgWeapons"]) exitWith { + _veh addWeaponCargoGlobal [_cls,_num]; + }; + if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) exitWith { + _veh addMagazineCargoGlobal [_cls,_num]; + }; + if(_cls isKindOf "Bag_Base") exitWith { + _veh addBackpackCargoGlobal [_cls,_num]; + }; + _veh addItemCargoGlobal [_cls,_num]; +}; +[-_total] call money; + +OT_taking = false; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf index c90a6062..fbc92a07 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf @@ -4,6 +4,19 @@ if(typename _b == "ARRAY") then { _building = (_b select 0); }; if(typeof _building == OT_policeStation) exitWith {[] call policeDialog}; +if(typeof _building == OT_barracks) exitWith {[] call recruitDialog}; +if(typeof _building == OT_warehouse) exitWith {[] call buyVehicleDialog}; + +if(typename _b != "ARRAY") exitWith { + private _ob = (getpos player) call nearestObjective; + _ob params ["_obpos","_obname"]; + if(_obpos distance player < 250) then { + if(_obname in (server getVariable ["NATOabandoned",[]])) then { + [] call buyVehicleDialog; + }; + }; +}; + if !(captive player) exitWith {"You cannot lease buildings while wanted" call notify_minor}; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/loadGame.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/loadGame.sqf index c174721a..defb81c6 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/loadGame.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/loadGame.sqf @@ -32,6 +32,12 @@ if(typename _data != "ARRAY") exitWith { _mrkid setMarkerText _name; }foreach(_val); }; + if(_key == "warehouse") then { + { + _cls = _x select 0; + warehouse setVariable [_cls,_x,true]; + }foreach(_val); + }; if(_key == "vehicles") then { _set = false; { @@ -62,24 +68,27 @@ if(typename _data != "ARRAY") exitWith { if(_type == OT_item_Map) then { _veh setObjectTextureGlobal [0,"dialogs\maptanoa.paa"]; }; - - if(_type in OT_staticMachineGuns) then { - _veh remoteExec["initStaticMGLocal",0,_veh]; - }; _veh setVariable ["owner",_owner,true]; { _cls = _x select 0; _num = _x select 1; + call { - if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) exitWith { - _veh addWeaponCargoGlobal _x; + if(_cls == "money") exitWith { + _veh setVariable ["money",_num,true]; + }; + if(_cls isKindOf ["Rifle",configFile >> "CfgWeapons"]) exitWith { + _veh addWeaponCargoGlobal [_cls,_num]; + }; + if(_cls isKindOf ["Launcher",configFile >> "CfgWeapons"]) exitWith { + _veh addWeaponCargoGlobal [_cls,_num]; }; if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) exitWith { - _veh addMagazineCargoGlobal _x; + _veh addMagazineCargoGlobal [_cls,_num]; }; if(_cls isKindOf "Bag_Base") exitWith { - _veh addBackpackCargoGlobal _x; + _veh addBackpackCargoGlobal [_cls,_num]; }; _veh addItemCargoGlobal _x; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf index fcde28a2..dd8634c8 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf @@ -142,13 +142,13 @@ if(_cost > 0) then { detach modeTarget; deleteVehicle modeTarget; }else{ - if ([getpos player,_typecls] call canPlace) then { - player setVariable ["money",_money - _cost,true]; + if ([getpos player,_typecls] call canPlace) then { + [-_cost] call money; modeTarget setPosATL [getPosATL modeTarget select 0,getPosATL modeTarget select 1,getPosATL player select 2]; modeTarget remoteExec ["enableSimulationGlobal true",2]; modeTarget enableSimulation true; modeTarget setVariable ["owner",getPlayerUID player,true]; - modeTarget call initObjectLocal; + modeTarget remoteExec["initObjectLocal",0,modeTarget]; if(_typecls == "Base" or _typecls == "Camp") then { _veh = createVehicle ["Land_ClutterCutter_large_F", (getpos modeTarget), [], 0, "CAN_COLLIDE"]; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/putMoney.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/putMoney.sqf new file mode 100644 index 00000000..be4292dc --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/putMoney.sqf @@ -0,0 +1,13 @@ +OT_context = _this select 0; +inputHandler = { + _val = parseNumber(ctrltext 1400); + _cash = player getVariable ["money",0]; + if(_val > _cash) then {_val = _cash}; + if(_val > 0) then { + [-_val] call money; + _in = OT_context getVariable ["money",0]; + OT_context setVariable ["money",_in + _val,true]; + }; +}; + +["How much to put in this safe?",player getvariable ["money",100]] spawn inputDialog; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitCiv.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitCiv.sqf index d2ab4ebc..345157a3 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitCiv.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitCiv.sqf @@ -22,4 +22,7 @@ _civ removeAllEventHandlers "FiredNear"; [_civ] spawn initRecruit; [player,format["New Recruit: %1",name _civ],format["Recruited: %1 for $%2",name _civ,_price]] call BIS_fnc_createLogRecord; -format["%1 has been recruited",name _civ] call notify_minor; \ No newline at end of file +format["%1 has been recruited",name _civ] call notify_minor; + +_civ setBehaviour "SAFE"; +[[_civ,""],"switchMove",TRUE,FALSE] spawn BIS_fnc_MP; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf index 4077c2e5..d451587f 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf @@ -1 +1,19 @@ -if !(captive player) exitWith {"You cannot recruit while wanted" call notify_minor}; \ No newline at end of file +if !(captive player) exitWith {"You cannot recruit while wanted" call notify_minor}; + +private _cls = _this select 0; +private _pos = _this select 1; +private _group = _this select 2; + +_soldier = _cls call getSoldier; + +private _money = player getVariable ["money",0]; +private _cost = _soldier select 0; +if(_money < _cost) exitWith {format ["You need $%1",_cost] call notify_minor}; + +[-_cost] call money; + +private _civ = [_soldier,_pos,_group] call createSoldier; + +_civ setVariable ["owner",getplayeruid player,true]; +[_civ] spawn initRecruit; +_civ setRank "SERGEANT"; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf new file mode 100644 index 00000000..60f34744 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf @@ -0,0 +1,39 @@ +if !(captive player) exitWith {"You cannot recruit while wanted" call notify_minor}; + +private _cls = _this select 0; +private _pos = _this select 1; + +_d = []; +{ + _name = _x select 0; + if(_name == _cls) exitWith {_d = _x}; +}foreach(OT_squadables); + +_comp = _d select 1; +_soldiers = []; +private _cost = 0; +{ + _s = OT_recruitables select _x; + + _soldier = (_s select 0) call getSoldier; + _cost = _cost + (_soldier select 0); + _soldiers pushback _soldier; +}foreach(_comp); + +private _money = player getVariable ["money",0]; +if(_money < _cost) exitWith {format ["You need $%1",_cost] call notify_minor}; + +[-_cost] call money; + +_group = creategroup resistance; +_leader = false; +{ + _civ = [_x,_pos,_group] call createSoldier; + player reveal [_civ,4]; + if(!_leader) then {_group selectLeader _civ;_leader=true}; +}foreach(_soldiers); +player hcSetGroup [_group,_cls]; + +_recruits = server getVariable ["squads",[]]; +_recruits pushback [getplayeruid player,_cls,_group,[]]; +server setVariable ["squads",_recruits,true]; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/removeLoadout.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/removeLoadout.sqf new file mode 100644 index 00000000..ba8203fe --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/removeLoadout.sqf @@ -0,0 +1,16 @@ +params ["_name"]; + +_loadout = profileNamespace setVariable [format["OT_loadout_%1",_name],nil]; + +_loadouts = profileNamespace getVariable ["OT_loadouts",[]]; +_loadouts deleteAt (_loadouts find _name); +profileNamespace setVariable ["OT_loadouts",_loadouts]; + +lbClear 1500; +{ + _cls = _x; + + _idx = lbAdd [1500,_cls]; + lbSetValue [1500,_idx,0]; + lbSetData [1500,_idx,_cls]; +}foreach(_loadouts); \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/restoreLoadout.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/restoreLoadout.sqf new file mode 100644 index 00000000..2b12b484 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/restoreLoadout.sqf @@ -0,0 +1,178 @@ +closeDialog 0; +params ["_unit","_ammobox","_name"]; + +_loadout = profileNamespace getVariable format["OT_loadout_%1",_name]; +_loadout params ["_primary","_secondary","_tertiary","_uniform","_vest","_backpack","_headgear","_goggles","_optic","_assigned"]; + +[_unit,_ammobox] call dumpStuff; + +if(count _primary > 0) then { + private _pWpn = _primary select 0; + private _pItems = [_primary select 1,_primary select 2,_primary select 3]; + private _pAmmo = (_primary select 4) select 0; + + if([_ammobox,_pWpn,1] call CBA_fnc_removeWeaponCargoGlobal) then { + _unit addWeaponGlobal _pWpn; + if(!isNil "_pAmmo") then { + if([_ammobox,_pAmmo,1] call CBA_fnc_removeMagazineCargoGlobal) then { + _unit addMagazineGlobal _pAmmo; + }; + }; + { + if([_ammobox,_x,1] call CBA_fnc_removeItemCargoGlobal) then { + _unit addPrimaryWeaponItem _x; + }; + }foreach(_pItems); + }; +}; + +if(count _secondary > 0) then { + private _sWpn = _secondary select 0; + private _sItems = [_secondary select 1,_secondary select 2,_secondary select 3]; + private _sAmmo = (_secondary select 4) select 0; + + if([_ammobox,_sWpn,1] call CBA_fnc_removeWeaponCargoGlobal) then { + _unit addWeaponGlobal _sWpn; + if(!isNil "_sAmmo") then { + if([_ammobox,_sAmmo,1] call CBA_fnc_removeMagazineCargoGlobal) then { + _unit addMagazineGlobal _sAmmo; + }; + }; + { + if([_ammobox,_x,1] call CBA_fnc_removeItemCargoGlobal) then { + _unit addSecondaryWeaponItem _x; + }; + }foreach(_sItems); + }; +}; + +if(count _tertiary > 0) then { + private _tWpn = _tertiary select 0; + private _tItems = [_tertiary select 1,_tertiary select 2,_tertiary select 3]; + private _tAmmo = (_tertiary select 4) select 0; + + if([_ammobox,_tWpn,1] call CBA_fnc_removeWeaponCargoGlobal) then { + _unit addWeaponGlobal _tWpn; + if(!isNil "_tAmmo") then { + if([_ammobox,_tAmmo,1] call CBA_fnc_removeMagazineCargoGlobal) then { + _unit addMagazineGlobal _tAmmo; + }; + }; + }; +}; + +private _uniformCls = _uniform select 0; +private _uniformItems = _uniform select 1; + + +if(count _vest > 0) then { + private _vestCls = _vest select 0; + private _vestItems = _vest select 1; + + if([_ammobox,_vestCls,1] call CBA_fnc_removeItemCargoGlobal) then { + _unit addVest _vestCls; + { + _cc = _x select 0; + if(typename _cc == "ARRAY") then {_cc = _cc select 0}; + _num = _x select 1; + _count = 0; + + _func = CBA_fnc_removeWeaponCargoGlobal; + [] call { + if(_cc isKindOf ["ItemCore",configFile >> "CfgWeapons"]) exitWith { + _func = CBA_fnc_removeItemCargoGlobal; + }; + if(_cc isKindOf ["Default",configFile >> "CfgMagazines"]) exitWith { + _func = CBA_fnc_removeMagazineCargoGlobal; + }; + }; + while {_count < _num} do { + if([_ammobox,_cc,1] call _func) then { + _unit addItemToVest _cc; + }; + _count = _count + 1; + }; + + }foreach(_vestItems); + }; +}; + +if(count _backpack > 0) then { + private _bpCls = _backpack select 0; + private _bpItems = _backpack select 1; + + if([_ammobox,_bpCls,1] call CBA_fnc_removeBackpackCargoGlobal) then { + _unit addBackpack _bpCls; + { + _cc = _x select 0; + if(typename _cc == "ARRAY") then {_cc = _cc select 0}; + _num = _x select 1; + _count = 0; + + _func = CBA_fnc_removeWeaponCargoGlobal; + [] call { + if(_cc isKindOf ["ItemCore",configFile >> "CfgWeapons"]) exitWith { + _func = CBA_fnc_removeItemCargoGlobal; + }; + if(_cc isKindOf ["Default",configFile >> "CfgMagazines"]) exitWith { + _func = CBA_fnc_removeMagazineCargoGlobal; + }; + }; + while {_count < _num} do { + if([_ammobox,_cc,1] call _func) then { + _unit addItemToBackpack _cc; + }; + _count = _count + 1; + }; + + }foreach(_bpItems); + }; +}; + +if(count _optic > 0) then { + private _opticCls = _optic select 0; + if([_ammobox,_opticCls,1] call CBA_fnc_removeWeaponCargoGlobal) then { + _unit addWeapon _opticCls; + _unit assignItem _opticCls; + }; +}; + +_unit forceAddUniform _uniformCls; + +{ + _cc = _x select 0; + if(typename _cc == "ARRAY") then {_cc = _cc select 0}; + _num = _x select 1; + _count = 0; + + _func = CBA_fnc_removeWeaponCargoGlobal; + [] call { + if(_cc isKindOf ["ItemCore",configFile >> "CfgWeapons"]) exitWith { + _func = CBA_fnc_removeItemCargoGlobal; + }; + if(_cc isKindOf ["Default",configFile >> "CfgMagazines"]) exitWith { + _func = CBA_fnc_removeMagazineCargoGlobal; + }; + }; + while {_count < _num} do { + if([_ammobox,_cc,1] call _func) then { + _unit addItemToUniform _cc; + }; + _count = _count + 1; + }; + +}foreach(_uniformItems); + +if([_ammobox,_headgear,1] call CBA_fnc_removeItemCargoGlobal) then { + _unit addHeadgear _headgear; +}; + +if([_ammobox,_goggles,1] call CBA_fnc_removeItemCargoGlobal) then { + _unit addGoggles _goggles; +}; + +{ + if([_ammobox,_x,1] call CBA_fnc_removeItemCargoGlobal) then { + _unit linkItem _x; + }; +}foreach(_assigned); \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/saveGame.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/saveGame.sqf index b92b0bf4..2801d493 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/saveGame.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/saveGame.sqf @@ -45,8 +45,12 @@ _vehicles = []; _count = 10001; { if(!(_x isKindOf "Man") and (alive _x) and (_x call hasOwner) and (typeof _x != OT_item_Flag)) then { - _owner = _x getVariable ["owner",false]; - _vehicles pushback [typeof _x,getpos _x,getdir _x,_x call unitStock,_owner,_x getVariable ["name",""],_x getVariable ["OT_init",""]]; + _owner = _x getVariable ["owner",false]; + _s = _x call unitStock; + if(typeof _x == OT_item_safe) then { + _s pushback ["money",_x getVariable ["money",0]]; + }; + _vehicles pushback [typeof _x,getpos _x,getdir _x,_s,_owner,_x getVariable ["name",""],_x getVariable ["OT_init",""]]; _done pushback _x; }; if(_count > 2000) then { @@ -60,6 +64,15 @@ _count = 10001; sleep 0.2; _data pushback ["vehicles",_vehicles]; +_warehouse = []; +{ + _var = warehouse getVariable _x; + if (!isNil "_var") then { + _warehouse pushback _var; + }; +}foreach(allvariables warehouse); +_data pushback ["warehouse",_warehouse]; + _recruits = []; { _do = true; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/saveLoadout.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/saveLoadout.sqf new file mode 100644 index 00000000..2f4f33c0 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/saveLoadout.sqf @@ -0,0 +1,14 @@ +inputHandler = { + _name = ctrltext 1400; + if(_name != "") then { + profileNamespace setVariable [format["OT_loadout_%1",_name],getUnitLoadout player]; + _loadouts = profileNamespace getVariable ["OT_loadouts",[]]; + _idx = _loadouts find _name; + if(_idx == -1) then { + _loadouts pushback _name; + }; + profileNamespace setVariable ["OT_loadouts",_loadouts]; + }; +}; + +["Name this loadout",""] spawn inputDialog; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sell.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sell.sqf index bd0713da..dac18804 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sell.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sell.sqf @@ -59,7 +59,16 @@ if !(_done) then { }; [_price] call money; -_b setVariable ["stock",_s,true]; +_b setVariable ["stock",_s,true]; + +if(OT_hasTFAR) then { + _c = _cls splitString "_"; + if((_c select 0) == "tf") then { + { + if(_x find _cls == 0) exitWith {_cls = _x}; + }foreach(items player); + }; +}; player removeItem _cls; lbClear 1500; _mystock = player call unitStock; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sellall.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sellall.sqf index 9b4e2a04..fb0b0db9 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sellall.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sellall.sqf @@ -1,4 +1,4 @@ -private ["_b","_s","_town","_standing","_cls","_num","_price","_idx","_done"]; +private ["_b","_s","_town","_standing","_cls","_num","_price","_idx","_done","_qty"]; if (OT_selling) exitWith {}; OT_selling = true; @@ -28,12 +28,11 @@ _mynum = 0; if(isNil "_price") exitWith {OT_selling = false}; -_pstock = player call unitStock; _qty = 0; { _c = _x select 0; if(_c == _cls) exitWith {_qty = _x select 1}; -}foreach(_pstock); +}foreach(player call unitStock); if(_qty == 0) exitWith {[_mystock,_town,_standing,_s] call sellDialog}; @@ -69,9 +68,17 @@ if !(_done) then { }; [(_price*_qty)] call money; - +_ocls = _cls; _b setVariable ["stock",_s,true]; for "_i" from 0 to _qty do { + if(OT_hasTFAR) then { + _c = _ocls splitString "_"; + if((_c select 0) == "tf") then { + { + if(_x find _ocls == 0) exitWith {_cls = _x}; + }foreach(items player); + }; + }; player removeItem _cls; }; OT_selling = false; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/setPassword.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/setPassword.sqf new file mode 100644 index 00000000..2e3c9f29 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/setPassword.sqf @@ -0,0 +1,7 @@ +OT_context = _this select 0; +inputHandler = { + _val = ctrltext 1400; + OT_context setVariable ["password",_val,true]; +}; + +["Set password (blank to remove)",""] spawn inputDialog; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeMoney.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeMoney.sqf new file mode 100644 index 00000000..6a434a69 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeMoney.sqf @@ -0,0 +1,42 @@ +OT_context = _this select 0; + +private _password = OT_context getVariable ["password",""]; + +if(_password == "") exitWith { + private _in = OT_context getVariable ["money",0]; + + inputHandler = { + _val = parseNumber(ctrltext 1400); + _cash = player getVariable ["money",0]; + _in = OT_context getVariable ["money",0]; + if(_val > _in) then {_val = _in}; + if(_val > 0) then { + [_val] call money; + OT_context setVariable ["money",_in - _val,true]; + }; + }; + + [format["How much to take? ($%1 Total)",[_in, 1, 0, true] call CBA_fnc_formatNumber],100] spawn inputDialog; +}; + +inputHandler = { + private _password = OT_context getVariable ["password",""]; + private _pw = ctrlText 1400; + if(_pw != _password) exitWith {"Wrong password" call notify_minor}; + private _in = OT_context getVariable ["money",0]; + + inputHandler = { + _val = parseNumber(ctrltext 1400); + _cash = player getVariable ["money",0]; + _in = OT_context getVariable ["money",0]; + if(_val > _in) then {_val = _in}; + if(_val > 0) then { + [_val] call money; + OT_context setVariable ["money",_in - _val,true]; + }; + }; + + [format["How much to take? ($%1 Total)",[_in, 1, 0, true] call CBA_fnc_formatNumber],100] spawn inputDialog; +}; + +["Please enter password",""] spawn inputDialog; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferFrom.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferFrom.sqf index a74e7509..6007087f 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferFrom.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferFrom.sqf @@ -5,7 +5,7 @@ if(_veh == player) exitWith {}; _objects = []; { if(_x != _veh) then {_objects pushback _x}; -}foreach(player nearEntities [["LandVehicle",OT_item_Storage,OT_items_distroStorage select 0],20]); +}foreach(player nearEntities [["LandVehicle","ReammoBox_F"],20]); if(count _objects == 0) exitWith { "Cannot find any containers or other vehicles within 20m of this vehicle" call notify_minor; @@ -13,16 +13,36 @@ if(count _objects == 0) exitWith { _sorted = [_objects,[],{_x distance player},"ASCEND"] call BIS_fnc_SortBy; _target = _sorted select 0; -"Transferring cargo from container" call notify_minor; +if(_veh call unitSeen) then { + if(typename (_target getVariable ["stockof",""]) == "SCALAR") then { + { + _x setCaptive false; + }foreach(units _veh); + _veh spawn revealToNATO; + hint "You were caught stealing!"; + }; +}; + +disableUserInput true; + +format["Transferring inventory from %1",(typeof _target) call ISSE_Cfg_Vehicle_GetName] call notify_minor; [5,false] call progressBar; -sleep 5; +_end = time + 5; { _count = 0; _cls = _x select 0; - while {_count < (_x select 1)} do { + + _full = false; + while {_count < (_x select 1)} do { + if(!(_veh isKindOf "Truck_F" or _veh isKindOf "ReammoBox_F") and !(_veh canAdd _cls)) exitWith { + _full = true; + }; _count = _count + 1; call { - if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) exitWith { + if(_cls isKindOf ["Rifle",configFile >> "CfgWeapons"]) exitWith { + _veh addWeaponCargoGlobal [_cls,1]; + }; + if(_cls isKindOf ["Launcher",configFile >> "CfgWeapons"]) exitWith { _veh addWeaponCargoGlobal [_cls,1]; }; if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) exitWith { @@ -34,10 +54,27 @@ sleep 5; _veh addItemCargoGlobal [_cls,1]; }; }; + + call { + if(_cls isKindOf ["Rifle",configFile >> "CfgWeapons"]) exitWith { + [_target, _cls, _count] call CBA_fnc_removeWeaponCargoGlobal; + }; + if(_cls isKindOf ["Launcher",configFile >> "CfgWeapons"]) exitWith { + [_target, _cls, _count] call CBA_fnc_removeWeaponCargoGlobal; + }; + if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) exitWith { + [_target, _cls, _count] call CBA_fnc_removeMagazineCargoGlobal; + }; + if(_cls isKindOf "Bag_Base") exitWith { + [_target, _cls, _count] call CBA_fnc_removeBackpackCargoGlobal; + }; + if !([_target, _cls, _count] call CBA_fnc_removeItemCargoGlobal) then { + [_target, _cls, _count] call CBA_fnc_removeWeaponCargoGlobal; + }; + }; + if(_full) exitWith {hint "This vehicle is full, use a truck for more storage"}; }foreach(_target call unitStock); -clearItemCargoGlobal _target; -clearMagazineCargoGlobal _target; -clearWeaponCargoGlobal _target; -clearBackpackCargoGlobal _target; +waitUntil {time > _end}; +"Inventory Transfer done" call notify_minor; -"Cargo Transfer done" call notify_minor; \ No newline at end of file +disableUserInput false; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferLegit.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferLegit.sqf index 6f89ee3c..852fe3ce 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferLegit.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferLegit.sqf @@ -2,10 +2,23 @@ _veh = vehicle player; if(_veh == player) exitWith {}; -_objects = []; -{ - if(_x != _veh) then {_objects pushback _x}; -}foreach(player nearEntities [["LandVehicle",OT_item_Storage,OT_items_distroStorage select 0],20]); +private _objects = []; + +private _b = player call getNearestRealEstate; +private _iswarehouse = false; +if(typename _b == "ARRAY") then { + _building = _b select 0; + if((typeof _building) == OT_warehouse and _building call hasOwner) then { + _iswarehouse = true; + }; + _objects = [_building]; +}; + +if(!_iswarehouse) then { + { + if(_x != _veh) then {_objects pushback _x}; + }foreach(player nearEntities [["LandVehicle","ReammoBox_F"],20]); +}; if(count _objects == 0) exitWith { "Cannot find any containers or other vehicles within 20m of this vehicle" call notify_minor; @@ -13,44 +26,50 @@ if(count _objects == 0) exitWith { _sorted = [_objects,[],{_x distance player},"ASCEND"] call BIS_fnc_SortBy; _target = _sorted select 0; -"Transferring legit cargo from container" call notify_minor; +private _toname = (typeof _target) call ISSE_Cfg_Vehicle_GetName; +if(_iswarehouse) then {_toname = "Warehouse"}; +format["Transferring legal inventory from %1",_toname] call notify_minor; + + [5,false] call progressBar; sleep 5; -_putback = []; -{ - _count = 0; - _cls = _x select 0; - if(_cls in (OT_allItems - OT_consumableItems)) then { - while {_count < (_x select 1)} do { - _veh addItemCargoGlobal [_cls,1]; - _count = _count + 1; - }; - }else{ - _putback pushback _x; - }; -}foreach(_target call unitStock); -clearItemCargoGlobal _target; -clearMagazineCargoGlobal _target; -clearWeaponCargoGlobal _target; - -{ - _count = 0; - _cls = _x select 0; - while {_count < (_x select 1)} do { - _count = _count + 1; - call { - if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) exitWith { - _target addWeaponCargoGlobal [_cls,1]; - }; - if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) exitWith { - _target addMagazineCargoGlobal [_cls,1]; +_full = false; +if(_iswarehouse) then { + { + _count = 0; + _d = warehouse getVariable [_x,[_x,0]]; + _cls = _d select 0; + _num = _d select 1; + if(_num > 0) then { + if(_cls in (OT_allItems - OT_consumableItems)) then { + while {_count < _num} do { + if !(_veh canAdd _cls) exitWith {_full = true;warehouse setVariable [_cls,_num - _count,true]}; + _veh addItemCargoGlobal [_cls,1]; + _count = _count + 1; + }; + if !(_full) then { + warehouse setVariable [_cls,nil,true]; + }; }; - if(_cls isKindOf "Bag_Base") exitWith { - _target addBackpackCargoGlobal [_cls,1]; + }; + if(_full) exitWith {}; + }foreach(allvariables warehouse); +}else{ + { + _count = 0; + _cls = _x select 0; + if(_cls in (OT_allItems - OT_consumableItems)) then { + while {_count < (_x select 1)} do { + if !(_veh canAdd _cls) exitWith {_full = true}; + _veh addItemCargoGlobal [_cls,1]; + _count = _count + 1; }; - _target addItemCargoGlobal [_cls,1]; - }; - }; -}foreach(_putback); - -"Cargo Transfer done" call notify_minor; \ No newline at end of file + }; + if !([_target, _cls, _count] call CBA_fnc_removeItemCargoGlobal) then { + [_target, _cls, _count] call CBA_fnc_removeWeaponCargoGlobal; + }; + if(_full) exitWith {}; + }foreach(_target call unitStock); +}; +if(_full) then {hint "This vehicle is full, use a truck for more storage"}; +"Inventory Transfer done" call notify_minor; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferTo.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferTo.sqf index d7201574..cbbc5c76 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferTo.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferTo.sqf @@ -1,43 +1,93 @@ -_veh = vehicle player; +_target = vehicle player; -if(_veh == player) exitWith {}; +if(_target == player) exitWith {}; +private _objects = []; -_objects = []; -{ - if(_x != _veh) then {_objects pushback _x}; -}foreach(player nearEntities [["LandVehicle",OT_item_Storage,OT_items_distroStorage select 0],20]); +private _b = player call getNearestRealEstate; +private _iswarehouse = false; +if(typename _b == "ARRAY") then { + _building = _b select 0; + if((typeof _building) == OT_warehouse and _building call hasOwner) then { + _iswarehouse = true; + }; + _objects = [_building]; +}; + +if(!_iswarehouse) then { + { + if(_x != _target) then {_objects pushback _x}; + }foreach(player nearEntities [["LandVehicle","ReammoBox_F"],20]); +}; if(count _objects == 0) exitWith { "Cannot find any containers or other vehicles within 20m of this vehicle" call notify_minor; }; _sorted = [_objects,[],{_x distance player},"ASCEND"] call BIS_fnc_SortBy; -_target = _sorted select 0; +_veh = _sorted select 0; + +private _toname = (typeof _veh) call ISSE_Cfg_Vehicle_GetName; +if(_iswarehouse) then {_toname = "Warehouse"}; -"Transferring cargo to container" call notify_minor; +format["Transferring inventory to %1",_toname] call notify_minor; [5,false] call progressBar; sleep 5; -{ - _count = 0; - _cls = _x select 0; - while {_count < (_x select 1)} do { - _count = _count + 1; +if(_iswarehouse) then { + { + _cls = _x select 0; + _d = warehouse getVariable [(_x select 0),[_cls,0]]; + _num = _x select 1; + _in = _d select 1; + warehouse setVariable[_cls,[_cls,_in + _num],true]; + }foreach(_target call unitStock); + clearMagazineCargoGlobal _target; + clearWeaponCargoGlobal _target; + clearBackpackCargoGlobal _target; + clearItemCargoGlobal _target; +}else{ + { + _count = 0; + _cls = _x select 0; + _full = false; + while {_count < (_x select 1)} do { + if(!(_veh isKindOf "Truck_F" or _veh isKindOf "ReammoBox_F") and !(_veh canAdd _cls)) exitWith { + _full = true; + }; + _count = _count + 1; + call { + if(_cls isKindOf ["Rifle",configFile >> "CfgWeapons"]) exitWith { + _veh addWeaponCargoGlobal [_cls,1]; + }; + if(_cls isKindOf ["Launcher",configFile >> "CfgWeapons"]) exitWith { + _veh addWeaponCargoGlobal [_cls,1]; + }; + if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) exitWith { + _veh addMagazineCargoGlobal [_cls,1]; + }; + if(_cls isKindOf "Bag_Base") exitWith { + _veh addBackpackCargoGlobal [_cls,1]; + }; + _veh addItemCargoGlobal [_cls,1]; + }; + }; call { - if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) exitWith { - _target addWeaponCargoGlobal [_cls,1]; + if(_cls isKindOf ["Rifle",configFile >> "CfgWeapons"]) exitWith { + [_target, _cls, _count] call CBA_fnc_removeWeaponCargoGlobal; + }; + if(_cls isKindOf ["Launcher",configFile >> "CfgWeapons"]) exitWith { + [_target, _cls, _count] call CBA_fnc_removeWeaponCargoGlobal; }; if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) exitWith { - _target addMagazineCargoGlobal [_cls,1]; + [_target, _cls, _count] call CBA_fnc_removeMagazineCargoGlobal; }; if(_cls isKindOf "Bag_Base") exitWith { - _target addBackpackCargoGlobal [_cls,1]; + [_target, _cls, _count] call CBA_fnc_removeBackpackCargoGlobal; + }; + if !([_target, _cls, _count] call CBA_fnc_removeItemCargoGlobal) then { + [_target, _cls, _count] call CBA_fnc_removeWeaponCargoGlobal; }; - _target addItemCargoGlobal [_cls,1]; - }; - }; -}foreach(_veh call unitStock); -clearMagazineCargoGlobal _veh; -clearWeaponCargoGlobal _veh; -clearItemCargoGlobal _veh; -clearBackpackCargoGlobal _veh; + }; + if(_full) exitWith {hint "The vehicle is full, use a truck or ammobox for more storage"}; + }foreach(_target call unitStock); +}; -"Cargo Transfer done" call notify_minor; \ No newline at end of file +"Inventory Transfer done" call notify_minor; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/warehouseTake.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/warehouseTake.sqf new file mode 100644 index 00000000..81a1eeb0 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/warehouseTake.sqf @@ -0,0 +1,45 @@ +if (OT_taking) exitWith {}; + +OT_taking = true; +private _idx = lbCurSel 1500; +private _cls = lbData [1500,_idx]; +private _num = _this select 0; +private _d = warehouse getVariable [_cls,[_cls,0]]; +_in = _d select 1; + +if(_num > _in or _num == -1) then { + _num = _in; +}; + +_count = 0; +private _veh = (vehicle player); +while {_count < _num} do { + if ((!(_veh isKindOf "Truck_F")) and (!(_veh canAdd _cls))) exitWith {hint "This vehicle is full, use a truck for more storage"; closeDialog 0; _num = _count}; + call { + if(_cls isKindOf ["Rifle",configFile >> "CfgWeapons"]) exitWith { + _veh addWeaponCargoGlobal [_cls,1]; + }; + if(_cls isKindOf ["Launcher",configFile >> "CfgWeapons"]) exitWith { + _veh addWeaponCargoGlobal [_cls,1]; + }; + if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) exitWith { + _veh addMagazineCargoGlobal [_cls,1]; + }; + if(_cls isKindOf "Bag_Base") exitWith { + _veh addBackpackCargoGlobal [_cls,1]; + }; + _veh addItemCargoGlobal [_cls,1]; + }; + _count = _count + 1; +}; + +private _newnum = _in - _num; +if(_newnum > 0) then { + warehouse setVariable [_cls,[_cls,_newnum],true]; +}else{ + warehouse setVariable [_cls,nil,true]; +}; + +[] call warehouseDialog; + +OT_taking = false; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext index 9c881d73..5266dfac 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext @@ -10,7 +10,7 @@ overviewPicture = "\ot\campaign\missions\Overthrow.Tanoa\overthrow_tanoa.jpg"; author="ARMAzac"; briefingName = "Overthrow Tanoa"; OnLoadName = "Overthrow Tanoa"; -OnLoadMission = "v0.5.6"; +OnLoadMission = "v0.6.1"; loadScreen = "\ot\campaign\missions\Overthrow.Tanoa\pic.jpg"; onLoadMissionTime = 1; allowSubordinatesTakeWeapons= 1; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/build.hpp b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/build.hpp index 52446e38..a185e1ed 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/build.hpp +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/build.hpp @@ -146,14 +146,14 @@ class OT_dialog_buildobjective class RscButton_1604: RscButton { idc = 1604; - action = "'Helipad' call build"; + action = "'Warehouse' call build"; - text = "Helipad"; //--- ToDo: Localize; + text = "Warehouse"; //--- ToDo: Localize; x = 0.0204687 * safezoneW + safezoneX; y = 0.676 * safezoneH + safezoneY; w = 0.0876563 * safezoneW; h = 0.077 * safezoneH; - tooltip = "Apparently helicopter pilots need to be told where they are allowed to land"; //--- ToDo: Localize; + tooltip = "Stores and retrieves items from all warehouses"; //--- ToDo: Localize; }; class RscButton_1605: RscButton { @@ -265,14 +265,14 @@ class OT_dialog_buildtown class RscButton_1603: RscButton { idc = 1603; - action = "'Bunkers' call build"; + action = "'Warehouse' call build"; - text = "Bunkers"; //--- ToDo: Localize; + text = "Warehouse"; //--- ToDo: Localize; x = 0.0204687 * safezoneW + safezoneX; y = 0.5 * safezoneH + safezoneY; w = 0.0876563 * safezoneW; h = 0.077 * safezoneH; - tooltip = "Small defensive structures"; //--- ToDo: Localize; + tooltip = "Store items"; //--- ToDo: Localize; }; class RscButton_1604: RscButton { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/main.hpp b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/main.hpp index c506e25d..553dca6c 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/main.hpp +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/main.hpp @@ -25,7 +25,7 @@ class OT_dialog_start class RscButton_1600: RscButton { idc = 1600; - action = "closeDialog 0;'actions\loadGame.sqf' remoteExec ['execVM',2];"; + action = "closeDialog 0;'actions\loadGame.sqf' remoteExec ['execVM',2,false];"; text = "Load Persistent Save"; //--- ToDo: Localize; x = 0.448438 * safezoneW + safezoneX; @@ -37,7 +37,7 @@ class OT_dialog_start class RscButton_1601: RscButton { idc = 1601; - action = "closeDialog 0;[] remoteExec ['newGame',2];"; + action = "closeDialog 0;[] remoteExec ['newGame',2,false];"; text = "New Game"; //--- ToDo: Localize; x = 0.448438 * safezoneW + safezoneX; @@ -137,6 +137,147 @@ class OT_dialog_vehicle } } +class OT_dialog_vehiclewarehouse +{ + idd=-1; + movingenable=false; + + class controlsBackground { + class RscStructuredText_1103: RscStructuredText + { + idc = 1103; + + text = ""; + x = 0 * safezoneW + safezoneX; + y = 0 * safezoneH + safezoneY; + w = 0.159844 * safezoneW; + h = 1 * safezoneH; + colorBackground[] = {0.1,0.1,0.1,1}; + }; + }; + + class controls + { + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Xeqozy) + //////////////////////////////////////////////////////// + + class RscButton_1600: RscButton + { + idc = 1600; + text = "Fast Travel"; //--- ToDo: Localize; + x = 0.0204687 * safezoneW + safezoneX; + y = 0.39 * safezoneH + safezoneY; + w = 0.0876563 * safezoneW; + h = 0.077 * safezoneH; + action = "closeDialog 0;[] spawn fastTravel;"; + tooltip = "Fast travels this vehicle and it's occupants"; //--- ToDo: Localize; + }; + class RscButton_1601: RscButton + { + idc = 1601; + text = "Take From"; //--- ToDo: Localize; + x = 0.0204687 * safezoneW + safezoneX; + y = 0.654 * safezoneH + safezoneY; + w = 0.0876563 * safezoneW; + h = 0.077 * safezoneH; + tooltip = "Take from the warehouse"; //--- ToDo: Localize; + action = "closeDialog 0;createDialog ""OT_dialog_warehouse"";[] call warehouseDialog;"; + }; + class RscButton_1602: RscButton + { + idc = 1602; + text = "Store All"; //--- ToDo: Localize; + x = 0.0204687 * safezoneW + safezoneX; + y = 0.478 * safezoneH + safezoneY; + w = 0.0876563 * safezoneW; + h = 0.077 * safezoneH; + tooltip = "Stores the contents of this vehicle in the warehouse"; //--- ToDo: Localize; + action = "closeDialog 0;[] spawn transferTo;"; + }; + class RscButton_1603: RscButton + { + idc = 1603; + text = "Take Legit"; //--- ToDo: Localize; + x = 0.0204687 * safezoneW + safezoneX; + y = 0.566 * safezoneH + safezoneY; + w = 0.0876563 * safezoneW; + h = 0.077 * safezoneH; + tooltip = "Takes all legal (sellable) items from the warehouse"; //--- ToDo: Localize; + action = "closeDialog 0;[] spawn transferLegit;"; + }; + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT END + //////////////////////////////////////////////////////// + + } +} + +class OT_dialog_vehicleport +{ + idd=-1; + movingenable=false; + + class controlsBackground { + class RscStructuredText_1103: RscStructuredText + { + idc = 1103; + + text = ""; + x = 0 * safezoneW + safezoneX; + y = 0 * safezoneH + safezoneY; + w = 0.159844 * safezoneW; + h = 1 * safezoneH; + colorBackground[] = {0.1,0.1,0.1,1}; + }; + }; + + class controls + { + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Xeqozy) + //////////////////////////////////////////////////////// + + class RscButton_1600: RscButton + { + idc = 1600; + text = "Fast Travel"; //--- ToDo: Localize; + x = 0.0204687 * safezoneW + safezoneX; + y = 0.39 * safezoneH + safezoneY; + w = 0.0876563 * safezoneW; + h = 0.077 * safezoneH; + action = "closeDialog 0;[] spawn fastTravel;"; + tooltip = "Fast travels this vehicle and it's occupants"; //--- ToDo: Localize; + }; + class RscButton_1601: RscButton + { + idc = 1601; + text = "Import"; //--- ToDo: Localize; + x = 0.0204687 * safezoneW + safezoneX; + y = 0.654 * safezoneH + safezoneY; + w = 0.0876563 * safezoneW; + h = 0.077 * safezoneH; + tooltip = "Import items from the global market"; //--- ToDo: Localize; + action = "closeDialog 0;createDialog ""OT_dialog_import"";[] call importDialog;"; + }; + class RscButton_1602: RscButton + { + idc = 1602; + text = "Export All"; //--- ToDo: Localize; + x = 0.0204687 * safezoneW + safezoneX; + y = 0.566 * safezoneH + safezoneY; + w = 0.0876563 * safezoneW; + h = 0.077 * safezoneH; + tooltip = "Exports the contents of this vehicle"; //--- ToDo: Localize; + action = "closeDialog 0;[] spawn exportAll;"; + }; + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT END + //////////////////////////////////////////////////////// + + } +} + class OT_dialog_command { idd=-1; @@ -318,7 +459,7 @@ class OT_dialog_main class RscButton_1600: RscButton { idc = 1600; - action = "closeDialog 0;[] call fastTravel"; + action = "closeDialog 0;[] spawn fastTravel"; text = "Fast Travel"; //--- ToDo: Localize; x = 0.005 * safezoneW + safezoneX; @@ -526,12 +667,12 @@ class OT_dialog_char y = 0.423 * safezoneH + safezoneY; w = 0.149531 * safezoneW; h = 0.044 * safezoneH; - action="[] call buyFitness;" + action="[""fitness""] call buyPerk;"; }; class RscStructuredText_1101: RscStructuredText { idc = 1101; - text = "TBC
Level 1
More perks coming soon"; //--- ToDo: Localize; + text = "Increase Level (-10 Influence)"; //--- ToDo: Localize; x = 0.427812 * safezoneW + safezoneX; y = 0.269 * safezoneH + safezoneY; w = 0.149531 * safezoneW; @@ -539,6 +680,16 @@ class OT_dialog_char colorBackground[] = {0,0,0,0.3}; colorActive[] = {0,0,0,0.3}; }; + class RscButton_1601: RscButton + { + idc = 1601; + text = "Increase Level (-10 Influence)"; //--- ToDo: Localize; + x = 0.427812 * safezoneW + safezoneX; + y = 0.423 * safezoneH + safezoneY; + w = 0.149531 * safezoneW; + h = 0.044 * safezoneH; + action="[""trade""] call buyPerk;"; + }; class RscStructuredText_1102: RscStructuredText { idc = 1102; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/place.hpp b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/place.hpp index 6ed57c98..97fd4365 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/place.hpp +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/place.hpp @@ -2,6 +2,19 @@ class OT_dialog_name { idd=-1; movingenable=false; + + class controlsBackground { + class RscStructuredText_1199: RscStructuredText + { + idc = 1199; + x = 0.371094 * safezoneW + safezoneX; + y = 0.368 * safezoneH + safezoneY; + w = 0.252656 * safezoneW; + h = 0.176 * safezoneH; + colorBackground[] = {0.1,0.1,0.1,1}; + colorActive[] = {0.1,0.1,0.1,1}; + }; + } class controls { @@ -45,15 +58,91 @@ class OT_dialog_name }; }; +class OT_dialog_input +{ + idd=8001; + movingenable=false; + + class controlsBackground { + class RscStructuredText_1199: RscStructuredText + { + idc = 1199; + x = 0.371094 * safezoneW + safezoneX; + y = 0.368 * safezoneH + safezoneY; + w = 0.252656 * safezoneW; + h = 0.176 * safezoneH; + colorBackground[] = {0.1,0.1,0.1,1}; + colorActive[] = {0.1,0.1,0.1,1}; + }; + } + + class controls + { + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Fuxuza) + //////////////////////////////////////////////////////// + + class RscEdit_1400: RscEdit + { + idc = 1400; + + onKeyDown = "_key = _this select 1;_name = ctrltext 1400;if(_key == 28 and _name != """") then {[] call inputHandler;closeDialog 0;}"; + text = ""; //--- ToDo: Localize; + x = 0.37625 * safezoneW + safezoneX; + y = 0.412 * safezoneH + safezoneY; + w = 0.242344 * safezoneW; + h = 0.055 * safezoneH; + }; + class RscStructuredText_1100: RscStructuredText + { + idc = 1100; + + text = ""; //--- ToDo: Localize; + x = 0.37625 * safezoneW + safezoneX; + y = 0.379 * safezoneH + safezoneY; + w = 0.195937 * safezoneW; + h = 0.022 * safezoneH; + colorBackground[] = {0,0,0,0}; + }; + class RscButton_1600: RscButton + { + idc = 1600; + action = "_this call inputHandler;closeDialog 0;"; + text = "OK"; //--- ToDo: Localize; + x = 0.577344 * safezoneW + safezoneX; + y = 0.478 * safezoneH + safezoneY; + w = 0.04125 * safezoneW; + h = 0.055 * safezoneH; + }; + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT END + //////////////////////////////////////////////////////// + } +} + + class OT_dialog_place { idd=8002; movingenable=false; + + class controlsBackground { + class RscStructuredText_1199: RscStructuredText + { + idc = 1199; + x = -0.000156274 * safezoneW + safezoneX; + y = 0.786 * safezoneH + safezoneY; + w = 1.00031 * safezoneW; + h = 0.11 * safezoneH; + colorBackground[] = {0.1,0.1,0.1,1}; + colorActive[] = {0.1,0.1,0.1,1}; + }; + } class controls { - //////////////////////////////////////////////////////// - // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Jawatu) + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Jevede) //////////////////////////////////////////////////////// class RscButton_1600: RscButton @@ -98,11 +187,11 @@ class OT_dialog_place action = "closeDialog 0;'Camp' spawn placementMode"; text = "Camp"; //--- ToDo: Localize; - x = 0.159687 * safezoneW + safezoneX; + x = 0.0617187 * safezoneW + safezoneX; y = 0.797 * safezoneH + safezoneY; w = 0.0928125 * safezoneW; h = 0.088 * safezoneH; - tooltip = "Creates a fast travel destination for you and your group"; //--- ToDo: Localize; + tooltip = "Creates a fast travel destination"; //--- ToDo: Localize; }; class RscButton_1604: RscButton { @@ -122,7 +211,7 @@ class OT_dialog_place action = "closeDialog 0;'Misc' spawn placementMode"; text = "Misc"; //--- ToDo: Localize; - x = 0.453594 * safezoneW + safezoneX; + x = 0.845469 * safezoneW + safezoneX; y = 0.797 * safezoneH + safezoneY; w = 0.0928125 * safezoneW; h = 0.088 * safezoneH; @@ -130,19 +219,44 @@ class OT_dialog_place }; class RscButton_1606: RscButton { - idc = 1603; + idc = 1606; action = "closeDialog 0;'Base' spawn placementMode"; - text = "Base"; //--- ToDo: Localize; + text = "FOB"; //--- ToDo: Localize; + x = 0.159687 * safezoneW + safezoneX; + y = 0.797 * safezoneH + safezoneY; + w = 0.0928125 * safezoneW; + h = 0.088 * safezoneH; + tooltip = "Creates a fast travel destination, allows building of light military structures"; //--- ToDo: Localize; + }; + class RscButton_1607: RscButton + { + idc = 1607; + action = "closeDialog 0;'Map' spawn placementMode"; + + text = "Map"; //--- ToDo: Localize; x = 0.257656 * safezoneW + safezoneX; y = 0.797 * safezoneH + safezoneY; w = 0.0928125 * safezoneW; h = 0.088 * safezoneH; - tooltip = "Creates a fast travel destination for all friendlies, allows building of military structures"; //--- ToDo: Localize; - }; + tooltip = "A map"; //--- ToDo: Localize; + }; + class RscButton_1608: RscButton + { + idc = 1608; + action = "closeDialog 0;'Safe' spawn placementMode"; + + text = "Safe"; //--- ToDo: Localize; + x = 0.453594 * safezoneW + safezoneX; + y = 0.797 * safezoneH + safezoneY; + w = 0.0928125 * safezoneW; + h = 0.088 * safezoneH; + tooltip = "Store and retrieve money"; //--- ToDo: Localize; + }; //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT END //////////////////////////////////////////////////////// + }; }; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/shop.hpp b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/shop.hpp index 51085707..416c341f 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/shop.hpp +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/shop.hpp @@ -3,6 +3,19 @@ class OT_dialog_buy idd=8000; movingenable=false; + class controlsBackground { + class RscStructuredText_1199: RscStructuredText + { + idc = 1199; + x = 0.242187 * safezoneW + safezoneX; + y = 0.214 * safezoneH + safezoneY; + w = 0.654844 * safezoneW; + h = 0.572 * safezoneH; + colorBackground[] = {0.1,0.1,0.1,1}; + colorActive[] = {0.1,0.1,0.1,1}; + }; + } + class controls { //////////////////////////////////////////////////////// @@ -123,6 +136,19 @@ class OT_dialog_workshop idd=8000; movingenable=false; + class controlsBackground { + class RscStructuredText_1199: RscStructuredText + { + idc = 1199; + x = 0.242187 * safezoneW + safezoneX; + y = 0.214 * safezoneH + safezoneY; + w = 0.654844 * safezoneW; + h = 0.572 * safezoneH; + colorBackground[] = {0.1,0.1,0.1,1}; + colorActive[] = {0.1,0.1,0.1,1}; + }; + } + class controls { //////////////////////////////////////////////////////// @@ -207,9 +233,260 @@ class OT_dialog_workshop //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT END //////////////////////////////////////////////////////// + }; +}; +class OT_dialog_warehouse +{ + idd=8000; + movingenable=false; + + class controlsBackground { + class RscStructuredText_1199: RscStructuredText + { + idc = 1199; + x = 0.242187 * safezoneW + safezoneX; + y = 0.214 * safezoneH + safezoneY; + w = 0.654844 * safezoneW; + h = 0.572 * safezoneH; + colorBackground[] = {0.1,0.1,0.1,1}; + colorActive[] = {0.1,0.1,0.1,1}; + }; + } + + class controls + { + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Wivoti) + //////////////////////////////////////////////////////// + class RscListbox_1500: RscListBox + { + idc = 1500; + onLBSelChanged = "_this call displayWarehousePic"; + x = 0.247344 * safezoneW + safezoneX; + y = 0.225 * safezoneH + safezoneY; + w = 0.402187 * safezoneW; + h = 0.55 * safezoneH; + colorBackground[] = {0,0,0,0.9}; + }; + class RscPicture_1200: RscPicture + { + idc = 1200; + text = "#(argb,8,8,3)color(1,1,1,1)"; + x = 0.654688 * safezoneW + safezoneX; + y = 0.225 * safezoneH + safezoneY; + w = 0.237187 * safezoneW; + h = 0.165 * safezoneH; + }; + class RscButton_1600: RscButton + { + idc = 1600; + action = "[-1] call warehouseTake;"; - }; -}; \ No newline at end of file + text = "Take All"; //--- ToDo: Localize; + x = 0.840312 * safezoneW + safezoneX; + y = 0.676 * safezoneH + safezoneY; + w = 0.0515625 * safezoneW; + h = 0.099 * safezoneH; + colorBackground[] = {0,0,0,0.8}; + }; + class RscStructuredText_1100: RscStructuredText + { + idc = 1100; + + x = 0.654688 * safezoneW + safezoneX; + y = 0.3999 * safezoneH + safezoneY; + w = 0.237187 * safezoneW; + h = 0.265001 * safezoneH; + colorBackground[] = {0,0,0,0.3}; + }; + class RscButton_1601: RscButton + { + idc = 1600; + action = "[100] call warehouseTake;"; + + text = "Take 100"; //--- ToDo: Localize; + x = 0.778437 * safezoneW + safezoneX; + y = 0.676 * safezoneH + safezoneY; + w = 0.0567187 * safezoneW; + h = 0.099 * safezoneH; + colorBackground[] = {0,0,0,0.8}; + }; + class RscButton_1602: RscButton + { + idc = 1600; + action = "[10] call warehouseTake;"; + + text = "Take 10"; //--- ToDo: Localize; + x = 0.716563 * safezoneW + safezoneX; + y = 0.676 * safezoneH + safezoneY; + w = 0.0567187 * safezoneW; + h = 0.099 * safezoneH; + colorBackground[] = {0,0,0,0.8}; + }; + class RscButton_1603: RscButton + { + idc = 1600; + action = "[1] call warehouseTake;"; + + text = "Take 1"; //--- ToDo: Localize; + x = 0.654688 * safezoneW + safezoneX; + y = 0.676 * safezoneH + safezoneY; + w = 0.0567187 * safezoneW; + h = 0.099 * safezoneH; + colorBackground[] = {0,0,0,0.8}; + }; + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT END + //////////////////////////////////////////////////////// + } +} + +class OT_dialog_import +{ + idd=8000; + movingenable=false; + + class controlsBackground { + class RscStructuredText_1199: RscStructuredText + { + idc = 1199; + x = 0.242187 * safezoneW + safezoneX; + y = 0.214 * safezoneH + safezoneY; + w = 0.654844 * safezoneW; + h = 0.572 * safezoneH; + colorBackground[] = {0.1,0.1,0.1,1}; + colorActive[] = {0.1,0.1,0.1,1}; + }; + } + + class controls + { + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Wivoti) + //////////////////////////////////////////////////////// + + class RscListbox_1500: RscListBox + { + idc = 1500; + onLBSelChanged = "_this call displayShopPic"; + + x = 0.247344 * safezoneW + safezoneX; + y = 0.225 * safezoneH + safezoneY; + w = 0.402187 * safezoneW; + h = 0.55 * safezoneH; + colorBackground[] = {0,0,0,0.9}; + }; + class RscPicture_1200: RscPicture + { + idc = 1200; + + text = "#(argb,8,8,3)color(1,1,1,1)"; + x = 0.654688 * safezoneW + safezoneX; + y = 0.225 * safezoneH + safezoneY; + w = 0.237187 * safezoneW; + h = 0.165 * safezoneH; + }; + class RscButton_1600: RscButton + { + idc = 1600; + action = "[1000] call import;"; + + text = "Import 1000"; //--- ToDo: Localize; + x = 0.840312 * safezoneW + safezoneX; + y = 0.676 * safezoneH + safezoneY; + w = 0.0515625 * safezoneW; + h = 0.099 * safezoneH; + colorBackground[] = {0,0,0,0.8}; + }; + class RscStructuredText_1100: RscStructuredText + { + idc = 1100; + + x = 0.654688 * safezoneW + safezoneX; + y = 0.3999 * safezoneH + safezoneY; + w = 0.237187 * safezoneW; + h = 0.265001 * safezoneH; + colorBackground[] = {0,0,0,0.3}; + }; + class RscButton_1601: RscButton + { + idc = 1600; + action = "[100] call import;"; + + text = "Import 100"; //--- ToDo: Localize; + x = 0.778437 * safezoneW + safezoneX; + y = 0.676 * safezoneH + safezoneY; + w = 0.0567187 * safezoneW; + h = 0.099 * safezoneH; + colorBackground[] = {0,0,0,0.8}; + }; + class RscButton_1602: RscButton + { + idc = 1600; + action = "[10] call import;"; + + text = "Import 10"; //--- ToDo: Localize; + x = 0.716563 * safezoneW + safezoneX; + y = 0.676 * safezoneH + safezoneY; + w = 0.0567187 * safezoneW; + h = 0.099 * safezoneH; + colorBackground[] = {0,0,0,0.8}; + }; + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT END + //////////////////////////////////////////////////////// + } +} + +class OT_dialog_loadout +{ + idd=8000; + movingenable=false; + + class controls + { + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Sozafo) + //////////////////////////////////////////////////////// + + class RscButton_1600: RscButton + { + idc = 1600; + action = "[player,OT_context,lbData [1500,lbCurSel 1500]] call restoreLoadout"; + + text = "Restore"; //--- ToDo: Localize; + x = 0.12875 * safezoneW + safezoneX; + y = 0.511 * safezoneH + safezoneY; + w = 0.149531 * safezoneW; + h = 0.088 * safezoneH; + colorBackground[] = {0,0,0,0.8}; + }; + class RscButton_1601: RscButton + { + idc = 1601; + action = "[lbData [1500,lbCurSel 1500]] call removeLoadout"; + + text = "Delete"; //--- ToDo: Localize; + x = 0.12875 * safezoneW + safezoneX; + y = 0.61 * safezoneH + safezoneY; + w = 0.149531 * safezoneW; + h = 0.044 * safezoneH; + colorBackground[] = {0.5,0,0,0.8}; + colorActive[] = {0.5,0,0,0.8}; + }; + class RscListbox_1500: RscListbox + { + idc = 1500; + x = 0.12875 * safezoneW + safezoneX; + y = 0.236 * safezoneH + safezoneY; + w = 0.149531 * safezoneW; + h = 0.264 * safezoneH; + }; + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT END + //////////////////////////////////////////////////////// + } +} \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/economy/setupTownEconomy.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/economy/setupTownEconomy.sqf index 8788cf2e..186cff1b 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/economy/setupTownEconomy.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/economy/setupTownEconomy.sqf @@ -2,7 +2,7 @@ private ["_shops","_active","_posTown"]; _town = _this select 0; _posTown = server getVariable _town; - +_stability = server getVariable format["stability%1",_town]; _shops = 0; _active = []; @@ -11,10 +11,10 @@ if(count _churches > 0) then { server setVariable [format["churchin%1",_town],getpos (_churches select 0),true]; }; -{ +{ if !(_x call hasOwner) then { //spawn any main shops - if((random 100 > 20)) then { + if(_shops < 5) then { _shops = _shops + 1; _stock = []; _itemsToStock = []; @@ -54,6 +54,7 @@ _active = []; { if !(_x call hasOwner) then { if((random 100) > 60) then { + _bdgid = [_x] call fnc_getBuildID; _pos = getpos _x; _stock = []; { @@ -63,7 +64,10 @@ _active = []; _max = 20; if(_base > 40) then { _max = 5; - }; + }; + if(_x in OT_allBackpacks) then { + _max = 2; + }; _num = floor(random _max); if(_x in OT_consumableItems) then { @@ -73,7 +77,7 @@ _active = []; _stock pushBack [_x,_num]; }; }foreach(OT_allItems + OT_allBackpacks); - server setVariable [format["garrison%1",(getpos _x)],2 + round(random 4),true]; + server setVariable [format["garrison%1",_bdgid],2 + round(random 4),true]; _active pushback [(getpos _x),_stock]; }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/entityKilled.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/entityKilled.sqf index dbb1f68d..421fefd9 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/entityKilled.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/entityKilled.sqf @@ -92,23 +92,23 @@ call { }; if(!isNil "_garrison" or !isNil "_vehgarrison" or !isNil "_airgarrison") exitWith { if(!isNil "_garrison") then { - _pop = server getVariable format["garrison%1",_garrison]; + _pop = server getVariable [format["garrison%1",_garrison],0]; if(_pop > 0) then { server setVariable [format["garrison%1",_garrison],_pop - 1,true]; }; if(_garrison in OT_allTowns) then { - _town = _garrison; - _townpop = server getVariable [format["population%1",_town],0]; - _stab = -1; - if(_townpop < 350 and (random 100) > 50) then { - _stab = -2; - }; - [_town,_stab] call stability; - format["%1 (%2 Stability)",_town,_stab] remoteExec ["notify_minor",0,false]; + _town = _garrison; }; if(isPlayer _killer) then { _standingChange = -1; - } + }; + _townpop = server getVariable [format["population%1",_town],0]; + _stab = -1; + if(_townpop < 350 and (random 100) > 50) then { + _stab = -2; + }; + [_town,_stab] call stability; + format["%1 (%2 Stability)",_town,_stab] remoteExec ["notify_minor",0,false]; }; if(!isNil "_vehgarrison") then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/CRIM.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/CRIM.sqf index 28524fad..01bf770a 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/CRIM.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/CRIM.sqf @@ -120,16 +120,19 @@ while {true} do { if ((typeName _leaderpos) == "ARRAY") then { server setVariable [format ["timecrims%1",_x],_time+_sleeptime,false]; _chance = 20; - _max = 6; + _max = 4; if(_town in (server getVariable ["NATOabandoned",[]])) then { _chance = 80; - _max = 12; + _max = 10; }; if(((random 100) < _chance) and _num < _max) then { - _numadd = round(random 4); - server setVariable [format ["numcrims%1",_x],_num + _numadd,false]; - server setVariable [format ["crimadd%1",_x],_numadd,false]; + _numadd = round(random 4); + if(_leaderpos call inSpawnDistance) then { + [_leaderpos,_numadd,_x] spawn sendCrims; + }else{ + server setVariable [format ["numcrims%1",_x],_num+_numadd,true]; + }; }; }else{ //New leader spawn @@ -140,8 +143,9 @@ while {true} do { }else{ _leaderpos = getpos _building; }; - server setVariable [format["crimnew%1",_town],_leaderpos,false]; - server setVariable [format ["crimadd%1",_x],0,false]; + + [_leaderpos,_x] spawn newLeader; + server setVariable [format ["timecrims%1",_x],0,false]; [2,_leaderpos,"Gang Hideout",format["Intelligence reports that this building was recently purchased by a known underworld figure, it's possible they will use this location as a base of operations for a new gang in %1.",_town],"target"] remoteExec ["intelEvent",0,false]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf index 0649bebc..9f37edb5 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf @@ -1,13 +1,13 @@ //Keeps track of all entities that should trigger the spawner while {true} do { - sleep 1; + sleep 10; _track = []; { if(_x getVariable ["spawntrack",false]) then { _track pushback _x; }else{ - if(((side _x == resistance) or (_x call hasOwner)) and (alive _x) and (!isPlayer _x)) then {}; + if(((side _x == resistance) or (_x call hasOwner)) and (alive _x) and (!isPlayer _x)) then {_track pushback _x}; }; sleep 0.01; }foreach(allunits); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf index 5fd574d1..90f55a95 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf @@ -8,54 +8,69 @@ OT_NATOcomms = []; _NATObusy = false; _abandoned = []; +OT_NATOobjectives = server getVariable ["NATOobjectives",[]]; +OT_NATOcomms = server getVariable ["NATOcomms",[]]; + if((server getVariable "StartupType") == "NEW" or (server getVariable ["NATOversion",0]) < OT_NATOversion) then { server setVariable ["NATOversion",OT_NATOversion,false]; + _abandoned = server getVariable ["NATOabandoned",[]]; (OT_loadingMessages call BIS_fnc_selectRandom) remoteExec['blackFaded',0,false]; sleep 0.1; { _stability = server getVariable format ["stability%1",_x]; - if(_stability < 11) then { + if(_stability < 11 and !(_x in _abandoned)) then { _abandoned pushback _x; }; }foreach (OT_allTowns); server setVariable ["NATOabandoned",_abandoned,true]; server setVariable ["garrisonHQ",1000,false]; + OT_NATOobjectives = []; + OT_NATOcomms = []; + server setVariable ["NATOobjectives",OT_NATOobjectives,false]; + server setVariable ["NATOcomms",OT_NATOcomms,false]; //Find military objectives { _name = text _x;// Get name _pos=getpos _x; - - //if its in the whitelist, within the NATO home region, or an airport, NATO lives here - if !(_name in OT_NATOblacklist) then { - if((_name in OT_NATOwhitelist) || ([_pos,OT_NATOregion] call fnc_isInMarker) || (_name in OT_allAirports)) then { - - if((_name find "Comms") == 0) then { - OT_NATOcomms pushBack [_pos,_name]; - }else{ - OT_NATOobjectives pushBack [_pos,_name]; - server setVariable [format ["vehgarrison%1",_name],[],true]; - }; - - _garrison = floor(4 + random(8)); - if(_name in OT_NATO_priority) then { - _garrison = floor(16 + random(8)); - server setVariable [format ["vehgarrison%1",_name],["B_T_MBT_01_arty_F","B_HMG_01_high_F","B_HMG_01_high_F","B_T_Mortar_01_F"],true]; + if !(_name in _abandoned) then { + //if its in the whitelist, within the NATO home region, or an airport, NATO lives here + if !(_name in OT_NATOblacklist) then { + if((_name in OT_NATOwhitelist) || ([_pos,OT_NATOregion] call fnc_isInMarker) || (_name in OT_allAirports)) then { + + if((_name find "Comms") == 0) then { + OT_NATOcomms pushBack [_pos,_name]; + }else{ + OT_NATOobjectives pushBack [_pos,_name]; + server setVariable [format ["vehgarrison%1",_name],[],true]; + }; + + _garrison = floor(4 + random(8)); + if(_name in OT_NATO_priority or _name in OT_allAirports) then { + _garrison = floor(16 + random(8)); + server setVariable [format ["vehgarrison%1",_name],["B_HMG_01_high_F","B_HMG_01_high_F","B_HMG_01_high_F"],true]; + }; + if(_name == OT_NATO_HQ) then { + _garrison = 48; + server setVariable [format ["vehgarrison%1",_name],["B_T_MBT_01_arty_F","B_T_MBT_01_arty_F","B_HMG_01_high_F","B_HMG_01_high_F","B_HMG_01_high_F","B_T_Mortar_01_F","B_T_Mortar_01_F"],true]; + server setVariable [format ["airgarrison%1",_name],[OT_NATO_Vehicle_AirTransport_Large],true]; + }else{ + server setVariable [format ["airgarrison%1",_name],[],true]; + }; + server setVariable [format ["garrison%1",_name],_garrison,true]; }; if(_name == OT_NATO_HQ) then { - _garrison = 48; - server setVariable [format ["vehgarrison%1",_name],["B_T_MBT_01_arty_F","B_T_MBT_01_arty_F","B_HMG_01_high_F","B_HMG_01_high_F","B_HMG_01_high_F","B_T_Mortar_01_F","B_T_Mortar_01_F"],true]; - server setVariable [format ["airgarrison%1",_name],[OT_NATO_Vehicle_AirTransport_Large],true]; - }else{ - server setVariable [format ["airgarrison%1",_name],[],true]; + OT_NATO_HQPos = getpos _x; }; - server setVariable [format ["garrison%1",_name],_garrison,true]; - }; - if(_name == OT_NATO_HQ) then { - OT_NATO_HQPos = getpos _x; + + sleep 0.05; }; - - sleep 0.05; + }else{ + if((_name find "Comms") == 0) then { + OT_NATOcomms pushBack [_pos,_name]; + }else{ + OT_NATOobjectives pushBack [_pos,_name]; + }; }; }foreach (nearestLocations [OT_centerPos, ["NameLocal","Airport"], 12000]); (OT_loadingMessages call BIS_fnc_selectRandom) remoteExec['blackFaded',0]; @@ -138,12 +153,10 @@ if((server getVariable "StartupType") == "NEW" or (server getVariable ["NATOvers }; }; server setVariable [format ["garrison%1",_x],_garrison,true]; - server setVariable [format ["garrisonadd%1",_x], 0,false]; sleep 0.05; }foreach (OT_allTowns); }; -OT_NATOobjectives = server getVariable "NATOobjectives"; -OT_NATOcomms = server getVariable "NATOcomms"; + OT_NATOInitDone = true; publicVariable "OT_NATOInitDone"; @@ -196,9 +209,8 @@ while {true} do { _need = _garrison - _current; if(_need < 0) then {_need = 0}; if(_need > 1) then { - _garrisoned = true; - server setVariable [format ["garrisonadd%1",_x], 2,false]; - server setVariable [format ["garrison%1",_x],_current+2,true]; + _garrisoned = true; + _x spawn reGarrisonTown; }; }else{ server setVariable [format ["garrison%1",_town],0,true]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/canFit.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/canFit.sqf index 5052b382..9c5254e9 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/canFit.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/canFit.sqf @@ -1,25 +1 @@ - - -_unit = _this select 0; -_cls = _this select 1; - -_mass = getNumber(configfile >> "CfgWeapons" >> _cls >> "ItemInfo" >> "Mass"); - -_totalfit = 0; -_uniform = uniform _unit; -_vest = vest _unit; -_backpack = backpack _unit; - -if(_uniform != "") then { - _totalfit = _totalfit + ((1.0 - (loadUniform _unit)) * (_uniform call totalCarry)); -}; -if(_vest != "") then { - _totalfit = _totalfit + ((1.0 - (loadVest _unit)) * (_vest call totalCarry)); -}; -if(_backpack != "") then { - _totalfit = _totalfit + ((1.0 - (loadBackpack _unit)) * (_backpack call totalCarry)); -}; -_ok = true; -if(_totalfit < _mass) then {_ok = false;}; - -_ok \ No newline at end of file +(_this select 0) canAdd (_this select 1) \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/cleanup.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/cleanup.sqf index 33c6ef6b..69e9b47a 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/cleanup.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/cleanup.sqf @@ -5,6 +5,7 @@ waitUntil {sleep 1;(resistance knowsabout _vehicle) < 1.4}; deleteVehicle _x; }; }foreach(units _vehicle); +if(vehicle _vehicle == _vehicle) exitWith{}; if !(_vehicle call hasOwner) then { deleteVehicle _vehicle; }; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/createSoldier.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/createSoldier.sqf new file mode 100644 index 00000000..568a7c34 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/createSoldier.sqf @@ -0,0 +1,99 @@ +params ["_soldier","_pos","_group"]; +_soldier params ["_cost","_cls","_wpn","_warehouseWpn","_pwpn","_warehousePistol","_tertiary","_warehouseTertiary","_scope","_warehouseScope","_uniform","_bino"]; + +//Take from warehouse +if(_warehouseWpn) then { + [_wpn,1] call removeFromWarehouse; +}; +if(_warehouseScope) then { + [_scope,1] call removeFromWarehouse; +}; +if(_warehousePistol) then { + [_pwpn,1] call removeFromWarehouse; +}; +if(_warehouseTertiary) then { + [_tertiary,1] call removeFromWarehouse; +}; + + + +private _start = [[[_pos,30]]] call BIS_fnc_randomPos; +private _civ = _group createUnit [_cls, _start, [],0, "NONE"]; + +private _firstname = OT_firstNames_local call BIS_fnc_selectRandom; +private _lastname = OT_lastNames_local call BIS_fnc_selectRandom; +private _fullname = [format["%1 %2",_firstname,_lastname],_firstname,_lastname]; +[_civ,_fullname] remoteExec ["setCivName",0,false]; + + +[_civ, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setAIFace", 0, _civ]; + +if(_uniform != "") then { + _civ forceAddUniform _uniform; +}else{ + _clothes = (OT_clothes_guerilla call BIS_fnc_selectRandom); + _civ forceAddUniform _clothes; +}; +_civ unlinkItem "NVGoggles_INDEP"; + +removeAllWeapons _civ; +removeHeadgear _civ; +removeVest _civ; + +private _helmet = [] call findHelmetInWarehouse; +if(_helmet != "") then { + _civ addHeadgear _helmet; + [_helmet,1] call removeFromWarehouse; +}; + +private _vest = [] call findVestInWarehouse; +if(_vest != "") then { + _civ addVest _vest; + [_vest,1] call removeFromWarehouse; +}; + +if(_wpn != "") then { + _civ addWeaponGlobal _wpn; + _base = [_wpn] call BIS_fnc_baseWeapon; + _magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) select 0; + _civ addMagazine _magazine; + _civ addMagazine _magazine; + _civ addMagazine _magazine; + _civ addMagazine _magazine; + _civ addMagazine _magazine; +}; + +if(_pwpn != "") then { + _civ addWeaponGlobal _pwpn; + _base = [_pwpn] call BIS_fnc_baseWeapon; + _magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) select 0; + _civ addMagazine _magazine; +}; + +if(_tertiary != "") then { + clearBackpackCargoGlobal _civ; + _civ addWeaponGlobal _tertiary; + _base = [_tertiary] call BIS_fnc_baseWeapon; + _magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) select 0; + _civ addMagazine _magazine; + _civ addMagazine _magazine; +}; + +if(_cls == "I_Medic_F") then { + clearBackpackCargoGlobal _civ; + if(OT_hasACE) then { + for "_i" from 1 to 10 do {_civ addItemToBackpack "ACE_fieldDressing";}; + for "_i" from 1 to 3 do {_civ addItemToBackpack "ACE_morphine";}; + _civ addItemToBackpack "ACE_bloodIV"; + _civ addItemToBackpack "ACE_epinephrine"; + _civ addItemToBackpack "ACE_epinephrine"; + }else{ + _civ addItemToBackpack "Medikit"; + }; +}; + +if(_scope != "") then { + _civ addPrimaryWeaponItem _scope; +}; + +_civ \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf index b73bccbd..cb7569e3 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf @@ -9,25 +9,42 @@ _pic = ""; _txt = ""; _desc = ""; -if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) then { - _txt = _cls call ISSE_Cfg_Magazine_GetName; - _pic = _cls call ISSE_Cfg_Magazine_GetPic; - _desc = _cls call ISSE_Cfg_Magazine_GetDesc; -}; -if(_cls isKindOf "Bag_Base") then { - _txt = _cls call ISSE_Cfg_Vehicle_GetName; - _pic = _cls call ISSE_Cfg_Vehicle_GetPic; - _desc = _cls call ISSE_Cfg_Vehicle_GetDesc; -}; -if(_cls in OT_allVehicles or _cls in OT_staticWeapons) then { - _txt = _cls call ISSE_Cfg_Vehicle_GetName; - _pic = getText(configFile >> "cfgVehicles" >> _cls >> "editorPreview"); - _desc = getText(configFile >> "cfgVehicles" >> _cls >> "Library" >> "libTextDesc"); -}; -if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) then { - _txt = _cls call ISSE_Cfg_Weapons_GetName; - _pic = _cls call ISSE_Cfg_Weapons_GetPic; - _desc = _cls call ISSE_Cfg_Weapons_GetDesc; +call { + if(_cls isKindOf ["Default",configFile >> "CfgMagazines"]) then { + _txt = _cls call ISSE_Cfg_Magazine_GetName; + _pic = _cls call ISSE_Cfg_Magazine_GetPic; + _desc = _cls call ISSE_Cfg_Magazine_GetDesc; + }; + if(isClass (configFile >> "CfgGlasses" >> _cls)) exitWith { + _txt = gettext(configFile >> "CfgGlasses" >> _cls >> "displayName"); + _pic = gettext(configFile >> "CfgGlasses" >> _cls >> "picture"); + }; + if(_cls in (OT_allVehicles + OT_allBoats)) exitWith { + _txt = _cls call ISSE_Cfg_Vehicle_GetName; + _pic = getText(configFile >> "cfgVehicles" >> _cls >> "editorPreview"); + _desc = getText(configFile >> "cfgVehicles" >> _cls >> "Library" >> "libTextDesc"); + }; + if(_cls isKindOf "Bag_Base") exitWith { + _txt = _cls call ISSE_Cfg_Vehicle_GetName; + _pic = _cls call ISSE_Cfg_Vehicle_GetPic; + _desc = _cls call ISSE_Cfg_Vehicle_GetDesc; + }; + if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) then { + _txt = _cls call ISSE_Cfg_Weapons_GetName; + _pic = _cls call ISSE_Cfg_Weapons_GetPic; + _desc = format["%1
%2",getText(configFile >> "CfgWeapons" >> _cls >> "descriptionShort"),_cls call ISSE_Cfg_Magazine_GetDesc]; + }; + + if(_cls isKindOf "Man") exitWith { + _txt = _cls call ISSE_Cfg_Vehicle_GetName; + _price = format["%1 + gear",_price]; + _desc = "Will recruit this soldier into your group fully equipped using the warehouse where possible."; + }; + if(_cls in OT_allSquads) exitWith { + _txt = _cls; + _price = format["%1 + gear",_price]; + _desc = "Will recruit this squad into your High-Command bar, accessible with ctrl-space."; + }; }; if !(isNil "_pic") then { ctrlSetText [1200,_pic]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayWarehousePic.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayWarehousePic.sqf new file mode 100644 index 00000000..78b67bc2 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayWarehousePic.sqf @@ -0,0 +1,46 @@ +params ["_ctrl","_index"]; + +disableSerialization; + +_cls = _ctrl lbData _index; +_price = [_ctrl lbValue _index, 1, 0, true] call CBA_fnc_formatNumber; + +_pic = ""; +_txt = ""; +_desc = ""; + +if(_cls isKindOf ["Default",configFile >> "CfgMagazines"]) then { + _txt = _cls call ISSE_Cfg_Magazine_GetName; + _pic = _cls call ISSE_Cfg_Magazine_GetPic; + _desc = _cls call ISSE_Cfg_Magazine_GetDesc; +}; +if(_cls isKindOf "Default") then { + _txt = _cls call ISSE_Cfg_Vehicle_GetName; + _pic = getText(configFile >> "cfgVehicles" >> _cls >> "editorPreview"); + _desc = getText(configFile >> "cfgVehicles" >> _cls >> "Library" >> "libTextDesc"); +}; +if(isClass (configFile >> "CfgGlasses" >> _cls)) then { + _txt = gettext(configFile >> "CfgGlasses" >> _cls >> "displayName"); + _pic = gettext(configFile >> "CfgGlasses" >> _cls >> "picture"); +}; +if(_cls isKindOf "Bag_Base") then { + _txt = _cls call ISSE_Cfg_Vehicle_GetName; + _pic = _cls call ISSE_Cfg_Vehicle_GetPic; + _desc = _cls call ISSE_Cfg_Vehicle_GetDesc; +}; +if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) then { + _txt = _cls call ISSE_Cfg_Weapons_GetName; + _pic = _cls call ISSE_Cfg_Weapons_GetPic; + _desc = format["%1
%2",getText(configFile >> "CfgWeapons" >> _cls >> "descriptionShort"),_cls call ISSE_Cfg_Magazine_GetDesc]; +}; +if !(isNil "_pic") then { + ctrlSetText [1200,_pic]; +}; + +_textctrl = (findDisplay 8000) displayCtrl 1100; + +_textctrl ctrlSetStructuredText parseText format[" + %1
+ %3 in stock

+ %2 +",_txt,_desc,_price]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/dumpStuff.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/dumpStuff.sqf index dbbb6c07..b4ec488e 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/dumpStuff.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/dumpStuff.sqf @@ -3,10 +3,16 @@ private ["_unit","_t"]; _unit = _this select 0; _t = _this select 1; +_full = false; +_istruck = (_t isKindOf "Truck_F") or (_t isKindOf "ReammoBox_F"); + { _count = 0; _cls = _x select 0; while {_count < (_x select 1)} do { + if !(_t canAdd _cls) exitWith { + _full = true; + }; if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) then { _t addMagazineCargoGlobal [_cls,1]; _unit removeMagazine _cls; @@ -18,23 +24,48 @@ _t = _this select 1; }; }foreach(_unit call unitStock); +if(_full and !_istruck) exitWith {false}; + if(headgear _unit != "") then { + if !(_t canAdd headgear _unit) exitWith { + _full = true; + }; _t addItemCargoGlobal [headgear _unit,1]; removeHeadgear _unit; }; +if(_full and !_istruck) exitWith {false}; + if(backpack _unit != "") then { + if !(_t canAdd backpack _unit) exitWith { + _full = true; + }; _t addBackpackCargoGlobal [backpack _unit,1]; removeBackpack _unit; }; +if(_full and !_istruck) exitWith {false}; + if(vest _unit != "") then { + if !(_t canAdd vest _unit) exitWith { + _full = true; + }; _t addItemCargoGlobal [vest _unit,1]; removeVest _unit; }; +if(_full and !_istruck) exitWith {false}; + if(goggles _unit != "") then { + if !(_t canAdd goggles _unit) exitWith { + _full = true; + }; _t addItemCargoGlobal [goggles _unit,1]; removeGoggles _unit; }; +if(_full and !_istruck) exitWith {false}; + if(primaryWeapon _unit != "") then { + if !(_t canAdd primaryWeapon _unit) exitWith { + _full = true; + }; { _t addItemCargoGlobal [_x,1]; }foreach(primaryWeaponItems _unit); @@ -42,11 +73,21 @@ if(primaryWeapon _unit != "") then { _t addWeaponCargoGlobal [primaryWeapon _unit,1]; _unit removeWeapon primaryWeapon _unit; }; +if(_full and !_istruck) exitWith {false}; + if(secondaryWeapon _unit != "") then { + if !(_t canAdd secondaryWeapon _unit) exitWith { + _full = true; + }; _t addWeaponCargoGlobal [secondaryWeapon _unit,1]; _unit removeWeapon secondaryWeapon _unit; }; +if(_full and !_istruck) exitWith {false}; + if(handgunWeapon _unit != "") then { + if !(_t canAdd handgunWeapon _unit) exitWith { + _full = true; + }; { _t addItemCargoGlobal [_x,1]; }foreach(handgunItems _unit); @@ -54,12 +95,20 @@ if(handgunWeapon _unit != "") then { _t addWeaponCargoGlobal [handgunWeapon _unit,1]; _unit removeWeapon handgunWeapon _unit; }; +if(_full and !_istruck) exitWith {false}; + { - if (([(configFile >> "CfgWeapons" >> _x),"optics",0] call BIS_fnc_returnConfigEntry) > 0) then { + if !(_t canAdd _x) exitWith { + _full = true; + }; + if (([(configFile >> "CfgWeapons" >> _x),"useAsBinocular",0] call BIS_fnc_returnConfigEntry) > 0) then { _unit unassignItem _x; _unit removeWeapon _x; }else{ _unit unlinkItem _x; - }; - _t addItemCargoGlobal[_x,1]; -}foreach(assignedItems _unit); \ No newline at end of file + }; + _t addItemCargoGlobal [_x,1]; +}foreach(assignedItems _unit); +if(_full and !_istruck) exitWith {false}; + +true \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/findHelmetInWarehouse.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/findHelmetInWarehouse.sqf new file mode 100644 index 00000000..144d9012 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/findHelmetInWarehouse.sqf @@ -0,0 +1,17 @@ +private _found = ""; +private _possible = []; +{ + private _d = warehouse getvariable [_x,[_x,0]]; + private _cls = _d select 0; + private _num = _d select 1; + if(_num > 0 and (_cls in OT_allHelmets)) then { + _possible pushback _cls; + }; +}foreach(allvariables warehouse); + +if(count _possible > 0) then { + _sorted = [_possible,[],{(cost getvariable [_x,[200]]) select 0},"DESCEND"] call BIS_fnc_SortBy; + _found = _sorted select 0; +}; + +_found \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/findScopeInWarehouse.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/findScopeInWarehouse.sqf new file mode 100644 index 00000000..c8009b4f --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/findScopeInWarehouse.sqf @@ -0,0 +1,25 @@ +private _range = _this select 0; +private _found = ""; +private _possible = []; +{ + private _d = warehouse getvariable [_x,[_x,0]]; + private _cls = _d select 0; + private _num = _d select 1; + if(_num > 0 and (_cls in OT_allOptics)) then { + private _allModes = "true" configClasses ( configFile >> "cfgWeapons" >> _cls >> "ItemInfo" >> "OpticsModes" ); + _max = 0; + { + _mode = configName _x; + _max = _max max getNumber (configFile >> "cfgWeapons" >> _cls >> "ItemInfo" >> "OpticsModes" >> _mode >> "distanceZoomMax"); + }foreach(_allModes); + + if(_max >= _range) then {_possible pushback _cls}; + }; +}foreach(allvariables warehouse); + +if(count _possible > 0) then { + _sorted = [_possible,[],{(cost getvariable [_x,[200]]) select 0},"DESCEND"] call BIS_fnc_SortBy; + _found = _sorted select 0; +}; + +_found \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/findVestInWarehouse.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/findVestInWarehouse.sqf new file mode 100644 index 00000000..ba64e88e --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/findVestInWarehouse.sqf @@ -0,0 +1,17 @@ +private _found = ""; +private _possible = []; +{ + private _d = warehouse getvariable [_x,[_x,0]]; + private _cls = _d select 0; + private _num = _d select 1; + if(_num > 0 and (_cls in OT_allVests)) then { + _possible pushback _cls; + }; +}foreach(allvariables warehouse); + +if(count _possible > 0) then { + _sorted = [_possible,[],{(cost getvariable [_x,[200]]) select 0},"DESCEND"] call BIS_fnc_SortBy; + _found = _sorted select 0; +}; + +_found \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/findWeaponInWarehouse.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/findWeaponInWarehouse.sqf new file mode 100644 index 00000000..d874e635 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/findWeaponInWarehouse.sqf @@ -0,0 +1,20 @@ +private _type = _this select 0; +private _found = ""; +private _possible = []; +{ + private _d = warehouse getvariable [_x,[_x,0]]; + private _cls = _d select 0; + private _num = _d select 1; + if(_num > 0) then { + private _weapon = [_cls] call BIS_fnc_itemType; + private _weaponType = _weapon select 1; + if(_weaponType == _type) then {_possible pushback _cls}; + }; +}foreach(allvariables warehouse); + +if(count _possible > 0) then { + _sorted = [_possible,[],{(cost getvariable [_x,[200]]) select 0},"DESCEND"] call BIS_fnc_SortBy; + _found = _sorted select 0; +}; + +_found \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getNearestRealEstate.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getNearestRealEstate.sqf index 830275e4..a7bf355f 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getNearestRealEstate.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getNearestRealEstate.sqf @@ -29,14 +29,15 @@ if(!isNil "modeTarget") then { call { if(_type in OT_lowPopHouses) exitWith {_baseprice = 1000;_totaloccupants=4}; if(_type in OT_mansions) exitWith {_baseprice = 25000;_totaloccupants=5;}; - if(_type in OT_medPopHouses) exitWith {_baseprice = 5000;_totaloccupants=6}; + if(_type in OT_medPopHouses) exitWith {_baseprice = 2000;_totaloccupants=6}; if(_type in OT_highPopHouses) exitWith {_baseprice = 5000;_totaloccupants=12}; - if(_type in OT_hugePopHouses) exitWith {_baseprice = 5000;_totaloccupants=50}; + if(_type in OT_hugePopHouses) exitWith {_baseprice = 15000;_totaloccupants=50}; + if(_type == OT_warehouse) exitWith {_baseprice = 3000;_totaloccupants=0}; }; }; _price = round(_baseprice + ((_baseprice * _stability * _population) * (1+OT_standardMarkup))); _sell = round(_baseprice + (_baseprice * _stability * _population)); - _lease = round((_stability * _population) * (_baseprice * 0.15)); + _lease = round((_stability * _population) * (_baseprice * _totaloccupants * 0.15)); if(_lease < 5) then {_lease = 5}; _building = _x; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getPrice.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getPrice.sqf index d5b285f2..ce72e2df 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getPrice.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getPrice.sqf @@ -5,17 +5,23 @@ _cls = _this select 1; _standing = _this select 2; _price = 0; -if(_cls in (OT_allWeapons + OT_allMagazines + OT_illegalItems + OT_allStaticBackpacks)) then { +private _trade = player getvariable ["OT_trade",1]; +private _discount = 0; +if(_trade > 1) then { + _discount = 0.1 * (_trade - 1); +}; + +if((_town in OT_allTowns) and _cls in (OT_allWeapons + OT_allMagazines + OT_illegalItems + OT_allStaticBackpacks)) then { _stock = server getVariable format["gunstock%1",_town]; { if((_x select 0) == _cls) exitWith {_price = _x select 1}; }foreach(_stock); }else{ - _cost = cost getVariable _cls; + _cost = cost getVariable [_cls,[10,0,0,0]]; _baseprice = _cost select 0; - _stability = 1.0 - ((server getVariable format["stability%1",_town]) / 100); - _population = server getVariable format["population%1",_town]; + _stability = 1.0 - ((server getVariable [format["stability%1",_town],100]) / 100); + _population = server getVariable [format["population%1",_town],1000]; if(_population > 1000) then {_population = 1000}; _population = 1-(_population / 1000); @@ -27,4 +33,4 @@ if(_cls in (OT_allWeapons + OT_allMagazines + OT_illegalItems + OT_allStaticBack _price = _baseprice + ((_baseprice * _standing) + (_baseprice * _stability * _population) * (1+OT_standardMarkup)); }; -round(_price) +round(_price - (_price * _discount)) diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getRandomBuilding.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getRandomBuilding.sqf index aaf40bee..89e7b537 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getRandomBuilding.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getRandomBuilding.sqf @@ -1,11 +1,11 @@ private ["_found","_range","_houses","_house"]; -_search = _this select 0; -_types = _this select 1; +private _search = _this select 0; +private _types = _this select 1; -_found = false; -_range = 500; -_house = false; +private _found = false; +private _range = 150; +private _house = false; while {not _found} do { _houses = nearestObjects [_search, _types, _range]; _possible = []; @@ -17,6 +17,7 @@ while {not _found} do { } }; _range = _range + 100; + if(_range > 1200) exitWith {}; }; _house \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getRealEstateData.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getRealEstateData.sqf index 74f375bb..402446c5 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getRealEstateData.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getRealEstateData.sqf @@ -11,12 +11,13 @@ if !(_type in OT_spawnHouses) then { call { if(_type in OT_lowPopHouses) exitWith {_baseprice = 1000;_totaloccupants=4}; if(_type in OT_mansions) exitWith {_baseprice = 25000;_totaloccupants=5;}; - if(_type in OT_medPopHouses) exitWith {_baseprice = 5000;_totaloccupants=6}; + if(_type in OT_medPopHouses) exitWith {_baseprice = 2000;_totaloccupants=6}; if(_type in OT_highPopHouses) exitWith {_baseprice = 5000;_totaloccupants=12}; - if(_type in OT_hugePopHouses) exitWith {_baseprice = 5000;_totaloccupants=50}; + if(_type in OT_hugePopHouses) exitWith {_baseprice = 15000;_totaloccupants=50}; + if(_type == OT_warehouse) exitWith {_baseprice = 3000;_totaloccupants=0}; }; }; private _price = round(_baseprice + ((_baseprice * _stability * _population) * (1+OT_standardMarkup))); private _sell = round(_baseprice + (_baseprice * _stability * _population)); -private _lease = round((_stability * _population) * (_baseprice * 0.15)); +private _lease = round((_stability * _population) * (_baseprice * _totaloccupants * 0.15)); [_price,_sell,_lease,_totaloccupants] \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getSellPrice.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getSellPrice.sqf index 397fc0c5..aaf4282e 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getSellPrice.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getSellPrice.sqf @@ -6,17 +6,17 @@ _standing = _this select 2; _price = 0; -if(_cls in (OT_allWeapons + OT_allMagazines)) then { +if(_cls in (OT_allWeapons + OT_allMagazines) and (_town in OT_allTowns)) then { _stock = server getVariable format["gunstock%1",_town]; { if((_x select 0) == _cls) exitWith {_price = _x select 1}; }foreach(_stock); }else{ - _cost = cost getVariable _cls; + _cost = cost getVariable [_cls,[10,0,0,0]]; _baseprice = _cost select 0; - _stability = 1.0 - ((server getVariable format["stability%1",_town]) / 100); - _population = server getVariable format["population%1",_town]; + _stability = 1.0 - ((server getVariable [format["stability%1",_town],100]) / 100); + _population = server getVariable [format["population%1",_town],1000]; if(_population > 1000) then {_population = 1000}; _population = 1-(_population / 1000); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getSoldier.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getSoldier.sqf new file mode 100644 index 00000000..6be10aac --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/getSoldier.sqf @@ -0,0 +1,76 @@ +private _cls = _this; + +private _data = []; +{ + if((_x select 0) == _cls) exitWith {_data = _x}; +}foreach(OT_recruitables); + +private _primary = _data select 1; +private _tertiary = _data select 2; +private _range = _data select 3; +private _uniform = _data select 4; +private _bino = _data select 5; + +private _warehouseWpn = false; +private _warehouseScope = false; +private _warehouseTertiary = false; +private _warehousePistol = false; + +//calculate cost +private _cost = floor((["Tanoa","CIV",0] call getPrice) * 1.5); + +private _wpn = [_primary] call findWeaponInWarehouse; +if(_wpn == "") then { + _possible = []; + { + _weapon = [_x] call BIS_fnc_itemType; + _weaponType = _weapon select 1; + if(_weaponType == _primary) then {_possible pushback _x}; + }foreach(OT_allWeapons); + _sorted = [_possible,[],{(cost getvariable [_x,[200]]) select 0},"ASCEND"] call BIS_fnc_SortBy; + _wpn = _sorted select 0; + _price =((cost getVariable [_wpn,[200]]) select 0); + _cost = _cost + _price; +}else{ + _warehouseWpn = true; +}; +private _pwpn = ["Pistol"] call findWeaponInWarehouse; +if(_pwpn != "") then { + _warehousePistol = true; +}; + +private _scope = [_range] call findScopeInWarehouse; +if(_scope == "") then { + _possible = []; + { + _name = _x; + _max = 0; + _allModes = "true" configClasses ( configFile >> "cfgWeapons" >> _name >> "ItemInfo" >> "OpticsModes" ); + { + _mode = configName _x; + _max = _max max getNumber (configFile >> "cfgWeapons" >> _name >> "ItemInfo" >> "OpticsModes" >> _mode >> "distanceZoomMax"); + }foreach(_allModes); + if(_max >= _range) then {_possible pushback _name}; + }foreach(OT_allOptics); + _sorted = [_possible,[],{(cost getvariable [_x,[200]]) select 0},"ASCEND"] call BIS_fnc_SortBy; + _scope = _sorted select 0; + if(_scope != "") then { + _price = ((cost getVariable [_scope,[200]]) select 0); + _cost = _cost + _price; + }; +}else{ + _warehouseScope = true; +}; + +if(_tertiary != "") then { + _d = warehouse getvariable [_tertiary,[_tertiary,0]]; + _num = _d select 1; + if(_num == 0) then { + _price = ((cost getVariable [_tertiary,[1000]]) select 0); + _cost = _cost + _price; + }else{ + _warehouseTertiary = true; + }; +}; + +[_cost,_cls,_wpn,_warehouseWpn,_pwpn,_warehousePistol,_tertiary,_warehouseTertiary,_scope,_warehouseScope,_uniform,_bino] \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/inSpawnDistance.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/inSpawnDistance.sqf index d4e2f4ba..9b7df436 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/inSpawnDistance.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/inSpawnDistance.sqf @@ -1,9 +1 @@ -({(alive _x or typename (_x getVariable ["player_uid",false]) == "STRING") and (_this distance _x) < OT_spawnDistance} count (allPlayers + alldeadmen + (spawner getVariable ["track",[]])) > 0) -/* -//So zeus spawns, a'la ALiVE -_zeus = getpos curatorCamera; -if ((_zeus select 0) != 0) then { - if((_zeus distance _pos) < OT_spawnDistance) exitWith {_return = true}; -}; - -_return;*/ +({(alive _x or typename (_x getVariable ["player_uid",false]) == "STRING") and (_this distance _x) < OT_spawnDistance} count (allPlayers + (spawner getVariable ["track",[]])) > 0) \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/intelLevel.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/intelLevel.sqf index ba946c47..c35177d5 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/intelLevel.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/intelLevel.sqf @@ -3,11 +3,23 @@ private _pos = _this select 1; private _mylevel = _unit getvariable ["intelBase",0]; -if((assignedItems _unit find "ItemRadio") > -1) then { - _mylevel = _mylevel + 1; //Player has radio: +1 - if(((_pos call nearestComms) select 1) in (server getVariable ["NATOabandoned",[]])) then {_mylevel = _mylevel + 1}; //Player has radio, and nearest comms tower is under control: +1 +if(OT_hasTFAR) then { + { + _c = _x splitString "_"; + if((_c select 0) == "tf") exitWith { + _mylevel = _mylevel + 1; //Player has radio: +1 + if(((_pos call nearestComms) select 1) in (server getVariable ["NATOabandoned",[]])) then {_mylevel = _mylevel + 1}; //Player has radio, and nearest comms tower is under control: +1 + }; + }foreach(assignedItems _unit); +}else{ + if((assignedItems _unit find "ItemRadio") > -1) then { + _mylevel = _mylevel + 1; //Player has radio: +1 + if(((_pos call nearestComms) select 1) in (server getVariable ["NATOabandoned",[]])) then {_mylevel = _mylevel + 1}; //Player has radio, and nearest comms tower is under control: +1 + }; }; + + if((_unit distance _pos) < 1000) then {_mylevel = _mylevel + 1}; //Player is within 1km of position: +1 if((_unit distance _pos) < 150) then {_mylevel = _mylevel + 1}; //Player is within 150m of position: +1 diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/removeFromWarehouse.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/removeFromWarehouse.sqf new file mode 100644 index 00000000..2e2e9bdb --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/removeFromWarehouse.sqf @@ -0,0 +1,16 @@ + +private _cls = _this select 0; +private _num = _this select 1; +private _d = warehouse getVariable [_cls,[_cls,0]]; +_in = _d select 1; + +if(_num > _in or _num == -1) then { + _num = _in; +}; + +private _newnum = _in - _num; +if(_newnum > 0) then { + warehouse setVariable [_cls,[_cls,_newnum],true]; +}else{ + warehouse setVariable [_cls,nil,true]; +}; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/takeStuff.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/takeStuff.sqf index ba1d1219..65d10190 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/takeStuff.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/takeStuff.sqf @@ -4,7 +4,7 @@ _unit = _this select 0; _t = _this select 1; if(vest _unit != "") then { - if !(typeof(vest _unit) in OT_illegalVests) then { + if !(vest _unit in OT_illegalVests) then { _t addVest vest _unit; }; }; @@ -28,7 +28,7 @@ if(backpack _unit != "") then { }foreach(_unit call unitStock); if(vest _unit != "") then { - if !(typeof(vest _unit) in OT_illegalVests) then { + if !(vest _unit in OT_illegalVests) then { removeVest _unit; }; }; @@ -50,7 +50,7 @@ if(handgunWeapon _unit != "") then { _unit removeWeapon handgunWeapon _unit; }; { - if (([(configFile >> "CfgWeapons" >> _x),"optics",0] call BIS_fnc_returnConfigEntry) > 0) then { + if (([(configFile >> "CfgWeapons" >> _x),"useAsBinocular",0] call BIS_fnc_returnConfigEntry) > 0) then { _t addWeapon _x; _t assignItem _x; _unit unassignItem _x; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitStock.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitStock.sqf index eca974dc..1a61da7b 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitStock.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitStock.sqf @@ -12,11 +12,23 @@ if(_this isKindOf "Man") then { }; if !(isNil "_myitems") then { { - if !(_x in _done) then { - _done pushback _x; - _items pushback [_x,1]; + _cls = _x; + if(OT_hasTFAR) then { + _c = _cls splitString "_"; + if((_c select 0) == "tf") then { + _cls = "tf"; + { + if(_forEachIndex == (count _c)-1) exitWith {}; + if(_forEachIndex != 0) then { + _cls = format["%1_%2",_cls,_x]; + }; + }foreach(_c); + }; + }; + if !(_cls in _done) then { + _done pushback _cls; + _items pushback [_cls,1]; }else { - _cls = _x; { if((_x select 0) == _cls) then { _x set [1,(_x select 1)+1]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf index 4b635813..c71590a1 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf @@ -9,15 +9,19 @@ while {true} do { _inf = 1; { _town = _x; - if(_town in OT_allTowns) then { + _total = _total + 250; + if(_town in OT_allAirports) then { + _total = _total + ((server getVariable ["stabilityTanoa",100]) * 4); //Tourism income + }; + _inf = _inf + 1; + if(_town in OT_allTowns) then { _population = server getVariable format["population%1",_town]; _stability = server getVariable format["stability%1",_town]; _add = round(_population * (_stability/100)); if(_stability > 49) then { - _add = round(_add * 2); + _add = round(_add * 4); }; _total = _total + _add; - _inf = _inf + 1; }; }foreach(server getVariable ["NATOabandoned",[]]); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf index 424f3a2e..12280f8a 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf @@ -4,7 +4,10 @@ * * https://github.com/armazac/Overthrow.Tanoa */ - +if !(isClass (configFile >> "CfgPatches" >> "OT_Overthrow_Main")) exitWith { + _txt = format ["Overthrow addon not detected, you must add @Overthrow to your -mod commandline",_this]; + [_txt, 0, 0.2, 30, 0, 0, 2] spawn bis_fnc_dynamicText; +}; inGameUISetEventHandler ["PrevAction", ""]; inGameUISetEventHandler ["Action", ""]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initEconomyLoad.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initEconomyLoad.sqf index db941cb1..9982b651 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initEconomyLoad.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initEconomyLoad.sqf @@ -2,11 +2,14 @@ //Find NATO HQ { - _name = text _x; + _name = _x select 0; + _pos = _x select 1; if(_name == OT_NATO_HQ) then { - OT_NATO_HQPos = getpos _x; + OT_NATO_HQPos = _pos; }; -}foreach (nearestLocations [getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition"), ["NameLocal","Airport"], 50000]); +}foreach (OT_airportData); + +_allActiveShops = []; //Stability markers { @@ -47,6 +50,9 @@ [_x] call setupTownEconomy; }; + _shops = server getVariable [format["activeshopsin%1",_x],[]]; + [_allActiveShops,_shops] call BIS_fnc_arrayPushStack; + //place animals [nearestBuilding _posTown, OT_allTownAnimals, _mSize+400] call BIS_fnc_animalSiteSpawn; private _church = server getVariable [format["churchin%1",_x],[]]; @@ -61,5 +67,8 @@ server setVariable ["EconomyVersion",OT_economyVersion,false]; +OT_allActiveShops = _allActiveShops; +publicVariable "OT_allActiveShops"; + OT_economyLoadDone = true; publicVariable "OT_economyLoadDone"; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf index 1c4490c8..65774ed5 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf @@ -30,6 +30,7 @@ giveIntel = compileFinal preProcessFileLineNumbers "funcs\giveIntel.sqf"; logisticsUnload = compileFinal preProcessFileLineNumbers "funcs\logisticsUnload.sqf"; eject = compileFinal preProcessFileLineNumbers "funcs\addons\eject.sqf"; displayShopPic = compileFinal preProcessFileLineNumbers "funcs\displayShopPic.sqf"; +displayWarehousePic = compileFinal preProcessFileLineNumbers "funcs\displayWarehousePic.sqf"; dumpStuff = compileFinal preProcessFileLineNumbers "funcs\dumpStuff.sqf"; takeStuff = compileFinal preProcessFileLineNumbers "funcs\takeStuff.sqf"; canPlace = compileFinal preProcessFileLineNumbers "funcs\canPlace.sqf"; @@ -37,6 +38,13 @@ progressBar = compileFinal preProcessFileLineNumbers "funcs\progressBar.sqf"; getRealEstateData = compileFinal preProcessFileLineNumbers "funcs\getRealEstateData.sqf"; revealToNATO = compileFinal preProcessFileLineNumbers "funcs\revealToNATO.sqf"; revealToCRIM = compileFinal preProcessFileLineNumbers "funcs\revealToCRIM.sqf"; +findScopeInWarehouse = compileFinal preProcessFileLineNumbers "funcs\findScopeInWarehouse.sqf"; +findWeaponInWarehouse = compileFinal preProcessFileLineNumbers "funcs\findWeaponInWarehouse.sqf"; +findVestInWarehouse = compileFinal preProcessFileLineNumbers "funcs\findVestInWarehouse.sqf"; +findHelmetInWarehouse = compileFinal preProcessFileLineNumbers "funcs\findHelmetInWarehouse.sqf"; +removeFromWarehouse = compileFinal preProcessFileLineNumbers "funcs\removeFromWarehouse.sqf"; +getSoldier = compileFinal preProcessFileLineNumbers "funcs\getSoldier.sqf"; +createSoldier = compileFinal preProcessFileLineNumbers "funcs\createSoldier.sqf"; //AI init initCivilian = compileFinal preProcessFileLineNumbers "AI\civilian.sqf"; @@ -81,6 +89,11 @@ buyClothesDialog = compileFinal preProcessFileLineNumbers "UI\buyClothesDialog.s sellDialog = compileFinal preProcessFileLineNumbers "UI\sellDialog.sqf"; workshopDialog = compileFinal preProcessFileLineNumbers "UI\workshopDialog.sqf"; policeDialog = compileFinal preProcessFileLineNumbers "UI\policeDialog.sqf"; +warehouseDialog = compileFinal preProcessFileLineNumbers "UI\warehouseDialog.sqf"; +inputDialog = compileFinal preProcessFileLineNumbers "UI\inputDialog.sqf"; +importDialog = compileFinal preProcessFileLineNumbers "UI\importDialog.sqf"; +recruitDialog = compileFinal preProcessFileLineNumbers "UI\recruitDialog.sqf"; +buyVehicleDialog = compileFinal preProcessFileLineNumbers "UI\buyVehicleDialog.sqf"; //QRF NATOattack = compileFinal preProcessFileLineNumbers "AI\QRF\NATOattack.sqf"; @@ -130,6 +143,7 @@ leaseBuilding = compileFinal preProcessFileLineNumbers "actions\leaseBuilding.sq recruitCiv = compileFinal preProcessFileLineNumbers "actions\recruitCiv.sqf"; rearmGroup = compileFinal preProcessFileLineNumbers "actions\rearmGroup.sqf"; recruitSoldier = compileFinal preProcessFileLineNumbers "actions\recruitSoldier.sqf"; +recruitSquad = compileFinal preProcessFileLineNumbers "actions\recruitSquad.sqf"; fastTravel = compileFinal preProcessFileLineNumbers "actions\fastTravel.sqf"; setHome = compileFinal preProcessFileLineNumbers "actions\setHome.sqf"; giveMoney = compileFinal preProcessFileLineNumbers "actions\giveMoney.sqf"; @@ -141,6 +155,11 @@ transferTo = compileFinal preProcessFileLineNumbers "actions\transferTo.sqf"; transferLegit = compileFinal preProcessFileLineNumbers "actions\transferLegit.sqf"; talkToCiv = compileFinal preProcessFileLineNumbers "actions\talkToCiv.sqf"; addPolice = compileFinal preProcessFileLineNumbers "actions\addPolice.sqf"; +warehouseTake = compileFinal preProcessFileLineNumbers "actions\warehouseTake.sqf"; +exportAll = compileFinal preProcessFileLineNumbers "actions\exportAll.sqf"; +import = compileFinal preProcessFileLineNumbers "actions\import.sqf"; +restoreLoadout = compileFinal preProcessFileLineNumbers "actions\restoreLoadout.sqf"; +removeLoadout = compileFinal preProcessFileLineNumbers "actions\removeLoadout.sqf"; //Modes placementMode = compileFinal preProcessFileLineNumbers "actions\placementMode.sqf"; @@ -256,6 +275,14 @@ setupKeyHandler = { (findDisplay 46) displayAddEventHandler ["KeyDown",keyHandler]; }; +setAIFace = { + (_this select 0) setFace (_this select 1); +}; + +setAISpeaker = { + (_this select 0) setSpeaker (_this select 1); +}; + assignedKey = { (cba_keybinding_dikDecToStringTable select ((actionKeys _this) select 0)+1) select 1 }; @@ -280,6 +307,7 @@ loadPlayerData = { private _player = _this; _newplayer = true; _data = server getvariable (getplayeruid _player); + _count = 0; if !(isNil "_data") then { _newplayer = false; { @@ -288,7 +316,13 @@ loadPlayerData = { if !(isNil "_val") then { _player setVariable [_key,_val,true]; }; + _count = _count + 1; + if(_count > 50) then { + _count = 0; + sleep 0.1; + }; }foreach(_data); + }; _loadout = server getvariable format["loadout%1",getplayeruid _player]; @@ -358,7 +392,7 @@ money = { if(_amount > 0) then { _plusmin = "+"; }; - format["%1$%2",_plusmin,_amount] call notify_minor; + format["%1$%2",_plusmin,[_amount, 1, 0, true] call CBA_fnc_formatNumber] call notify_minor; }; @@ -504,4 +538,4 @@ fnc_isInMarker = { _ret = false; //Who's passing ellipses in? }; _ret; - }; \ No newline at end of file + }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf index da35209b..81e0c23b 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf @@ -11,6 +11,11 @@ removeBackpack player; removeHeadgear player; removeVest player; +if (isClass (configFile >> "CfgPatches" >> "task_force_radio")) then { + call TFAR_fnc_sendVersionInfo; + "task_force_radio_pipe" callExtension "dummy"; +}; + player linkItem "ItemMap"; server setVariable [format["name%1",getplayeruid player],name player,true]; @@ -19,9 +24,17 @@ spawner setVariable [format["%1",getplayeruid player],player,true]; if(isMultiplayer and (!isServer)) then { call compile preprocessFileLineNumbers "initFuncs.sqf"; + if (isClass (configFile >> "CfgPatches" >> "task_force_radio")) then { + call TFAR_fnc_sendVersionInfo; + "task_force_radio_pipe" callExtension "dummy"; + }; call compile preprocessFileLineNumbers "initVar.sqf"; }; +if (isClass (configFile >> "CfgPatches" >> "task_force_radio")) then { + player linkItem "tf_anprc148jem"; +}; + _start = [1385.17,505.453,1.88826]; _introcam = "camera" camCreate _start; _introcam camSetTarget [1420,535,5.8]; @@ -99,6 +112,12 @@ if(isMultiplayer or _startup == "LOAD") then { _mrkName setMarkerColor "ColorWhite"; _mrkName setMarkerAlpha 0; _mrkName setMarkerAlphaLocal 1; + + if(typeof _bdg == OT_warehouse) then { + _mrkName setMarkerType "mil_box"; + _mrkName setMarkerColor "ColorGUER"; + _mrkName setMarkerAlpha 1; + }; }; if(_x in _leased) then { _bdg setVariable ["leased",true,true]; @@ -152,8 +171,8 @@ if(isMultiplayer or _startup == "LOAD") then { if(typename _civ == "ARRAY") then { _civ = group player createUnit [_type,_civ,[],0,"NONE"]; _civ setVariable ["owner",getplayeruid player,true]; - [_civ, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _civ]; - [_civ, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _civ]; + [_civ, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setAIFace", 0, _civ]; + [_civ, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setAISpeaker", 0, _civ]; _civ setUnitLoadout _loadout; _civ spawn wantedSystem; _civ setName _name; @@ -185,6 +204,7 @@ if(isMultiplayer or _startup == "LOAD") then { if (_newplayer) then { _clothes = (OT_clothes_guerilla call BIS_fnc_selectRandom); + player forceAddUniform _clothes; player setVariable ["uniform",_clothes,true]; player setVariable ["money",100,true]; player setVariable ["owner",getplayerUID player,true]; @@ -223,7 +243,7 @@ if (_newplayer) then { _light setLightAmbient[.9, .9, .6]; _light setLightColor[.5, .5, .4]; - _house setVariable ["owner",getPlayerUID player,true]; + _house setVariable ["owner",getPlayerUID player,true]; player setVariable ["home",_housepos,true]; _furniture = (_house call spawnTemplate) select 0; @@ -254,10 +274,7 @@ _count = 0; { if !(_x isKindOf "Vehicle") then { if(_x call hasOwner) then { - _owner = _x getVariable ["owner",""]; - if((_owner == getplayeruid player) or (typeof _x == OT_item_Map)) then { - _x call initObjectLocal; - }; + _x call initObjectLocal; }; }; if(_count > 5000) then { @@ -332,6 +349,7 @@ if(_newplayer) then { player setVariable ["tute",true,true]; }; }; + _introcam cameraEffect ["Terminate", "BACK" ]; _introcam = nil; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf index 072bc74f..79d6703b 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf @@ -4,18 +4,26 @@ private ["_allPrimaryWeapons","_allHandGuns","__allLaunchers"]; OT_centerPos = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition"); //Used to control updates and persistent save compatability. When these numbers go up, that section will be reinitialized on load if required. (ie leave them alone) -OT_economyVersion = 3; -OT_NATOversion = 2; +OT_economyVersion = 6; +OT_NATOversion = 3; OT_CRIMversion = 1; +OT_adminMode = false; +OT_economyLoadDone = false; OT_hasAce = false; -if (!isNil "ace_common_settingFeedbackIcons") then { +if (isClass (configFile >> "CfgPatches" >> "ace_ui")) then { OT_hasAce = true; }; + +OT_hasTFAR = false; +if (isClass (configFile >> "CfgPatches" >> "task_force_radio")) then { + OT_hasTFAR = true; +}; + OT_fastTime = true; //When true, 1 day will last 6 hrs real time OT_spawnDistance = 1200; -OT_spawnCivPercentage = 0.08; -OT_spawnVehiclePercentage = 0.04; +OT_spawnCivPercentage = 0.06; +OT_spawnVehiclePercentage = 0.03; OT_standardMarkup = 0.2; //Markup in shops is calculated from this OT_randomSpawnTown = false; //if true, every player will start in a different town, if false, all players start in the same town (Multiplayer only) OT_distroThreshold = 500; //Size a towns order must be before a truck is sent (in dollars) @@ -29,8 +37,8 @@ OT_item_wrecks = ["Land_Wreck_HMMWV_F","Land_Wreck_Skodovka_F","Land_Wreck_Truck OT_spawnTowns = ["Rautake","Tavu","Balavu","Muaceba","Katkoula","Savaka"]; //Towns where new players will spawn OT_spawnHouses = ["Land_Slum_01_F","Land_Slum_02_F","Land_House_Native_02_F"]; //Houses where new players will spawn -OT_NATOwait = 200; //Half the Average time between NATO orders -OT_CRIMwait = 350; //Half the Average time between crim changes +OT_NATOwait = 400; //Half the Average time between NATO orders +OT_CRIMwait = 500; //Half the Average time between crim changes //Interactable items that spawn in your house OT_item_Storage = "B_CargoNet_01_ammo_F"; //Your spawn ammobox @@ -40,6 +48,7 @@ OT_item_Map = "Land_MapBoard_F"; OT_item_Repair = "Land_ToolTrolley_02_F"; OT_item_Tent = "Land_TentDome_F"; OT_item_Flag = "Flag_HorizonIslands_F"; +OT_item_Safe = "Land_MetalCase_01_small_F"; OT_allLowAnimals = ["Rabbit_F","Turtle_F"]; OT_allHighAnimals = ["Goat_random_F"]; @@ -47,16 +56,55 @@ OT_allFarmAnimals = ["Hen_random_F","Cock_random_F","Sheep_random_F"]; OT_allVillageAnimals = ["Hen_random_F","Cock_random_F"]; OT_allTownAnimals = ["Alsatian_Random_F","Fin_random_F"]; +_miscables = ["Land_PortableLight_single_F","Land_PortableLight_double_F","Land_Camping_Light_F","Land_PortableHelipadLight_01_F","PortableHelipadLight_01_blue_F","PortableHelipadLight_01_green_F","PortableHelipadLight_01_red_F","PortableHelipadLight_01_white_F","PortableHelipadLight_01_yellow_F","Land_Campfire_F"]; + +if(OT_hasACE) then { + _miscables pushback "ACE_Wheel"; + _miscables pushback "ACE_Track"; +}; + +//Items you can place OT_Placeables = [ - ["Sandbags",20,["Land_BagFence_01_long_green_F","Land_BagFence_01_short_green_F","Land_BagFence_01_round_green_F","Land_BagFence_01_corner_green_F","Land_BagFence_01_end_green_F"],[0,3,0.8]], - ["Camo Nets",40,["CamoNet_ghex_F","CamoNet_ghex_open_F","CamoNet_ghex_big_F"],[0,7,2]], - ["Barriers",60,["Land_HBarrier_01_line_5_green_F","Land_HBarrier_01_line_3_green_F","Land_HBarrier_01_line_1_green_F"],[0,4,1.2]], - ["Misc",30,[OT_item_Map,OT_item_Repair,"Land_PortableLight_single_F","Land_PortableLight_double_F","Land_Camping_Light_F","Land_PortableHelipadLight_01_F","PortableHelipadLight_01_blue_F","PortableHelipadLight_01_green_F","PortableHelipadLight_01_red_F","PortableHelipadLight_01_white_F","PortableHelipadLight_01_yellow_F","Land_Campfire_F"],[0,2,1.2]], - ["Deploy",500,["B_Boat_Transport_01_F","I_HMG_01_high_F","I_HMG_01_F"],[0,2.3,2]] + ["Sandbags",20,["Land_BagFence_01_long_green_F","Land_BagFence_01_short_green_F","Land_BagFence_01_round_green_F","Land_BagFence_01_corner_green_F","Land_BagFence_01_end_green_F"],[0,3,0.8],"Bags filled with lots of sand. Apparently this can stop bullets or something?"], + ["Camo Nets",40,["CamoNet_ghex_F","CamoNet_ghex_open_F","CamoNet_ghex_big_F"],[0,7,2],"Large and terribly flimsy structures that may or may not obscure your forces from airborne units."], + ["Barriers",60,["Land_HBarrier_01_line_5_green_F","Land_HBarrier_01_line_3_green_F","Land_HBarrier_01_line_1_green_F"],[0,4,1.2],"Really big sandbags, basically."], + ["Map",30,[OT_item_Map],[0,2,1.2],"Use these to save your game, change options or check town info."], + ["Safe",50,[OT_item_Safe],[0,2,0.5],"Store and retrieve money"], + ["Misc",30,_miscables,[0,3,1.2],"Various other items, including lights"] ]; -OT_churches = ["Land_Church_03_F","Land_Church_01_F","Land_Church_02_F","Land_Temple_Native_01_F"]; +//People you can recruit, and squads are composed of +OT_Recruitables = [ + ["I_soldier_F","AssaultRifle","",200,"",""], //0 + ["I_soldier_AR_F","MachineGun","",200,"",""], //1 + ["I_Soldier_LAT_F","AssaultRifle","launch_RPG7_F",200,"",""], //2 + ["I_Soldier_M_F","AssaultRifle","",500,"",""], //3 + ["I_Sniper_F","SniperRifle","",1800,"U_B_T_FullGhillie_tna_F","Binocular"], //4 + ["I_Spotter_F","AssaultRifle","",500,"U_B_T_FullGhillie_tna_F","Binocular"], //5 + ["I_Soldier_SL_F","AssaultRifle","",200,"","Binocular"], //6 + ["I_Soldier_TL_F","AssaultRifle","",200,"U_I_C_Soldier_Para_2_F","Binocular"], //7 + ["I_Medic_F","AssaultRifle","",200,"",""], //8 + ["I_Soldier_AT_F","AssaultRifle","launch_I_Titan_short_F",200,"",""], //9 + ["I_Soldier_AA_F","AssaultRifle","launch_I_Titan_F",200,"",""], //10 + ["I_Soldier_AAT_F","AssaultRifle","",200,"",""], //11 + ["I_Soldier_AAA_F","AssaultRifle","",200,"",""] //12 +]; +OT_Squadables = [ + ["Sentry",[6,0]], + ["Sniper Squad",[4,5]], + ["AT Squad",[6,9,11,8]], + ["AA Squad",[6,10,12,8]], + ["Fire Team",[7,0,1,2,3,8]], + ["Infantry Team",[7,0,1,2,3,8,9,10]] +]; +OT_allSquads = []; +{ + _name = _x select 0; + OT_allSquads pushback _name; +}foreach(OT_Squadables); + +OT_churches = ["Land_Church_03_F","Land_Church_01_F","Land_Church_02_F","Land_Temple_Native_01_F"]; OT_voices_local = ["Male01ENGFRE","Male02ENGFRE"]; OT_voices_western = ["Male01ENG","Male02ENG","Male03ENG","Male04ENG","Male05ENG","Male06ENG","Male07ENG","Male08ENG","Male09ENG","Male10ENG","Male11ENG","Male12ENG","Male01ENGB","Male02ENGB","Male03ENGB","Male04ENGB","Male05ENGB"]; @@ -78,6 +126,7 @@ OT_vehType_distro = "C_Van_01_box_F"; OT_activeDistribution = []; OT_activeShops = []; OT_selling = false; +OT_taking = false; //Shop items OT_item_ShopRegister = "Land_CashDesk_F";//Cash registers @@ -112,7 +161,7 @@ OT_clothes_port = "U_Marshal"; OT_clothes_shops = ["U_C_Man_casual_2_F","U_C_Man_casual_3_F","U_C_Man_casual_1_F"]; OT_clothes_carDealers = ["U_Marshal"]; OT_clothes_harbor = ["U_C_man_sport_1_F","U_C_man_sport_2_F","U_C_man_sport_3_F"]; -OT_clothes_guerilla = ["U_I_C_Soldier_Para_1_F","U_I_C_Soldier_Para_2_F","U_I_C_Soldier_Para_3_F","U_I_C_Soldier_Para_5_F","U_I_C_Soldier_Para_4_F"]; +OT_clothes_guerilla = ["U_I_C_Soldier_Para_1_F","U_I_C_Soldier_Para_2_F","U_I_C_Soldier_Para_3_F","U_I_C_Soldier_Para_4_F"]; OT_clothes_police = ["U_I_G_resistanceLeader_F","U_BG_Guerilla2_1","U_BG_Guerilla2_3","U_I_C_Soldier_Para_4_F"]; OT_vest_police = "V_TacVest_blk_POLICE"; OT_hat_police = "H_Cap_police"; @@ -191,6 +240,7 @@ OT_CRIM_Unit = "C_man_p_fugitive_F"; OT_CRIM_Clothes = ["U_I_C_Soldier_Bandit_3_F","U_BG_Guerilla3_1","U_C_HunterBody_grn","U_I_G_Story_Protagonist_F"]; OT_CRIM_Goggles = ["G_Balaclava_blk","G_Balaclava_combat","G_Balaclava_lowprofile","G_Balaclava_oli","G_Bandanna_blk","G_Bandanna_khk","G_Bandanna_oli","G_Bandanna_shades","G_Bandanna_sport","G_Bandanna_tan"]; + //ECONOMY //This is the prices table, shops will only stock these items, any others must be imported or produced and will have their costs generated automatically @@ -200,7 +250,6 @@ OT_CRIM_Goggles = ["G_Balaclava_blk","G_Balaclava_combat","G_Balaclava_lowprofil //The cost to produce an item will be the Base price - player/factory bonuses + raw materials //The wholesale sell price of an item will be the base price - local markup //NB: the local markup can be negative, making buy prices lower and sell prices higher, in certain situations (high stability and/or player rep) - OT_items = []; if(OT_hasAce) then { [OT_items,[ @@ -216,24 +265,59 @@ if(OT_hasAce) then { ["ACE_Sandbag_empty",2,0,0,0], ["ACE_Altimeter",110,0,0,1], ["ACE_Banana",1,0,0,0], - ["ACE_microDAGR",200,0,0,1] + ["ACE_RangeTable_82mm",1,0,0,1], + ["ACE_ATragMX",140,0,0,1], + ["ACE_microDAGR",200,0,0,1], + ["ACE_DAGR",100,0,0,1], + ["ACE_DefusalKit",5,0,0,1], + ["ACE_EntrenchingTool",6,0,0,1], + ["ACE_HuntIR_monitor",300,0,0,1], + ["ACE_IR_Strobe_Item",10,0,0,1], + ["ACE_packingBandage",3,0,0,1], + ["ACE_personalAidKit",4,0,0,1], + ["ACE_RangeCard",1,0,0,1], + ["ACE_salineIV",5,0,0,1], + ["ACE_salineIV_250",7,0,0,1], + ["ACE_salineIV_500",10,0,0,1], + ["ACE_SpottingScope",75,0,0,1], + ["ACE_Tripod",35,0,0,1], + ["ACE_surgicalKit",32,0,0,1], + ["ACE_tourniquet",27,0,0,1], + ["ACE_UAVBattery",14,0,0,1], + ["ACE_wirecutter",4,0,0,1], + ["ACE_MapTools",2,0,0,1] ]] call BIS_fnc_arrayPushStack; }else{ [OT_items,[ ["FirstAidKit",10,0,0,0.1], - ["Medikit",40,0,0,0.5] + ["Medikit",40,0,0,0.5] + ]] call BIS_fnc_arrayPushStack; +}; + +if(OT_hasTFAR) then { + [OT_items,[ + ["tf_anprc148jem",20,0,0,0.1], + ["tf_anprc152",20,0,0,0.1], + ["tf_fadak",20,0,0,0.5], + ["tf_pnr1000a",10,0,0,0.5], + ["tf_rf7800str",10,0,0,0.5] ]] call BIS_fnc_arrayPushStack; +}else{ + OT_items pushback ["ItemRadio",20,0,0,1]; }; [OT_items,[ + ["Laserdesignator",220,1,0,0], + ["Laserdesignator_01_khk_F",220,1,0,0], + ["Laserdesignator_02_ghex_F",200,1,0,0], + ["MineDetector",10,1,0,0], ["ToolKit",25,1,0,0], ["ItemGPS",60,0,0,1], ["ItemCompass",5,0.1,0,0], ["ItemMap",1,0,0,0], ["ItemWatch",30,0,0,1], ["Binocular",70,0,0,1], - ["Rangefinder",130,0,0,1], - ["ItemRadio",20,0,0,1] + ["Rangefinder",130,0,0,1] ]] call BIS_fnc_arrayPushStack; OT_staticBackpacks = [ @@ -261,25 +345,40 @@ OT_backpacks = [ ["B_Carryall_khk",80,0,0,1], ["B_Carryall_oli",80,0,0,1], ["B_Bergen_dgtl_F",100,0,0,1], - ["B_Bergen_hex_F",100,0,0,1] + ["B_Bergen_hex_F",100,0,0,1], + ["B_Parachute",120,0,0,1] ]; + +if(OT_hasTFAR) then { + [OT_backpacks,[ + ["tf_anprc155",100,0,0,0.1], + ["tf_anarc210",150,0,0,0.1], + ["tf_anarc164",20,0,0,0.5], + ["tf_anprc155_coyote",10,0,0,0.5] + ]] call BIS_fnc_arrayPushStack; +}; + + + OT_boats = [ ["C_Scooter_Transport_01_F",150,1,0,1], ["C_Boat_Civil_01_rescue_F",300,1,1,1], ["C_Boat_Transport_02_F",600,1,0,1] ]; OT_vehicles = []; +OT_helis = []; OT_allVehicles = []; OT_allBoats = ["B_Boat_Transport_01_F"]; OT_allItems = []; OT_allWeapons = []; +OT_allOptics = []; OT_allMagazines = [OT_ammo_50cal]; OT_allBackpacks = []; OT_allStaticBackpacks = []; OT_vehWeights_civ = []; _mostExpensive = 0; -_allVehs = " +private _allVehs = " ( getNumber ( _x >> ""scope"" ) isEqualTo 2 && { getText ( _x >> ""vehicleClass"" ) isEqualTo ""Car""} @@ -290,9 +389,11 @@ _allVehs = " { _cls = configName _x; - _cost = (getNumber (configFile >> "cfgVehicles" >> _cls >> "armor") + getNumber (configFile >> "cfgVehicles" >> _cls >> "enginePower")) * 3; + _cost = (getNumber (configFile >> "cfgVehicles" >> _cls >> "armor") + getNumber (configFile >> "cfgVehicles" >> _cls >> "enginePower")); _cost = _cost + round(getNumber (configFile >> "cfgVehicles" >> _cls >> "maximumLoad") * 0.1); + if(_cls isKindOf "Truck_F") then {_cost = _cost * 2}; + if(_cost > _mostExpensive)then { _mostExpensive = _cost; }; @@ -304,6 +405,28 @@ _allVehs = " }; } foreach (_allVehs); +private _allHelis = " + ( getNumber ( _x >> ""scope"" ) isEqualTo 2 + && + { getText ( _x >> ""vehicleClass"" ) isEqualTo ""Air""} + && + { getText ( _x >> ""faction"" ) isEqualTo ""CIV_F""} + ) +" configClasses ( configFile >> "cfgVehicles" ); + +{ + _cls = configName _x; + _cost = (getNumber (configFile >> "cfgVehicles" >> _cls >> "armor") + getNumber (configFile >> "cfgVehicles" >> _cls >> "enginePower")); + _cost = _cost + round(getNumber (configFile >> "cfgVehicles" >> _cls >> "maximumLoad") * 1.5); + + if(isServer) then { + cost setVariable [_cls,[_cost,1,1,1],true]; + }; + + OT_helis pushback [_cls,_cost,1,1,1]; + OT_allVehicles pushback _cls; +} foreach (_allHelis); + { _cls = _x select 0; if(isServer) then { @@ -316,18 +439,30 @@ _allVehs = " }foreach(OT_vehicles); -_allWeapons = " +private _allWeapons = " ( getNumber ( _x >> ""scope"" ) isEqualTo 2 && { getText ( _x >> ""simulation"" ) isEqualTo ""Weapon""}) " configClasses ( configFile >> "cfgWeapons" ); -_allUniforms = " +private _allOptics = " + ( getNumber ( _x >> ""scope"" ) isEqualTo 2 + && + { getNumber ( _x >> ""ItemInfo"" >> ""optics"" ) isEqualTo 1}) +" configClasses ( configFile >> "cfgWeapons" ); + +private _allUniforms = " ( getNumber ( _x >> ""scope"" ) isEqualTo 2 && { getNumber ( _x >> ""ItemInfo"" >> ""type"" ) isEqualTo 801}) " configClasses ( configFile >> "cfgWeapons" ); +private _allHelmets = " + ( getNumber ( _x >> ""scope"" ) isEqualTo 2 + && + { getNumber ( _x >> ""ItemInfo"" >> ""type"" ) isEqualTo 605}) +" configClasses ( configFile >> "cfgWeapons" ); + OT_allSubMachineGuns = []; OT_allAssaultRifles = []; OT_allMachineGuns = []; @@ -342,6 +477,9 @@ OT_allProtectiveVests = []; OT_allExpensiveVests = []; OT_allCheapVests = []; OT_allClothing = []; +OT_allOptics = []; +OT_allHelmets = []; +OT_allHats = []; { _name = configName _x; @@ -382,12 +520,13 @@ OT_allClothing = []; call { if(_caliber == " 5.56" or _caliber == "5.56" or _caliber == " 5.45" or _caliber == " 5.8") exitWith {_cost = 500}; if(_caliber == " 12 gauge") exitWith {_cost = 1200}; - if(_caliber == " .338 Lapua Magnum" or _caliber == " .408" or _caliber == " .303") exitWith {_cost = 800}; + if(_caliber == " .408") exitWith {_cost = 2000}; + if(_caliber == " .338 Lapua Magnum" or _caliber == " .303") exitWith {_cost = 700}; if(_caliber == " 9") exitWith {_cost = 400}; //9x21mm if(_caliber == " 6.5") exitWith {_cost = 1000}; if(_caliber == " 7.62") exitWith {_cost = 1500}; if(_caliber == " 9.3" or _caliber == "9.3") exitWith {_cost = 1700}; - if(_caliber == " 12.7") exitWith {_cost = 2500}; + if(_caliber == " 12.7") exitWith {_cost = 3000}; //I dunno what caliber this is _cost = 1500; }; @@ -407,21 +546,23 @@ OT_allClothing = []; case "RocketLauncher": {_cost = 1500;OT_allRocketLaunchers pushBack _name}; case "Vest": { if !(_name in (OT_illegalVests + ["V_RebreatherB","V_RebreatherIA","V_RebreatherIR","V_Rangemaster_belt"])) then { - _cost = 80 + (getNumber(configFile >> "CfgWeapons" >> _name >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Chest" >> "armor") * 50); + _cost = 40 + (getNumber(configFile >> "CfgWeapons" >> _name >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Chest" >> "armor") * 20); OT_allVests pushBack _name; - if(_cost > 80) then { + if(_cost > 40) then { OT_allProtectiveVests pushback _name; }; - if(_cost > 900) then { + if(_cost > 300) then { OT_allExpensiveVests pushback _name; }; - if(_cost < 900 and _cost > 80) then { + if(_cost < 300 and _cost > 40) then { OT_allCheapVests pushback _name; }; }; }; }; - cost setVariable [_name,[_cost,1,0,1],true]; + if(isServer) then { + cost setVariable [_name,[_cost,1,0,1],true]; + }; } foreach (_allWeapons); { @@ -432,9 +573,41 @@ OT_allClothing = []; _cost = round(_carry * 0.5); OT_allClothing pushback _name; - cost setVariable [_name,[_cost,1,0,1],true]; + cost setVariable [_name,[_cost,0,0,1],true]; } foreach (_allUniforms); +{ + _name = configName _x; + _cost = 20 + (getNumber(configFile >> "CfgWeapons" >> _name >> "ItemInfo" >> "HitpointsProtectionInfo" >> "Head" >> "armor") * 30); + if(_cost > 20) then { + OT_allHelmets pushback _name; + }else{ + OT_allHats pushback _name; + }; + if(isServer) then { + cost setVariable [_name,[_cost,0,0,1],true]; + }; +} foreach (_allHelmets); + +{ + _name = configName _x; + _allModes = "true" configClasses ( configFile >> "cfgWeapons" >> _name >> "ItemInfo" >> "OpticsModes" ); + _cost = 50; + { + _mode = configName _x; + _max = getNumber (configFile >> "cfgWeapons" >> _name >> "ItemInfo" >> "OpticsModes" >> _mode >> "distanceZoomMax"); + _mul = 0.1; + if(_mode == "NVS") then {_mul = 0.2}; + if(_mode == "TWS") then {_mul = 0.5}; + _cost = _cost + floor(_max * _mul); + }foreach(_allModes); + + OT_allOptics pushback _name; + if(isServer) then { + cost setVariable [_name,[_cost,0,0,1],true]; + }; +} foreach (_allOptics); + OT_allWeapons = OT_allSubMachineGuns + OT_allAssaultRifles + OT_allMachineGuns + OT_allSniperRifles + OT_allHandGuns + OT_allMissileLaunchers + OT_allRocketLaunchers; if(isServer) then { @@ -442,7 +615,7 @@ if(isServer) then { cost setVariable [OT_item_UAV,[200,0,0,1],true]; //Drug prices - cost setVariable ["OT_Ganja",[100,0,0,0],true]; + cost setVariable ["OT_Ganja",[100,0,0,0],true]; }; //populate the cost gamelogic with the above data so it can be accessed quickly { @@ -497,6 +670,8 @@ OT_portBuildings = ["Land_Warehouse_01_F","Land_Warehouse_02_F","Land_ContainerL OT_airportTerminals = ["Land_Airport_01_terminal_F","Land_Airport_02_terminal_F","Land_Hangar_F"]; OT_portBuilding = "Land_Warehouse_02_F"; OT_policeStation = "Land_Cargo_House_V3_F"; +OT_warehouse = "Land_Warehouse_03_F"; +OT_barracks = "Land_Barracks_01_grey_F"; OT_loadingMessages = ["Adding Hidden Agendas","Adjusting Bell Curves","Aesthesizing Industrial Areas","Aligning Covariance Matrices","Applying Feng Shui Shaders","Applying Theatre Soda Layer","Asserting Packed Exemplars","Attempting to Lock Back-Buffer","Binding Sapling Root System","Breeding Fauna","Building Data Trees","Bureacritizing Bureaucracies","Calculating Inverse Probability Matrices","Calculating Llama Expectoration Trajectory","Calibrating Blue Skies","Charging Ozone Layer","Coalescing Cloud Formations","Cohorting Exemplars","Collecting Meteor Particles","Compounding Inert Tessellations","Compressing Fish Files","Computing Optimal Bin Packing","Concatenating Sub-Contractors","Containing Existential Buffer","Debarking Ark Ramp","Debunching Unionized Commercial Services","Deciding What Message to Display Next","Decomposing Singular Values","Decrementing Tectonic Plates","Deleting Ferry Routes","Depixelating Inner Mountain Surface Back Faces","Depositing Slush Funds","Destabilizing Economic Indicators","Determining Width of Blast Fronts","Deunionizing Bulldozers","Dicing Models","Diluting Livestock Nutrition Variables","Downloading Satellite Terrain Data","Exposing Flash Variables to Streak System","Extracting Resources","Factoring Pay Scale","Fixing Election Outcome Matrix","Flood-Filling Ground Water","Flushing Pipe Network","Gathering Particle Sources","Generating Jobs","Gesticulating Mimes","Graphing Whale Migration","Hiding Willio Webnet Mask","Implementing Impeachment Routine","Increasing Accuracy of RCI Simulators","Increasing Magmafacation","Initializing Rhinoceros Breeding Timetable","Initializing Robotic Click-Path AI","Inserting Sublimated Messages","Integrating Curves","Integrating Illumination Form Factors","Integrating Population Graphs","Iterating Cellular Automata","Lecturing Errant Subsystems","Mixing Genetic Pool","Modeling Object Components","Mopping Occupant Leaks","Normalizing Power","Obfuscating Quigley Matrix","Overconstraining Dirty Industry Calculations","Partitioning City Grid Singularities","Perturbing Matrices","Pixellating Nude Patch","Polishing Water Highlights","Populating Lot Templates","Preparing Sprites for Random Walks","Prioritizing Landmarks","Projecting Law Enforcement Pastry Intake","Realigning Alternate Time Frames","Reconfiguring User Mental Processes","Relaxing Splines","Removing Road Network Speed Bumps","Removing Texture Gradients","Removing Vehicle Avoidance Behavior","Resolving GUID Conflict","Reticulating Splines","Retracting Phong Shader","Retrieving from Back Store","Reverse Engineering Image Consultant","Routing Neural Network Infanstructure","Scattering Rhino Food Sources","Scrubbing Terrain","Searching for Llamas","Seeding Architecture Simulation Parameters","Sequencing Particles","Setting Advisor ","Setting Inner Deity ","Setting Universal Physical Constants","Sonically Enhancing Occupant-Free Timber","Speculating Stock Market Indices","Splatting Transforms","Stratifying Ground Layers","Sub-Sampling Water Data","Synthesizing Gravity","Synthesizing Wavelets","Time-Compressing Simulator Clock","Unable to Reveal Current Activity","Weathering Buildings","Zeroing Crime Network"]; OT_allBuyableBuildings = OT_lowPopHouses + OT_medPopHouses + OT_highPopHouses + OT_hugePopHouses + OT_mansions + [OT_item_Tent,OT_item_Flag]; @@ -507,12 +682,13 @@ OT_Buildables = [ ["Walls",200,["Land_ConcreteWall_01_l_8m_F","Land_ConcreteWall_01_l_gate_F","Land_HBarrier_01_wall_6_green_F","Land_HBarrier_01_wall_4_green_F","Land_HBarrier_01_wall_corner_green_F"],"",false,"Stop people (or tanks) from getting in. Press space to change type."], ["Helipad",50,["Land_HelipadCircle_F","Land_HelipadCivil_F","Land_HelipadRescue_F","Land_HelipadSquare_F"],"",false,"Apparently helicopter pilots need to be told where they are allowed to land"], ["Observation Post",800,["Land_Cargo_Patrol_V4_F"],"structures\observationPost.sqf",false,"Includes unarmed personnel to keep an eye over the area and provide intel on enemy positions"], - ["Barracks",5000,["Land_Barracks_01_camo_F","Land_Barracks_01_grey_F"],"",false,"Allows recruiting of squads"], + ["Barracks",5000,[OT_barracks],"",false,"Allows recruiting of squads"], ["Guard Tower",10000,["Land_Cargo_Tower_V4_F"],"",false,"It's a huge tower, what else do you need? besides 2 x Static MGs maybe but it comes with those."], ["Hangar",1200,["Land_Airport_01_hangar_F"],"",false,"A big empty building, could probably fit a plane inside it."], ["Workshop",2500,[] call compileFinal preProcessFileLineNumbers "templates\military\workshop.sqf","structures\workshop.sqf",true,"A place to repair and rearm your vehicles"], ["House",1100,["Land_House_Small_06_F","Land_House_Small_02_F","Land_House_Small_03_F","Land_GarageShelter_01_F","Land_Slum_04_F"],"",false,"4 walls, a roof, and if you're lucky a door that opens."], - ["Police Station",3500,[OT_policeStation],"structures\policeStation.sqf",false,"Allows hiring of policeman to raise stability in a town and keep the peace. Comes with 2 units."] + ["Police Station",3500,[OT_policeStation],"structures\policeStation.sqf",false,"Allows hiring of policeman to raise stability in a town and keep the peace. Comes with 2 units."], + ["Warehouse",5000,[OT_warehouse],"structures\warehouse.sqf",false,"A house that you put wares in."] ]; OT_workshop = [ @@ -535,6 +711,7 @@ OT_workshop = [ OT_allHouses = OT_lowPopHouses + OT_medPopHouses + OT_highPopHouses + OT_hugePopHouses + OT_touristHouses; OT_allEnterableHouses = ["Land_House_Small_02_F","Land_House_Big_02_F","Land_House_Small_03_F","Land_House_Small_06_F","Land_House_Big_01_F","Land_Slum_05_F","Land_Slum_01_F","Land_GarageShelter_01_F","Land_House_Small_01_F","Land_Slum_03_F","Land_House_Big_04_F","Land_House_Small_04_F","Land_House_Small_05_F"]; +OT_townData = [["Lami",[7941.7,7663.32,-7.3052]],["Lifou",[7080.21,8004.08,-2.67]],["Lobaka",[6028.08,8580.17,-26.4572]],["Lakatoro",[9213.6,8741.29,-220.615]],["La Foa",[8825.16,4778.34,0.205969]],["Savaka",[7211.97,4237.91,-1.39777]],["Regina",[4919.7,8728.68,-2.99988]],["Katkoula",[5684.68,3993.67,0.0045675]],["Moddergat",[9407.35,4133.13,-6.81528]],["Lösi",[10200.8,4964.28,-16.149]],["Tanouka",[9014.23,10214.2,-30.0952]],["Tobakoro",[8741.21,3556.31,0.0318844]],["Georgetown",[5396.22,10334.7,0.00964478]],["Kotomo",[10974.5,6232.58,-11.9053]],["Rautake",[3403.76,6836.13,0]],["Harcourt",[11122.5,5342.93,-0.0348662]],["Buawa",[8316.95,11132.2,-130.3]],["Saint-Julien",[5808.6,11213.3,-2.6792]],["Balavu",[2677.42,7441.56,0.00116708]],["Namuvaka",[2824.25,5700.17,-4.71091]],["Vagalala",[11069.2,9748.43,-112.357]],["Imone",[10487.6,10613.7,-163.045]],["Leqa",[2363.54,8236.87,-4.31921]],["Galili",[8114.07,11957.2,-216.278]],["Sosovu",[2686.79,9280.77,-4.71367]],["Blerick",[10255.9,2738.07,-9.01873]],["Yanukka",[3051.14,3448.56,-17.0524]],["Oua-Oué",[5752.39,12325.8,-26.058]],["Cerebu",[2131.95,4589.63,-6.61045]],["Laikoro",[1628.02,6190.57,0]],["Saioko",[12403.5,4569.93,-32.6168]],["Belfort",[3132.55,10977.1,0.0920983]],["Ouméré",[12984.3,7321.96,-0.00245522]],["Muaceba",[1556.43,8545.12,-0.733838]],["Nicolet",[6164.67,12864.7,0.0123867]],["Lailai",[3627.54,2208.85,-45.4752]],["Doodstil",[12861.9,4691.1,-2.63918]],["Tavu",[974.49,7654.05,-3.96532]],["Lijnhaven",[11802,2662.98,-0.0168395]],["Nani",[1954.62,10727,-5.50346]],["Petit Nicolet",[6813.05,13439.5,0.00345634]],["Port-Boisé",[12715.1,3309.17,-9.54124]],["Saint-Paul",[7829.41,13599.8,0.0181113]],["Nasua",[11417.6,12360.2,-105.833]],["Savu",[8393.35,13778.4,0.000719533]],["Luganville",[14040.9,8308.29,-1.57949]],["Momea",[10423.8,13252.2,-20.6373]],["La Rochelle",[9549.78,13673.4,0.0130114]],["Koumac",[1347.24,2968.37,0.0902042]],["Taga",[12255.2,1880.2,-121.022]],["Bua Bua",[13255.1,3019.73,-58.4955]],["Pénélo",[10966.2,13183.5,-16.9658]],["Vatukoulo",[14057.4,9955.55,-98.8908]],["Nandai",[14496.3,8877.4,-1.13811]],["Tuvanaka",[1579.49,11937.8,-0.253379]],["Rereki",[13069.4,2117.94,2.97365e-005]],["Ovau",[12401.7,12787.8,-1.56371]],["Blue Pearl industrial port",[13523,12134.8,0.26935]],["Ba",[14295.2,11680.3,-1.10196]],["Ipota",[12317.8,13929.5,-9.70543]]]; OT_allTowns = []; //get all the templates we need @@ -556,14 +733,21 @@ OT_allTowns = []; } foreach(OT_mansions + OT_lowPopHouses + OT_medPopHouses + OT_highPopHouses + OT_shops + OT_carShops); { - OT_allTowns pushBack (text _x); + _name = _x select 0; + _pos = _x select 1; + OT_allTowns pushBack _name; if(isServer) then { - server setVariable [text _x,getpos _x,true]; + server setVariable [_name,_pos,true]; }; -}foreach (nearestLocations [getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition"), ["NameCityCapital","NameCity","NameVillage","CityCenter"], 50000]); +}foreach (OT_townData); +OT_airportData = [["Aéroport de Tanoa",[6952.61,7400.35,-2.66]],["Saint-George Airstrip",[11570,3150.79,-5.56791]],["Bala Airstrip",[2089.06,3523.68,-12.95]],["La Rochelle Aerodrome",[11650.3,13135.4,-6.95]],["Tuvanaka Airbase",[1953.34,13173.8,-13.45]]]; OT_allAirports = []; { - OT_allAirports pushBack text _x; -}foreach (nearestLocations [getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition"), ["Airport"], 50000]); + OT_allAirports pushBack (_x select 0); +}foreach (OT_airportData); + +if(isServer) then { + cost setVariable ["V_RebreatherIA",[75,0,0,1],true]; +}; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf index 07f80082..49c48bdd 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf @@ -53,7 +53,7 @@ _handler = { (_this select 0) drawIcon [ "\A3\ui_f\data\igui\cfg\islandmap\iconplayer_ca.paa", _color, - getpos _x, + visiblePosition _x, 24, 24, 0 @@ -79,7 +79,7 @@ _handler = { (_this select 0) drawIcon [ "iconMan", _color, - getpos _x, + visiblePosition _x, 24, 24, getDir _x, @@ -102,12 +102,12 @@ _handler = { _passengers = format["%1 %2",_passengers,name _x]; }; if !(captive _x) then {_color = [0.5,0,0,1]}; - }foreach(units _x); + }foreach(crew _x); (_this select 0) drawIcon [ getText(configFile >> "CfgVehicles" >> (typeof _x) >> "icon"), _color, - getpos _x, + visiblePosition _x, 24, 24, getdir _x, @@ -131,7 +131,7 @@ _handler = { if(_ka > 1.4) then { _opacity = (_ka-1.4) / 1; if(_opacity > 1) then {_opacity = 1}; - _pos = getpos _u; + _pos = visiblePosition _u; (_this select 0) drawIcon [ "\A3\ui_f\data\map\markers\nato\b_inf.paa", [0,0.3,0.59,_opacity], @@ -159,7 +159,7 @@ _handler = { if(_ka > 1.4) then { _opacity = (_ka-1.4) / 1; if(_opacity > 1) then {_opacity = 1}; - _pos = getpos _u; + _pos = visiblePosition _u; (_this select 0) drawIcon [ "\A3\ui_f\data\map\markers\nato\b_inf.paa", [0.5,0,0,_opacity], @@ -190,6 +190,23 @@ _handler = { }; }; }foreach(vehicles); + + _scale = ctrlMapScale (_this select 0); + if(_scale <= 0.14) then { + { + (_this select 0) drawIcon [ + "iconObject_circle", + [1,1,1,1], + _x select 0, + 0.5/ctrlMapScale (_this select 0), + 0.5/ctrlMapScale (_this select 0), + 0 + ]; + }foreach(OT_allActiveShops); + }; + + + mapCenter }; if(!isNil "OT_OnDraw") then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initCarShopLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initCarShopLocal.sqf index 785bc838..45f017df 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initCarShopLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initCarShopLocal.sqf @@ -1,25 +1,7 @@ _civ = _this; _civ addAction ["Buy Vehicle", { - _town = (getpos player) call nearestTown; - _standing = player getVariable format['rep%1',_town]; - createDialog "OT_dialog_buy"; - { - _cls = _x select 0; - _price = [_town,_cls,_standing] call getPrice; - if("fuel depot" in (server getVariable "OT_NATOabandoned")) then { - _price = round(_price * 0.5); - }; - _idx = lbAdd [1500,format["%1",_cls call ISSE_Cfg_Vehicle_GetName]]; - lbSetPicture [1500,_idx,_cls call ISSE_Cfg_Vehicle_GetPic]; - lbSetData [1500,_idx,_cls]; - lbSetValue [1500,_idx,_price]; - }foreach(OT_vehicles); - _price = [_town,OT_item_UAV,_standing] call getPrice; - _idx = lbAdd [1500,format["Quadcopter"]]; - lbSetPicture [1500,_idx,OT_item_UAV call ISSE_Cfg_Vehicle_GetPic]; - lbSetData [1500,_idx,OT_item_UAV]; - lbSetValue [1500,_idx,_price]; + [] call buyVehicleDialog; },nil,1.5,true,true,"","alive _target",5]; _civ addAction ["Ask about weapons", { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initGunDealerLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initGunDealerLocal.sqf index 4e0b7a9c..a473a38d 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initGunDealerLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initGunDealerLocal.sqf @@ -4,11 +4,10 @@ _civ addAction ["Buy", { _town = (getpos player) call nearestTown; _stock = server getVariable format["gunstock%1",_town]; - if(isNil "_stock") then { - _basic = cost getVariable OT_item_BasicGun; - _numguns = round(random 5)+3; - _count = 0; - _stock = []; + if(isNil "_stock") then { + _numguns = round(random 7)+3; + _count = 0; + _stock = [[OT_item_BasicGun,25],[OT_item_BasicAmmo,1]]; _tostock = []; while {_count < _numguns} do { _type = OT_allWeapons call BIS_fnc_selectRandom; @@ -48,6 +47,12 @@ _civ addAction ["Buy", { }; }; + { + _cost = cost getVariable _x; + _price = _cost select 0; + _stock pushBack [_x,_price]; + }foreach(OT_allOptics); + _stock pushback [OT_ammo_50cal,25]; { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf index 2e2029b2..204c3110 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf @@ -12,27 +12,15 @@ if(typeof _this == OT_item_Map) then { },nil,0,false,true,"",""]; }; -if(typeof _this == OT_item_Tent) exitWith { - _camp = player getVariable ["camp",objNull]; - if !(isNull _camp) then { - _fire = _camp getVariable "fire"; - deleteVehicle _fire; - deleteVehicle _camp; - }; - _mrkid = format["%1-camp",getplayeruid player]; - createMarkerLocal [_mrkid,getpos _this]; - _mrkid setMarkerPos (getpos _this); - _mrkid setMarkerShape "ICON"; - _mrkid setMarkerType "loc_Bunker"; - _mrkid setMarkerColor "ColorWhite"; - _mrkid setMarkerAlpha 0; - _mrkid setMarkerAlphaLocal 1; - _mrkid setMarkerText "Camp"; - - _pos = [(getpos _this),1.2,getDir _this] call BIS_fnc_relPos; - _fire = "Land_Campfire_F" createVehicle _pos; - _this setVariable ["fire",_fire,false]; - player setvariable ["camp",_this,false]; +if(typeof _this == OT_item_Storage) then { + _this addAction ["Dump Everything", {[player,_this select 0] call dumpStuff},nil,0,false,true,"",""]; + _this addAction ["Save Loadout", "actions\saveLoadout.sqf",nil,0,false,true,"",""]; + _this addAction ["Restore Loadout", "UI\loadoutDialog.sqf",nil,0,false,true,"",""]; +}; +if(typeof _this == OT_item_Safe) then { + _this addAction ["Put Money", "actions\putMoney.sqf",nil,0,false,true,"",""]; + _this addAction ["Take Money", "actions\takeMoney.sqf",nil,0,false,true,"",""]; + _this addAction ["Set Password", "actions\setPassword.sqf",nil,0,false,true,"","(_target getVariable ['owner','']) == getplayeruid _this"]; }; if(typeof _this == "Land_Cargo_House_V4_F") then { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf index ebac8d78..631b96a2 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf @@ -9,14 +9,30 @@ if (_key == 21) then if(count (player nearObjects ["Land_Cargo_House_V4_F",10]) > 0) then { [] call workshopDialog; }else{ - [] spawn menuHandler; - if(count (groupSelectedUnits player) > 0) exitWith { - createDialog "OT_dialog_command"; + if((vehicle player) != player and count (player nearObjects [OT_portBuilding,30]) > 0) then { + createDialog "OT_dialog_vehicleport"; + }else{ + [] spawn menuHandler; + if(count (groupSelectedUnits player) > 0) exitWith { + createDialog "OT_dialog_command"; + }; + if(vehicle player != player) exitWith { + _b = player call getNearestRealEstate; + _iswarehouse = false; + if(typename _b == "ARRAY") then { + _building = _b select 0; + if((typeof _building) == OT_warehouse and _building call hasOwner) then { + _iswarehouse = true; + }; + }; + if(_iswarehouse) then { + createDialog "OT_dialog_vehiclewarehouse"; + }else{ + createDialog "OT_dialog_vehicle"; + }; + }; + [] spawn mainMenu; }; - if(vehicle player != player) exitWith { - createDialog "OT_dialog_vehicle"; - }; - [] spawn mainMenu; }; }else{ closeDialog 0; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm index 8d214e27..5eb8b9ee 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm @@ -8,7 +8,7 @@ class EditorData toggles=522; class ItemIDProvider { - nextID=1860; + nextID=1902; }; class MarkerIDProvider { @@ -16,14 +16,14 @@ class EditorData }; class LayerIndexProvider { - nextID=125; + nextID=139; }; class Camera { - pos[]={11650.592,23.617928,3098.2451}; - dir[]={0.05677253,-0.35712317,0.93245697}; - up[]={0.021715941,0.93395948,0.35664409}; - aside[]={0.99828118,-2.0644948e-006,-0.060783774}; + pos[]={8242.1758,5.1270618,1132.2975}; + dir[]={0.93825758,-0.17957866,-0.29575416}; + up[]={0.17126842,0.98374462,-0.053986907}; + aside[]={-0.30064145,-4.6537025e-008,-0.9537642}; }; }; binarizationWanted=0; @@ -48,13 +48,14 @@ addons[]= "ace_refuel", "ace_repair", "ace_respawn", - "ace_explosives" + "ace_explosives", + "ace_parachute" }; class AddonsMetaData { class List { - items=18; + items=19; class Item0 { className="A3_Modules_F"; @@ -181,6 +182,13 @@ class AddonsMetaData author="ACE-Team"; url="http://ace3mod.com/"; }; + class Item18 + { + className="ace_parachute"; + name="ACE3 - Parachute"; + author="ACE-Team"; + url="http://ace3mod.com/"; + }; }; }; randomSeed=2938931; @@ -639,7 +647,7 @@ class Mission }; class Entities { - items=73; + items=75; class Item0 { dataType="Logic"; @@ -656,12 +664,12 @@ class Mission dataType="Logic"; class PositionInfo { - position[]={6964.0986,2.6599121,7372.5869}; + position[]={6951.3999,2.6601276,7369.8564}; }; name="spawner"; id=170; type="Logic"; - atlOffset=-8.7976456e-005; + atlOffset=0.00012755394; }; class Item2 { @@ -1169,7 +1177,7 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12432.01,142.51147,1944.7036}; + position[]={8257.9717,2.235322,1132.2445}; angles[]={0,2.4981525,0}; }; side="Independent"; @@ -1199,7 +1207,7 @@ class Mission }; id=1719; type="I_G_Soldier_F"; - atlOffset=1.1268005; + atlOffset=0.26118183; class CustomAttributes { class Attribute0 @@ -1343,7 +1351,7 @@ class Mission { }; id=1718; - atlOffset=1.1268005; + atlOffset=0.26118183; }; class Item28 { @@ -2378,22 +2386,22 @@ class Mission dataType="Logic"; class PositionInfo { - position[]={12432.561,142.69208,1943.8542}; + position[]={8260.1895,2.2602558,1131.5494}; }; id=1778; type="HighCommand"; - atlOffset=1.0883942; + atlOffset=0.19563913; }; class Item38 { dataType="Logic"; class PositionInfo { - position[]={12430.65,143.12283,1942.6661}; + position[]={8260.5811,1.6100495,1129.7875}; }; id=1779; type="HighCommand"; - atlOffset=0.77326965; + atlOffset=-0.20714045; }; class Item39 { @@ -2407,7 +2415,7 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12429.896,142.71075,1943.6604}; + position[]={8258.2617,2.2789326,1130.9398}; angles[]={0,2.5596125,0}; }; side="Independent"; @@ -2437,7 +2445,7 @@ class Mission }; id=1713; type="I_G_Soldier_F"; - atlOffset=0.56637573; + atlOffset=0.45641577; class CustomAttributes { class Attribute0 @@ -2581,17 +2589,18 @@ class Mission { }; id=1712; - atlOffset=0.56637573; + atlOffset=0.45641577; }; class Item40 { dataType="Logic"; class PositionInfo { - position[]={12428.884,143.6432,1937.9398}; + position[]={8258.8145,1.7369285,1125.0612}; }; id=1780; type="HighCommand"; + atlOffset=0.51213205; }; class Item41 { @@ -2605,7 +2614,7 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12427.28,144.00064,1940.5491}; + position[]={8257.2109,1.854847,1127.6704}; angles[]={0,2.5596125,0}; }; side="Independent"; @@ -2636,7 +2645,7 @@ class Mission }; id=1711; type="I_G_Soldier_F"; - atlOffset=0.76300049; + atlOffset=0.4326787; class CustomAttributes { class Attribute0 @@ -2780,7 +2789,7 @@ class Mission { }; id=49; - atlOffset=0.76300049; + atlOffset=0.4326787; class CustomAttributes { class Attribute0 @@ -2817,7 +2826,7 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12425.829,142.89973,1942.9515}; + position[]={8256.9805,1.7166214,1129.9745}; angles[]={0,2.4981525,0}; }; side="Independent"; @@ -2847,7 +2856,7 @@ class Mission }; id=1782; type="I_G_Soldier_F"; - atlOffset=0.091491699; + atlOffset=0.055262446; class CustomAttributes { class Attribute0 @@ -2991,18 +3000,18 @@ class Mission { }; id=1781; - atlOffset=0.091491699; + atlOffset=0.055262446; }; class Item43 { dataType="Logic"; class PositionInfo { - position[]={12426.38,143.08034,1942.1022}; + position[]={8256.3105,1.5675538,1129.2235}; }; id=1783; type="HighCommand"; - atlOffset=0.11779785; + atlOffset=-0.022015929; }; class Item44 { @@ -3016,7 +3025,7 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12424.501,143.45351,1940.6622}; + position[]={8254.4316,1.5472312,1127.7836}; angles[]={0,2.4981525,0}; }; side="Independent"; @@ -3046,7 +3055,7 @@ class Mission }; id=1785; type="I_G_Soldier_F"; - atlOffset=0.057937622; + atlOffset=0.053429604; class CustomAttributes { class Attribute0 @@ -3190,18 +3199,18 @@ class Mission { }; id=1784; - atlOffset=0.057937622; + atlOffset=0.053429604; }; class Item45 { dataType="Logic"; class PositionInfo { - position[]={12425.052,143.63411,1939.8129}; + position[]={8254.9824,1.7278342,1126.9342}; }; id=1786; type="HighCommand"; - atlOffset=0.12416077; + atlOffset=0.32050335; }; class Item46 { @@ -3215,7 +3224,7 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12428.037,141.86743,1945.5441}; + position[]={8256.2539,1.9761378,1133.2538}; angles[]={0,2.4981525,0}; }; side="Independent"; @@ -3245,7 +3254,7 @@ class Mission }; id=1788; type="I_G_Soldier_F"; - atlOffset=0.092666626; + atlOffset=-0.087297559; class CustomAttributes { class Attribute0 @@ -3389,18 +3398,18 @@ class Mission { }; id=1787; - atlOffset=0.092666626; + atlOffset=-0.087297559; }; class Item47 { dataType="Logic"; class PositionInfo { - position[]={12428.588,142.04803,1944.6947}; + position[]={8256.2168,1.6162128,1132.3899}; }; id=1789; type="HighCommand"; - atlOffset=0.089279175; + atlOffset=-0.34002137; }; class Item48 { @@ -3414,7 +3423,7 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12424.552,143.70006,1937.8154}; + position[]={8254.4824,1.3515821,1124.9368}; angles[]={0,2.4981525,0}; }; side="Independent"; @@ -3444,7 +3453,7 @@ class Mission }; id=1791; type="I_G_Soldier_F"; - atlOffset=-0.014633179; + atlOffset=0.108729; class CustomAttributes { class Attribute0 @@ -3588,18 +3597,18 @@ class Mission { }; id=1790; - atlOffset=-0.014633179; + atlOffset=0.108729; }; class Item49 { dataType="Logic"; class PositionInfo { - position[]={12425.103,143.88066,1936.9661}; + position[]={8255.0332,1.9743857,1124.0874}; }; id=1792; type="HighCommand"; - atlOffset=0.1966095; + atlOffset=0.81161845; }; class Item50 { @@ -3613,7 +3622,7 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12423.053,143.67563,1939.6907}; + position[]={8252.9834,1.5238681,1126.812}; angles[]={0,2.4981525,0}; }; side="Independent"; @@ -3643,7 +3652,7 @@ class Mission }; id=1794; type="I_G_Soldier_F"; - atlOffset=0.056503296; + atlOffset=0.14028168; class CustomAttributes { class Attribute0 @@ -3787,18 +3796,18 @@ class Mission { }; id=1793; - atlOffset=0.056503296; + atlOffset=0.14028168; }; class Item51 { dataType="Logic"; class PositionInfo { - position[]={12423.604,143.85623,1938.8413}; + position[]={8253.5342,1.9499564,1125.9626}; }; id=1795; type="HighCommand"; - atlOffset=0.13182068; + atlOffset=0.6072892; }; class Item52 { @@ -3812,7 +3821,7 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12423.523,143.13379,1942.749}; + position[]={8250.415,1.6760843,1130.4153}; angles[]={0,2.4981525,0}; }; side="Independent"; @@ -3842,7 +3851,7 @@ class Mission }; id=1797; type="I_G_Soldier_F"; - atlOffset=0.077392578; + atlOffset=0.12352729; class CustomAttributes { class Attribute0 @@ -3986,18 +3995,18 @@ class Mission { }; id=1796; - atlOffset=0.077392578; + atlOffset=0.12352729; }; class Item53 { dataType="Logic"; class PositionInfo { - position[]={12424.074,143.31439,1941.8997}; + position[]={8254.0049,1.8016083,1129.021}; }; id=1798; type="HighCommand"; - atlOffset=0.12409973; + atlOffset=0.18175387; }; class Item54 { @@ -4011,7 +4020,7 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12426.016,141.81244,1946.4591}; + position[]={8253.6445,1.3806171,1134.1543}; angles[]={0,2.4981525,0}; }; side="Independent"; @@ -4041,7 +4050,7 @@ class Mission }; id=1800; type="I_G_Soldier_F"; - atlOffset=0.11477661; + atlOffset=-0.77034903; class CustomAttributes { class Attribute0 @@ -4185,18 +4194,18 @@ class Mission { }; id=1799; - atlOffset=0.11477661; + atlOffset=-0.77034903; }; class Item55 { dataType="Logic"; class PositionInfo { - position[]={12426.566,141.99304,1945.6097}; + position[]={8254.1953,1.5612202,1133.3049}; }; id=1801; type="HighCommand"; - atlOffset=0.087097168; + atlOffset=-0.4975307; }; class Item56 { @@ -4210,7 +4219,7 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12430.948,140.58051,1947.2827}; + position[]={8258.5771,0.14868355,1134.9779}; angles[]={0,2.4981525,0}; }; side="Independent"; @@ -4240,7 +4249,7 @@ class Mission }; id=1803; type="I_G_Soldier_F"; - atlOffset=0.14581299; + atlOffset=-2.4196291; class CustomAttributes { class Attribute0 @@ -4384,18 +4393,18 @@ class Mission { }; id=1802; - atlOffset=0.14581299; + atlOffset=-2.4196291; }; class Item57 { dataType="Logic"; class PositionInfo { - position[]={12431.499,140.76111,1946.4333}; + position[]={8259.1279,0.32928658,1134.1285}; }; id=1804; type="HighCommand"; - atlOffset=0.035614014; + atlOffset=-2.1241059; }; class Item58 { @@ -4409,11 +4418,11 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12428.088,142.46356,1943.6302}; + position[]={8257.6729,1.984525,1129.015}; angles[]={0,2.4981525,0}; }; side="Independent"; - flags=6; + flags=2; class Attributes { init="this setCaptive true;"; @@ -4439,7 +4448,7 @@ class Mission }; id=1806; type="I_G_Soldier_F"; - atlOffset=0.092712402; + atlOffset=0.42794144; class CustomAttributes { class Attribute0 @@ -4583,18 +4592,18 @@ class Mission { }; id=1805; - atlOffset=0.092712402; + atlOffset=0.42794144; }; class Item59 { dataType="Logic"; class PositionInfo { - position[]={12428.639,142.64417,1942.7809}; + position[]={8258.5049,1.6877265,1131.4136}; }; id=1807; type="HighCommand"; - atlOffset=0.089279175; + atlOffset=-0.20994258; }; class Item60 { @@ -4608,11 +4617,11 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12426.545,143.52431,1939.7998}; + position[]={8256.4756,1.618032,1126.9211}; angles[]={0,2.4981525,0}; }; side="Independent"; - flags=6; + flags=2; class Attributes { init="this setCaptive true;"; @@ -4638,7 +4647,7 @@ class Mission }; id=1809; type="I_G_Soldier_F"; - atlOffset=0.060073853; + atlOffset=0.2501204; class CustomAttributes { class Attribute0 @@ -4782,18 +4791,18 @@ class Mission { }; id=1808; - atlOffset=0.060073853; + atlOffset=0.2501204; }; class Item61 { dataType="Logic"; class PositionInfo { - position[]={12427.096,143.70491,1938.9504}; + position[]={8257.0264,1.798635,1126.0718}; }; id=1810; type="HighCommand"; - atlOffset=0.12405396; + atlOffset=0.51849771; }; class Item62 { @@ -4807,7 +4816,7 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12421.654,143.48976,1937.8292}; + position[]={8251.585,1.2179973,1124.9506}; angles[]={0,2.4981525,0}; }; side="Independent"; @@ -4837,7 +4846,7 @@ class Mission }; id=1812; type="I_G_Soldier_F"; - atlOffset=-0.015441895; + atlOffset=0.07810235; class CustomAttributes { class Attribute0 @@ -4981,18 +4990,18 @@ class Mission { }; id=1811; - atlOffset=-0.015441895; + atlOffset=0.07810235; }; class Item63 { dataType="Logic"; class PositionInfo { - position[]={12422.205,143.67036,1936.9799}; + position[]={8252.1357,1.7640891,1124.1012}; }; id=1813; type="HighCommand"; - atlOffset=0.19732666; + atlOffset=0.67794251; }; class Item64 { @@ -5006,7 +5015,7 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12421.342,143.48177,1941.0923}; + position[]={8251.2725,1.5754905,1128.2136}; angles[]={0,2.4981525,0}; }; side="Independent"; @@ -5036,7 +5045,7 @@ class Mission }; id=1815; type="I_G_Soldier_F"; - atlOffset=0.042068481; + atlOffset=0.16438985; class CustomAttributes { class Attribute0 @@ -5180,18 +5189,18 @@ class Mission { }; id=1814; - atlOffset=0.042068481; + atlOffset=0.16438985; }; class Item65 { dataType="Logic"; class PositionInfo { - position[]={12421.893,143.66237,1940.2429}; + position[]={8251.7568,1.7560935,1127.3945}; }; id=1816; type="HighCommand"; - atlOffset=0.13964844; + atlOffset=0.38698578; }; class Item66 { @@ -5205,7 +5214,7 @@ class Mission dataType="Object"; class PositionInfo { - position[]={12421.403,143.00854,1943.6097}; + position[]={8250.7959,1.6243865,1131.4795}; angles[]={0,2.4981525,0}; }; side="Independent"; @@ -5235,7 +5244,7 @@ class Mission }; id=1818; type="I_G_Soldier_F"; - atlOffset=0.098114014; + atlOffset=-0.040309191; class CustomAttributes { class Attribute0 @@ -5379,18 +5388,18 @@ class Mission { }; id=1817; - atlOffset=0.098114014; + atlOffset=-0.040309191; }; class Item67 { dataType="Logic"; class PositionInfo { - position[]={12421.954,143.18915,1942.7604}; + position[]={8251.8848,1.6763642,1129.8817}; }; id=1819; type="HighCommand"; - atlOffset=0.084091187; + atlOffset=0.084218144; }; class Item68 { @@ -5729,6 +5738,33 @@ class Mission nAttributes=3; }; }; + class Item73 + { + dataType="Logic"; + class PositionInfo + { + position[]={6951.25,2.6600001,7365.313}; + }; + name="warehouse"; + id=1860; + type="Logic"; + }; + class Item74 + { + dataType="Object"; + class PositionInfo + { + position[]={10886.197,265.15662,-825.25891}; + angles[]={0,0,6.2511969}; + }; + side="Empty"; + class Attributes + { + }; + id=1900; + type="ACE_NonSteerableParachute"; + atlOffset=329.91495; + }; }; class Connections { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/onPlayerRespawn.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/onPlayerRespawn.sqf index 13f559a6..f4a44172 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/onPlayerRespawn.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/onPlayerRespawn.sqf @@ -10,6 +10,12 @@ waitUntil {alive player}; player setCaptive true; player allowDamage false; +private _money = player getVariable ["money",0]; +private _take = floor(_money * 0.25); +if(_take > 0) then { + [-_take] call money; +}; + removeHeadgear player; removeAllWeapons player; removeAllAssignedItems player; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/propagandaSystem.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/propagandaSystem.sqf index b933ecdf..dcda376c 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/propagandaSystem.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/propagandaSystem.sqf @@ -4,12 +4,17 @@ waitUntil {sleep 1;server getVariable ["StartupType",""] != ""}; sleep 20; while {true} do { _lasthour = date select 3; + _totalStability = 0; + _totalPop = 0; private _abandoned = server getVariable ["NATOabandoned",[]]; { private _town = _x; private _townPos = server getVariable _town; private _commsAbandoned = ((_townPos call nearestComms) select 1) in _abandoned; private _stability = server getVariable format["stability%1",_town]; + private _pop = server getVariable format["population%1",_town]; + _totalStability = _totalStability + _stability; + _totalPop = _totalPop + _pop; if(_town in _abandoned) then { if(_commsAbandoned) then { //Resistance controls both, stability goes up if theres police @@ -35,5 +40,8 @@ while {true} do { }; }; }foreach(OT_allTowns); + server setVariable ["stabilityTanoa",_totalStability / (count OT_allTowns),true]; + server setVariable ["populationTanoa",_totalPop,true]; waitUntil {sleep 5;(date select 3) != _lasthour}; //do actions on the hour -}; \ No newline at end of file +}; + diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/setupPlayer.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/setupPlayer.sqf index e502b63d..07321310 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/setupPlayer.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/setupPlayer.sqf @@ -33,15 +33,17 @@ player setVariable ["player_uid",getPlayerUID player,true]; _closestcount = 0; -while {true} do { +while {alive player} do { sleep 2; if(_closestcount <= 0) then { _closest = (getPos player) call nearestTown; - if(_closest != _town) then { - _closest call townChange; - _closestcount = 20; - }; + if !(isNil "_closest") then { + if(_closest != _town) then { + _closest call townChange; + _closestcount = 60; + }; + }; }; _closestcount = _closestcount - 2; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/ambientVehicles.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/ambientVehicles.sqf index bbcbdccf..5fa51489 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/ambientVehicles.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/ambientVehicles.sqf @@ -62,12 +62,11 @@ while {(_count < _numVeh)} do { _wp setWaypointSpeed "LIMITED"; _wp setWaypointBehaviour "SAFE"; _wp setWaypointCompletionRadius 60; - _wp setWaypointStatements ["true","unassignvehicle this;moveout this;(group this) call civilianGroup;[vehicle this] execVM 'funcs\cleanup.sqf'"]; + _wp setWaypointStatements ["true","unassignvehicle this;moveout this;(group this) call civilianGroup;[vehicle this] execVM 'funcs\cleanup.sqf';[this] execVM 'funcs\cleanup.sqf'"]; }else{ _groups pushBack _veh; }; - _count = _count + 1; - sleep 0.1; + _count = _count + 1; }; }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/carDealer.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/carDealer.sqf index e9fc2cb1..de02ff72 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/carDealer.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/carDealer.sqf @@ -18,7 +18,6 @@ _groups = [_group]; _t = _pos call nearestTown; if(_t == _town) then { _tracked = _building call spawnTemplate; - sleep 0.2; _vehs = _tracked select 0; [_groups,_vehs] call BIS_fnc_arrayPushStack; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/civ.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/civ.sqf index 8904caf4..a8d14410 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/civ.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/civ.sqf @@ -70,10 +70,8 @@ while {_count < _numCiv} do { _civ setBehaviour "SAFE"; [_civ] call initCivilian; _count = _count + 1; - _groupcount = _groupcount + 1; - sleep 0.1; + _groupcount = _groupcount + 1; }; _group spawn civilianGroup; - sleep (0.01 * _pergroup); }; _groups \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/criminal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/criminal.sqf index 6e021338..7ee8fd82 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/criminal.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/criminal.sqf @@ -48,8 +48,7 @@ if(_numCRIM > 0) then { _civ setBehaviour "SAFE"; _wp = _group addWaypoint [_leaderpos,0]; - _wp setWaypointType "GUARD"; - sleep 0.1; + _wp setWaypointType "GUARD"; }else{ _start = [[[_posTown,150]]] call BIS_fnc_randomPos; _group setBehaviour "CARELESS"; @@ -90,7 +89,6 @@ if(_numCRIM > 0) then { _civ setBehaviour "SAFE"; _count = _count + 1; - sleep 0.1; }; { _x addCuratorEditableObjects [units _group,true]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/distribution.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/distribution.sqf index 36bf9f23..243fd123 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/distribution.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/distribution.sqf @@ -10,31 +10,13 @@ _groups = []; _stock = _x select 1; _building = nearestBuilding _pos; - _security = server getvariable format["garrison%1",_pos]; + _bdgid = [_building] call fnc_getBuildID; + _security = server getvariable format["garrison%1",_bdgid]; - //Parked truck - _vehtype = OT_vehType_distro; - _start = [_pos,11,(getDir _building)-155] call BIS_fnc_relPos; - _posVeh = _start findEmptyPosition [0,15,_vehtype]; - _veh = _building getVariable "truck"; - if(count _posVeh > 0 and isNil("_veh")) then { - _veh = _vehtype createVehicle _posVeh; - clearItemCargoGlobal _veh; - - _veh setDir (getDir _building)-90; - _groups pushBack _veh; - _building setVariable ["truck",_veh,false]; - _veh setVariable ["distro",_building,false]; - _veh addEventHandler ["Take",{ - _unit setCaptive false; - }]; - }; - sleep 0.1; if(_hour > 18 or _hour < 8) then { //Put a light on - sleep 0.1; _lightpos = getpos _building; _light = "#lightpoint" createVehicle [_lightpos select 0,_lightpos select 1,(_lightpos select 2)+4]; _light setLightBrightness 0.2; @@ -50,9 +32,9 @@ _groups = []; _start = [[[_pos,50]]] call BIS_fnc_randomPos; _civ = _group createUnit [OT_NATO_Unit_Police, _start, [],0, "NONE"]; _civ setBehaviour "SAFE"; - [_civ,_building] spawn initSecurity; - _count = _count + 1; - sleep 0.1; + [_civ,_building] spawn initSecurity; + _civ setVariable ["garrison",_bdgid,true]; + _count = _count + 1; }; _wp = _group addWaypoint [_pos,5]; @@ -67,7 +49,7 @@ _groups = []; _veh = _vehtype createVehicle _pos; clearItemCargoGlobal _veh; _veh setDir (getDir _building); - _veh setVariable ["stockof",_building]; + _veh setVariable ["stockof",_bdgid,true]; _veh addEventHandler ["ContainerOpened",illegalContainerOpened]; if(OT_hasAce) then { @@ -82,7 +64,6 @@ _groups = []; }else{ _veh addItemCargoGlobal _x; }; - sleep 0.1; }foreach(_stock); }foreach(_activeshops); diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/newLeader.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/newLeader.sqf index 927360f2..6e8b5efa 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/newLeader.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/newLeader.sqf @@ -4,10 +4,18 @@ private ["_pos","_town","_townPos","_drop","_group","_start","_stability","_veht _leaderpos = _this select 0; _numcrim = 2 + (random 4); -_town = _this select 2; +_town = _this select 1; _townPos = server getVariable _town; +_region = server getVariable format["region_%1",_town]; +_mob = _townPos call nearestMobster; +_mobpos = _mob select 0; +if !([_mobpos,_region] call fnc_isInMarker) exitWith {}; + server setVariable [format["numcrims%1",_town],_numcrim,false]; +server setVariable [format["crimleader%1",_town],_leaderpos,false]; + +if !(_leaderpos call inSpawnDistance) exitWith {}; _mob = _townPos call nearestMobster; _mobpos = _mob select 0; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/reGarrisonTown.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/reGarrisonTown.sqf index ed9a41ac..8a6b801d 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/reGarrisonTown.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/reGarrisonTown.sqf @@ -6,6 +6,7 @@ private _region = server getVariable format["region_%1",_town]; private _police = []; private _support = []; +private _groups = []; private _close = nil; private _dist = 8000; @@ -25,8 +26,13 @@ private _abandoned = server getVariable["NATOabandoned",[]]; }foreach(OT_NATOobjectives); if(!isNil "_close") then { + _current = server setVariable [format ["garrison%1",_x],0]; + server setVariable [format ["garrison%1",_x],_current+2,true]; + if !(_townPos call inSpawnDistance) exitWith {}; + _start = [_close,0,200, 1, 0, 0, 0] call BIS_fnc_findSafePos; _group = creategroup blufor; + _groups pushback _group; _tgroup = creategroup blufor; _spawnpos = _start findEmptyPosition [0,100,OT_NATO_Vehicle_Police]; @@ -48,6 +54,7 @@ if(!isNil "_close") then { [_civ,_town] call initGendarm; _civ setBehaviour "SAFE"; sleep 0.01; + _start = [_start, 0, 20, 1, 0, 0, 0] call BIS_fnc_findSafePos; _civ = _group createUnit [OT_NATO_Unit_Police, _start, [],0, "NONE"]; @@ -84,9 +91,11 @@ if(!isNil "_close") then { _x addCuratorEditableObjects [_police+_support,true]; } forEach allCurators; - [3,_townPos,format["%1 Reinforcements",_town],format["Intelligence reports that NATO is reinforcing the garrison in %1. %2 personnel were spotted departing %3 in an offroad.",_town,2,_closest]] remoteExec ["intelEvent",0,false]; + [3,_drop,format["%1 Reinforcements",_town],format["Intelligence reports that NATO is reinforcing the garrison in %1. %2 personnel were spotted departing %3 in an offroad and are currently enroute to the marked location.",_town,2,_closest]] remoteExec ["intelEvent",0,false]; +}else{ + [_town,-4] call stability; }; -_police+_support; \ No newline at end of file +_groups \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/sendCrims.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/sendCrims.sqf index c45d3fbd..9666ad75 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/sendCrims.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/sendCrims.sqf @@ -5,8 +5,13 @@ _numcrim = _this select 1; _town = _this select 2; _townPos = server getVariable _town; +_region = server getVariable format["region_%1",_town]; _mob = _townPos call nearestMobster; _mobpos = _mob select 0; +if !([_mobpos,_region] call fnc_isInMarker) exitWith {[_town,1] call stability}; + +_num = server getVariable [format ["numcrims%1",_town],0]; +server setVariable [format ["numcrims%1",_town],_num + _numcrim,false]; _group = creategroup east; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryCheckpoint.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryCheckpoint.sqf index b3a3083b..c7feebfb 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryCheckpoint.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryCheckpoint.sqf @@ -1,111 +1,67 @@ -private ["_id","_town","_posTown","_active","_groups","_soldiers","_numNATO","_pop","_count","_range"]; -if (!isServer) exitwith {}; +params ["_start","_name"]; -_active = false; +private _count = 0; -_count = 0; -_id = _this select 0; -_start = _this select 1; -_name = _this select 3; +private _numNATO = server getVariable format["garrison%1",_name]; +if(_numNATO <= 0) exitWith {[]}; -_groups = []; -_soldiers = []; //Stores all soldiers for tear down -_vehs = []; -waitUntil{spawner getVariable _id}; +private _road = [_start] call BIS_fnc_nearestRoad; +private _start = getPos _road; +private _vehtype = OT_vehTypes_civ call BIS_Fnc_selectRandom; -while{true} do { - //Do any updates here that should happen whether spawned or not - if(_name in (server getVariable "NATOabandoned")) exitWith{}; - - //Main spawner - if !(_active) then { - if (spawner getVariable _id) then { - _active = true; - //Spawn stuff in +private _roadscon = roadsConnectedto _road; +private _dir = [_road, _roadscon select 0] call BIS_fnc_DirTo; - _road = [_start] call BIS_fnc_nearestRoad; - _start = getPos _road; - _vehtype = OT_vehTypes_civ call BIS_Fnc_selectRandom; - - _roadscon = roadsConnectedto _road; - _dir = [_road, _roadscon select 0] call BIS_fnc_DirTo; - - _vehs = [_start,_dir,template_checkpoint] call BIS_fnc_objectsMapper; - - _numNATO = server getVariable format["garrison%1",_name]; - if(isNil "_numNATO") then { - //New checkpoint was added to game - _numNATO = 4 + (random 4); - server setVariable [format["garrison%1",_name],_numNATO,true]; - }; - - _count = 0; - _range = 100; - _groupcount = 0; - - _group = createGroup blufor; - _groups pushBack _group; - _groupcount = 1; - - _start = [_start,12,_dir+90] call BIS_fnc_relPos; - - _civ = _group createUnit [OT_NATO_Unit_LevelOneLeader, _start, [],0, "NONE"]; - _civ setVariable ["garrison",_name,false]; - _civ setRank "MAJOR"; - _soldiers pushBack _civ; - [_civ,_name] call initMilitary; - _civ setBehaviour "SAFE"; +private _vehs = [_start,_dir,template_checkpoint] call BIS_fnc_objectsMapper; - { - if(typeof _x in OT_staticMachineGuns) then { - _group addVehicle _x; - }; - }foreach(_vehs); - - _count = _count + 1; - sleep 0.1; - while {(spawner getVariable _id) and (_count < _numNATO)} do { - _pos = [_start,0,60, 0.1, 0, 0, 0] call BIS_fnc_findSafePos; - _civ = _group createUnit [OT_NATO_Units_LevelTwo call BIS_fnc_selectRandom, _pos, [],0, "NONE"]; - _civ setVariable ["garrison",_name,false]; - _soldiers pushBack _civ; - _civ setRank "CAPTAIN"; - [_civ,_name] call initMilitary; - _civ setBehaviour "SAFE"; - - sleep 0.1; - _count = _count + 1; - _groupcount = _groupcount + 1; - }; - _group call initCheckpoint; +private _groups = []; +private _soldiers = []; - - sleep 1; - { - _x setDamage 0; - }foreach(_soldiers); - }; - }else{ - if (spawner getVariable _id) then { - //Do updates here that should happen only while spawned - //... - }else{ - _active = false; - //Tear it all down - { - deleteVehicle _x; - }foreach(_soldiers); - { - if!(_x call hasOwner) then { - deleteVehicle _x; - }; - }foreach(_vehs); - { - deleteGroup _x; - }foreach(_groups); - _soldiers = []; - }; +if(isNil "_numNATO") then { + //New checkpoint was added to game + _numNATO = 6 + (random 4); + server setVariable [format["garrison%1",_name],_numNATO,true]; +}; + +_count = 0; +_range = 100; +_groupcount = 0; + +_group = createGroup blufor; +_groups pushBack _group; +_groupcount = 1; + +_start = [_start,12,_dir+90] call BIS_fnc_relPos; + +_civ = _group createUnit [OT_NATO_Unit_LevelOneLeader, _start, [],0, "NONE"]; +_civ setVariable ["garrison",_name,false]; +_civ setRank "MAJOR"; +_soldiers pushBack _civ; +[_civ,_name] call initMilitary; +_civ setBehaviour "SAFE"; + +{ + if(typeof _x in OT_staticMachineGuns) then { + _group addVehicle _x; }; - sleep 1; -}; \ No newline at end of file + _groups pushback _x; +}foreach(_vehs); + +_count = _count + 1; + +while {_count < _numNATO} do { + _pos = [_start,0,60, 0.1, 0, 0, 0] call BIS_fnc_findSafePos; + _civ = _group createUnit [OT_NATO_Units_LevelTwo call BIS_fnc_selectRandom, _pos, [],0, "NONE"]; + _civ setVariable ["garrison",_name,false]; + _soldiers pushBack _civ; + _civ setRank "CAPTAIN"; + [_civ,_name] call initMilitary; + _civ setBehaviour "SAFE"; + + _count = _count + 1; + _groupcount = _groupcount + 1; +}; +_group spawn initCheckpoint; + +_groups \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf index a2ea895f..05ff7179 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf @@ -1,236 +1,183 @@ -private ["_id","_town","_posTown","_active","_groups","_numNATO","_pop","_count","_range"]; -if (!isServer) exitwith {}; +params ["_posTown","_name"]; -_active = false; +private _count = 0; +private _groups = []; +_numNATO = server getVariable format["garrison%1",_name]; +if(_name in (server getVariable ["NATOabandoned",[]])) exitWith {[]}; + +//Make sure the first group spawned in at a comms base are a sniper, spotter, AA specialist and AA assistant _count = 0; -_id = _this select 0; -_posTown = _this select 1; -_name = _this select 3; +if(_name find "Comms" == 0) then { + _tower = nearestObjects [_posTown,OT_NATO_CommTowers,100] select 0; + _posTown = getpos _tower; + + _group = createGroup blufor; + _groups pushBack _group; + + _civ = _group createUnit [OT_NATO_Unit_Sniper, _posTown, [],0, "NONE"]; + _civ setVariable ["garrison",_name,false]; + _civ setRank "CAPTAIN"; + [_civ,_name] call initSniper; + _civ setBehaviour "SAFE"; + _civ action ["ladderOnUp", _tower, 0, 0]; + + _count = _count + 1; + + if(_count < _numNATO) then { + _civ = _group createUnit [OT_NATO_Unit_Spotter, _posTown, [],0, "NONE"]; + _civ setVariable ["garrison",_name,false]; + _civ setRank "CAPTAIN"; + _civ setVariable ["VCOM_NOPATHING_Unit",true,false]; + [_civ,_name] call initSniper; + _civ setBehaviour "SAFE"; + _civ action ["ladderOnUp", _tower, 0, 0]; + _count = _count + 1; + }; + + if(_count < _numNATO) then { + _group = createGroup blufor; + _groups pushBack _group; + _start = [[[_posTown,150]]] call BIS_fnc_randomPos; + _civ = _group createUnit [OT_NATO_Unit_AA_spec, _start, [],0, "NONE"]; + _civ setVariable ["garrison",_name,false]; + _civ setRank "CAPTAIN"; + _civ setVariable ["VCOM_NOPATHING_Unit",true,false]; + [_civ,_name] call initMilitary; + _civ setBehaviour "SAFE"; + _count = _count + 1; + + _wp = _group addWaypoint [getpos _tower,0]; + _wp setWaypointType "GUARD"; + _wp setWaypointBehaviour "SAFE"; + _wp setWaypointSpeed "LIMITED"; + + }; + + if(_count < _numNATO) then { + _start = [[[_posTown,150]]] call BIS_fnc_randomPos; + _civ = _group createUnit [OT_NATO_Unit_AA_ass, _start, [],0, "NONE"]; + _civ setVariable ["garrison",_name,false]; + _civ setRank "CAPTAIN"; + _civ setVariable ["VCOM_NOPATHING_Unit",true,false]; + [_civ,_name] call initMilitary; + _civ setBehaviour "SAFE"; + _count = _count + 1; + }; + +}else{ + //put up a flag + _flag = OT_flag_NATO createVehicle _posTown; + _groups pushback _flag; +}; -_groups = []; +_range = 100; +_groupcount = 0; +while {_count < _numNATO} do { + _start = [[[_posTown,150]]] call BIS_fnc_randomPos; + _group = createGroup blufor; + _groups pushBack _group; + _groupcount = 1; + + _civ = _group createUnit [OT_NATO_Unit_LevelOneLeader, _start, [],0, "NONE"]; + _civ setVariable ["garrison",_name,false]; + _civ setRank "CAPTAIN"; + _civ setVariable ["VCOM_NOPATHING_Unit",true,false]; + [_civ,_name] call initMilitary; + _civ setBehaviour "SAFE"; + + _count = _count + 1; + while {(_count < _numNATO) and (_groupcount < 8)} do { + _start = [_start,0,40, 1, 0, 0, 0] call BIS_fnc_findSafePos; + + _civ = _group createUnit [OT_NATO_Units_LevelOne call BIS_fnc_selectRandom, _start, [],0, "NONE"]; + _civ setVariable ["garrison",_name,false]; + _civ setRank "LIEUTENANT"; + _civ setVariable ["VCOM_NOPATHING_Unit",true,false]; + [_civ,_name] call initMilitary; + _civ setBehaviour "SAFE"; + + + _count = _count + 1; + _groupcount = _groupcount + 1; + }; + _group call initMilitaryPatrol; + _range = _range + 50; +}; + -waitUntil{spawner getVariable _id}; +_pos = []; +_dir = 0; +_terminal = nearestobjects [_posTown,OT_airportTerminals,350]; +if(count _terminal > 0) then { + _tp = getpos (_terminal select 0); + _dir = getdir (_terminal select 0); + _dist = 35; + if(typeof (_terminal select 0) == "Land_Hangar_F") then { + _dir = _dir + 180; + _dist = 50; + }; + _pos = [_tp,_dist,_dir] call BIS_fnc_relPos; + _pos = [_pos,100,_dir-90] call BIS_fnc_relPos; +}else{ + _dir = 80; + _pos = [_posTown,20,_dir] call BIS_fnc_relPos; + _pos = [_pos,130,_dir-90] call BIS_fnc_relPos; +}; +_airgarrison = server getVariable [format["airgarrison%1",_name],[]]; +{ + _vehtype = _x; + + _pos = [_pos,42,_dir+90] call BIS_fnc_relPos; + + _veh = _vehtype createVehicle _pos; + _veh setVariable ["airgarrison",_name,false]; + + _veh setDir _dir; + + _groups pushback _veh; +}foreach(_airgarrison); -while{true} do { - //Do any updates here that should happen whether spawned or not - if(_name in (server getVariable "NATOabandoned")) exitWith{}; +_vehgarrison = server getVariable [format["vehgarrison%1",_name],[]]; +_pos = []; +_road = objNull; +{ + _vgroup = creategroup blufor; + _groups pushback _vgroup; + _vehtype = _x; + _dir = 0; + _got = false; + if(_vehtype in OT_staticWeapons) then { + _pos = _posTown findEmptyPosition [10,50,_vehtype]; + _dir = [_posTown,_pos] call BIS_fnc_dirTo; + _p = [_pos,1.5,_dir] call BIS_fnc_relPos; + _veh = "Land_BagFence_Round_F" createVehicle _p; + _veh setpos _p; + _veh setDir (_dir-180); + _groups pushback _veh; + _p = [_pos,-1.5,_dir] call BIS_fnc_relPos; + _veh = "Land_BagFence_Round_F" createVehicle _p; + _veh setpos _p; + _veh setDir (_dir); + _groups pushback _veh; + }else{ + _pos = [_posTown, 10, 100, 10, 0, 0.3, 0] call BIS_Fnc_findSafePos; + _dir = random 360; + }; + _veh = _vehtype createVehicle _pos; + _veh setpos _pos; + _veh setVariable ["vehgarrison",_name,false]; - //Main spawner - if !(_active) then { - if (spawner getVariable _id) then { - _active = true; - //Spawn stuff in - - _numNATO = server getVariable format["garrison%1",_name]; - if(_numNATO == 0) exitWith {}; - - //Make sure the first group spawned in at a comms base are a sniper, spotter, AA specialist and AA assistant - _count = 0; - if(_name find "Comms" == 0) then { - _tower = nearestObjects [_posTown,OT_NATO_CommTowers,100] select 0; - _posTown = getpos _tower; - - _group = createGroup blufor; - _groups pushBack _group; - - _civ = _group createUnit [OT_NATO_Unit_Sniper, _posTown, [],0, "NONE"]; - _civ setVariable ["garrison",_name,false]; - _civ setRank "CAPTAIN"; - [_civ,_name] call initSniper; - _civ setBehaviour "SAFE"; - _civ action ["ladderOnUp", _tower, 0, 0]; - - _count = _count + 1; - - if(_count < _numNATO) then { - sleep 2; - _civ = _group createUnit [OT_NATO_Unit_Spotter, _posTown, [],0, "NONE"]; - _civ setVariable ["garrison",_name,false]; - _civ setRank "CAPTAIN"; - _civ setVariable ["VCOM_NOPATHING_Unit",true,false]; - [_civ,_name] call initSniper; - _civ setBehaviour "SAFE"; - _civ action ["ladderOnUp", _tower, 0, 0]; - _count = _count + 1; - sleep 0.1; - }; - - if(_count < _numNATO) then { - _group = createGroup blufor; - _groups pushBack _group; - _start = [[[_posTown,150]]] call BIS_fnc_randomPos; - _civ = _group createUnit [OT_NATO_Unit_AA_spec, _start, [],0, "NONE"]; - _civ setVariable ["garrison",_name,false]; - _civ setRank "CAPTAIN"; - _civ setVariable ["VCOM_NOPATHING_Unit",true,false]; - [_civ,_name] call initMilitary; - _civ setBehaviour "SAFE"; - _count = _count + 1; - - _wp = _group addWaypoint [getpos _tower,0]; - _wp setWaypointType "GUARD"; - _wp setWaypointBehaviour "SAFE"; - _wp setWaypointSpeed "LIMITED"; - - sleep 0.1; - }; - - if(_count < _numNATO) then { - _start = [[[_posTown,150]]] call BIS_fnc_randomPos; - _civ = _group createUnit [OT_NATO_Unit_AA_ass, _start, [],0, "NONE"]; - _civ setVariable ["garrison",_name,false]; - _civ setRank "CAPTAIN"; - _civ setVariable ["VCOM_NOPATHING_Unit",true,false]; - [_civ,_name] call initMilitary; - _civ setBehaviour "SAFE"; - _count = _count + 1; - sleep 0.1; - }; - - }else{ - //put up a flag - _flag = OT_flag_NATO createVehicle _posTown; - _groups pushback _flag; - }; - - _range = 100; - _groupcount = 0; - while {(spawner getVariable _id) and (_count < _numNATO)} do { - _start = [[[_posTown,150]]] call BIS_fnc_randomPos; - _group = createGroup blufor; - _groups pushBack _group; - _groupcount = 1; - - _civ = _group createUnit [OT_NATO_Unit_LevelOneLeader, _start, [],0, "NONE"]; - _civ setVariable ["garrison",_name,false]; - _civ setRank "CAPTAIN"; - _civ setVariable ["VCOM_NOPATHING_Unit",true,false]; - [_civ,_name] call initMilitary; - _civ setBehaviour "SAFE"; - - _count = _count + 1; - sleep 0.1; - while {(spawner getVariable _id) and (_count < _numNATO) and (_groupcount < 8)} do { - _start = [_start,0,40, 1, 0, 0, 0] call BIS_fnc_findSafePos; - - _civ = _group createUnit [OT_NATO_Units_LevelOne call BIS_fnc_selectRandom, _start, [],0, "NONE"]; - _civ setVariable ["garrison",_name,false]; - _civ setRank "LIEUTENANT"; - _civ setVariable ["VCOM_NOPATHING_Unit",true,false]; - [_civ,_name] call initMilitary; - _civ setBehaviour "SAFE"; - - - sleep 0.1; - _count = _count + 1; - _groupcount = _groupcount + 1; - }; - _group call initMilitaryPatrol; - _range = _range + 50; - }; - - - _pos = []; - _dir = 0; - _terminal = nearestobjects [_posTown,OT_airportTerminals,350]; - if(count _terminal > 0) then { - _tp = getpos (_terminal select 0); - _dir = getdir (_terminal select 0); - _dist = 35; - if(typeof (_terminal select 0) == "Land_Hangar_F") then { - _dir = _dir + 180; - _dist = 50; - }; - _pos = [_tp,_dist,_dir] call BIS_fnc_relPos; - _pos = [_pos,100,_dir-90] call BIS_fnc_relPos; - }else{ - _dir = 80; - _pos = [_posTown,20,_dir] call BIS_fnc_relPos; - _pos = [_pos,130,_dir-90] call BIS_fnc_relPos; - }; - _airgarrison = server getVariable [format["airgarrison%1",_name],[]]; - { - _vehtype = _x; - - _pos = [_pos,42,_dir+90] call BIS_fnc_relPos; - - _veh = _vehtype createVehicle _pos; - _veh setVariable ["airgarrison",_name,false]; - - _veh setDir _dir; - - _groups pushback _veh; - sleep 0.1; - }foreach(_airgarrison); - sleep 0.5; - _vehgarrison = server getVariable [format["vehgarrison%1",_name],[]]; - _pos = []; - _road = objNull; - { - _vgroup = creategroup blufor; - _groups pushback _vgroup; - _vehtype = _x; - _dir = 0; - _got = false; - if(_vehtype in OT_staticWeapons) then { - _pos = _posTown findEmptyPosition [10,50,_vehtype]; - _dir = [_posTown,_pos] call BIS_fnc_dirTo; - _p = [_pos,1.5,_dir] call BIS_fnc_relPos; - _veh = "Land_BagFence_Round_F" createVehicle _p; - _veh setpos _p; - _veh setDir (_dir-180); - _groups pushback _veh; - _p = [_pos,-1.5,_dir] call BIS_fnc_relPos; - _veh = "Land_BagFence_Round_F" createVehicle _p; - _veh setpos _p; - _veh setDir (_dir); - _groups pushback _veh; - }else{ - _pos = [_posTown, 10, 100, 10, 0, 0.3, 0] call BIS_Fnc_findSafePos; - _dir = random 360; - }; - _veh = _vehtype createVehicle _pos; - _veh setpos _pos; - _veh setVariable ["vehgarrison",_name,false]; - - _veh setDir _dir; - if(random 100 < 99) then { - createVehicleCrew _veh; - }; - _groups pushback _veh; - sleep 0.1; - { - [_x] joinSilent _vgroup; - _x setVariable ["garrison","HQ",false]; - }foreach(crew _veh); - _vgroup call initMilitaryPatrol; - }foreach(_vehgarrison); - }; - }else{ - if (spawner getVariable _id) then { - //Do updates here that should happen only while spawned - //... - }else{ - _active = false; - //Tear it all down - { - if(typename _x == "GROUP") then { - { - sleep 0.05; - if !(_x call hasOwner) then { - deleteVehicle _x; - }; - }foreach(units _x); - deleteGroup _x; - }else{ - if !(_x call hasOwner) then { - deleteVehicle _x; - }; - }; - sleep 0.05; - }foreach(_groups); - }; + _veh setDir _dir; + if(random 100 < 99) then { + createVehicleCrew _veh; }; - sleep 2; -}; \ No newline at end of file + _groups pushback _veh; + { + [_x] joinSilent _vgroup; + _x setVariable ["garrison","HQ",false]; + }foreach(crew _veh); + _vgroup call initMilitaryPatrol; +}foreach(_vehgarrison); + +_groups \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/mobster.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/mobster.sqf index e33fda1d..2c49e751 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/mobster.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/mobster.sqf @@ -1,120 +1,72 @@ -private ["_id","_pos","_building","_tracked","_vehs","_group","_all","_shopkeeper","_groups"]; -if (!isServer) exitwith {}; -_active = false; -_spawned = false; +params ["_pos","_mobsterid"]; +private _groups = []; +private _group = createGroup east; +_groups pushback _group; +_group setBehaviour "SAFE"; +_garrison = server getVariable [format["crimgarrison%1",_mobsterid],0]; + +//the camp +_veh = createVehicle ["Campfire_burning_F",_pos,[],0,"CAN_COLLIDE"]; +_groups pushback _veh; +_dir = random 360; +_flagpos = [_pos,2,_dir] call BIS_fnc_relPos; +_veh = createVehicle [OT_flag_CRIM,_flagpos,[],0,"CAN_COLLIDE"]; +_groups pushback _veh; + +_count = 0; +_d = 0; +while {_count < 8} do { + _p = [_pos,10,_d] call SHK_pos; + _cls = OT_item_wrecks call BIS_fnc_selectRandom; + _p = _p findEmptyPosition [1,50,_cls]; + _veh = createVehicle [_cls,_p,[],0,"CAN_COLLIDE"]; + _veh setDir (_d+90); + _groups pushback _veh; + _count = _count + 1; + _d = _d + 45; +}; + +_numtents = 2 + round(random 3); _count = 0; -_id = _this select 0; -_pos = _this select 1; -_mobsterid = _this select 3; -_groups = []; +while {_count < _numtents} do { + //this code is in tents + _d = random 360; + _p = [_pos,[2,9],_d] call SHK_pos; + _p = _p findEmptyPosition [1,40,"Land_TentDome_F"]; + _veh = createVehicle ["Land_TentDome_F",_p,[],0,"CAN_COLLIDE"]; + _veh setDir _d; + _groups pushback _veh; + _count = _count + 1; +}; + + +//spawn in the crime boss +_start = [_pos,[0,30]] call SHK_pos; +_civ = _group createUnit [OT_CRIM_Unit, _start, [],0, "NONE"]; +_civ setRank "COLONEL"; +[_civ] joinSilent nil; +[_civ] joinSilent _group; +_civ setVariable ["garrison",_mobsterid,true]; +_civ call initMobBoss; + + +//spawn in his protection +_count = 0; +while {_count < _garrison} do { + _start = [_pos,[0,60]] call SHK_pos; + _civ = _group createUnit [OT_CRIM_Unit, _start, [],0, "NONE"]; + _civ setRank "MAJOR"; + [_civ] joinSilent nil; + [_civ] joinSilent _group; + _civ setVariable ["garrison",_mobsterid,true]; + _civ call initMobster; + _count = _count + 1; +}; -waitUntil{spawner getVariable _id}; +_wp = _group addWaypoint [_flagpos,0]; +_wp setWaypointType "GUARD"; -sleep 4; -while{true} do { - //Do any updates here that should happen whether spawned or not - _a = server getVariable [format["mobleader%1",_mobsterid],0]; - if(typename _a != "ARRAY") exitWith {}; - //Main spawner - if !(_active) then { - if (spawner getVariable _id) then { - _active = true; - - _group = createGroup east; - _groups pushback _group; - _group setBehaviour "SAFE"; - _garrison = server getVariable [format["crimgarrison%1",_mobsterid],0]; - - //the camp - _veh = createVehicle ["Campfire_burning_F",_pos,[],0,"CAN_COLLIDE"]; - _groups pushback _veh; - _dir = random 360; - _flagpos = [_pos,2,_dir] call BIS_fnc_relPos; - _veh = createVehicle [OT_flag_CRIM,_flagpos,[],0,"CAN_COLLIDE"]; - _groups pushback _veh; - sleep 0.1; - _count = 0; - _d = 0; - while {_count < 8} do { - _p = [_pos,10,_d] call SHK_pos; - _cls = OT_item_wrecks call BIS_fnc_selectRandom; - _p = _p findEmptyPosition [1,50,_cls]; - _veh = createVehicle [_cls,_p,[],0,"CAN_COLLIDE"]; - _veh setDir (_d+90); - _groups pushback _veh; - _count = _count + 1; - _d = _d + 45; - }; - sleep 0.1; - _numtents = 2 + round(random 3); - _count = 0; - - while {_count < _numtents} do { - //this code is in tents - _d = random 360; - _p = [_pos,[2,9],_d] call SHK_pos; - _p = _p findEmptyPosition [1,40,"Land_TentDome_F"]; - _veh = createVehicle ["Land_TentDome_F",_p,[],0,"CAN_COLLIDE"]; - _veh setDir _d; - _groups pushback _veh; - _count = _count + 1; - }; - sleep 0.1; - - //spawn in the crime boss - _start = [_pos,[0,30]] call SHK_pos; - _civ = _group createUnit [OT_CRIM_Unit, _start, [],0, "NONE"]; - _civ setRank "COLONEL"; - [_civ] joinSilent nil; - [_civ] joinSilent _group; - _civ setVariable ["garrison",_mobsterid,true]; - _civ call initMobBoss; - sleep 0.1; - - //spawn in his protection - _count = 0; - while {_count < _garrison} do { - _start = [_pos,[0,60]] call SHK_pos; - _civ = _group createUnit [OT_CRIM_Unit, _start, [],0, "NONE"]; - _civ setRank "MAJOR"; - [_civ] joinSilent nil; - [_civ] joinSilent _group; - _civ setVariable ["garrison",_mobsterid,true]; - _civ call initMobster; - _count = _count + 1; - }; - - _wp = _group addWaypoint [_flagpos,0]; - _wp setWaypointType "GUARD"; - }; - }else{ - if (spawner getVariable _id) then { - //Do updates here that should happen only while spawned - //... - - }else{ - _active = false; - { - if(typename _x == "GROUP") then { - { - sleep 0.05; - if !(_x call hasOwner) then { - deleteVehicle _x; - }; - }foreach(units _x); - deleteGroup _x; - }else{ - if !(_x call hasOwner) then { - deleteVehicle _x; - }; - }; - sleep 0.05; - }foreach(_groups); - _groups = []; - }; - }; - sleep 2; -}; \ No newline at end of file +_groups \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/police.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/police.sqf index eed053ef..8128d5cb 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/police.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/police.sqf @@ -36,7 +36,6 @@ while {_count < _numNATO} do { _groupcount = _groupcount + 1; _count = _count + 1; - sleep 0.1; }; _group call initPolicePatrol; _range = _range + 50; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/shop.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/shop.sqf index 8a515b5f..c41ad40b 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/shop.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/shop.sqf @@ -1,20 +1,19 @@ private ["_id","_pos","_building","_tracked","_vehs","_group","_all","_shopkeeper","_groups"]; -_hour = date select 3; -_town = _this; -_activeshops = server getVariable [format["activeshopsin%1",_town],[]]; +private _hour = date select 3; +private _town = _this; +private _activeshops = server getVariable [format["activeshopsin%1",_town],[]]; -_group = createGroup civilian; +private _group = createGroup civilian; _group setBehaviour "CARELESS"; -_groups = [_group]; +private _groups = [_group]; { _pos = _x select 0; _building = nearestBuilding _pos; _tracked = _building call spawnTemplate; - sleep 0.1; _vehs = _tracked select 0; { _groups pushback _x; @@ -37,7 +36,6 @@ _groups = [_group]; [_shopkeeper] call initShopkeeper; //Put a light on - sleep 0.1; _pos = getpos _building; _light = "#lightpoint" createVehicle [_cashpos select 0,_cashpos select 1,(_cashpos select 2)+2.2]; _light setLightBrightness 0.13; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/townGarrison.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/townGarrison.sqf index c64df714..afdcbaf4 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/townGarrison.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/townGarrison.sqf @@ -30,7 +30,7 @@ while {_count < _numNATO} do { [_civ,_town] call initGendarm; _count = _count + 1; _groupcount = _groupcount + 1; - sleep 0.1; + while {(_groupcount < _pergroup) and (_count < _numNATO)} do { _pos = [[[_start,50]]] call BIS_fnc_randomPos; @@ -43,7 +43,7 @@ while {_count < _numNATO} do { _groupcount = _groupcount + 1; _count = _count + 1; - sleep 0.1; + }; _group call initGendarmPatrol; _range = _range + 50; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/structures/observationPost.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/structures/observationPost.sqf index 6ad1a506..796de8ec 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/structures/observationPost.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/structures/observationPost.sqf @@ -11,8 +11,8 @@ _group setFormDir _dir; _posleft = [_pos,[[-1.5104,-0.4,4.34404], (getDir _post)-180] call BIS_fnc_rotateVector2D] call BIS_fnc_vectorAdd; _civ = _group createUnit ["I_Spotter_F",_posleft,[],0,"NONE"]; -[_civ, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _civ]; -[_civ, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _civ]; +[_civ, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setAIFace", 0, _civ]; +[_civ, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setAISpeaker", 0, _civ]; _civ disableAI "MOVE"; _civ disableAI "AUTOCOMBAT"; _civ setVariable ["NOAI",true,false]; @@ -34,12 +34,16 @@ _civ selectWeapon "Rangefinder"; _civ linkItem "ItemMap"; _civ linkItem "ItemCompass"; _civ linkItem "ItemWatch"; -_civ linkItem "ItemRadio"; +if(OT_hasTFAR) then { + _unit linkItem "tf_anprc148jem"; +}else{ + _unit linkItem "ItemRadio"; +}; _posright = [_pos,[[1.5104,-0.4,4.34404], (getDir _post)-180] call BIS_fnc_rotateVector2D] call BIS_fnc_vectorAdd; _civ = _group createUnit ["I_Spotter_F",_posright,[],0,"NONE"]; -[_civ, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setFace", 0, _civ]; -[_civ, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setSpeaker", 0, _civ]; +[_civ, (OT_faces_local call BIS_fnc_selectRandom)] remoteExec ["setAIFace", 0, _civ]; +[_civ, (OT_voices_local call BIS_fnc_selectRandom)] remoteExec ["setAISpeaker", 0, _civ]; _civ disableAI "MOVE"; _civ disableAI "AUTOCOMBAT"; _civ setVariable ["NOAI",true,false]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/structures/warehouse.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/structures/warehouse.sqf new file mode 100644 index 00000000..2511b379 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/structures/warehouse.sqf @@ -0,0 +1,7 @@ +private ["_pos","_shop"]; + +_pos = _this select 0; +_shop = (_pos nearObjects [OT_warehouse,10]) select 0; + + + diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/houses/Land_House_Native_02_F.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/houses/Land_House_Native_02_F.sqf index 9c5536c9..c6a0fcda 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/houses/Land_House_Native_02_F.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/houses/Land_House_Native_02_F.sqf @@ -2,7 +2,7 @@ ["Land_Wrench_F",[2.08631,-1.10585,0.190778],0,1,0,[],"","",true,false], ["Land_MapBoard_F",[1.77709,1.85536,0.148079],38.8726,1,0,[],"","",true,false], ["Land_CanisterOil_F",[1.02398,-2.50222,0.135127],4.89243,1,0,[],"","",true,false], - ["Land_ToolTrolley_02_F",[1.96175,-1.98313,0.121121],37.1995,1,0,[],"","",true,false], + ["Land_MetalCase_01_small_F",[1.96175,-1.98313,0.121121],37.1995,1,0,[],"","",true,false], ["Land_CampingChair_V2_F",[-2.49132,1.92123,0.103003],184.926,1,0,[],"","",true,false], ["OfficeTable_01_new_F",[-2.31248,2.38399,0.103003],0,1,0,[],"","",true,false], ["B_CargoNet_01_ammo_F",[-3.07393,-1.85328,0.157859],0,1,0,[],"","",true,false] diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/houses/Land_Slum_01_F.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/houses/Land_Slum_01_F.sqf index 785ff169..3a639cc0 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/houses/Land_Slum_01_F.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/houses/Land_Slum_01_F.sqf @@ -1,5 +1,5 @@ [ - ["Land_ToolTrolley_02_F",[-0.897521,0.746889,0.594079],178.839,1,0,[0,-0],"","",true,false], + ["Land_MetalCase_01_small_F",[-0.897521,0.746889,0.594079],178.839,1,0,[0,-0],"","",true,false], ["Land_CanisterFuel_F",[-0.907734,2.02789,0.59408],315.784,1,0,[0,0],"","",true,false], ["Land_CanisterOil_F",[-0.447842,2.23861,0.59408],7.58015,1,0,[0,0],"","",true,false], ["Land_CampingChair_V2_F",[2.81286,1.43731,0.59408],166.446,1,0,[0,-0],"","",true,false], diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/houses/Land_Slum_02_F.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/houses/Land_Slum_02_F.sqf index 37c3629f..a1a6b39b 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/houses/Land_Slum_02_F.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/houses/Land_Slum_02_F.sqf @@ -3,7 +3,7 @@ ["Land_CampingChair_V2_F",[-0.38521,4.00503,0.559122],192.326,1,0,[0,0],"","",true,false], ["Land_CanisterOil_F",[2.51703,3.33921,0.559122],116.692,1,0,[0,-0],"","",true,false], ["B_CargoNet_01_ammo_F",[1.83102,-3.80072,0.559122],0,1,0,[0,0],"","",true,false], - ["Land_ToolTrolley_02_F",[1.25476,4.2525,0.559122],287.951,1,0,[0,0],"","",true,false], + ["Land_MetalCase_01_small_F",[1.25476,4.2525,0.559122],287.951,1,0,[0,0],"","",true,false], ["OfficeTable_01_new_F",[-0.0970871,4.45407,0.559122],0,1,0,[0,0],"","",true,false], ["Land_CanisterFuel_F",[2.4685,3.84274,0.559122],64.8959,1,0,[0,0],"","",true,false] ] \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/tutorial.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/tutorial.sqf index e7309f97..242c6a9e 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/tutorial.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/tutorial.sqf @@ -134,7 +134,11 @@ menuHandler = { hint format["The items are in your pocket, you can see it in your inventory (%1 key). Balavu, Rautake and Tavu have shops that will buy them from you as well as locations all over Tanoa. Towns with lower stability will pay higher prices for all items.", "Gear" call assignedKey] }; [player,_gundealer,[(_this select 0),"Well I'm not really the guy to help you there, but I have these items laying around","What am I supposed to do with these?","Take them to a shop and sell them I guess"],_end] spawn doConversation; - player addItemToUniform "ItemRadio"; + if(OT_hasTFAR) then { + player addItemToUniform "tf_anprc148jem"; + }else{ + player addItemToUniform "ItemRadio"; + }; player addItemToUniform "ItemWatch"; } ] diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization.sqf index 44aaab6a..e9306615 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization.sqf @@ -1,8 +1,3 @@ -private ["_uniqueCounter","_allspawners","_id","_start","_end"]; - -diag_virt = 0; -publicVariable "diag_virt"; - OT_spawnUniqueCounter = -1; OT_allspawners = []; @@ -30,19 +25,9 @@ OT_fnc_registerSpawner = { OT_spawnUniqueCounter = OT_spawnUniqueCounter + 1; _id = format["spawn%1",OT_spawnUniqueCounter]; - - spawner setvariable [_id,false,true]; - OT_allspawners pushBack [_id,_start,_end]; - - - - if(typename _code == "ARRAY")then { - { - [_id,_start,_end,_params] spawn _x; - }foreach(_code); - }else{ - [_id,_start,_end,_params] spawn _code; - }; + + OT_allspawners pushBack [_id,_start,_end,_code,_params]; + OT_spawnUniqueCounter }; publicVariable "OT_fnc_registerSpawner"; @@ -74,36 +59,66 @@ OT_fnc_updateSpawnerPosition = { }foreach(OT_allspawners); }; -_last = time; +OT_allSpawned = []; + +_spawn = { + params ["_i","_s","_e","_c","_p"]; + private _g = _p call _c; + spawner setVariable [_i,_g,false]; +}; + +_despawn = { + params ["_i"]; + { + if(typename _x == "GROUP") then { + { + sleep 0.1; + if !(_x call hasOwner) then { + deleteVehicle _x; + }; + }foreach(units _x); + deleteGroup _x; + }else{ + if !(_x call hasOwner) then { + deleteVehicle _x; + }; + }; + sleep 0.1; + }foreach(spawner getVariable [_i,[]]); + spawner setVariable [_i,[],false]; +}; + while{true} do { - if (time - _last >= 0.5) then {sleep 0.1} else {sleep 0.5 - (time - _last)}; - diag_virt = time - _last; - //hint format["virt %1 @ %2",diag_virt,count OT_allSpawners]; - _last = time; + sleep 0.1; { - _id = _x select 0; - _start = _x select 1; - _end = _x select 2; - _val = spawner getvariable [_id,false]; + private _id = _x select 0; + private _start = _x select 1; + private _end = _x select 2; + private _spawnidx = OT_allSpawned find _id; + private _val = (_spawnidx > -1); if((_start select 0) == (_end select 0)) then { if(_val) then { if !(_start call inSpawnDistance) then { - spawner setvariable [_id,false,false]; + OT_allSpawned deleteAt _spawnidx; + [_id] spawn _despawn; }; }else{ if (_start call inSpawnDistance) then { - spawner setvariable [_id,true,false]; + OT_allSpawned pushback _id; + _x spawn _spawn; }; }; }else{ if(_val) then { if !((_start call inSpawnDistance) || (_end call inSpawnDistance)) then { - spawner setvariable [_id,false,false]; + OT_allSpawned deleteAt _spawnidx; + [_id] spawn _despawn; }; }else{ if ((_start call inSpawnDistance) || (_end call inSpawnDistance)) then { - spawner setvariable [_id,true,false]; + OT_allSpawned pushback _id; + _x spawn _spawn; }; }; }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization/military.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization/military.sqf index cc0d9e05..089812af 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization/military.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization/military.sqf @@ -3,10 +3,10 @@ _checkpoints = compileFinal preProcessFileLineNumbers "spawners\militaryCheckpoi { _name = _x select 1; _pos = _x select 0; - [_pos,_garrison,_name] call OT_fnc_registerSpawner; + [_pos,_garrison,[_pos,_name]] call OT_fnc_registerSpawner; }foreach(OT_NATOobjectives + OT_NATOcomms); { _pos = getMarkerPos _x; - [_pos,_checkpoints,_x] call OT_fnc_registerSpawner; + [_pos,_checkpoints,[_pos,_x]] call OT_fnc_registerSpawner; }foreach(OT_NATO_control); \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization/mobsters.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization/mobsters.sqf index 9d024fc2..017c7cc3 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization/mobsters.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization/mobsters.sqf @@ -5,5 +5,5 @@ waitUntil {!isNil "OT_CRIMInitDone"}; private ["_p","_i"]; _p = _x select 0; _i = _x select 1; - [_p,_spawner,_i] call OT_fnc_registerSpawner; + [_p,_spawner,[_p,_i]] call OT_fnc_registerSpawner; }foreach(server getVariable ["activemobsters",[]]); \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization/towns.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization/towns.sqf index 226fda6b..dec9e640 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization/towns.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/virtualization/towns.sqf @@ -1,5 +1,3 @@ -private ["_pos"]; - OT_townSpawners = [ compileFinal preProcessFileLineNumbers "spawners\civ.sqf", compileFinal preProcessFileLineNumbers "spawners\townGarrison.sqf", @@ -14,129 +12,16 @@ OT_townSpawners = [ ]; { - _pos = server getVariable _x; + private _pos = server getVariable _x; + private _town = _x; [_pos,{ - private ["_active","_groups","_town","_id"]; - _active = false; - _id = _this select 0; - _town = _this select 3; - _groups = []; - waitUntil{spawner getVariable _id}; - - while{true} do { - //Do any updates here that should happen whether spawned or not - //Main spawner - if !(_active) then { - if (spawner getVariable _id) then { - _active = true; - { - _spawner = _x; - [_groups,_town,_spawner] spawn { - private ["_g","_t","_s"]; - _g = _this select 0; - _t = _this select 1; - _s = _this select 2; - sleep (random 2); - { - _g pushback _x; - _grp = _x; - }foreach(_t call _s); - }; - }foreach(OT_townSpawners); - }else{ - //NATO - _need = server getVariable [format ["garrisonadd%1",_town],0]; - if(_need > 1) then { - server setVariable[format ["garrisonadd%1",_town],_need-2,false]; - server setVariable[format ["garrison%1",_town],(server getVariable format["garrison%1",_town])+2,false]; - }; - - //CRIM - _newpos = server getVariable format["crimnew%1",_town]; - _addnum = server getVariable format["crimadd%1",_town]; - _current = server getVariable format["numcrims%1",_town]; - if((typename "_newpos") == "ARRAY") then { - server setVariable [format["crimleader%1",_town],_newpos,false]; - server setVariable [format["crimnew%1",_town],false,false]; - server setVariable [format["numcrims%1",_town],2+(random 4),false]; - }; - server setVariable [format["crimadd%1",_town],0,false]; - server setVariable [format["crimnew%1",_town],false,false]; - }; - }else{ - if (spawner getVariable _id) then { - //Do updates here that should happen only while spawned - - //NATO - _need = server getVariable [format ["garrisonadd%1",_town],0]; - if(_need > 1) then { - _town spawn reGarrisonTown; - server setVariable[format ["garrisonadd%1",_town],_need-2,false]; - }; - - //CRIM - _newpos = server getVariable [format["crimnew%1",_town],false]; - _addnum = server getVariable [format["crimadd%1",_town],0]; - _current = server getVariable [format["numcrims%1",_town],0]; - if((typename _newpos) == "ARRAY") then { - server setVariable [format["crimleader%1",_town],_newpos,true]; - _new = [_newpos,_addnum,_town] call newleader; - _groups pushback _new; - }else{ - if(_addnum > 0) then { - _new = [server getVariable _town,_addnum,_town] call sendCrims; - _groups pushback _new; - server setVariable [format["numcrims%1",_town],_current+_addnum,false]; - }; - }; - server setVariable [format["crimnew%1",_town],false,false]; - _current = server getVariable [format["numcrims%1",_town],0]; - - server setVariable [format["crimadd%1",_town],0,false]; - }else{ - _active = false; - sleep 1; - //Tear it all down - { - if(typename _x == "GROUP") then { - - { - if !(_x call hasOwner) then { - deleteVehicle _x; - }; - }foreach(units _x); - deleteGroup _x; - }else{ - if !(_x call hasOwner) then { - deleteVehicle _x; - }; - }; - sleep 0.05; - }foreach(_groups); - _groups = []; - - _despawn = spawner getVariable [format["despawn%1",_town],[]]; - { - if(typename _x == "GROUP") then { - - { - if !(_x call hasOwner) then { - deleteVehicle _x; - }; - }foreach(units _x); - deleteGroup _x; - }else{ - if !(_x call hasOwner) then { - deleteVehicle _x; - }; - }; - sleep 0.05; - }foreach(_despawn); - spawner setVariable [format["despawn%1",_town],[],false]; - }; - }; - sleep 0.5; - }; - },_x] call OT_fnc_registerSpawner; - spawner setVariable [format["despawn%1",_x],[],false]; + private _t = _this; + private _g = []; + { + { + _g pushback _x; + }foreach(_t call _x); + }foreach(OT_townSpawners); + _g; + },_town] call OT_fnc_registerSpawner; }foreach(OT_allTowns); \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf index 1592fe9a..f47c1d51 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf @@ -18,20 +18,9 @@ _unit addEventHandler ["take", { _me setCaptive false; _me spawn revealToNATO; _me spawn revealToCRIM; - } + }; }; }; - - if(_container isKindOf "Man" and !(_container call hasOwner)) then { - _container setVariable ["looted",true,true]; - [_container] spawn { - sleep 300; - _n = _this select 0; - if!(isNil "_n") then { - hideBody (_this select 0); - } - }; - }; }]; _unit addEventHandler ["Fired", { @@ -52,7 +41,7 @@ _unit addEventHandler ["Fired", { }; }]; -while {alive _unit} do { +while {alive _unit} do { sleep 3; //check wanted status if !(captive _unit) then { @@ -191,17 +180,20 @@ while {alive _unit} do { }; _base = (getpos player) call nearestObjective; if !(isNil "_base") then { - _dist = 200; - if(((_base select 1) find "Comm") == 0) then { - _dist = 20; - }; - if((_base select 0) distance (getpos player) < _dist) exitWith { - if(isPlayer _unit) then { - "You are in a restricted area" call notify_minor; + _base params ["_obpos","_obname"]; + if !(_obname in (server getVariable ["NATOabandoned",[]])) then { + _dist = 200; + if((_obname find "Comm") == 0) then { + _dist = 20; }; - _unit setCaptive false; - _unit spawn revealToNATO; - } + if(_obpos distance (getpos player) < _dist) exitWith { + if(isPlayer _unit) then { + "You are in a restricted area" call notify_minor; + }; + _unit setCaptive false; + _unit spawn revealToNATO; + }; + }; }; }; }; diff --git a/mod.cpp b/mod.cpp index bf0a39ca..e6337211 100644 --- a/mod.cpp +++ b/mod.cpp @@ -1,10 +1,10 @@ -name = "Overthrow 0.5.6"; //This name will be displayed only in game , specifically the expansion menu +name = "Overthrow 0.6.1"; //This name will be displayed only in game , specifically the expansion menu picture = "logo_overthrow.paa"; //Location of your addon's icon logo = "logo_overthrow.paa"; logoOver = "logo_overthrow.paa"; actionName = "Github"; //The name of the action action = "https://github.com/armazac/Overthrow.Tanoa"; //The action , "Authors Website Link" -description = "Overthrow - Version 0.5.6"; // Addon Description +description = "Overthrow - Version 0.6.1"; // Addon Description overview = "A Revolution Simulator for Arma 3"; author = "ARMAzac"; overviewPicture = "logo_overthrow.paa"; \ No newline at end of file