@@ -12,60 +12,28 @@
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_supportCopter.sqf
*/
//[[[cog import generate_private_arrays ]]]
private ["_aiskill","_arrSkills","_arrUnits","_arrVals","_grp","_minAISkill","_player","_unit","_unitCount","_units"];
//[[[end]]]
params ["_pos","_copter"];

_player = player; //need to check on change owner
_unit = objNull;

_grp = createGroup RESISTANCE;
_grp setBehaviour "COMBAT";
_grp setCombatMode "RED";

_minAISkill = getNumber (getMissionConfig "CfgEpochUAVSupport" >> "minAISkill");
_arrUnits = getArray (getMissionConfig "CfgEpochUAVSupport" >> "unitTypes");
_unitCount = getNumber (getMissionConfig "CfgEpochUAVSupport" >> "maxUnitNum");
_arrSkills = ["aimingAccuracy","aimingShake","aimingSpeed","endurance","spotDistance","spotTime","courage","reloadSpeed","commanding","general"];
_arrVals = [
getNumber (getMissionConfig "CfgEpochUAVSupport" >> "maxAimingAccuracy"),
getNumber (getMissionConfig "CfgEpochUAVSupport" >> "maxAimingShake"),
getNumber (getMissionConfig "CfgEpochUAVSupport" >> "maxAimingSpeed"),
getNumber (getMissionConfig "CfgEpochUAVSupport" >> "maxEndurance"),
getNumber (getMissionConfig "CfgEpochUAVSupport" >> "maxSpotDistance"),
getNumber (getMissionConfig "CfgEpochUAVSupport" >> "maxSpotTime"),
getNumber (getMissionConfig "CfgEpochUAVSupport" >> "maxCourage"),
getNumber (getMissionConfig "CfgEpochUAVSupport" >> "maxReloadSpeed"),
getNumber (getMissionConfig "CfgEpochUAVSupport" >> "maxCommanding"),
getNumber (getMissionConfig "CfgEpochUAVSupport" >> "maxGeneral")
];
_units = [];
for "_i" from 0 to (_unitCount - 1) do {

_unit = _grp createUnit[selectRandom _arrUnits, _pos, [], 0, "FORM"];
_units pushBack _unit;

//_unit setSkill 0.6;
_unit setRank "Private";

_unit enableAI "TARGET";
_unit enableAI "AUTOTARGET";
_unit enableAI "MOVE";
_unit enableAI "ANIM";
_unit disableAI "FSM";

for "_i" from 0 to ((count _arrSkills)-1) do {
_aiskill = floor random (_arrVals select _i);
if (_aiskill<_minAISkill) then {_aiskill=_minAISkill};
_unit setSkill [_arrSkills select _i,_arrVals select _i];
};

if (_i == 0) then {
_grp selectLeader _unit;
[_pos,_copter,_player,_unit] execFSM "\x\addons\a3_epoch_code\System\Group_Leader_Brain.fsm";
_minunitCount = getNumber (getMissionConfig "CfgEpochUAVSupport" >> "minUnitNum");
_maxunitCount = getNumber (getMissionConfig "CfgEpochUAVSupport" >> "maxUnitNum");
_unitCount = _minunitCount + round (random (_maxunitCount - _minunitCount));

_SpawnTypes = [];
_Spawncounts = [];
for "_i" from 1 to _unitCount do {
_UnitType = selectRandom _arrUnits;
_idx = _SpawnTypes find _UnitType;
if (_idx == -1) then {
_SpawnTypes pushback _UnitType;
_Spawncounts pushback 1;
}
else {
_Spawncounts set [_idx,(_Spawncounts select _idx)+ 1];
};
};

// cleanup units or (transfer ownership) if player logs out
_units remoteExec ["EPOCH_localCleanup",2];
{
[_SpawnTypes select _foreachindex, player, true, _x, _this] call EPOCH_unitSpawn;
} forEach _Spawncounts;

@@ -15,25 +15,22 @@
//[[[cog import generate_private_arrays ]]]
private ["_bomb","_config","_currentLimit","_disableAI","_driver","_grp","_index","_jammerRange","_jammers","_loop","_nonJammer","_nonTrader","_nonTraderAIRange","_restricted","_sapperNum","_spawnLimit","_targetPos","_unit","_units"];
//[[[end]]]
params ["_unitClass",["_trgt",player],["_doVariable",false]];
params ["_unitClass",["_trgt",player],["_doVariable",false],["_unitCount",1],["_extraData",[]]];

_bomb = objNull;
// diag_log format["DEBUG: Antagonist %1 Spawning on %2. Do variable: %3.", _unitClass, _trgt, _doVariable];

if(random 100 < 6)then{
[] execFSM "\x\addons\a3_epoch_code\System\Event_Air_Drop.fsm";
};
if(_doVariable)then{_unitClass call EPOCH_unitSpawnIncrease;};//Assumes Antagonist is required.

_index = EPOCH_spawnIndex find _unitClass;
_spawnLimit = EPOCH_playerSpawnArray select _index;
_spawnLimit = 0;
if (_index != -1) then {
_spawnLimit = EPOCH_playerSpawnArray select _index;
};
_currentLimit = count(_trgt nearEntities[_unitClass, 800]);
if (!_doVariable && (_currentLimit >= _spawnLimit)) exitWith {
diag_log format["DEBUG: too many %1 exiting unitspawn",_unitClass];
};

_nonJammer = ["CfgEpochClient", "nonJammerAI", ["B_Heli_Transport_01_F","PHANTOM","EPOCH_Sapper_F","Epoch_SapperB_F","I_UAV_01_F","EPOCH_RyanZombie_1"]] call EPOCH_fnc_returnConfigEntryV2;
_nonTrader = ["CfgEpochClient", "nonTraderAI", ["B_Heli_Transport_01_F","PHANTOM","EPOCH_Sapper_F","Epoch_SapperB_F","I_UAV_01_F","Epoch_Cloak_F","GreatWhite_F","EPOCH_RyanZombie_1"]] call EPOCH_fnc_returnConfigEntryV2;
_nonJammer = ["CfgEpochClient", "nonJammerAI", ["B_Heli_Transport_01_F","PHANTOM","EPOCH_Sapper_F","Epoch_SapperG_F","Epoch_SapperB_F","I_UAV_01_F","EPOCH_RyanZombie_1"]] call EPOCH_fnc_returnConfigEntryV2;
_nonTrader = ["CfgEpochClient", "nonTraderAI", ["B_Heli_Transport_01_F","PHANTOM","EPOCH_Sapper_F","Epoch_SapperG_F","Epoch_SapperB_F","I_UAV_01_F","Epoch_Cloak_F","GreatWhite_F","EPOCH_RyanZombie_1"]] call EPOCH_fnc_returnConfigEntryV2;
_nonTraderAIRange = ["CfgEpochClient", "nonTraderAIRange", 150] call EPOCH_fnc_returnConfigEntryV2;
_loop = false;
_unit = objNull;
@@ -55,18 +52,22 @@ _disableAI = {
_units = [];
switch _unitClass do {
case "Epoch_Cloak_F": {
_unit = createAgent[_unitClass, _targetPos, [], 256, "FORM"];
_units pushBack _unit;
_unit call _disableAI;
[_unit,_trgt] execFSM "\x\addons\a3_epoch_code\System\cloak.fsm";
for "_i" from 0 to (_unitCount-1) do {
_unit = createAgent[_unitClass, _targetPos, [], 256, "FORM"];
_units pushBack _unit;
_unit call _disableAI;
[_unit,_trgt] execFSM "\x\addons\a3_epoch_code\System\cloak.fsm";
};
};
case "GreatWhite_F": {
if (surfaceIsWater _targetPos) then{
if (((_targetPos vectorDiff getPosASL _trgt) select 2) > 25) then{
_unit = createAgent[_unitClass, _targetPos, [], 120, "FORM"];
_units pushBack _unit;
_unit call _disableAI;
[_unit] execFSM "\x\addons\a3_epoch_code\System\Shark_Brain.fsm";
for "_i" from 0 to (_unitCount-1) do {
_unit = createAgent[_unitClass, _targetPos, [], 120, "FORM"];
_units pushBack _unit;
_unit call _disableAI;
[_unit] execFSM "\x\addons\a3_epoch_code\System\Shark_Brain.fsm";
};
};
};
};
@@ -79,39 +80,59 @@ switch _unitClass do {
};
[_trgt,_sapperNum] execVM "epoch_code\compile\EPOCH_callSapperMigration.sqf";
}else{
for "_i" from 0 to (_unitCount-1) do {
_unit = createAgent[_unitClass, _targetPos, [], 256, "FORM"];
_units pushBack _unit;
_bomb = createVehicle ["Sapper_Charge_Ammo", _targetPos, [], 0, "CAN_COLLIDE"];
_bomb attachTo [_unit, [0,0,0],"Pelvis"];
_unit call _disableAI;
_sapperHndl = [_unit, _bomb, _trgt] execFSM "\x\addons\a3_epoch_code\System\Sapper_Brain.fsm";
_unit setVariable ["sapperHndl",_sapperHndl];
_unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]];
_unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]];
};
};
};
case "Epoch_SapperG_F": {
for "_i" from 0 to (_unitCount-1) do {
_unit = createAgent[_unitClass, _targetPos, [], 256, "FORM"];
_units pushBack _unit;
_bomb = createVehicle ["Sapper_Charge_Ammo", _targetPos, [], 0, "CAN_COLLIDE"];
_bomb = createVehicle ["SmokeShellToxicSapper", _targetPos, [], 0, "CAN_COLLIDE"];
_bomb attachTo [_unit, [0,0,0],"Pelvis"];
_unit call _disableAI;
sapperHndl = [_unit, _bomb, _trgt] execFSM "\x\addons\a3_epoch_code\System\Sapper_Brain.fsm";
_unit addEventHandler ["FiredNear", "sapperHndl setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];"];
_unit addEventHandler ["Hit", "sapperHndl setFSMVariable [""_sHit"",[_this select 1, _this select 2]];"];
_sapperHndl = [_unit, _bomb, _trgt] execFSM "\x\addons\a3_epoch_code\System\Sapper_Brain2.fsm";
_unit setVariable ["sapperHndl",_sapperHndl];
_unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]];
_unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]];
};
};
case "Epoch_SapperB_F": {
_unit = createAgent[_unitClass, _targetPos, [], 256, "FORM"];
_units pushBack _unit;
_bomb = createVehicle["SapperB_Charge_Ammo", _targetPos, [], 0, "CAN_COLLIDE"];
_bomb attachTo[_unit, [0, 0, 0], "Pelvis"];
_unit call _disableAI;
sapperHndl = [_unit, _bomb, _trgt] execFSM "\x\addons\a3_epoch_code\System\Sapper_Brain2.fsm";
_unit addEventHandler["FiredNear", "sapperHndl setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];"];
_unit addEventHandler["Hit", "sapperHndl setFSMVariable [""_sHit"",[_this select 1, _this select 2]];"];
for "_i" from 0 to (_unitCount-1) do {
_unit = createAgent[_unitClass, _targetPos, [], 256, "FORM"];
_units pushBack _unit;
_bomb = createVehicle["SapperB_Charge_Ammo", _targetPos, [], 0, "CAN_COLLIDE"];
_bomb attachTo[_unit, [0, 0, 0], "Pelvis"];
_unit call _disableAI;
_sapperHndl = [_unit, _bomb, _trgt] execFSM "\x\addons\a3_epoch_code\System\Sapper_Brain2.fsm";
_unit setVariable ["sapperHndl",_sapperHndl];
_unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]];
_unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]];
};
};
case "I_UAV_01_F": {
_targetPos = getPosATL _trgt;
_targetPos = [_targetPos, 600, 1200, 5, 0, 400, 0] call BIS_fnc_findSafePos;
_targetPos set[2, 600];
_unit = createVehicle["I_UAV_01_F", _targetPos, [], 0, "FLY"];
_unit disableTIEquipment true;
_units pushBack _unit;
addToRemainsCollector[_unit];
_unit flyInHeight 600;
_grp = createGroup RESISTANCE;
_driver = _grp createUnit["I_UAV_AI", position _unit, [], 0, "CAN_COLLIDE"];
_driver moveInAny _unit;
[_unit, _trgt] execFSM "\x\addons\a3_epoch_code\System\Copter_brain.fsm";
for "_i" from 0 to (_unitCount-1) do {
_targetPos = [_targetPos, 600, 1200, 5, 0, 400, 0] call BIS_fnc_findSafePos;
_targetPos set[2, 600];
_unit = createVehicle["I_UAV_01_F", _targetPos, [], 0, "FLY"];
_unit disableTIEquipment true;
_units pushBack _unit;
addToRemainsCollector[_unit];
_unit flyInHeight 600;
_grp = createGroup [RESISTANCE, true];
_driver = _grp createUnit["I_UAV_AI", position _unit, [], 0, "CAN_COLLIDE"];
_driver moveInAny _unit;
[_unit, _trgt] execFSM "\x\addons\a3_epoch_code\System\Copter_brain.fsm";
};
};
case "PHANTOM": {
[] execFSM "\x\addons\a3_epoch_code\System\Phantom_Brain.fsm";
@@ -126,6 +147,52 @@ switch _unitClass do {
_units pushBack _unit;
};
};
case "I_Soldier_EPOCH": {
_extraData params [["_pos",[]],["_copter",objnull]];
if (_pos isEqualTo []) then {
_pos = [_targetPos,80,150,1,true] call EPOCH_fnc_findSafePos;
};
_pos set [2,0];
_grp = createGroup [RESISTANCE, true];
_grp setBehaviour "COMBAT";
_grp setCombatMode "RED";
_minAISkill = getNumber (getMissionConfig "CfgEpochSoldier" >> "minAISkill");
_arrUnits = getArray (getMissionConfig "CfgEpochSoldier" >> "unitTypes");
_arrSkills = ["aimingAccuracy","aimingShake","aimingSpeed","endurance","spotDistance","spotTime","courage","reloadSpeed","commanding","general"];
_arrVals = [
getNumber (getMissionConfig "CfgEpochSoldier" >> "maxAimingAccuracy"),
getNumber (getMissionConfig "CfgEpochSoldier" >> "maxAimingShake"),
getNumber (getMissionConfig "CfgEpochSoldier" >> "maxAimingSpeed"),
getNumber (getMissionConfig "CfgEpochSoldier" >> "maxEndurance"),
getNumber (getMissionConfig "CfgEpochSoldier" >> "maxSpotDistance"),
getNumber (getMissionConfig "CfgEpochSoldier" >> "maxSpotTime"),
getNumber (getMissionConfig "CfgEpochSoldier" >> "maxCourage"),
getNumber (getMissionConfig "CfgEpochSoldier" >> "maxReloadSpeed"),
getNumber (getMissionConfig "CfgEpochSoldier" >> "maxCommanding"),
getNumber (getMissionConfig "CfgEpochSoldier" >> "maxGeneral")
];
for "_i" from 0 to (_unitCount - 1) do {
_unit = _grp createUnit[selectRandom _arrUnits, _pos, [], 0, "FORM"];
_units pushBack _unit;
_unit setRank "Private";
_unit enableAI "TARGET";
_unit enableAI "AUTOTARGET";
_unit enableAI "MOVE";
_unit enableAI "ANIM";
_unit disableAI "FSM";
// randomize skill
for "_i" from 0 to ((count _arrSkills)-1) do {
_aiskill = floor random (_arrVals select _i);
if (_aiskill<_minAISkill) then {_aiskill=_minAISkill};
_unit setSkill [_arrSkills select _i,_arrVals select _i];
};
// spawn brains only on leader
if (_i == 0) then {
_grp selectLeader _unit;
[_pos,_copter,_trgt,_unit] execFSM "\x\addons\a3_epoch_code\System\Group_Leader_Brain.fsm";
};
};
};
};

if(_doVariable && (!isNull _unit) && (!isNull _trgt))then{
@@ -23,14 +23,15 @@
BOOL
*/
//[[[cog import generate_private_arrays ]]]
private ["_alljammer","_buildingAllowed","_buildingCountLeader","_buildingCountLimit","_buildingCountPerMember","_buildingJammerRange","_bypassJammer","_c","_cfgBaseBuilding","_config","_isAllowed","_jammer","_jammerPerGroup","_limitNearby","_maxBuildingHeight","_membercount","_minjammerdistance","_myPosATL","_nearestJammer","_obj","_objType","_objectCount","_ownedJammerExists","_range","_restricted","_restrictedArray","_restrictedLocations","_restrictedLocationsArray","_restrictedLocationsRange","_simulClass","_staticClass","_storageCountLeader","_storageCountPerMember","_scl","_gcl","_storageCountLimit","_useGroupCountLimits","_ghostClass"];
private ["_alljammer","_buildingAllowed","_buildingCountLeader","_buildingCountLimit","_buildingCountPerMember","_buildingJammerRange","_bypassJammer","_c","_cfgBaseBuilding","_config","_ghostClass","_isAllowed","_jammer","_jammerGLOnly","_jammerPerGroup","_limitNearby","_maxBuildingHeight","_membercount","_minJammerDistance","_myPosATL","_nearestJammer","_obj","_objType","_objectscount","_ownedJammerExists","_range","_restricted","_restrictedArray","_restrictedLocations","_restrictedLocationsArray","_restrictedLocationsRange","_simulClass","_staticClass","_storageCountLeader","_storageCountLimit","_storageCountPerMember","_useGroupCountLimits","_useSplitCountLimits"];
//[[[end]]]

_buildingAllowed = true;
_ownedJammerExists = false;
_useSplitCountLimits = false;
_useGroupCountLimits = true;
_nearestJammer = objNull;
_jammerGLOnly = true;

// reject building if in vehicle
if (vehicle player != player)exitWith{["Building Disallowed: Inside Vehicle", 5] call Epoch_message; false };
@@ -50,6 +51,7 @@ _maxBuildingHeight = getNumber(_config >> "maxBuildingHeight");
_jammerPerGroup = getNumber(_config >> "jammerPerGroup");
if(getNumber(_config >> "useGroupCountLimits") == 0)then{_useGroupCountLimits=false};
if(getNumber(_config >> "splitCountLimits") == 1)then{_useSplitCountLimits=true};
if(getNumber(_config >> "jammerGLOnly") == 0)then{_jammerGLOnly=false};
if(_buildingJammerRange == 0)then{_buildingJammerRange = 75};
if(_buildingCountLimit == 0)then{_buildingCountLimit = 200};
if(_buildingCountLeader == 0)then{_buildingCountLeader = _buildingCountLimit};
@@ -81,7 +83,7 @@ if !(_jammer isEqualTo []) then {
["Building Disallowed: Existing Jammer Signal", 5] call Epoch_message;
};
} foreach _jammer;
}
}
else {
{
if (alive _x && (_x distance player) <= _buildingJammerRange) exitWith{
@@ -96,9 +98,14 @@ if !(_jammer isEqualTo []) then {
_ownedJammerExists = true;
if(_useGroupCountLimits)then{
_membercount = 0;
if(count Epoch_my_Group > 0)then{
_membercount = count (Epoch_my_Group select 3) + count (Epoch_my_Group select 4)
};
Epoch_my_Group params [
["_groupName",""],
["_leaderName",""],
["_groupSize",0],
["_modArray",[]],
["_memberArray",[]]
];
_membercount = count _modArray + count _memberArray;
_storageCountLimit = _storageCountLeader + (_storageCountPerMember * _membercount);
_buildingCountLimit = _buildingCountLeader + (_buildingCountPerMember * _membercount);
};
@@ -131,6 +138,10 @@ if !(_jammer isEqualTo []) then {
}
else {
if (_objType in ["PlotPole_EPOCH", "PlotPole_SIM_EPOCH"]) then {
if (!(EPOCH_my_groupUID isequalto "") && !((getplayeruid player) isequalto EPOCH_my_groupUID) && _jammerGLOnly) exitwith {
_buildingAllowed = false;
["The Group Leader must place the Jammer!", 5] call Epoch_message;
};
// TODO: rework not ideal to use allmissionobjects
_alljammer = allmissionobjects 'PlotPole_EPOCH';
_c = 0;
@@ -101,14 +101,7 @@ if (isText(_simulClassConfig)) then {
_lastCheckTime = diag_tickTime;
_rejectMove = !(EPOCH_target call EPOCH_isBuildAllowed);
};
if (_rejectMove) exitWith{
// remove object and refund items
deleteVehicle EPOCH_target;
_removeParts = getArray(('CfgBaseBuilding' call EPOCH_returnConfig) >> _objType >> "removeParts");
{
[_x select 0,_x select 1] call EPOCH_fnc_addItemOverflow;
} forEach _removeParts;
};
if (_rejectMove) exitWith { EPOCH_target = objNull; };
_playerdistance = player distance EPOCH_target;
if (_playerdistance < 10) then {
_isSnap = false;
@@ -0,0 +1,19 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors: [Ignatz] He-Man
Description:
A3 Epoch InventoryClosed Eventhandler
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/event_handlers/EPOCH_InventoryClosed.sqf
*/
params ["_unit","_container"];
if !(EPOCH_arr_interactedObjs isEqualTo[]) then {
[EPOCH_arr_interactedObjs] remoteExec['EPOCH_server_save_vehicles', 2];
EPOCH_arr_interactedObjs = [];
};
@@ -0,0 +1,37 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors: [Ignatz] He-Man
Description:
A3 Epoch InventoryOpened Eventhandler
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/event_handlers/EPOCH_InventoryOpened.sqf
*/
params ["_unit","_container","_sec"];
setMousePosition[0.5, 0.5];
call EPOCH_showStats;
_this spawn EPOCH_initUI;
_containerlocked = (locked _container in [2, 3] || _container getVariable['EPOCH_Locked', false]);
_seclocked = false;
if !(isNull _sec) then {
_seclocked = (locked _sec in [2, 3] || _sec getVariable['EPOCH_Locked', false]);
};
_blocked = (_containerlocked && _seclocked);
if (!_blocked && _containerlocked || _seclocked) then {
[] spawn {
disableSerialization;
waitUntil {!isNull findDisplay 602};
_d = findDisplay 602;
_cargo = _d displayCtrl 6401;
_ground = _d displayCtrl 6321;
_cargo ctrlEnable false;
ctrlSetFocus _ground;
ctrlActivate _ground;
};
};
_blocked
@@ -32,6 +32,9 @@ params ["_display","_dikCode","_shift","_ctrl","_alt"];

_handled = false;

_this call Epoch_custom_EH_KeyDown;
if (_handled) exitWith{ true };

if !(alive player) exitWith{ false };

EPOCH_doRotate = false;
@@ -80,6 +83,7 @@ if (_dikCode == EPOCH_keysDebugMon) then {
//Action Menu
if (_dikCode == EPOCH_keysAction) then {
//_handled = true;
{player reveal _x;} foreach (player nearObjects 50);
if !(EPOCH_keysActionPressed) then {
EPOCH_keysActionPressed = true;
if (cursorTarget isKindOf "AllVehicles") then {
@@ -147,6 +151,9 @@ if (vehicle player == player) then {
_currentPos = ATLtoASL _currentPos;
};
player forceWalk(lineIntersects[eyePos player, _currentPos, player, objNull]);
}
else {
player forceWalk false;
};
};
};
@@ -30,6 +30,10 @@ private ["_handled"];
//[[[end]]]
params ["_display","_dikCode","_shift","_ctrl","_alt"];
_handled = false;

_this call Epoch_custom_EH_KeyUp;
if (_handled) exitWith{ true };

//Main actions
if (_dikCode == EPOCH_keysAction) then {
EPOCH_keysActionPressed = false;
@@ -49,7 +49,7 @@ if !(_interactActions isEqualTo []) then {
};
// ammo repack
if (_magCount > 1) then {
_button_texts pushBack ["REPACK"];
_button_texts pushBack ["REPACK","[0] call EPOCH_consumeItem;"];
};

_config = 'CfgCrafting' call EPOCH_returnConfig;
@@ -16,7 +16,7 @@
private ["_unit"];
//[[[end]]]
for "_i" from 0 to 4 step 1 do {
_unit = createGroup RESISTANCE createUnit ["Epoch_Female_F", getPos player, [], 400, "CAN_COLLIDE"];
_unit = createGroup [RESISTANCE, true] createUnit ["Epoch_Female_F", getPos player, [], 400, "CAN_COLLIDE"];
_unit addBackPack "B_FieldPack_blk";
_unit addWeapon "Hatchet";
_unit addMagazine "hatchet_swing";
@@ -6,7 +6,7 @@ _unit = createVehicle["I_UAV_01_F", _targetPos, [], 0, "FLY"];
_unit disableTIEquipment true;
addToRemainsCollector[_unit];
_unit flyInHeight 600;
_grp = createGroup RESISTANCE;
_grp = createGroup [RESISTANCE, true];
_driver = _grp createUnit["I_UAV_AI", position _unit, [], 0, "CAN_COLLIDE"];
_driver moveInAny _unit;
[_unit, _trgt] execFSM "\x\addons\a3_epoch_code\System\Copter_brain.fsm";
@@ -0,0 +1,14 @@
if (vehicle player == player) exitwith {false};
if !(local vehicle player) exitwith {false};
if (speed vehicle player > 2 || speed vehicle player < -2) exitwith {false};
if (((getpos vehicle player) select 2) > 1) exitwith {false};

_config = 'CfgServicePoint' call EPOCH_returnConfig;
_servicepoints = getArray (_config >> worldname >> 'ServicePoints');
_servicepointDist = ["CfgServicePoint", "ServicePointDist", 40] call EPOCH_fnc_returnConfigEntryV2;

if (_servicepoints isequalto []) exitwith {false};
if !(({player distance _x < _servicepointDist} count _servicepoints > 0)) exitwith {false};
_Vehicle = vehicle player;
if (!(_Vehicle iskindof 'ship') && (((getposasl _Vehicle) select 2) < 1)) exitwith {false};
true
@@ -0,0 +1,30 @@
params ['_vehicle','_ammotype','_turret','_reloagmags','_ammocount','_costs'];
private ['_magname'];
_vehtype = typeof _vehicle;
_VehName = getText(configFile >> 'cfgVehicles' >> _vehtype >> 'displayName');
if (!local _vehicle) exitWith {
_line = 'Rearm denied - Vehicle is not local to you!';
[_line,5] call Epoch_message;
};
if(count (crew _vehicle) > 1) exitWith {
_line = 'Rearm denied - All Passengers must exit the Vehicle!';
[_line,5] call Epoch_message;
};
if (EPOCH_playerCrypto < _costs) exitWith {
_line = format ['You need %1 Crypto to re-arm %2', _costs,_VehName];
[_line,5] call Epoch_message;
};

if(_costs > 0)then{
[player,(_costs*-1),Epoch_personalToken] remoteexec ['epoch_server_paycrypto',2];
};
_vehicle removeMagazinesTurret [_ammotype,_turret];
for '_i' from 1 to _reloagmags do {
_vehicle addMagazineTurret [_ammotype, _turret, _ammocount];
};
_magname = getText (configFile >> 'CfgMagazines' >> _ammotype >> 'displayName');
if (_magname isequalto '') then {
_magname = _ammotype;
};
_line = format ['%1 rearmed with %2', _VehName, _magname];
[_line,5] call Epoch_message;
@@ -0,0 +1,33 @@
private ['_vehicle','_args','_servicePoint','_costs','_updateInterval','_amount','_type','_name','_textMissing'];
_vehicle = _this select 0;
if (!local _vehicle) exitWith {};
_args = _this select 1;
_costs = _args select 0;
_updateInterval = _args select 1;
_amount = _args select 2;
_type = typeOf _vehicle;
_name = getText(configFile >> 'cfgVehicles' >> _type >> 'displayName');
if (EPOCH_playerCrypto < _costs) exitWith {
_line = format ['You need %1 Crypto to refuel %2', _costs,_name];
[_line,5] call Epoch_message;
};
if(_costs > 0)then{
[player,(_costs*-1),Epoch_personalToken] remoteexec ['epoch_server_paycrypto',2];
};
_vehicle engineOn false;
if ((vehicle player != _vehicle) || (!local _vehicle) || speed _vehicle < -2 || speed _vehicle > 2) exitWith {
_line = format ['Fueling of %1 stopped', _name];
[_line,5] call Epoch_message;
};
while {(vehicle player == _vehicle) && (local _vehicle)} do {
if (speed _vehicle > 2 || speed _vehicle < -2 ) exitWith {
_line = format ['Refueling of %1 stopped', _name];
[_line,5] call Epoch_message;
};
_vehicle setFuel ((Fuel _vehicle)+_amount);
if (Fuel _vehicle > 0.99) exitWith {
_line = format ['%1 Refueled', _name];
[_line,5] call Epoch_message;
};
uisleep _updateInterval;
};
@@ -0,0 +1,50 @@
private ['_Ignatz_vehicle','_args','_servicePoint','_costs','_repairTime','_type','_name','_hitpoints','_allRepaired'];
_Ignatz_vehicle = _this select 0;
if (!local _Ignatz_vehicle) exitWith {
diag_log format['Error: called service_point_repair.sqf with non-local vehicle: %1', _Ignatz_vehicle]
};
_args = _this select 1;
_costs = _args select 0;
_repairTime = _args select 1;
_type = typeOf _Ignatz_vehicle;
_name = getText(configFile >> 'cfgVehicles' >> _type >> 'displayName');
if (EPOCH_playerCrypto < _costs) exitWith {
_line = format ['You need %1 Crypto to Repair %2', _costs,_name];
[_line,5] call Epoch_message;
};
if(_costs > 0)then{
[player,(_costs*-1),Epoch_personalToken] remoteexec ['epoch_server_paycrypto',2];
};
_Ignatz_vehicle engineOn false;
_repaired = [];
_allRepaired = true;
_allHitPointsDamage = getAllHitPointsDamage _Ignatz_vehicle;
{
if ((vehicle player != _Ignatz_vehicle) || (!local _Ignatz_vehicle) || speed _Ignatz_vehicle < -2 || speed _Ignatz_vehicle > 2) exitWith {
_allRepaired = false;
_line = format ['Repairing of %1 stopped', _name];
[_line,5] call Epoch_message;
};
if (!(_x in _repaired) && !(_x isequalto "") && (_allHitPointsDamage select 2 select _foreachindex) > 0) then {
_partName = toarray _x;
_partName set [0,20];
_partName set [1,45];
_partName set [2,20];
_partName = toString _partName;
_Ignatz_vehicle setHitPointDamage [_x,0];
_line = format ['Repairing%1 ...', _partName];
[_line,5] call Epoch_message;
_repaired pushback _x;
uisleep _repairTime;
};
} foreach (_allHitPointsDamage select 0);
if (_allRepaired) then {
if ((damage _Ignatz_vehicle) > 0) then {
[_Ignatz_vehicle,["ALL",0],player,Epoch_personalToken] remoteExec ["EPOCH_server_repairVehicle",2];
};
_pos = getposatl _Ignatz_vehicle;
_pos set [2,(_pos select 2)+0.25];
_Ignatz_vehicle setposatl _pos;
_line = format ['%1 full Repaired', _name];
[_line,5] call Epoch_message;
};
@@ -0,0 +1,104 @@
Ignatz_Refuel = nil;
Ignatz_Repair = nil;
Ignatz_Rearm0 = nil;
Ignatz_Rearm1 = nil;
Ignatz_Rearm2 = nil;
Ignatz_Rearm3 = nil;

if (vehicle player == player) exitwith {false};
if !(local vehicle player) exitwith {false};
if (speed vehicle player > 2 || speed vehicle player < -2) exitwith {false};
if (((getpos vehicle player) select 2) > 1) exitwith {false};

private ['_missingammo','_ownedcompletemags','_magname','_actionTitle','_costs','_vehicle','_refuel_costs','_refuel_updateInterval','_refuel_amount','_costsFree','_repair_costs','_repair_repairTime','_fnc_getCosts','_fnc_actionTitle'];

_config = 'CfgServicePoint' call EPOCH_returnConfig;
_servicepoints = getArray (_config >> worldname >> 'ServicePoints');
_servicepointDist = ["CfgServicePoint", "ServicePointDist", 40] call EPOCH_fnc_returnConfigEntryV2;

if !(({player distance _x < _servicepointDist} count _servicepoints > 0)) exitwith {false};
_Vehicle = vehicle player;
if (!(_Vehicle iskindof 'ship') && (((getposasl _Vehicle) select 2) < 1)) exitwith {false};

_repair_costs = ["CfgServicePoint", "repair_costs", []] call EPOCH_fnc_returnConfigEntryV2;
_refuel_costs = ["CfgServicePoint", "refuel_costs", []] call EPOCH_fnc_returnConfigEntryV2;
_refuel_updateInterval = ["CfgServicePoint", "refuel_updateInterval", 1] call EPOCH_fnc_returnConfigEntryV2;
_refuel_amount = ["CfgServicePoint", "refuel_amount", 0.1] call EPOCH_fnc_returnConfigEntryV2;
_repairTime = ["CfgServicePoint", "repairTime", 1.2] call EPOCH_fnc_returnConfigEntryV2;
_VehiclesAndAmmo = ["CfgServicePoint", "VehiclesAndAmmo", []] call EPOCH_fnc_returnConfigEntryV2;

_Ignatz_SP_Array = [];
_costsFree = 'free';

_fnc_getCosts = {
private ['_typeName','_vehicle','_costs','_cost'];
_vehicle = _this select 0;
_costs = _this select 1;
_cost = 0;
{
_typeName = _x select 0;
if (_vehicle isKindOf _typeName) exitWith {
_cost = _x select 1;
};
} forEach _costs;
_cost
};
_fnc_actionTitle = {
private ['_itemName','_displayName','_actionName','_costs','_costsText','_actionTitle'];
_actionName = _this select 0;
_costs = _this select 1;
_costsText = _costsFree;
if (_costs > 0) then {
_costsText = format ['%1 Crypto',_costs];
};
_actionTitle = format ['%1 (%2)', _actionName, _costsText];
_actionTitle
};

{
if ((typeof _vehicle) == _x select 0) exitwith {
{
_ammotype = _x select 0;
_turret = _x select 1;
_maxmags = _x select 2;
_costs = _x select 3;
_ammocount = getNumber (configfile >> "CfgMagazines" >> (_x select 0) >> "count");
_maxammototal = _maxmags*_ammocount;
_totalammocount = 0;
{
if (_ammotype isequalto (_x select 0) && _turret isequalto (_x select 1)) then {
_totalammocount = _totalammocount + (_x select 2);
};
} foreach (magazinesAllTurrets _vehicle);
if (_totalammocount < _maxammototal) then {
for '_i' from 1 to 10 do {
if (_totalammocount < _i*_ammocount) exitwith {
_ownedcompletemags = _i-1;
_missingammo = _ammocount*_i - _totalammocount;
_costs = round (_costs/_ammocount*_missingammo);
};
};
_magname = getText (configFile >> 'CfgMagazines' >> _ammotype >> 'displayName');
if (_magname isequalto '') then {
_magname = _ammotype;
};
_reloagmags = _ownedcompletemags+1;
_actionTitle = format['Rearm %1 with %2 round %3 (%4 Crypto)',getText (configFile >> 'Cfgvehicles' >> typeOf _vehicle >> 'displayName'),_missingammo,_magname, _costs];
_Ignatz_SP_Array pushback [_actionTitle,[_vehicle,_ammotype,_turret,_reloagmags,_ammocount,_costs]];
};
} foreach (_x select 1);
};
} foreach _VehiclesAndAmmo;

_costs = [_vehicle, _refuel_costs] call _fnc_getCosts;
_actionTitle = [format['Refuel %1',getText (configFile >> 'Cfgvehicles' >> typeOf _vehicle >> 'displayName')], _costs] call _fnc_actionTitle;
Ignatz_Refuel = [_actionTitle,[_vehicle,[_costs, _refuel_updateInterval,_refuel_amount]]];

_costs = [_vehicle, _repair_costs] call _fnc_getCosts;
_actionTitle = [format['Repair %1',getText (configFile >> 'Cfgvehicles' >> typeOf _vehicle >> 'displayName')], _costs] call _fnc_actionTitle;
Ignatz_Repair = [_actionTitle,[_vehicle,[_costs, _repairTime]]];
if (count _Ignatz_SP_Array > 0) then {Ignatz_Rearm0 = _Ignatz_SP_Array select 0;};
if (count _Ignatz_SP_Array > 1) then {Ignatz_Rearm1 = _Ignatz_SP_Array select 1;};
if (count _Ignatz_SP_Array > 2) then {Ignatz_Rearm2 = _Ignatz_SP_Array select 2;};
if (count _Ignatz_SP_Array > 3) then {Ignatz_Rearm3 = _Ignatz_SP_Array select 3;};
true
@@ -42,7 +42,7 @@ if !(alive player && alive _playerObject && !isPlayer _playerObject) then {
params ["_playerObject","_personalToken","_loadAbs"];

// get current player object
_prevPlayerObjectect = player;
_prevPlayerObject = player;

// wait for loadAbs to sync
waitUntil {_loadAbs isEqualTo (loadAbs _playerObject)};
@@ -16,7 +16,7 @@ if !(surfaceIsWater _position) then {
_offsetZ = ((_position vectorDiff getPosASL player) select 2);
EPOCH_playerIsSwimming = (_offsetZ > 1.7);
if (_offsetZ > 50) then {
"GreatWhite_F" call EPOCH_unitSpawn;
["GreatWhite_F", player, true] call EPOCH_unitSpawn;
};
};
};
@@ -3,7 +3,7 @@ if (random EPOCH_droneRndChance < _spawnChance) then {
"I_UAV_01_F" call EPOCH_unitSpawnIncrease;
};
if (EPOCH_mod_Ryanzombies_Enabled) then {
if (random EPOCH_zombieRndChance < _spawnChance) then {
if (random EPOCH_zombieRngChance < _spawnChance) then {
["EPOCH_RyanZombie_1",12] call EPOCH_unitSpawnIncrease;
};
};
@@ -20,7 +20,7 @@ _prevEnergy = EPOCH_playerEnergy;

// init config data
EPOCH_sapperRndChance = ["CfgEpochClient", "sapperRngChance", 100] call EPOCH_fnc_returnConfigEntryV2;
EPOCH_zombieRndChance = ["CfgEpochClient", "zombieRndChance", 50] call EPOCH_fnc_returnConfigEntryV2;
EPOCH_zombieRngChance = ["CfgEpochClient", "zombieRngChance", 50] call EPOCH_fnc_returnConfigEntryV2;
EPOCH_droneRndChance = ["CfgEpochClient", "droneRngChance", 100] call EPOCH_fnc_returnConfigEntryV2;
_baseHTLoss = ["CfgEpochClient", "baseHTLoss", 8] call EPOCH_fnc_returnConfigEntryV2;
_energyCostNV = ["CfgEpochClient", "energyCostNV", 3] call EPOCH_fnc_returnConfigEntryV2;
@@ -0,0 +1,73 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors: He-Man
Description:
NPC trade code
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/traders/EPOCH_startNpcTrade.sqf
Example:
cursorTarget call EPOCH_startNpcTrade;
Parameter(s):
_this: OBJECT
Returns:
NOTHING
*/
//[[[cog import generate_private_arrays ]]]
private ["_addWeaponToHands","_arrayIn","_arrayOut","_config","_current_crypto","_errorMsg","_item","_itemTax","_itemWorth","_sizeOut","_tax","_type","_vehSlot","_vehicle","_vehicles"];
//[[[end]]]
params [["_returnIn",[]],["_returnOut",[]],["_message",""]];

if (isNil "EPOCH_TRADE_STARTED") exitWith{};

if !(_returnOut isEqualTo[]) then {
// add purchased items
{
if ([_x, "CfgWeapons"] call EPOCH_fnc_isAny) then {
_type = getNumber(configfile >> "CfgWeapons" >> (_x) >> "type");
_addWeaponToHands = false;
switch (_type) do {
case 1: {
if (primaryWeapon player == "") then {
_addWeaponToHands = true;
};
};
case 4: {
if (secondaryWeapon player == "") then {
_addWeaponToHands = true;
};
};
case 2: {
if (handgunWeapon player == "") then {
_addWeaponToHands = true;
};
};
};
if (_addWeaponToHands) then {
player addWeapon _x;
}
else {
_x call EPOCH_fnc_addItemOverflow;
};
}
else {
if ([_x, "CfgMagazines"] call EPOCH_fnc_isAny) then {
_x call EPOCH_fnc_addItemOverflow;
};
};
} forEach _returnOut;
};

if !(_message isequalto "") then {
[_message, 5] call Epoch_message;
};

EPOCH_TRADE_STARTED = nil;
@@ -25,7 +25,6 @@
private ["_addWeaponToHands","_arrayIn","_arrayOut","_config","_current_crypto","_errorMsg","_item","_itemTax","_itemWorth","_sizeOut","_tax","_type","_vehSlot","_vehicle","_vehicles"];
//[[[end]]]

if (!isNil "EPOCH_TRADE_COMPLETE") exitWith {};
if (!isNil "EPOCH_TRADE_STARTED") exitWith{};
if (isNull _this) exitWith{};

@@ -119,74 +118,5 @@ if (alive _this) then {

// close menu
closeDialog 0;

[_arrayIn, _arrayOut] spawn{

waitUntil{ uiSleep 0.1; !isNil "EPOCH_TRADE_COMPLETE" };

// SOLD ITEMS ARRAY
if !((EPOCH_TRADE_COMPLETE select 0) isEqualTo[]) then {
if ((EPOCH_TRADE_COMPLETE select 0) isEqualTo(_this select 0)) then {
['Items Sold', 5] call Epoch_message;
}
else {
['Failed To Sell Items', 5] call Epoch_message;
};
};

// PURCHASED ITEMS ARRAY
if !((EPOCH_TRADE_COMPLETE select 1) isEqualTo[]) then {
if ((EPOCH_TRADE_COMPLETE select 1) isEqualTo(_this select 1)) then {

_errorMsg = 'Items Purchased: ';
// add purchased items
{
if ([_x, "CfgWeapons"] call EPOCH_fnc_isAny) then {
_errorMsg = _errorMsg + format["%1, ", getText(configfile >> "CfgWeapons" >> (_x) >> "displayName")];
_type = getNumber(configfile >> "CfgWeapons" >> (_x) >> "type");
_addWeaponToHands = false;
switch (_type) do {
case 1: {
if (primaryWeapon player == "") then {
_addWeaponToHands = true;
};
};
case 4: {
if (secondaryWeapon player == "") then {
_addWeaponToHands = true;
};
};
case 2: {
if (handgunWeapon player == "") then {
_addWeaponToHands = true;
};
};
};
if (_addWeaponToHands) then {
player addWeapon _x;
}
else {
_x call EPOCH_fnc_addItemOverflow;
};
} else {
if ([_x, "CfgMagazines"] call EPOCH_fnc_isAny) then {
_errorMsg = _errorMsg + format["%1, ", getText(configfile >> "CfgMagazines" >> (_x) >> "displayName")];
_x call EPOCH_fnc_addItemOverflow;
} else {
_errorMsg = _errorMsg + format["%1, ", getText(configfile >> "CfgVehicles" >> (_x) >> "displayName")];
};
};
} forEach(_this select 1);

[_errorMsg, 5] call Epoch_message;
}
else {
['Failed To Purchase Items', 5] call Epoch_message;
};
};

EPOCH_TRADE_COMPLETE = nil;
EPOCH_TRADE_STARTED = nil;
};
};
};
@@ -0,0 +1,15 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors: [Ignatz] He-Man
Description:
Custom A3 Epoch FiredMan Eventhandler
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/custom/EPOCH_custom_EH_FiredMan.sqf
*/
params ["_unit","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile"];
@@ -0,0 +1,16 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors: [Ignatz] He-Man
Description:
Custom A3 Epoch GetInMan Eventhandler
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/custom/EPOCH_custom_EH_GetInMan.sqf
*/
params ["_unit","_position","_vehicle"];

@@ -0,0 +1,16 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors: [Ignatz] He-Man
Description:
Custom A3 Epoch GetOutMan Eventhandler
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/custom/EPOCH_custom_EH_GetOutMan.sqf
*/
params ["_unit","_position","_vehicle"];

@@ -0,0 +1,15 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors: [Ignatz] He-Man
Description:
Custom A3 Epoch InventoryClosed Eventhandler
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/custom/EPOCH_custom_EH_Take.sqf
*/
params ["_unit","_container"];
@@ -0,0 +1,21 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors: [Ignatz] He-Man
Description:
Custom A3 Epoch InventoryOpened Eventhandler
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/custom/EPOCH_custom_EH_InventoryOpened.sqf
*/
params ["_unit","_container","_sec"];
// Start Custom Code



// End Custom Code
false
@@ -0,0 +1,19 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors: [Ignatz] He-Man
Description:
Custom A3 Epoch KeyUp Eventhandler
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/custom/EPOCH_custom_EH_KeyDown.sqf
*/
params ["_display","_dikCode","_shift","_ctrl","_alt"];
_handled = false;


_handled
@@ -0,0 +1,19 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors: [Ignatz] He-Man
Description:
Custom A3 Epoch KeyUp Eventhandler
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/custom/EPOCH_custom_EH_KeyUp.sqf
*/
params ["_display","_dikCode","_shift","_ctrl","_alt"];
_handled = false;


_handled
@@ -0,0 +1,15 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors: [Ignatz] He-Man
Description:
Custom A3 Epoch Killed Eventhandler
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/custom/EPOCH_custom_EH_Killed.sqf
*/
params [["_unit",objNull,[objNull]],["_killer",objNull,[objNull]] ];
@@ -0,0 +1,15 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors: [Ignatz] He-Man
Description:
Custom A3 Epoch Put Eventhandler
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/custom/EPOCH_custom_EH_Put.sqf
*/
params ["_unit","_container","_itemclass"];
@@ -0,0 +1,15 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors: [Ignatz] He-Man
Description:
Custom A3 Epoch Take Eventhandler
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/custom/EPOCH_custom_EH_Take.sqf
*/
params ["_unit","_container","_itemclass"];
@@ -0,0 +1,14 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors: [Ignatz] He-Man
Description:
Custom A3 Epoch OnEachFrame
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/custom/EPOCH_custom_OnEachFrame.sqf
*/
@@ -137,7 +137,7 @@ if (_buttonSettings isEqualTo []) then {_selfOrTarget = "self"; call _checkConfi

_entries = count _buttonSettings;
if !(_entries <= 0) then {
[_entries, _buttonSettings] call epoch_dynamicMenuPopulate;
[_entries, _buttonSettings] spawn epoch_dynamicMenuPopulate;
} else {
true call Epoch_dynamicMenuCleanup;
};
@@ -15,6 +15,7 @@
//[[[cog import generate_private_arrays ]]]
private ["_cfg","_cleanupVars","_close"];
//[[[end]]]
disableSerialization;
_close = param [0,false,[false]];

_cleanupVars = {
@@ -26,7 +27,10 @@ _cleanupVars = {
};

if (_close) then {
(findDisplay 66600) closeDisplay 1;
_display = findDisplay 66600;
if !(isNull _display) then {
_display closeDisplay 1;
};
};

if (uiNamespace getVariable ["rmx_var_dynamicMenuInProgress",false]) then {
@@ -20,6 +20,8 @@ params ["_entries","_buttonSettings"];
disableSerialization;

_inProgress = uiNamespace getVariable ["rmx_var_dynamicMenuInProgress", false];

waitUntil{!isNull (findDisplay 66600)};
_display = findDisplay 66600;

if (_inProgress) then {
@@ -13,36 +13,46 @@
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/group/EPOCH_Group_BtnInvite.sqf
*/
//[[[cog import generate_private_arrays ]]]
private ["_BtnInvite","_InvitePlayerCombo","_currentMaxMember","_currentMember","_found","_playerName","_playerUID","_ret","_txt","_upgradePrice","_upgradeSlots"];
private ["_BtnInvite","_InvitePlayerCombo","_groupSize","_currentMember","_found","_playerName","_playerUID","_ret","_txt","_upgradePrice","_upgradeSlots"];
//[[[end]]]
disableSerialization;
_BtnInvite = (findDisplay -1300) displayCtrl 30;
_playerUID = getPlayerUID player;
if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (Epoch_my_Group select 3) > 0) then {
_currentMember = count(Epoch_my_Group select 3) + count(Epoch_my_Group select 4) + 1;
_currentMaxMember = Epoch_my_Group select 2;
if (_currentMember < _currentMaxMember) then {

Epoch_my_Group params [
["_groupName",""],
["_leaderName",""],
["_groupSize",0],
["_modArray",[]],
["_memberArray",[]]
];

if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (_modArray) > 0) then {
_currentMember = count(_modArray) + count(_memberArray) + 1;
if (_currentMember < _groupSize) then {
_InvitePlayerCombo = (findDisplay -1300) displayCtrl 41;
_playerUID = _InvitePlayerCombo lbData (lbCurSel _InvitePlayerCombo);
_playerName = _InvitePlayerCombo lbText (lbCurSel _InvitePlayerCombo);
if (_playerUID != "" && _playerName != "" && ({_playerUID in _x} count (Epoch_my_Group select 3) == 0) && ({_playerUID in _x} count (Epoch_my_Group select 4) == 0) && !(_playerUID == Epoch_my_GroupUID)) then {
if (_playerUID != "" && _playerName != "" && ({_playerUID in _x} count (_modArray) == 0) && ({_playerUID in _x} count (_memberArray) == 0) && !(_playerUID == Epoch_my_GroupUID)) then {
_txt = format["Do you want to add %1 to your Group?",_playerName];
[_playerUID,_txt] spawn {
_ret = [_this select 1,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage;
[_playerUID,_txt,_groupName] spawn {
params ["_playerUID","_txt","_groupName"];
_ret = [_txt,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage;
if (_ret) then {
[_this select 0,Epoch_my_GroupUID,Epoch_my_Group select 0,player,Epoch_personalToken] remoteExec ["EPOCH_server_invitePlayer",2];
[_playerUID,Epoch_my_GroupUID,_groupName,player,Epoch_personalToken] remoteExec ["EPOCH_server_invitePlayer",2];
};
};
};
} else {
_found = EPOCH_group_upgrade_lvl find _currentMaxMember;
_found = EPOCH_group_upgrade_lvl find _groupSize;
if (count EPOCH_group_upgrade_lvl >= (_found+3)) then {
_upgradePrice = parseNumber (EPOCH_group_upgrade_lvl select (_found+3));
if ((EPOCH_playerCrypto-_upgradePrice) >= 0) then {
_upgradeSlots = EPOCH_group_upgrade_lvl select (_found+2);
_txt = format["Do you want to upgrade your group from %1 to %2 slots for %3 Krypto?",_currentMaxMember,_upgradeSlots,_upgradePrice];
_txt = format["Do you want to upgrade your group from %1 to %2 slots for %3 Krypto?",_groupSize,_upgradeSlots,_upgradePrice];
[_txt,_upgradePrice] spawn {
_ret = [_this select 0,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage;
params ["_txt","_upgradePrice"];
_ret = [_txt,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage;
if (_ret) then {
[Epoch_my_GroupUID,player,Epoch_personalToken] remoteExec ["EPOCH_server_upgradeGroup",2];
};
@@ -19,7 +19,16 @@ disableSerialization;
_BtnKick = (findDisplay -1300) displayCtrl 33;

_playerUID = getPlayerUID player;
if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (Epoch_my_Group select 3) > 0) then {

Epoch_my_Group params [
["_groupName",""],
["_leaderName",""],
["_groupSize",0],
["_modArray",[]],
["_memberArray",[]]
];

if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (_modArray) > 0) then {
_group = (findDisplay -1300) displayCtrl 40;
_selected = lbCurSel _group;
if (_selected >= 0) then {
@@ -28,9 +37,10 @@ if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (Epoch_m
if (_playerUID != "" && _playerName != "") then {
_txt = format["Do you want to kick %1 from your Group?",_playerName];
[_playerUID,_txt] spawn {
_ret = [_this select 1,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage;
params ["_playerUID","_txt"];
_ret = [_txt,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage;
if (_ret) then {
[Epoch_my_GroupUID,_this select 0,false,false,player,Epoch_personalToken] remoteExec ["EPOCH_server_updatePlayerGroup",2];
[Epoch_my_GroupUID,_playerUID,false,false,player,Epoch_personalToken] remoteExec ["EPOCH_server_updatePlayerGroup",2];
};
};
};
@@ -17,17 +17,24 @@ private ["_BtnLeave","_ret","_txt"];
//[[[end]]]
disableSerialization;
_BtnLeave = (findDisplay -1300) displayCtrl 31;
Epoch_my_Group params [
["_groupName",""],
["_leaderName",""],
["_groupSize",0],
["_modArray",[]],
["_memberArray",[]]
];
if (getPlayerUID player == Epoch_my_GroupUID) then {
_BtnLeave ctrlSetText "Delete Group";
_txt = format["Do you want to delete your Group called %1?",Epoch_my_Group select 0];
_txt = format["Do you want to delete your Group called %1?",_groupName];
_txt spawn {
_ret = [_this,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage;
if (_ret) then {
[player,Epoch_personalToken] remoteExec ["EPOCH_server_deleteGroup",2];
};
};
} else {
_txt = format["Do you want to leave the %1 Group?",Epoch_my_Group select 0];
_txt = format["Do you want to leave the %1 Group?",_groupName];
_txt spawn {
_ret = [_this,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage;
if (_ret) then {
@@ -30,9 +30,10 @@ if (getPlayerUID player == Epoch_my_GroupUID) then {
};

[_playerUID,_isMember,_txt] spawn {
_ret = [_this select 2,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage;
params ["_playerUID","_isMember","_txt"];
_ret = [_txt,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage;
if (_ret) then {
[Epoch_my_GroupUID,_this select 0,true,_this select 1,player,Epoch_personalToken] remoteExec ["EPOCH_server_updatePlayerGroup",2];
[Epoch_my_GroupUID,_playerUID,true,_isMember,player,Epoch_personalToken] remoteExec ["EPOCH_server_updatePlayerGroup",2];
};
};
};
@@ -14,16 +14,24 @@
*/
disableSerialization;
//[[[cog import generate_private_arrays ]]]
private ["_BtnInvite","_ctrl","_currentMaxMember","_currentMember","_playerUID","_selected"];
private ["_BtnInvite","_ctrl","_currentMember","_playerUID","_selected"];
//[[[end]]]

Epoch_my_Group params [
["_groupName",""],
["_leaderName",""],
["_groupSize",0],
["_modArray",[]],
["_memberArray",[]]
];

_ctrl = _this select 0;
_selected = _this select 1;
_playerUID = getPlayerUID player;
if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (Epoch_my_Group select 3) > 0) then {
if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (_modArray) > 0) then {
_BtnInvite = (findDisplay -1300) displayCtrl 30;
_currentMember = count(Epoch_my_Group select 3) + count(Epoch_my_Group select 4) + 1;
_currentMaxMember = Epoch_my_Group select 2;
if (_currentMember < _currentMaxMember) then {
_currentMember = count(_modArray) + count(_memberArray) + 1;
if (_currentMember < _groupSize) then {
_BtnInvite ctrlSetText format ["Invite %1",_ctrl lbtext _selected];
};
true
@@ -13,7 +13,7 @@
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/group/EPOCH_Group_onLoad.sqf
*/
//[[[cog import generate_private_arrays ]]]
private ["_BtnInvite","_GroupMemberList","_InvitePlayerCombo","_currentMaxMember","_currentMember","_display","_found","_index","_myPlayerUID","_onlinePUID","_picture","_playerIsLeader","_playerIsMod","_playerUID","_players"];
private ["_BtnInvite","_GroupMemberList","_InvitePlayerCombo","_currentMaxMember","_display","_found","_index","_myPlayerUID","_onlinePUID","_picture","_playerIsLeader","_playerIsMod","_playerUID","_players"];
//[[[end]]]
disableSerialization;
_display = findDisplay -1300;
@@ -22,13 +22,21 @@ _BtnInvite = _display displayCtrl 30;
_GroupMemberList = _display displayCtrl 40;
_InvitePlayerCombo = _display displayCtrl 41;

_currentMaxMember = count(Epoch_my_Group select 3) + count(Epoch_my_Group select 4) + 1;
_currentMember = Epoch_my_Group select 2;
(_display displayCtrl 21) ctrlSetText format["Group Name: %1 (%2/%3 Slots)",Epoch_my_Group select 0,_currentMaxMember,_currentMember];
Epoch_my_Group params [
["_groupName",""],
["_leaderName",""],
["_groupSize",0],
["_modArray",[]],
["_memberArray",[]]
];

_currentMaxMember = count(_modArray) + count(_memberArray) + 1;

(_display displayCtrl 21) ctrlSetText format["Group Name: %1 (%2/%3 Slots)",_groupName,_currentMaxMember,_groupSize];

_myPlayerUID = getPlayerUID player;
_playerIsLeader = _myPlayerUID == Epoch_my_GroupUID;
_playerIsMod = {_x select 0 == _myPlayerUID}count (Epoch_my_Group select 3) > 0;
_playerIsMod = {_x select 0 == _myPlayerUID}count (_modArray) > 0;
(_display displayCtrl 32) ctrlEnable false;
(_display displayCtrl 33) ctrlEnable false;

@@ -37,7 +45,7 @@ _onlinePUID = [];
_onlinePUID pushBack (getPlayerUID _x);
}forEach (units group player);

if (_currentMaxMember < _currentMember) then {
if (_currentMaxMember < _groupSize) then {
_players = player nearEntities [["Epoch_Male_F","Epoch_Female_F","LandVehicle","Ship","Air","Tank"], 10];

if (_playerIsLeader || _playerIsMod) then {
@@ -90,7 +98,7 @@ if (_currentMaxMember < _currentMember) then {
}forEach _x;
}forEach
[
[[Epoch_my_GroupUID,Epoch_my_Group select 1]],
Epoch_my_Group select 3,
Epoch_my_Group select 4
[[Epoch_my_GroupUID,_leaderName]],
_modArray,
_memberArray
];
@@ -12,101 +12,112 @@
Usage:
"TEST" call Epoch_message
TODO: Add colors
*/

#include "\A3\ui_f\hpp\defineCommonGrids.inc"
_msg = param [0, "No input"];
_time = param [1, 2];
_customCol = param[2,[]];
private["_bgCol","_txtCol"];
if(_customCol isEqualTo [])then{
_config = 'CfgEpochClient' call EPOCH_returnConfig;
_bgCol = getArray(_config >> "epochMessageBackgroundCol");
_txtCol = getArray(_config >> "epochMessageTextCol");
if !(_bgCol isEqualTypeAll 0)then{_bgCol = [0,0,0,0.2]};
if !(_txtCol isEqualTypeAll 0)then{_txtCol = [1,1,1,0.95]};
}else{
_bgCol = if((_customCol select 0)isEqualTypeAll 0)then[{_customCol select 0},{_bgCol = [0,0,0,0.2]}];
_txtCol = if((_customCol select 1)isEqualTypeAll 0)then[{_customCol select 1},{_txtCol = [1,1,1,0.95]}];
};

_msg = str (parseText str _msg); //Parses and converts text back to small string

if !(isNil "rmx_var_msgQueue") exitWith { rmx_var_msgQueue pushBack [_msg, _time];};
if !(isNil "rmx_var_msgQueue") exitWith {rmx_var_msgQueue pushBack [_msg, _time, [_bgCol,_txtCol]]};

rmx_var_msgQueue = [[_msg, _time]];
rmx_var_msgQueue = [[_msg, _time, [_bgCol,_txtCol]]];

[] spawn {
private ["_c1pos","_c2pos","_c3pos","_clr","_dsp"];

disableSerialization;

_dsp = findDisplay 46;

_yPos = 15;
_ySize = 2;
_c1StartPos = [safeZoneX,((_yPos - _ySize) * GUI_GRID_H + GUI_GRID_Y),safeZoneW, _ySize * GUI_GRID_H];
_c1pos = [safeZoneX,(_yPos * GUI_GRID_H + GUI_GRID_Y),safeZoneW, _ySize * GUI_GRID_H];
_c2pos = [safeZoneX,((_yPos + _ySize) * GUI_GRID_H + GUI_GRID_Y),safeZoneW, _ySize * GUI_GRID_H];
_c3pos = [safeZoneX,((_yPos + _ySize * 2) * GUI_GRID_H + GUI_GRID_Y),safeZoneW, _ySize * GUI_GRID_H];

_getClr = call Epoch_getColorScheme;
_clr = [_getClr select 0, _getClr select 1, _getClr select 2, 0.2];


//Start anim
_msg = "";
_time = (rmx_var_msgQueue select 0 select 1);

_col = (rmx_var_msgQueue select 0)select 2;

_fnc_animFirst = {
private "_ctrl";

_ctrl = param [0];
_msg = param [1];
_ctrl ctrlSetBackgroundColor [_clr select 0, _clr select 1, _clr select 2, 0.2];
_col = param [2];

_ctrl ctrlSetBackgroundColor (_col select 0);
_ctrl ctrlSetText _msg;

_ctrl ctrlSetTextColor (_col select 1);

_ctrl ctrlSetPosition _c1StartPos;
_ctrl ctrlSetFade 1;
_ctrl ctrlCommit 0;

_ctrl ctrlSetPosition _c1pos;
_ctrl ctrlSetFade 0;
_ctrl ctrlCommit 0.3;
};

_fnc_animShiftCtrl = {
private ["_ctrl", "_fade", "_fontSize", "_pos"];
_ctrl = param [0];
_fade = param [1];
_fontSize = param [2];
_pos = param [3];

_ctrl ctrlSetPosition _pos;
_ctrl ctrlSetFontHeight _fontSize;
_ctrl ctrlSetFade _fade;
_ctrl ctrlCommit 0.3;
};

_tick = diag_tickTime; _ctrlArr = [];

_tick = diag_tickTime;
_ctrlArr = [];
while {(diag_tickTime - _tick) < _time} do {

if !(rmx_var_msgQueue isEqualTo []) then {

_msg = (rmx_var_msgQueue select 0 select 0);
_time = (rmx_var_msgQueue select 0 select 1);
_col = (rmx_var_msgQueue select 0)select 2;
_tick = diag_tickTime;
rmx_var_msgQueue deleteAt 0;
_uniqueID =
//_uniqueID =
switch (count _ctrlArr) do {
case 0:
{
_c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC];
_ctrlArr = [[_c, _msg]];
[_c, _msg] call _fnc_animFirst;
[_c, _msg, _col] call _fnc_animFirst;
};
case 1:
{
_c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC];
_ctrlArr set [count _ctrlArr, [_c, _msg]];
[_c, _msg] call _fnc_animFirst;
[_c, _msg, _col] call _fnc_animFirst;

[_ctrlArr select 0 select 0, 0.5, 0.035, _c2pos] call _fnc_animShiftCtrl;
};
case 2:
{
_c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC];
_ctrlArr set [count _ctrlArr, [_c, _msg]];
[_c, _msg] call _fnc_animFirst;
[_c, _msg, _col] call _fnc_animFirst;

[_ctrlArr select 1 select 0, 0.5, 0.035, _c2pos] call _fnc_animShiftCtrl;
[_ctrlArr select 0 select 0, 0.75, 0.03, _c3pos] call _fnc_animShiftCtrl;
};
@@ -116,18 +127,18 @@ rmx_var_msgQueue = [[_msg, _time]];
[_oldCtrl] call epoch_getIDC;
ctrlDelete _oldCtrl;
_ctrlArr deleteAt 0;

_c = _dsp ctrlCreate ["rmx_t1", call epoch_getIDC];
_ctrlArr pushBack [_c, _msg];
[_c, _msg] call _fnc_animFirst;
[_c, _msg, _col] call _fnc_animFirst;

[_ctrlArr select 1 select 0, 0.5, 0.035, _c2pos] call _fnc_animShiftCtrl;
[_ctrlArr select 0 select 0, 0.75, 0.03, _c3pos] call _fnc_animShiftCtrl;
};
};
};
};

//End anim
{
(_x select 0) ctrlSetFade 1;
@@ -136,11 +147,11 @@ rmx_var_msgQueue = [[_msg, _time]];
} forEach _ctrlArr;

uisleep 0.50;

{
ctrlDelete (_x select 0);
} forEach _ctrlArr;

rmx_var_msgQueue = nil;
};

@@ -66,6 +66,7 @@ _antagonistSpawnDefaults = [
["Epoch_Cloak_F", 1],
["GreatWhite_F", 2],
["Epoch_Sapper_F",2],
["Epoch_SapperG_F",1],
["Epoch_SapperB_F",1],
["I_UAV_01_F",2],
["PHANTOM",1],
@@ -70,7 +70,7 @@ if(EPOCH_AirDropChance < 0)then{EPOCH_AirDropChance = 101;EPOCH_AirDropCheck = 9

EPOCH_droneRndChance = 100;
EPOCH_sapperRndChance = 100;
EPOCH_zombieRndChance = 50;
EPOCH_zombieRngChance = 50;

// Custom Keys
EPOCH_keysActionPressed = false; //prevents EH spam
@@ -29,7 +29,7 @@ class veh_unLock
};
class player_inspect
{
condition = "true";
condition = "!dyna_inVehicle";
action = "call EPOCH_lootTrash;";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\player_inspect.paa";
tooltip = "Examine";
@@ -51,8 +51,8 @@ class player_group_requests

class base_mode_enable
{
condition = "EPOCH_buildMode in [0,2] && EPOCH_playerEnergy > 0";
action = "EPOCH_stabilityTarget = objNull;EPOCH_buildMode = 1;['Build Mode: Enabled Snap alignment', 5] call Epoch_message;EPOCH_buildDirection = 0;";
condition = "EPOCH_buildMode in [0,2] && !dyna_inVehicle";
action = "if (EPOCH_playerEnergy > 0) then {EPOCH_stabilityTarget = objNull;EPOCH_buildMode = 1;['Build Mode: Enabled Snap alignment', 5] call Epoch_message;EPOCH_buildDirection = 0} else {['Need Energy!', 5] call Epoch_message};";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\build_maintain.paa";
tooltip = "Build Mode: Snap alignment";
};
@@ -99,3 +99,46 @@ class base_mode_snap_direction_3
icon = "x\addons\a3_epoch_code\Data\UI\buttons\build_move.paa";
tooltip = "Build Mode: Snap Direction 270°";
};
class ServicePoint
{
condition = "call EPOCH_SP_Check";
action = "call EPOCH_SP_Start;";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\Repair_man.paa";
tooltip = "Service Point";

class Refuel
{
condition = "true";
action = "(Ignatz_Refuel select 1) spawn EPOCH_SP_Refuel";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\vehicle_refuel.paa";
tooltipcode = "Ignatz_Refuel select 0";
};
class Repair
{
condition = "true";
action = "(Ignatz_Repair select 1) spawn EPOCH_SP_Repair";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\repair.paa";
tooltipcode = "Ignatz_Repair select 0";
};
class Rearm0
{
condition = "!isnil 'Ignatz_Rearm0'";
action = "(Ignatz_Rearm0 select 1) call EPOCH_SP_Rearm";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\Rearm.paa";
tooltipcode = "Ignatz_Rearm0 select 0";
};
class Rearm1
{
condition = "!isnil 'Ignatz_Rearm1'";
action = "(Ignatz_Rearm1 select 1) call EPOCH_SP_Rearm";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\Rearm.paa";
tooltipcode = "Ignatz_Rearm1 select 0";
};
class Rearm2
{
condition = "!isnil 'Ignatz_Rearm2'";
action = "(Ignatz_Rearm2 select 1) call EPOCH_SP_Rearm";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\Rearm.paa";
tooltipcode = "Ignatz_Rearm2 select 0";
};
};
@@ -79,7 +79,7 @@ class tra_shop

class player_takeCrypto
{
condition = "dyna_isDeadPlayer";
condition = "(dyna_cursorTarget getVariable [""Crypto"",0]) > 0";
action = "dyna_cursorTarget call EPOCH_takeCrypto;";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\krypto.paa";
tooltip = "Take Krypto";
@@ -107,6 +107,14 @@ class maintain_jammer
icon = "x\addons\a3_epoch_code\Data\UI\buttons\build_maintain.paa";
tooltip = "Maintain";
};
class select_jammer
{
condition = "dyna_cursorTargetType isEqualTo 'PlotPole_EPOCH' && (damage dyna_cursorTarget < 1)";
action = "[dyna_cursorTarget,player,Epoch_personalToken] remoteExec [""EPOCH_server_makeSP"",2];";
icon = "x\addons\a3_epoch_code\Data\UI\buttons\player_inspect.paa";
tooltip = "Make Spawnpoint";
};

//lock unlock
class unlock_lockbox
{
@@ -60,6 +60,7 @@ class CfgClientFunctions
};
class traders
{
class NpcTrade_return {};
class startInteract {};
class startInteractNPC {};
class npcTraderAdd {};
@@ -82,6 +83,8 @@ class CfgClientFunctions
{
class getInMan {};
class getOutMan {};
class InventoryClosed {};
class InventoryOpened {};
};
class setup
{
@@ -165,6 +168,29 @@ class CfgClientFunctions
class initUI {};
class refeshUI {};
};
class servicepoint
{
class SP_Check {};
class SP_Rearm {};
class SP_Refuel {};
class SP_Repair {};
class SP_Start {};
};
class customs
{
file = "epoch_code\customs";
class custom_EH_FiredMan {};
class custom_EH_GetInMan {};
class custom_EH_GetOutMan {};
class custom_EH_InventoryClosed {};
class custom_EH_InventoryOpened {};
class custom_EH_KeyDown {};
class custom_EH_KeyUp {};
class custom_EH_Killed {};
class custom_EH_Put {};
class custom_EH_Take {};
class custom_OnEachFrame {};
};
class messaging
{
file = "epoch_code\gui\scripts\messaging";

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -105,6 +105,12 @@ class CfgObjectInteractions
aliveState = 1;
interactAttributes[] = {{"Toxicity",20,1},{"Soiled",20,1}};
};
class Epoch_SapperG_F : Default
{
interactMode = 3;
aliveState = 1;
interactAttributes[] = {{"Toxicity",50,1},{"Soiled",50,1}};
};
class Epoch_SapperB_F : Default
{
interactMode = 3;
@@ -2914,6 +2914,10 @@ class CfgPricing
{
price = 2;
};
class SmokeShellToxic
{
price = 10;
};
class SmokeShellGreen
{
price = 2;
@@ -3278,6 +3282,34 @@ class CfgPricing
{
price = 5;
};
class U_CamoAloha_uniform
{
price = 5;
};
class U_CamoBiker_uniform
{
price = 5;
};
class U_CamoBubblegum_uniform
{
price = 5;
};
class U_CamoLumberjack_uniform
{
price = 5;
};
class U_CamoOutback_uniform
{
price = 5;
};
class U_CamoPink_uniform
{
price = 5;
};
class U_CamoPinkPolka_uniform
{
price = 5;
};
class U_C_Driver_1
{
price = 5;
@@ -26,6 +26,11 @@ class CfgRemoteExec
{
mode = 1;
jip = 0;
class EPOCH_server_paycrypto
{
allowedTargets = 2;
jip = 0;
};
class EPOCH_server_save_vehicles
{
allowedTargets = 2;
@@ -286,6 +291,11 @@ class CfgRemoteExec
allowedTargets = 2;
jip = 0;
};
class EPOCH_server_makeSP
{
allowedTargets = 2;
jip = 0;
};
};
class Commands
{
@@ -0,0 +1,248 @@
class CfgServicePoint {
class Altis {
ServicePoints[] = {
{13325,14477,0}
};
};
class Tanoa {
ServicePoints[] = {
/*
{2157.79,3477.65,0},
{11731.5,3125.95,0},
{7008.93,7582.59,0},
{2326.28,13167.9,0},
{11805.8,13100.6,0},

{5525.8,10345.2,0},
{11916,2383.88,0},
{13562.4,12139.5,0}
*/
};
};
class Chernarus {
ServicePoints[] = {

};
};
ServicePointDist = 40;
refuel_updateInterval = 1;
refuel_amount = 0.1;
repairTime = 1.2;
repair_costs[] = {
{"Air",0},
{"Tank",0},
{"Ship",0},
{"Landvehicle",0}
};
refuel_costs[] = {
{"Air",0},
{"Tank",0},
{"Ship",0},
{"Landvehicle",0}
};
VehiclesAndAmmo[] = {
/*
{
"typeof vehicle",
{
{"Ammoclass",{Turretpath},MaxMagsCount,PricePerMag},
{"Ammoclass",{Turretpath},MaxMagsCount,PricePerMag}
}
},
*/
{
"B_G_Offroad_01_armed_F",
{
{"100Rnd_127x99_mag_Tracer_Yellow",{0},4,200}
}
},
{
"O_G_Offroad_01_armed_F",
{
{"100Rnd_127x99_mag_Tracer_Yellow",{0},4,200}
}
},
{
"I_G_Offroad_01_armed_F",
{
{"100Rnd_127x99_mag_Tracer_Yellow",{0},4,200}
}
},
{
"I_MRAP_03",
{
{"SmokeLauncherMag",{0},1,150}
}
},
{
"I_MRAP_03_EPOCH",
{
}
},
{
"O_MRAP_02_F",
{
{"SmokeLauncherMag",{-1},1,150}
}
},
{
"B_LSV_01_armed_olive_F",
{
{"100Rnd_127x99_mag_Tracer_Red",{0},3,200},
{"130Rnd_338_Mag",{1},3,260}
}
},
{
"B_LSV_01_armed_black_F",
{
{"100Rnd_127x99_mag_Tracer_Red",{0},3,200},
{"130Rnd_338_Mag",{1},3,260}
}
},
{
"O_T_LSV_02_armed_black_F",
{
{"500Rnd_65x39_Belt_Tracer_Green_Splash",{0},3,500}
}
},
{
"O_T_LSV_02_armed_ghex_F",
{
{"500Rnd_65x39_Belt_Tracer_Green_Splash",{0},3,500}
}
},
{
"B_SDV_01_EPOCH",
{
}
},
{
"B_Heli_Light_01_armed_F",
{
{"5000Rnd_762x51_Belt",{-1},1,1600}
}
},
{
"O_Heli_Light_02_unarmed_EPOCH",
{
{"168Rnd_CMFlare_Chaff_Magazine",{-1},1,150}
}
},
{
"O_Heli_Light_02_v2_F",
{
{"2000Rnd_65x39_Belt_Tracer_Green_Splash",{-1},1,1200},
{"168Rnd_CMFlare_Chaff_Magazine",{-1},1,150}
}
},
{
"B_Heli_Transport_01_EPOCH",
{
{"168Rnd_CMFlare_Chaff_Magazine",{-1},1,150},
{"2000Rnd_65x39_Belt_Tracer_Red",{1},1,1200},
{"2000Rnd_65x39_Belt_Tracer_Red",{2},1,1200}
}
},
{
"I_Heli_Transport_02_F",
{
{"168Rnd_CMFlare_Chaff_Magazine",{-1},1,150}
}
},
{
"I_Heli_Transport_02_EPOCH",
{
{"168Rnd_CMFlare_Chaff_Magazine",{-1},1,150}
}
},
{
"B_Heli_Transport_03_F",
{
{"168Rnd_CMFlare_Chaff_Magazine",{-1},1,150},
{"2000Rnd_65x39_Belt_Tracer_Red",{1},1,1200},
{"2000Rnd_65x39_Belt_Tracer_Red",{2},1,1200}
}
},
{
"B_Heli_Transport_03_black_F",
{
{"168Rnd_CMFlare_Chaff_Magazine",{-1},1,150},
{"2000Rnd_65x39_Belt_Tracer_Red",{1},1,1200},
{"2000Rnd_65x39_Belt_Tracer_Red",{2},1,1200}
}
},
{
"B_Heli_Transport_03_unarmed_EPOCH",
{
{"168Rnd_CMFlare_Chaff_Magazine",{-1},1,150}
}
},
{
"I_Heli_light_03_unarmed_EPOCH",
{
{"168Rnd_CMFlare_Chaff_Magazine",{-1},1,150}
}
},
{
"B_T_VTOL_01_vehicle_blue_F",
{
{"240Rnd_CMFlare_Chaff_Magazine",{-1},1,150}
}
},
{
"B_T_VTOL_01_infantry_olive_F",
{
{"240Rnd_CMFlare_Chaff_Magazine",{-1},1,150}
}
},
{
"B_T_VTOL_01_infantry_blue_F",
{
{"240Rnd_CMFlare_Chaff_Magazine",{-1},1,150}
}
},
{
"O_T_VTOL_02_vehicle_F",
{
{"168Rnd_CMFlare_Chaff_Magazine",{-1},1,150}
}
},
{
"O_T_VTOL_02_vehicle_grey_F",
{
{"168Rnd_CMFlare_Chaff_Magazine",{-1},1,150}
}
},
{
"O_T_VTOL_02_infantry_F",
{
{"168Rnd_CMFlare_Chaff_Magazine",{-1},1,150}
}
},
{
"B_Heli_Attack_01_F",
{
{"240Rnd_CMFlare_Chaff_Magazine",{-1},1,150}
}
},
{
"O_Heli_Attack_02_black_F",
{
{"192Rnd_CMFlare_Chaff_Magazine",{-1},1,150}
}
},
{
"O_Heli_Attack_02_F",
{
{"192Rnd_CMFlare_Chaff_Magazine",{-1},1,150}
}
},
{
"O_Boat_Armed_01_hmg_F",
{
{"SmokeLauncherMag_boat",{-1},1,100},
{"200Rnd_127x99_mag_Tracer_Green",{1},3,300}
}
}
};
};
@@ -35,51 +35,65 @@ class CfgCrafting
{
DeveloperMode = 0;
colorScheme[] = {"\x\addons\a3_epoch_code\Data\UI\crafting\cancel.paa","\x\addons\a3_epoch_code\Data\UI\crafting\craft.paa","\x\addons\a3_epoch_code\Data\UI\crafting\close.paa",{"Recipes",{0,0,0,0.8}},{"Ingredients",{0,0,0,0.8}},{"Preview",{0.76,0.5,0.07,0.8}},{"Resources",{0,0,0,0.8}},{"Description",{0,0,0,0.8}},{" -- Requires -- ",{0.99,0.53,0.03,1}},{" -- Used in -- ",{0.99,0.53,0.03,1}},{0,1,0,1},{0,1,0,1},{1,1,0,1},{1,0,0,1},{1,1,1,1},{0,0,0,0.1},{0,0,0,1},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0.76,0.5,0.07,0.8},{0,0,0,0.3},"#FFFFFF",{1,0.6,0.01,1}};
class Default
{
craftTime = 1;
recipe[] = {};
nearby[] = {};
usedIn[] = {};
previewPosition[] = {0.8125,1,0.285};
previewScale = 1;
previewVector = 0;
priority = 0;
type = 0;
descriptionFull = "";
};
class WeaponHolder : Default
{
priority = 0;
type = 1;
offset[] = {0,1,0};
craftTime = 10;
descriptionFull = "Demo: Can be used if player's inventory space is an issue";
};
class Vehicle : Default
{
priority = 0;
type = 2;
offset[] = {0,5,0};
craftTime = 10;
descriptionFull = "Demo: Should be used for vehicles only";
};
class Kit : Default
{
priority = 1;
descriptionFull = "Base building material";
craftTime = 4;
};
class Item : Default
{
priority = 2;
craftTime = 2;
};
class Part : Default
{
priority = 3;
descriptionFull = "<t color='#FD7F30'>This item has no recipe, but is a part used for other recipes</t>";
};
/** --------- Don't edit --------- **/
class Default //className, any object or item
{
craftTime = 1; //time it takes to craft

recipe[] = {}; //nested arrays, {{"item", 1}};
nearby[] = {}; //nearby requirements - fire, water source, object
usedIn[] = {}; //item is an ingredient

previewPosition[] = {0.8125,1,0.285}; //XzY
previewScale = 1;
previewVector = 0; //vector rotation multiplier

priority = 0; //Recipe list priority, items with 0 are on top followed by order in config file.
type = 0; //After crafting, item is added: [0 - to inventory], [1 - in weapon holder], [2 - as vehicle]
descriptionFull = ""; //Structured text, added on new line after descriptionShort

/** --------- Config Overrides --------- **/
//displayName = "";
//picture = "";
//descriptionShort = "";
//model = "\x\addons\a3_epoch_assets\models\logo.p3d";
};

/** --------- Main templates --------- **/
class WeaponHolder: Default //Placed inside weaponholder in front of player (?)
{
priority = 0;
type = 1;
offset[] = {0,1,0}; //local space
craftTime = 10;
descriptionFull = "Demo: Can be used if player's inventory space is an issue";
};
class Vehicle: Default //Spawned in front of player (?)
{
priority = 0;
type = 2;
offset[] = {0,5,0}; //local space
craftTime = 10;
descriptionFull = "Demo: Should be used for vehicles only";
};
class Kit: Default //base building kits gets higher priority on the list
{
priority = 1;
descriptionFull = "Base building material";
craftTime = 4;
};
class Item: Default //Goes into inventory
{
priority = 2;
craftTime = 2;
};
class Part: Default //Looted part - an ingredient for other items, can't be crafted
{
priority = 3;
descriptionFull = "<t color='#FD7F30'>This item has no recipe, but is a part used for other recipes</t>";
};

/** --------- RECIPES BELOW --------- **/
class ItemCoolerE : Part
{
usedIn[] = {"ItemCooler0","ItemCooler1","ItemCooler2","ItemCooler3","ItemCooler4"};
@@ -215,7 +229,7 @@ class CfgCrafting
};
class ItemRock : Part
{
usedIn[] = {"KitFirePlace","MeleeMaul","CrudeHatchet"};
usedIn[] = {"KitFirePlace","MeleeMaul","CrudeHatchet","MortarBucket"};
previewPosition[] = {0.796998,1,0.35};
previewScale = 1.3;
};
@@ -284,9 +298,11 @@ class CfgCrafting
previewPosition[] = {0.800064,1,0.25};
previewScale = 0.3;
};
class MortarBucket : Part
class MortarBucket : Item
{
usedIn[] = {"KitFoundation","KitCinderWall","KitHesco3"};
nearby[] = {{"Fire","","fire",{1,{"ALL"}},3,1,1,0},{"Workbench","","workbench",{1,{"WorkBench_EPOCH"}},3,1,0,1}};
recipe[] = {{"ItemRock",12},{"water_epoch",2}};
previewPosition[] = {0.799442,1,0.426761};
previewScale = 0.6;
previewVector = 0;
@@ -636,7 +652,7 @@ class CfgCrafting
};
class water_epoch : Item
{
usedIn[] = {"clean_water_epoch"};
usedIn[] = {"clean_water_epoch", "MortarBucket"};
nearby[] = {{"Water source","","water",{2,{"water"}},3,1,0,0}};
recipe[] = {"emptyjar_epoch"};
previewPosition[] = {0.807346,1,0.43035};
@@ -1 +1 @@
build=675;
build=741;
@@ -52,6 +52,7 @@ wreckRemovalMaxTime = 360;

disableRandomization[] = {"All"};

#include "Configs\CfgServicePoint.hpp"
#include "Configs\CfgItemSort.hpp"
#include "Configs\CfgTraderMissions.hpp"
#include "Configs\CfgMissions.hpp"
@@ -1 +1 @@
build=675;
build=741;
@@ -15,8 +15,8 @@
private["_safeUnits"];
params [["_bomb",objNull], "_player", ["_token","",[""]], "_unit", ["_killUnit",false]];
if !([_player,_token]call EPOCH_server_getPToken)exitWith{};
_safeUnits = ["Epoch_Sapper_F","Epoch_SapperB_F"];
_safeBombs = ["Sapper_Charge_Ammo","SapperB_Charge_Ammo"];
_safeUnits = ["Epoch_Sapper_F","Epoch_SapperB_F","Epoch_SapperG_F"];
_safeBombs = ["Sapper_Charge_Ammo","SapperB_Charge_Ammo","SmokeShellToxicSapper"];
if!(isNull _bomb)then{
if(typeOf _bomb in _safeBombs) then {
_bomb setDamage 1;
@@ -34,6 +34,9 @@ if (!isNull _target) then {
case "SapperB": {
"Epoch_SapperB_F" remoteExec ['EPOCH_unitSpawnIncrease',_target];
};
case "SapperG": {
"Epoch_SapperG_F" remoteExec ['EPOCH_unitSpawnIncrease',_target];
};
case "PHANTOM": {
"PHANTOM" remoteExec ['EPOCH_unitSpawnIncrease',_target];
};
@@ -17,8 +17,14 @@ if (!isNull _object && !(_class isEqualTo "")) then {
_newObj attachTo [_object,[0,0,0]];
};
};

deleteVehicle _object;

// force nearby players to reveal new object faster
_playersNear = _newObj nearEntities[["Epoch_Male_F", "Epoch_Female_F"], 300];
{
[_x, _newObj] remoteExec ['reveal',_x];
}forEach _playersNear;

};
};
_newObj
@@ -24,7 +24,7 @@ if (_groupID != "") then {
{
_x setVariable ["GROUP", nil];
[["resetGroup", true], _x] call EPOCH_sendRemoteExecClient;
[_x] joinSilent (createGroup west);
[_x] joinSilent (createGroup [west, true]);
} forEach (allPlayers select {(_x getVariable["GROUP", ""]) == _groupID});

_return = ["Group", _groupID] call EPOCH_fnc_server_hiveDEL;
@@ -30,12 +30,8 @@ _modOrMemberRevert = if (_this select 3) then [{4},{3}];
_response = ["Group", _groupID] call EPOCH_fnc_server_hiveGETRANGE;
if ((_response select 0) == 1 && (_response select 1) isEqualType []) then {
_contentArray = _response select 1;

//_groupName = _contentArray select 0;
//_leaderName = _contentArray select 1;
//_groupSize = _contentArray select 2;
_modArray = _contentArray select 3;
_memberArray = _contentArray select 4;
_contentArray params ["_groupName","_leaderName","_groupSize","_modArray","_memberArray"];
_allPlayers = allPlayers select {alive _x};

if (_addOrRemove) then { //Add
_selectedPlayerName = "Dead Player";
@@ -49,14 +45,14 @@ if ((_response select 0) == 1 && (_response select 1) isEqualType []) then {
if ((_x getVariable["GROUP",""]) == _groupID) exitWith {
_group = group _x;
};
}count allPlayers;
} forEach _allPlayers;

if (isNull _group) then {
_group = createGroup west;
_group = createGroup [west, true];
};
[_x] joinSilent _group;
};
} forEach (allPlayers select {getPlayerUID _x == _selectedPlayerUID});
} forEach (_allPlayers select {getPlayerUID _x == _selectedPlayerUID});

// find player name from DB
if (_selectedPlayerName == "Dead Player") then {
@@ -89,9 +85,9 @@ if ((_response select 0) == 1 && (_response select 1) isEqualType []) then {

{
_x setVariable ["GROUP", nil];
[_x] joinSilent (createGroup west);
[_x] joinSilent (createGroup [west, true]);
[["resetGroup", true], _x] call EPOCH_sendRemoteExecClient;
} forEach (allPlayers select {getPlayerUID _x == _selectedPlayerUID});
} forEach (_allPlayers select {getPlayerUID _x == _selectedPlayerUID});

{
if (_x select 0 == _selectedPlayerUID) exitWith {
@@ -119,7 +115,7 @@ if ((_response select 0) == 1 && (_response select 1) isEqualType []) then {

{
[["groupUpdate", _contentArray], _x] call EPOCH_sendRemoteExecClient;
} forEach (allPlayers select {(_x getVariable["GROUP", ""]) == _groupID});
} forEach (_allPlayers select {(_x getVariable["GROUP", ""]) == _groupID});

// Save Group Data
["Group", _groupID, _contentArray] call EPOCH_fnc_server_hiveSET;
@@ -43,7 +43,7 @@ _obj allowdamage false;
_obj setPosATL _pos;
_obj setFuel 1;
_obj flyInHeight 120;
_grp = createGroup RESISTANCE;
_grp = createGroup [RESISTANCE, true];

_unitPos = _pos;
_driver = _grp createUnit["I_helipilot_F", _unitPos, [], 0, "CAN_COLLIDE"];
@@ -161,7 +161,7 @@ if(count _vehicles > 0)then{
_obj allowdamage false;

if (_driverType != "" || _gunnerType != "" || _commanderType != "") then {
_grp = createGroup RESISTANCE;
_grp = createGroup [RESISTANCE, true];
};

if (_driverType != "") then {
@@ -0,0 +1,41 @@
/*
Author: Aaron Clark - EpochMod.com

Contributors: He-Man

Description:
Add items/weapons to player containers

Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike

Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/both/EPOCH_isAny.sqf

Example:
[_player, _itemsInContainers] call EPOCH_fnc_addItemToX;

Parameter(s):
_this select 0: OBJECT - player
_this select 1: ARRAY -
[
[["itemClass",1],["anotherClass",5]], // addItemToUniform
[["thatClass",2],["thisClass",2]], // addItemToVest
[["yourClass",4],["myClass",3]] // addItemToBackpack
]
*/
private ["_itemSlot"];
params ["_player","_slots"];
{
_itemSlot = _forEachIndex;
_x params ["_items","_itemqtys"];
{
for "_i" from 1 to (_itemqtys select _forEachIndex) do {
switch _itemSlot do {
case 0: { _player addItemToUniform _x };
case 1: { _player addItemToVest _x };
case 2: { _player addItemToBackpack _x };
};
};
} forEach(_items);
} forEach (_slots);
@@ -0,0 +1,7 @@
params [["_player",objNull,[objNull]],["_crypto",0,[0]],["_token","",[""]]];
if !([_player, _token] call EPOCH_server_getPToken) exitWith{};
if (_crypto > 0) exitwith { // This is only for pay Crypto, not for give Crypto ;)
diag_log format ['Player %1 (%2) killed for Code hack',name _player, getplayeruid _player];
_player setdamage 1
};
_this call EPOCH_server_effectCrypto;

Large diffs are not rendered by default.

@@ -0,0 +1,47 @@
/*
Author: Aaron Clark - EpochMod.com

Contributors:

Description:
Select spawn point

Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike

Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_player/EPOCH_server_selectSpawnpoint.sqf
*/
params [["_jammer",objNull],["_player",objNull],["_token",""]];
// check token
if !([_player, _token] call EPOCH_server_getPToken) exitWith{};
// require object
if (isNull _jammer) exitWith {};
// reject if player is too far away
if (_player distance _jammer > 20) exitWith{};
// check if in group with owner
if (alive _jammer) then {
if ((_jammer getVariable["BUILD_OWNER", "-1"]) in [getPlayerUID _player, _player getVariable["GROUP", ""]]) then {
_server_vars = _player getVariable["SERVER_VARS", []];
_currentPos = _server_vars param [0,[]];
// invalidate previous position
if (!(_currentPos isEqualTo []) && {_jammer distance _currentPos > 20}) then { _currentPos = [] };
if (_currentPos isEqualTo []) then {
// set position of spawnpoint to players SERVER_VARS
_server_vars set [0, getposATL _jammer]; // 0 = RESPAWN POS
_player setVariable ["SERVER_VARS", _server_vars];
["Spawnpoint set", 5] remoteExec ['Epoch_message',_player];
}
else
{
// remove position of spawnpoint from players SERVER_VARS
_server_vars set [0, []]; // 0 = RESPAWN POS
_player setVariable ["SERVER_VARS", _server_vars];
["Spawnpoint removed", 5] remoteExec ['Epoch_message',_player];
};
}
else
{
["This is not one of your Group's Jammers", 5] remoteExec ['Epoch_message',_player];
};
};
@@ -12,31 +12,15 @@
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_player/EPOCH_server_revivePlayer.sqf
*/
private["_player", "_playerUID", "_items", "_class", "_dir", "_location", "_type", "_weapon", "_attachments", "_currWeap", "_itemSlot", "_itemqtys", "_goggles", "_headgear", "_vest", "_backpack", "_uniform", "_weapons", "_magazinesAmmo", "_itemsplayer", "_weaponsplayer", "_group", "_primaryWeapon", "_secondaryWeapon", "_attachment", "_equipped", "_wMags", "_playerGroup", "_droppedWeapons", "_newPlyr", "_token", "_owner", "_reviver"];
params ["_player","_reviver",["_token","",[""]]];
//[[[cog import generate_private_arrays ]]]
private ["_CorpseCrypto","_PlayerCrypto","_attachments","_backpack","_cIndex","_class","_currWeap","_currwh","_deleteprimary","_deletesecondary","_dir","_droppedPrimary","_droppedSecondary","_droppedWeapons","_equipped","_goggles","_group","_headgear","_items","_itemsplayer","_location","_magazinesAmmo","_newPlyr","_playerGroup","_playerUID","_primaryWeapon","_secondaryWeapon","_token","_type","_uniform","_vars","_vest","_wMags","_wMagsArray","_weapon","_weapons","_weaponsplayer","_wh"];
//[[[end]]]
params ["_player","_reviver",["_token","",[""]] ];

if !([_reviver, _token] call EPOCH_server_getPToken) exitWith{};
if (isNull _player) exitWith{};
if (_player distance _reviver > 20) exitWith{};

_fnc_addItemToX = {
private ["_itemSlot","_itemqtys","_newPlyr"];
_newPlyr = _this select 0;
{
_itemSlot = _forEachIndex;
_itemqtys = _x select 1;
{
for "_i" from 1 to (_itemqtys select _forEachIndex) do {
switch _itemSlot do {
case 0: { _newPlyr addItemToUniform _x };
case 1: { _newPlyr addItemToVest _x };
case 2: { _newPlyr addItemToBackpack _x };
};
};
} forEach(_x select 0);
} forEach (_this select 1);
};

if (!local _player) then {
_playerUID = getPlayerUID _player;
if (!isNil "_playerUID" && !alive _player) then {
@@ -51,6 +35,10 @@ if (!local _player) then {
if (_class in ["Epoch_Male_F", "Epoch_Female_F"]) then {

if (_player getVariable["REVIVE", true]) then {
if (_player getvariable ['Reviving', false]) exitwith {
diag_log format['DEBUG Reviving skipped - Player already reviving : %1', _this];
};
_player setvariable ['Reviving',true];

diag_log format["DEBUG server_revivePlayer : %1", _this];

@@ -71,21 +59,7 @@ if (!local _player) then {
_secondaryWeapon = "";

_wh = nearestObjects[_player, ["WeaponHolderSimulated"], 12];
/*
_droppedWeapons = [];
reverse _wh;
{
{
_droppedWeapons pushBack _x;
_type = getNumber(configfile >> "cfgweapons" >> (_x select 0) >> "type");
switch _type do {
case 1: { _primaryWeapon = _x select 0 };
case 4: { _secondaryWeapon = _x select 0 };
};
} forEach (weaponsItemsCargo _x);

} foreach _wh;
*/
_droppedPrimary = [];
_droppedSecondary = [];
_droppedWeapons = [];
@@ -123,15 +97,15 @@ if (!local _player) then {
if ((_x getVariable["GROUP",""]) == _playerGroup) exitWith {
_group = group _x;
};
}forEach allPlayers;
}forEach (allPlayers select {alive _x});

if (isNull _group) then {
_group = createGroup west;
_group = createGroup [west, true];
};

diag_log format["DEBUG Group Found: %1", _group];
} else {
_group = createGroup west;
_group = createGroup [west, true];
diag_log format["DEBUG Group Created: %1", _group];
};

@@ -242,10 +216,10 @@ if (!local _player) then {
}forEach _items;

// add items to containers
[_newPlyr, _itemsplayer] call _fnc_addItemToX;
[_newPlyr, _itemsplayer] call EPOCH_fnc_addItemToX;

// add weapons to containers
[_newPlyr, _weaponsplayer] call _fnc_addItemToX;
[_newPlyr, _weaponsplayer] call EPOCH_fnc_addItemToX;

// Add magazines
{_newPlyr addMagazine _x;}forEach _magazinesAmmo;
@@ -54,7 +54,9 @@ if (_allowSave) then{
};
_player setVariable ["VARS", _vars];

// Server Only Stats
/* SERVER_VARS INUSE INDEX:
0 = RESPAWN POS
*/
_server_vars = _player getVariable["SERVER_VARS", []];

_group = _player getVariable ["GROUP", ""];