Skip to content

Commit

Permalink
Merge pull request #115 from ArmaOverthrow/dev
Browse files Browse the repository at this point in the history
0.7.3.2
  • Loading branch information
armazac authored Apr 24, 2017
2 parents dc00040 + 5afb8b8 commit f3679f8
Show file tree
Hide file tree
Showing 48 changed files with 622 additions and 327 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ buildOnKeyDown = {
_cls = modeValues select modeIndex;

modeTarget = createVehicle [_cls, modeValue, [], 0, "CAN_COLLIDE"];
modeTarget enableDynamicSimulation true;
modeTarget remoteExec ["enableSimulationGlobal false",2,false];
modeTarget setDir _dir;
};
Expand Down Expand Up @@ -282,7 +283,8 @@ buildOnMouseUp = {
_created setVariable ["OT_init",modeCode,true];
[modeValue,modeCode] remoteExec ["structureInit",2];
};
createVehicle ["Land_ClutterCutter_large_F", (getpos modeTarget), [], 0, "CAN_COLLIDE"];
_clu = createVehicle ["Land_ClutterCutter_large_F", (getpos modeTarget), [], 0, "CAN_COLLIDE"];
_clu enableDynamicSimulation true;
};
deleteVehicle modeVisual;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,45 @@ if(_obpos distance player < 250) then {
_town = "Tanoa";
_standing = 100;
if((_obname in OT_allAirports) or OT_adminMode) then {
_items = OT_helis + OT_vehicles + OT_staticBackpacks;
_items = OT_helis + OT_vehicles + OT_staticBackpacks + [["Set_HMG"]];
}else{
_items = OT_vehicles + OT_boats + OT_staticBackpacks;
_items = OT_vehicles + OT_boats + OT_staticBackpacks + [["Set_HMG"]];
};
}
};

if(OT_adminMode) then {
_items = OT_helis + OT_vehicles + OT_boats + OT_staticBackpacks;
_items = OT_helis + OT_vehicles + OT_boats + OT_staticBackpacks + [["Set_HMG"]];
};

createDialog "OT_dialog_buy";

{
_cls = _x select 0;
_price = [_town,_cls,_standing] call OT_fnc_getPrice;
_price = 0;
if !(_cls == "Set_HMG") then {
_price = [_town,_cls,_standing] call OT_fnc_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];
_name = "";
_pic = "";
if(_cls == "Set_HMG") then {
_p = (cost getVariable "I_HMG_01_high_weapon_F") select 0;
_p = _p + ((cost getVariable "I_HMG_01_support_high_F") select 0);
private _quad = ((cost getVariable "C_Quadbike_01_F") select 0) + 60;
_p = _p + _quad;
_p = _p + 150; //Convenience cost
_price = _p;
_name = "Quad Bike w/ HMG Backpacks";
_pic = "C_Quadbike_01_F" call ISSE_Cfg_Vehicle_GetPic;
}else{
_pic = _cls call ISSE_Cfg_Vehicle_GetPic;
_name = _cls call ISSE_Cfg_Vehicle_GetName;
};
_idx = lbAdd [1500,format["%1",_name]];
lbSetPicture [1500,_idx,_pic];
lbSetData [1500,_idx,_cls];
lbSetValue [1500,_idx,_price];
}foreach(_items);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
private _town = (getpos player) call OT_fnc_nearestTown;
private _town = (getpos player) call OT_fnc_nearestTown;

_stock = server getVariable format["gunstock%1",_town];
if(isNil "_stock") then {
if(isNil "_stock") then {
_numguns = round(random 7)+3;
_count = 0;
_count = 0;
_stock = [[OT_item_BasicGun,25],[OT_item_BasicAmmo,1]];

_stock pushback [OT_ammo_50cal,25];

_p = (cost getVariable "I_HMG_01_high_weapon_F") select 0;
_p = _p + ((cost getVariable "I_HMG_01_support_high_F") select 0);
private _quad = ((cost getVariable "C_Quadbike_01_F") select 0) + 60;
_p = _p + _quad;
_p = _p + 50; //Convenience cost

_stock pushback ["Set_HMG",_p];

_stock pushback ["C_Quadbike_01_F",_quad];

{
_cost = cost getVariable _x;
_price = _cost select 0;
_stock pushBack [_x,_price];
}foreach(OT_allStaticBackpacks);

_tostock = [];
while {_count < _numguns} do {
_type = OT_allWeapons call BIS_fnc_selectRandom;
if !(_type in _tostock) then {

_tostock pushBack _type;
_count = _count + 1;
_cost = cost getVariable _type;
_price = round((_cost select 0) * ((random 2) + 1));
_stock pushBack [_type,_price];

_base = [_type] call BIS_fnc_baseWeapon;
_magazines = getArray (configFile / "CfgWeapons" / _base / "magazines");
_price = 2;
Expand All @@ -39,56 +58,56 @@ if(isNil "_stock") then {
};
if(_type in OT_allMissileLaunchers) then {
_price = 100;
};
_stock pushBack [_magazines call BIS_fnc_selectRandom,_price];
};
_stock pushBack [_magazines call BIS_fnc_selectRandom,_price];
};
};
{

{
_cost = cost getVariable _x;
_price = _cost select 0;
_stock pushBack [_x,_price];
}foreach(OT_allOptics);

_stock pushback [OT_ammo_50cal,25];

{
_cost = cost getVariable _x;
_price = _cost select 0;
_stock pushBack [_x,_price];
}foreach(OT_allStaticBackpacks);

{

{
_price = round (([_town,_x] call OT_fnc_getDrugPrice) * 0.9);
_stock pushBack [_x,_price];
}foreach(OT_allDrugs);
}foreach(OT_allDrugs);

server setVariable [format["gunstock%1",_town],_stock,true];
};

createDialog "OT_dialog_buy";
{
{
_cls = _x select 0;
_price = _x select 1;
if !(isNil "_cls") then {
_txt = _cls;
_pic = "";

call {
if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) exitWith {
_txt = format["--- %1",_cls call ISSE_Cfg_Magazine_GetName];
if(_cls == "Set_HMG") exitWith {
_txt = "Quadbike w/ HMG Backpacks";
_pic = "C_Quadbike_01_F" call ISSE_Cfg_Magazine_GetPic;
};
if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) exitWith {
_txt = format["--- %1",_cls call ISSE_Cfg_Magazine_GetName];
_pic = _cls call ISSE_Cfg_Magazine_GetPic;
};
if(_cls in OT_allStaticBackpacks) exitWith {
_txt = format["--- %1",_cls call ISSE_Cfg_Vehicle_GetName];
if(_cls in OT_allStaticBackpacks) exitWith {
_txt = format["--- %1",_cls call ISSE_Cfg_Vehicle_GetName];
_pic = _cls call ISSE_Cfg_Vehicle_GetPic;
};
_txt = _cls call ISSE_Cfg_Weapons_GetName;
_pic = _cls call ISSE_Cfg_Weapons_GetPic;
};
if(_cls isKindOf "Land") exitWith {
_txt = format["%1",_cls call ISSE_Cfg_Vehicle_GetName];
_pic = _cls call ISSE_Cfg_Vehicle_GetPic;
};
_txt = _cls call ISSE_Cfg_Weapons_GetName;
_pic = _cls call ISSE_Cfg_Weapons_GetPic;
};
_idx = lbAdd [1500,format["%1",_txt]];
lbSetData [1500,_idx,_cls];
lbSetValue [1500,_idx,_price];
lbSetPicture [1500,_idx,_pic];
};
}foreach(_stock);
}foreach(_stock);
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ if(typename _b == "ARRAY") then {
};
_buildingTxt = format["
<t align='left' size='0.8'>%1</t><br/>
<t align='left' size='0.65'>Lease Value: $%2/hr</t>
<t align='left' size='0.65'>Lease Value: $%2/6hrs</t>
",_name,[_lease, 1, 0, true] call CBA_fnc_formatNumber];

if(typeof _building == OT_barracks) then {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ refreshRecruits = {
lbClear 1500;
_t = 1;
{
_recruit = _x;
if !(isPlayer _x) then {
_idx = lbadd [1500,format["%1. %2 (%3)",_t,name _x,rank _x]];
_idx = lbadd [1500,format["%1. %2 (%3) [%4/%5]",_t,name _x,rank _x,_recruit getVariable ["OT_xp",0],OT_rankXP select (rankId _recruit)]];
lbSetValue [1500,_idx,_t];
};
_t = _t + 1;
Expand All @@ -22,24 +23,24 @@ refreshRecruits = {
recruitSelected = {
ctrlEnable [1600,true];
_recruit = (units group player) select (lbValue[1500,lbCurSel 1500]-1);
_town = (getpos _recruit) call OT_fnc_nearestTown;
disableSerialization;
disableSerialization;
_ctrl = (findDisplay 8004) displayCtrl 1100;
_ctrl ctrlSetStructuredText parseText format["
<t align='left' size='1.3'>%1</t><br/>
<t align='left' size='1'>Currently In %2</t><br/>
<t align='left' size='0.7'>Rank: %3</t>
",name _recruit,_town,rank _recruit];
<t align='center' size='1.3'>%1</t><br/><br/>
<t align='left' size='0.7'>Location: %2</t><br/>
<t align='left' size='0.7'>Rank: %3</t><br/>
<t align='left' size='0.7'>XP: %4/%5</t>
",name _recruit,(getpos _recruit) call BIS_fnc_locationDescription,rank _recruit,_recruit getVariable ["OT_xp",0],OT_rankXP select (rankId _recruit)];
};

dismissRecruit = {
_recruit = (units group player) select (lbValue[1500,lbCurSel 1500]-1);
deleteVehicle _recruit;
ctrlEnable [1600,false];
[] call refreshRecruits;
disableSerialization;
disableSerialization;
_ctrl = (findDisplay 8004) displayCtrl 1100;
_ctrl ctrlSetStructuredText parseText "";
_ctrl ctrlSetStructuredText parseText "";
};

[] call refreshRecruits;
[] call refreshRecruits;
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@ _money = player getVariable "money";
if(_money < _price) exitWith {"You cannot afford that!" call notify_minor};

call {
if(_cls == "Set_HMG") exitWith {
_pos = (getpos player) findEmptyPosition [5,100,"C_Quadbike_01_F"];
if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call notify_minor};

player setVariable ["money",_money-_price,true];
_veh = "C_Quadbike_01_F" createVehicle _pos;
_veh setVariable ["owner",getPlayerUID player,true];
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
clearBackpackCargoGlobal _veh;
clearItemCargoGlobal _veh;
_veh addBackpackCargoGlobal ["I_HMG_01_high_weapon_F", 1];
_veh addBackpackCargoGlobal ["I_HMG_01_support_high_F", 1];

player reveal _veh;
format["You bought a Quad Bike w/ HMG for $%1",_price] call notify_minor;
playSound "3DEN_notificationDefault";
};
if(OT_interactingWith getVariable ["factionrep",false] and ((_cls isKindOf "Land") or (_cls isKindOf "Air"))) exitWith {
_blueprints = server getVariable ["GEURblueprints",[]];
if !(_cls in _blueprints) then {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
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};
if({!captive _x} count (crew vehicle player) != 0) exitWith {"There are wanted people in this vehicle" call notify_minor};
};

if(((vehicle player) != player) and (vehicle player) isKindOf "Ship") exitWith {"You cannot fast travel in a boat" call notify_minor};

"Click near a friendly base/camp or a building you own" call notify_minor;
openMap true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ if(typename _data != "ARRAY") exitWith {
_owner = _x select 2;

_veh = createVehicle [OT_Item_Flag, _pos, [], 0, "CAN_COLLIDE"];
_veh enableDynamicSimulation true;
_veh setVariable ["owner",_owner,true];
_veh = createVehicle ["Land_ClutterCutter_large_F", _pos, [], 0, "CAN_COLLIDE"];
_veh enableDynamicSimulation true;

_mrkid = format["%1-base",_pos];
createMarker [_mrkid,_pos];
Expand Down Expand Up @@ -57,6 +59,7 @@ if(typename _data != "ARRAY") exitWith {
_name = _x select 5;
};
_veh = _type createVehicle _pos;
_veh enableDynamicSimulation true;

if(count _x > 7) then {
(_x select 7) params ["_fuel","_dmg"];
Expand All @@ -71,7 +74,8 @@ if(typename _data != "ARRAY") exitWith {

_veh setPosATL _pos;
if(_type isKindOf "Building") then {
createVehicle ["Land_ClutterCutter_large_F", _pos, [], 0, "CAN_COLLIDE"];
_clu = createVehicle ["Land_ClutterCutter_large_F", _pos, [], 0, "CAN_COLLIDE"];
_clu enableDynamicSimulation true;
};
if(typename _dir == "SCALAR") then {
//Pre 0.6.8 save, scalar direction
Expand Down Expand Up @@ -151,7 +155,7 @@ if(typename _data != "ARRAY") exitWith {
};

if(_type == OT_item_tent) then {
_mrkid = format["%1-camp",_pos];
_mrkid = format["%1-camp",_owner];
createMarker [_mrkid,_pos];
_mrkid setMarkerShape "ICON";
_mrkid setMarkerType "ot_Camp";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ if(_cost > 0) then {
_cls = modeValues select modeValue;

modeTarget = createVehicle [_cls, [0,0,0], [], 0, "CAN_COLLIDE"];
modeTarget enableDynamicSimulation true;
if(_cls == "B_Boat_Transport_01_F") then {
_dir = _dir + 90;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private _data = [];
_d = [];
_all = [];
{
if(_x != "ot_loaded" and _x != "owner" and _x != "morale" and _x != "player_uid" and _x != "sa_tow_actions_loaded" and _x != "hiding" and _x != "randomValue" and _x != "saved3deninventory" and (_x select [0,4]) != "ace_" and (_x select [0,4]) != "cba_" and (_x select [0,4]) != "bis_") then {
if(_x != "ot_loaded" and _x != "owner" and _x != "morale" and _x != "player_uid" and _x != "sa_tow_actions_loaded" and _x != "hiding" and _x != "randomValue" and _x != "saved3deninventory" and (_x select [0,11]) != "MissionData" and (_x select [0,4]) != "ace_" and (_x select [0,4]) != "cba_" and (_x select [0,4]) != "bis_") then {
_all pushback _x;
_val = _me getVariable _x;
if !(isNil "_val") then {
Expand Down Expand Up @@ -88,17 +88,23 @@ private _recruits = [];
{
_do = true;
_unitorpos = _x select 2;
_d = [_x select 0,_x select 1,_x select 2,_x select 3,_x select 4,_x select 5];
if(count _x > 6) then {
_d set [6,_x select 6];
}else{
_d set [6,0];
};
if(typename _unitorpos == "OBJECT") then {
if(alive _unitorpos) then {
_p = getpos _unitorpos;
_x set [4,getUnitLoadout _unitorpos];
_x set [2,[_p select 0,_p select 1,_p select 2]];
_d set [4,getUnitLoadout _unitorpos];
_d set [2,getpos _unitorpos];
_d set [6,_unitorpos getVariable ["OT_xp",0]];
}else{
_do = false;
};
};
if(_do) then {
_recruits pushback _x;
_recruits pushback _d;
};
}foreach(server getVariable ["recruits",[]]);

Expand Down
Loading

0 comments on commit f3679f8

Please sign in to comment.