Skip to content

Commit 3f4a7e9

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/v0.7.8.1' into dev
2 parents bdddb64 + 48f4c01 commit 3f4a7e9

19 files changed

Lines changed: 158 additions & 106 deletions

addons/overthrow_main.pbo

2.71 KB
Binary file not shown.

addons/overthrow_main/functions/AI/NPC/fn_initCriminal.sqf

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,10 @@ if((random 100) < 15) then {
6969
if((random 100) > 80) exitWith {
7070
//This is a medic
7171
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);
72-
if(OT_hasACE) then {
73-
for "_i" from 1 to 10 do {_unit addItemToBackpack "ACE_fieldDressing";};
74-
for "_i" from 1 to 3 do {_unit addItemToBackpack "ACE_morphine";};
75-
_unit addItemToBackpack "ACE_bloodIV";
76-
_unit addItemToBackpack "ACE_epinephrine";
77-
}else{
78-
_unit addItemToBackpack "Medikit";
79-
};
72+
for "_i" from 1 to 10 do {_unit addItemToBackpack "ACE_fieldDressing";};
73+
for "_i" from 1 to 3 do {_unit addItemToBackpack "ACE_morphine";};
74+
_unit addItemToBackpack "ACE_bloodIV";
75+
_unit addItemToBackpack "ACE_epinephrine";
8076
};
8177
if((random 100) > 90) exitWith {
8278
//This is an engineer
@@ -86,12 +82,11 @@ if((random 100) < 15) then {
8682
_unit addItemToBackpack "ClaymoreDirectionalMine_Remote_Mag";
8783
_unit addItemToBackpack "IEDUrbanSmall_Remote_Mag";
8884

89-
if(OT_hasACE) then {
90-
_unit addItemToBackpack "ACE_DefusalKit";
91-
_unit addItemToBackpack "ACE_M26_Clacker";
92-
_unit addItemToBackpack "ACE_Clacker";
93-
_unit addItemToBackpack "ACE_DeadManSwitch";
94-
};
85+
_unit addItemToBackpack "ACE_DefusalKit";
86+
_unit addItemToBackpack "ACE_M26_Clacker";
87+
_unit addItemToBackpack "ACE_Clacker";
88+
_unit addItemToBackpack "ACE_DeadManSwitch";
89+
9590
_unit addItemToBackpack "Toolkit";
9691
};
9792
if((random 100) > 97) exitWith {
@@ -113,7 +108,7 @@ if((random 100) > 50) then {
113108
_unit addItem "MiniGrenade";
114109
};
115110

116-
if(OT_hasACE && ((random 100) > 90)) then {
111+
if((random 100) > 90) then {
117112
_unit addItem "ACE_M84";
118113
};
119114

addons/overthrow_main/functions/AI/NPC/fn_initGendarm.sqf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@ if(_skill > 0.8) then {
4545
_unit addGoggles "G_Bandanna_aviator";
4646
};
4747

48-
if(OT_hasACE) then {
49-
_unit addItem "ACE_fieldDressing";
50-
_unit addItem "ACE_fieldDressing";
51-
_unit addItem "ACE_morphine";
52-
if((random 100) > 90) exitWith {
48+
49+
_unit addItem "ACE_fieldDressing";
50+
_unit addItem "ACE_fieldDressing";
51+
_unit addItem "ACE_morphine";
52+
if((random 100) > 90) exitWith {
5353
_unit addItem "ACE_epinephrine";
54-
}
5554
};
5655

5756
private _weapons = OT_allSubMachineGuns;

addons/overthrow_main/functions/AI/NPC/fn_initMobBoss.sqf

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,8 @@ _hour = date select 3;
4444
if(_hour < 8 || _hour > 15) then {
4545
_unit linkItem "O_NVGoggles_ghex_F";
4646
};
47-
if(OT_hasACE) then {
48-
_unit linkItem "ACE_Altimeter";
49-
}else{
50-
_unit linkItem "ItemWatch";
51-
};
47+
48+
_unit linkItem "ACE_Altimeter";
5249
_unit linkItem "ACE_Cellphone";
5350

5451
_weapon = (OT_CRIM_Weapons + OT_allCheapRifles) call BIS_fnc_selectRandom;

addons/overthrow_main/functions/AI/NPC/fn_initMobster.sqf

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ _unit addEventHandler ["HandleDamage", {
1313
_src = _this select 3;
1414
if(captive _src) then {
1515
if((vehicle _src) != _src || (_src call OT_fnc_unitSeenCRIM)) then {
16-
_src setCaptive false;
17-
};
18-
};
16+
_src setCaptive false;
17+
};
18+
};
1919
}];
2020

2121
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _unit];
@@ -44,11 +44,9 @@ _hour = date select 3;
4444
if(_hour < 8 || _hour > 15) then {
4545
_unit linkItem "O_NVGoggles_ghex_F";
4646
};
47-
if(OT_hasACE) then {
48-
_unit linkItem "ACE_Altimeter";
49-
}else{
50-
_unit linkItem "ItemWatch";
51-
};
47+
48+
_unit linkItem "ACE_Altimeter";
49+
5250

5351
if((random 100) < 15) then {
5452
_unit addItem "OT_Ganja";
@@ -63,46 +61,42 @@ _unit addWeapon _weapon;
6361
params ["_unit"];
6462
if((random 100) > 98) exitWith {
6563
//This guy has a launcher
66-
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);
64+
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);
6765
_launcher = OT_CRIM_Launchers select 0;
6866
_base = [_launcher] call BIS_fnc_baseWeapon;
6967
_magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) call BIS_fnc_SelectRandom;
7068
_unit addMagazineGlobal _magazine;
7169
_unit addMagazineGlobal _magazine;
72-
_unit addMagazineGlobal _magazine;
70+
_unit addMagazineGlobal _magazine;
7371
_unit addWeapon _launcher;
7472
};
7573
if((random 100) > 85) exitWith {
7674
//This is a medic
77-
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);
78-
if(OT_hasACE) then {
79-
for "_i" from 1 to 10 do {_unit addItemToBackpack "ACE_fieldDressing";};
80-
for "_i" from 1 to 3 do {_unit addItemToBackpack "ACE_morphine";};
81-
_unit addItemToBackpack "ACE_bloodIV";
82-
_unit addItemToBackpack "ACE_epinephrine";
83-
}else{
84-
_unit addItemToBackpack "Medikit";
85-
};
75+
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);
76+
77+
for "_i" from 1 to 10 do {_unit addItemToBackpack "ACE_fieldDressing";};
78+
for "_i" from 1 to 3 do {_unit addItemToBackpack "ACE_morphine";};
79+
_unit addItemToBackpack "ACE_bloodIV";
80+
_unit addItemToBackpack "ACE_epinephrine";
8681
};
8782
if((random 100) > 95) exitWith {
8883
//This is an engineer
89-
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);
84+
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);
9085
for "_i" from 1 to 2 do {_unit addItemToBackpack "DemoCharge_Remote_Mag";};
9186
_unit addItemToBackpack "APERSBoundingMine_Range_Mag";
9287
_unit addItemToBackpack "ClaymoreDirectionalMine_Remote_Mag";
9388
_unit addItemToBackpack "IEDUrbanSmall_Remote_Mag";
94-
95-
if(OT_hasACE) then {
96-
_unit addItemToBackpack "ACE_DefusalKit";
97-
_unit addItemToBackpack "ACE_M26_Clacker";
98-
_unit addItemToBackpack "ACE_Clacker";
99-
_unit addItemToBackpack "ACE_DeadManSwitch";
100-
};
89+
90+
_unit addItemToBackpack "ACE_DefusalKit";
91+
_unit addItemToBackpack "ACE_M26_Clacker";
92+
_unit addItemToBackpack "ACE_Clacker";
93+
_unit addItemToBackpack "ACE_DeadManSwitch";
94+
10195
_unit addItemToBackpack "Toolkit";
10296
};
10397
if((random 100) > 97) exitWith {
10498
//This guy just has a shitload of weed
105-
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);
99+
_unit addBackpack (OT_allBackpacks call BIS_fnc_selectRandom);
106100
for "_i" from 1 to round(random 30) do {_unit addItemToBackpack "OT_Ganja";};
107101
};
108102
};
@@ -125,14 +119,14 @@ if((random 100) > 50) then {
125119
_unit addItem "MiniGrenade";
126120
};
127121

128-
if(OT_hasACE && ((random 100) > 90)) then {
122+
if((random 100) > 90) then {
129123
_unit addItem "ACE_M84";
130124
};
131125

132126
_config = configfile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo";
133127
_numslots = count(_config);
134128
for "_i" from 0 to (_numslots-1) do {
135-
if (isClass (_config select _i)) then {
129+
if (isClass (_config select _i)) then {
136130
_slot = configName(_config select _i);
137131
_com = _config >> _slot >> "compatibleItems";
138132
_items = [];
@@ -142,9 +136,9 @@ for "_i" from 0 to (_numslots-1) do {
142136
};
143137
}else{
144138
_items = getArray(_com);
145-
};
146-
if(count _items > 0) then {
147-
_cls = _items call BIS_fnc_selectRandom;
139+
};
140+
if(count _items > 0) then {
141+
_cls = _items call BIS_fnc_selectRandom;
148142
_unit addPrimaryWeaponItem _cls;
149143
};
150144
};
@@ -156,4 +150,4 @@ _base = [_weapon] call BIS_fnc_baseWeapon;
156150
_magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) select 0;
157151
if !(isNil "_magazine") then {
158152
_unit addItem _magazine;
159-
};
153+
};
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
params ["_unit"];
22

3-
if(OT_hasACE) then {
4-
_unit addItemToUniform "ACE_rangeCard";
5-
};
3+
4+
_unit addItemToUniform "ACE_rangeCard";
5+
66
_unit setVariable ["NOAI",true,false];
77
_unit disableAI "MOVE";
88
[
99
{
1010
private _dir = random 360;
1111
private _pos = ([_this,1,_dir] call BIS_fnc_relPos);
12-
_this setposATL [_pos select 0,_pos select 1,((getposATL _this) select 2)+0.3];
12+
_this setposATL [_pos select 0,_pos select 1,((getposATL _this) select 2)+0.3];
1313
_this setDir _dir;
1414
_this setUnitPos "MIDDLE";
1515
},
@@ -21,7 +21,7 @@ _unit addEventHandler ["HandleDamage", {
2121
params ["_me","","","_src"];
2222
if(captive _src) then {
2323
if((vehicle _src) != _src || (_src call OT_fnc_unitSeenNATO)) then {
24-
_src setCaptive false;
25-
};
26-
};
27-
}];
24+
_src setCaptive false;
25+
};
26+
};
27+
}];

addons/overthrow_main/functions/AI/fn_createSoldier.sqf

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,11 @@ if(_tertiary != "") then {
8282

8383
if(_cls isEqualTo "I_Medic_F") then {
8484
clearBackpackCargoGlobal _civ;
85-
if(OT_hasACE) then {
86-
for "_i" from 1 to 10 do {_civ addItemToBackpack "ACE_fieldDressing";};
87-
for "_i" from 1 to 3 do {_civ addItemToBackpack "ACE_morphine";};
88-
_civ addItemToBackpack "ACE_bloodIV";
89-
_civ addItemToBackpack "ACE_epinephrine";
90-
_civ addItemToBackpack "ACE_epinephrine";
91-
}else{
92-
_civ addItemToBackpack "Medikit";
93-
};
85+
for "_i" from 1 to 10 do {_civ addItemToBackpack "ACE_fieldDressing";};
86+
for "_i" from 1 to 3 do {_civ addItemToBackpack "ACE_morphine";};
87+
_civ addItemToBackpack "ACE_bloodIV";
88+
_civ addItemToBackpack "ACE_epinephrine";
89+
_civ addItemToBackpack "ACE_epinephrine";
9490
};
9591

9692
if((_cls find "_AA_") > -1 || (_cls find "_AAA_") > -1) then {

addons/overthrow_main/functions/actions/fn_sell.sqf

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,21 @@ if(OT_hasTFAR) then {
2525
private _target = player;
2626
if((player getVariable ["OT_shopTarget","Self"]) == "Vehicle") then {
2727
_target = vehicle player;
28-
[_target, _cls, 1] call CBA_fnc_removeItemCargo;
28+
if !([_target, _cls, 1] call CBA_fnc_removeItemCargo) then {
29+
if !([_target, _cls, 1] call CBA_fnc_removeWeaponCargo) then {
30+
if !([_target, _cls, 1] call CBA_fnc_removeMagazineCargo) then {
31+
if !([_target, _cls, 1] call CBA_fnc_removeBackpackCargo) then {
32+
//item must be in a backpack/uniform etc
33+
{
34+
_x params ["_itemcls","_item"];
35+
if(_cls in (itemCargo _item)) exitWith {[_item, _cls, 1] call CBA_fnc_removeItemCargo};
36+
if(_cls in (weaponCargo _item)) exitWith {[_item, _cls, 1] call CBA_fnc_removeWeaponCargo};
37+
if(_cls in (magazineCargo _item)) exitWith {[_item, _cls, 1] call CBA_fnc_removeMagazineCargo};
38+
}foreach(everyContainer _target);
39+
};
40+
};
41+
};
42+
};
2943
}else{
3044
_target removeItem _cls;
3145
};

addons/overthrow_main/functions/actions/fn_sellAll.sqf

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,50 @@ if(_total > 100) then {[_town,round(_total / 100)] call OT_fnc_support};
3333
private _ocls = _sellcls;
3434

3535
if((player getVariable ["OT_shopTarget","Self"]) isEqualTo "Vehicle") then {
36-
[_target, _sellcls, _qty] call CBA_fnc_removeItemCargo;
36+
private _noncontaineritems = ((itemCargo _target) + (magazineCargo _target) + (backpackCargo _target)) call BIS_fnc_consolidateArray;
37+
private _ncqty = 0;
38+
{
39+
_x params ["_thiscls","_thisqty"];
40+
if(_thiscls isEqualTo _sellcls) exitWith {
41+
_ncqty = _thisqty;
42+
};
43+
}foreach(_noncontaineritems);
44+
if(_ncqty > 0) then {
45+
[_target, _sellcls, _ncqty] call CBA_fnc_removeItemCargo;
46+
};
47+
_qty = _qty - _ncqty;
48+
if(_qty > 0) then {
49+
//still need to find more items in backpacks, uniforms etc
50+
{
51+
_x params ["_itemcls","_item"];
52+
{
53+
_x params ["_c","_q"];
54+
if(_c isEqualTo _sellcls) exitWith {
55+
[_item, _sellcls, _q] call CBA_fnc_removeItemCargo;
56+
_qty = _qty - _q;
57+
};
58+
}foreach((itemCargo _item) call BIS_fnc_consolidateArray);
59+
if(_qty > 0) then {
60+
61+
{
62+
_x params ["_c","_q"];
63+
if(_c isEqualTo _sellcls) exitWith {
64+
[_item, _sellcls, _q] call CBA_fnc_removeWeaponCargo;
65+
_qty = _qty - _q;
66+
};
67+
}foreach((weaponCargo _item) call BIS_fnc_consolidateArray);
68+
};
69+
if(_qty > 0) then {
70+
{
71+
_x params ["_c","_q"];
72+
if(_c isEqualTo _sellcls) exitWith {
73+
[_item, _sellcls, _q] call CBA_fnc_removeMagazineCargo;
74+
_qty = _qty - _q;
75+
};
76+
}foreach((magazineCargo _item) call BIS_fnc_consolidateArray);
77+
};
78+
}foreach(everyContainer _target);
79+
};
3780
}else{
3881
for "_i" from 0 to _qty do {
3982
if(OT_hasTFAR) then {

addons/overthrow_main/functions/actions/fn_talkToCiv.sqf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ if (side _civ isEqualTo west || side _civ isEqualTo east) exitWith {
1515
_options call OT_fnc_playerDecision;
1616
};
1717

18+
//make sure any purchases come to me, not my vehicle
19+
player setVariable ["OT_shopTarget","Self",false];
20+
1821
private _canRecruit = true;
1922

2023
private _canBuy = false;
@@ -36,9 +39,10 @@ if (_civ getvariable ["notalk",false]) then {_canSellDrugs = false;_canRecruit =
3639
if (_civ getvariable ["factionrep",false]) then {_canSellDrugs = false;_canRecruit = false;_canBuyGuns=false;_canIntel=false;_canMission=true};
3740
if (_civ getvariable ["crimleader",false]) then {_canSellDrugs = true;_canRecruit = false;_canBuyGuns=false;_canIntel=false;_canMission=false};
3841

39-
if (_civ call OT_fnc_hasOwner) then {_canRecruit = false;_canIntel = false};
42+
if (_civ call OT_fnc_hasOwner) then {_canRecruit = false;_canIntel = false;_canSellDrugs=false};
4043

41-
if !((_civ getvariable ["garrison",""]) isEqualTo "") then {_canRecruit = false;_canIntel = false};
44+
if !((_civ getvariable ["garrison",""]) isEqualTo "") then {_canRecruit = false;_canIntel = false;_canSellDrugs=false};
45+
if !((_civ getvariable ["polgarrison",""]) isEqualTo "") then {_canRecruit = false;_canIntel = false;_canSellDrugs=false};
4246

4347
if (_canRecruit) then {
4448
_options pushBack [

0 commit comments

Comments
 (0)