Compare commits
No commits in common. "635460f9d82f760feda56c10428887e36226e8ed" and "be8e19a1a71698a648cbed99b3966f5618a114cb" have entirely different histories.
635460f9d8
...
be8e19a1a7
@ -10,7 +10,6 @@ PREP(destroy);
|
||||
PREP(destroyModule);
|
||||
PREP(explosivesModule);
|
||||
PREP(handler);
|
||||
PREP(handleTaskRewards);
|
||||
PREP(heartBeat);
|
||||
PREP(hostage);
|
||||
PREP(hostageModule);
|
||||
|
@ -13,12 +13,7 @@
|
||||
* 5: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
||||
* 6: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||
* 7: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||
* 8: Amount of time before target(s) escape <NUMBER> (default: -1)
|
||||
* 9: Equipment rewards <ARRAY> (default: [])
|
||||
* 10: Supply rewards <ARRAY> (default: [])
|
||||
* 11: Weapon rewards <ARRAY> (default: [])
|
||||
* 12: Vehicle rewards <ARRAY> (default: [])
|
||||
* 13: Special rewards <ARRAY> (default: [])
|
||||
* 8: Amount of time before target(s) escape <NUMBER> (default: nil)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -30,22 +25,7 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [
|
||||
["_taskID", "", [""]],
|
||||
["_limitFail", -1, [0]],
|
||||
["_limitSuccess", -1, [0]],
|
||||
["_companyFunds", 0, [0]],
|
||||
["_ratingFail", 0, [0]],
|
||||
["_ratingSuccess", 0, [0]],
|
||||
["_endSuccess", false, [false]],
|
||||
["_endFail", false, [false]],
|
||||
["_time", -1, [0]],
|
||||
["_equipmentRewards", [], [[]]],
|
||||
["_supplyRewards", [], [[]]],
|
||||
["_weaponRewards", [], [[]]],
|
||||
["_vehicleRewards", [], [[]]],
|
||||
["_specialRewards", [], [[]]]
|
||||
];
|
||||
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_endSuccess", false], ["_endFail", false], "_time"];
|
||||
|
||||
private _result = 0;
|
||||
|
||||
@ -63,7 +43,7 @@ waitUntil {
|
||||
|
||||
private _targetsKilled = ({ !alive _x } count _targets);
|
||||
|
||||
if (_time isNotEqualTo -1) then {
|
||||
if (!isNil "_time") then {
|
||||
private _timeExpired = (floor time - _startTime >= _time);
|
||||
|
||||
if (_targetsKilled < _limitSuccess && _timeExpired) then { _result = 1; };
|
||||
@ -79,39 +59,35 @@ if (_result == 1) then {
|
||||
|
||||
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||
|
||||
private _penalties = createHashMap;
|
||||
_penalties set ["reputation", _ratingFail];
|
||||
if (_endFail) then {
|
||||
["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
|
||||
[_taskID, _penalties] call FUNC(handleTaskRewards);
|
||||
// ["deduct", _ratingFail] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingFail] call EFUNC(org,addReputation);
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
sleep 1;
|
||||
|
||||
if (_endFail) then { ["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
} else {
|
||||
{ deleteVehicle _x } forEach _targets;
|
||||
|
||||
private _rewards = createHashMap;
|
||||
_rewards set ["funds", _companyFunds];
|
||||
_rewards set ["reputation", _ratingSuccess];
|
||||
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||
|
||||
if (count _equipmentRewards > 0) then { _rewards set ["equipment", _equipmentRewards]; };
|
||||
if (count _supplyRewards > 0) then { _rewards set ["supplies", _supplyRewards]; };
|
||||
if (count _weaponRewards > 0) then { _rewards set ["weapons", _weaponRewards]; };
|
||||
if (count _vehicleRewards > 0) then { _rewards set ["vehicles", _vehicleRewards]; };
|
||||
if (count _specialRewards > 0) then { _rewards set ["special", _specialRewards]; };
|
||||
|
||||
[_taskID, _rewards] call FUNC(handleTaskRewards);
|
||||
[_taskID, "SUCCEEDED"] call BIS_fnc_taskSetState;
|
||||
if (_endSuccess) then {
|
||||
["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
// ["advance", _ratingSuccess] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingSuccess] call EFUNC(org,addReputation);
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
sleep 1;
|
||||
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
|
||||
// ["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||
[_companyFunds] call EFUNC(org,addFunds);
|
||||
[format ["Task completed: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endSuccess) then { ["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
};
|
@ -16,39 +16,17 @@
|
||||
* 8: Enemy wave count <NUMBER> (default: 3)
|
||||
* 9: Time between waves in seconds <NUMBER> (default: 300)
|
||||
* 10: Minimum BLUFOR units required in zone <NUMBER> (default: 1)
|
||||
* 11: Equipment rewards <ARRAY> (default: [])
|
||||
* 12: Supply rewards <ARRAY> (default: [])
|
||||
* 13: Weapon rewards <ARRAY> (default: [])
|
||||
* 14: Vehicle rewards <ARRAY> (default: [])
|
||||
* 15: Special rewards <ARRAY> (default: [])
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* ["defend_zone_1", "defend_marker", 900, 500000, -100, 400, false, false, 3, 300, 1, ["ItemGPS"], ["FirstAidKit"], ["arifle_MX_F"], ["B_MRAP_01_F"], ["B_UAV_01_F"]] spawn forge_client_task_fnc_defend;
|
||||
* ["defend_zone_1", "defend_marker", 900, 500000, -100, 400, false, false, 3, 300, 1] spawn forge_client_task_fnc_defend;
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [
|
||||
["_taskID", "", [""]],
|
||||
["_defenseZone", "", [""]],
|
||||
["_defendTime", 600, [0]],
|
||||
["_companyFunds", 0, [0]],
|
||||
["_ratingFail", 0, [0]],
|
||||
["_ratingSuccess", 0, [0]],
|
||||
["_endSuccess", false, [false]],
|
||||
["_endFail", false, [false]],
|
||||
["_waveCount", 3, [0]],
|
||||
["_waveCooldown", 300, [0]],
|
||||
["_minBlufor", 1, [0]],
|
||||
["_equipmentRewards", [], [[]]],
|
||||
["_supplyRewards", [], [[]]],
|
||||
["_weaponRewards", [], [[]]],
|
||||
["_vehicleRewards", [], [[]]],
|
||||
["_specialRewards", [], [[]]]
|
||||
];
|
||||
params [["_taskID", "", [""]], ["_defenseZone", "", [""]], ["_defendTime", 600, [0]], ["_companyFunds", 0, [0]], ["_ratingFail", 0, [0]], ["_ratingSuccess", 0, [0]], ["_endSuccess", false, [false]], ["_endFail", false, [false]], ["_waveCount", 3, [0]], ["_waveCooldown", 300, [0]], ["_minBlufor", 1, [0]]];
|
||||
|
||||
if (_defenseZone == "" || !(markerShape _defenseZone in ["RECTANGLE", "ELLIPSE"])) exitWith { diag_log format ["ERROR: Invalid defense zone marker: %1", _defenseZone]; };
|
||||
|
||||
@ -61,7 +39,12 @@ private _warningIssued = false;
|
||||
|
||||
waitUntil {
|
||||
sleep 1;
|
||||
private _bluforInZone = count (allUnits select { _x isKindOf "CAManBase" && { side _x == west } && { alive _x }} inAreaArray _defenseZone);
|
||||
private _bluforInZone = count (allUnits select {
|
||||
_x isKindOf "CAManBase" &&
|
||||
{side _x == west} &&
|
||||
{alive _x}
|
||||
} inAreaArray _defenseZone);
|
||||
|
||||
private _timeElapsed = time - _startTime;
|
||||
|
||||
if (_bluforInZone < _minBlufor) then {
|
||||
@ -93,37 +76,30 @@ waitUntil {
|
||||
if (_result == 1) then {
|
||||
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||
|
||||
private _penalties = createHashMap;
|
||||
_penalties set ["reputation", _ratingFail];
|
||||
if (_endFail) then {
|
||||
["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
|
||||
[_taskID, _penalties] call FUNC(handleTaskRewards);
|
||||
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
// ["deduct", _ratingFail] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingFail] call EFUNC(org,addReputation);
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endFail) then { ["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
} else {
|
||||
private _rewards = createHashMap;
|
||||
_rewards set ["funds", _companyFunds];
|
||||
_rewards set ["reputation", _ratingSuccess];
|
||||
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||
|
||||
if (count _equipmentRewards > 0) then { _rewards set ["equipment", _equipmentRewards]; };
|
||||
if (count _supplyRewards > 0) then { _rewards set ["supplies", _supplyRewards]; };
|
||||
if (count _weaponRewards > 0) then { _rewards set ["weapons", _weaponRewards]; };
|
||||
if (count _vehicleRewards > 0) then { _rewards set ["vehicles", _vehicleRewards]; };
|
||||
if (count _specialRewards > 0) then { _rewards set ["special", _specialRewards]; };
|
||||
|
||||
[_taskID, _rewards] call FUNC(handleTaskRewards);
|
||||
[_taskID, "SUCCEEDED"] call BIS_fnc_taskSetState;
|
||||
if (_endSuccess) then {
|
||||
["MissionSuccess", false] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
|
||||
// ["advance", _ratingSuccess] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingSuccess] call EFUNC(org,addReputation);
|
||||
[format ["Task succeeded: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[format ["Task completed: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endSuccess) then { ["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
// ["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||
[_companyFunds] call EFUNC(org,addFunds);
|
||||
[format ["Task succeeded: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
};
|
@ -13,11 +13,6 @@
|
||||
* 5: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
||||
* 6: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||
* 7: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||
* 8: Equipment rewards <ARRAY> (default: [])
|
||||
* 9: Supply rewards <ARRAY> (default: [])
|
||||
* 10: Weapon rewards <ARRAY> (default: [])
|
||||
* 11: Vehicle rewards <ARRAY> (default: [])
|
||||
* 12: Special rewards <ARRAY> (default: [])
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -28,21 +23,7 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [
|
||||
["_taskID", "", [""]],
|
||||
["_limitFail", -1, [0]],
|
||||
["_limitSuccess", -1, [0]],
|
||||
["_companyFunds", 0, [0]],
|
||||
["_ratingFail", 0, [0]],
|
||||
["_ratingSuccess", 0, [0]],
|
||||
["_endSuccess", false, [false]],
|
||||
["_endFail", false, [false]],
|
||||
["_equipmentRewards", [], [[]]],
|
||||
["_supplyRewards", [], [[]]],
|
||||
["_weaponRewards", [], [[]]],
|
||||
["_vehicleRewards", [], [[]]],
|
||||
["_specialRewards", [], [[]]]
|
||||
];
|
||||
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_endSuccess", false], ["_endFail", false]];
|
||||
|
||||
private _result = 0;
|
||||
|
||||
@ -77,42 +58,38 @@ if (_result == 1) then {
|
||||
|
||||
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||
|
||||
private _penalties = createHashMap;
|
||||
_penalties set ["reputation", _ratingFail];
|
||||
if (_endFail) then {
|
||||
["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
|
||||
[_taskID, _penalties] call FUNC(handleTaskRewards);
|
||||
// ["deduct", _ratingFail] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingFail] call EFUNC(org,addReputation);
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
sleep 1;
|
||||
|
||||
if (_endFail) then { ["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
} else {
|
||||
{ deleteVehicle _x } forEach _ieds;
|
||||
{ deleteVehicle _x } forEach _entities;
|
||||
|
||||
private _rewards = createHashMap;
|
||||
_rewards set ["funds", _companyFunds];
|
||||
_rewards set ["reputation", _ratingSuccess];
|
||||
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||
|
||||
if (count _equipmentRewards > 0) then { _rewards set ["equipment", _equipmentRewards]; };
|
||||
if (count _supplyRewards > 0) then { _rewards set ["supplies", _supplyRewards]; };
|
||||
if (count _weaponRewards > 0) then { _rewards set ["weapons", _weaponRewards]; };
|
||||
if (count _vehicleRewards > 0) then { _rewards set ["vehicles", _vehicleRewards]; };
|
||||
if (count _specialRewards > 0) then { _rewards set ["special", _specialRewards]; };
|
||||
|
||||
[_taskID, _rewards] call FUNC(handleTaskRewards);
|
||||
[_taskID, "SUCCEEDED"] call BIS_fnc_taskSetState;
|
||||
if (_endSuccess) then {
|
||||
["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
// ["advance", _ratingSuccess] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingSuccess] call EFUNC(org,addReputation);
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
sleep 1;
|
||||
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
|
||||
// ["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||
[_companyFunds] call EFUNC(org,addFunds);
|
||||
[format ["Task completed: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endSuccess) then { ["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
};
|
||||
|
||||
GVAR(defusedCount) = 0;
|
@ -14,12 +14,7 @@
|
||||
* 6: Amount of rating the company and player receive if the task is successful <NUMBER> (default: 0)
|
||||
* 7: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||
* 8: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||
* 9: Amount of time to complete delivery <NUMBER> (default: -1)
|
||||
* 10: Equipment rewards <ARRAY> (default: [])
|
||||
* 11: Supply rewards <ARRAY> (default: [])
|
||||
* 12: Weapon rewards <ARRAY> (default: [])
|
||||
* 13: Vehicle rewards <ARRAY> (default: [])
|
||||
* 14: Special rewards <ARRAY> (default: [])
|
||||
* 9: Amount of time to complete delivery <NUMBER> (default: nil)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -31,23 +26,7 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [
|
||||
["_taskID", "", [""]],
|
||||
["_limitFail", -1, [0]],
|
||||
["_limitSuccess", -1, [0]],
|
||||
["_deliveryZone", "", [""]],
|
||||
["_companyFunds", 0, [0]],
|
||||
["_ratingFail", 0, [0]],
|
||||
["_ratingSuccess", 0, [0]],
|
||||
["_endSuccess", false, [false]],
|
||||
["_endFail", false, [false]],
|
||||
["_time", -1, [0]],
|
||||
["_equipmentRewards", [], [[]]],
|
||||
["_supplyRewards", [], [[]]],
|
||||
["_weaponRewards", [], [[]]],
|
||||
["_vehicleRewards", [], [[]]],
|
||||
["_specialRewards", [], [[]]]
|
||||
];
|
||||
params [["_taskID", "", [""]], ["_limitFail", -1, [0]], ["_limitSuccess", -1, [0]], ["_deliveryZone", "", [""]], ["_companyFunds", 0, [0]], ["_ratingFail", 0, [0]], ["_ratingSuccess", 0, [0]], ["_endSuccess", false, [false]], ["_endFail", false, [false]], ["_time", nil, [0]]];
|
||||
|
||||
private _result = 0;
|
||||
|
||||
@ -58,7 +37,7 @@ waitUntil {
|
||||
};
|
||||
|
||||
private _cargo = GVAR(allCargo) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
||||
private _startTime = if (_time isNotEqualTo -1) then { floor(time) } else { nil };
|
||||
private _startTime = if (!isNil "_time") then { floor(time) } else { nil };
|
||||
|
||||
waitUntil {
|
||||
sleep 1;
|
||||
@ -66,7 +45,7 @@ waitUntil {
|
||||
private _cargoDelivered = ({ _x inArea _deliveryZone && (damage _x) < 0.7 } count _cargo);
|
||||
private _cargoDamaged = ({ damage _x >= 0.7 } count _cargo);
|
||||
|
||||
if (_time isNotEqualTo -1) then {
|
||||
if (!isNil "_time") then {
|
||||
private _timeExpired = (floor time - _startTime >= _time);
|
||||
|
||||
if (_cargoDamaged >= _limitFail) then { _result = 1; };
|
||||
@ -83,39 +62,37 @@ waitUntil {
|
||||
if (_result == 1) then {
|
||||
{ deleteVehicle _x } forEach _cargo;
|
||||
|
||||
private _penalties = createHashMap;
|
||||
_penalties set ["reputation", _ratingFail];
|
||||
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||
|
||||
[_taskID, _penalties] call FUNC(handleTaskRewards);
|
||||
if (_endFail) then {
|
||||
["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
// ["deduct", _ratingFail] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingFail] call EFUNC(org,addReputation);
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endFail) then { ["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
} else {
|
||||
{ deleteVehicle _x } forEach _cargo;
|
||||
|
||||
private _rewards = createHashMap;
|
||||
_rewards set ["funds", _companyFunds];
|
||||
_rewards set ["reputation", _ratingSuccess];
|
||||
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||
|
||||
if (count _equipmentRewards > 0) then { _rewards set ["equipment", _equipmentRewards]; };
|
||||
if (count _supplyRewards > 0) then { _rewards set ["supplies", _supplyRewards]; };
|
||||
if (count _weaponRewards > 0) then { _rewards set ["weapons", _weaponRewards]; };
|
||||
if (count _vehicleRewards > 0) then { _rewards set ["vehicles", _vehicleRewards]; };
|
||||
if (count _specialRewards > 0) then { _rewards set ["special", _specialRewards]; };
|
||||
|
||||
[_taskID, _rewards] call FUNC(handleTaskRewards);
|
||||
[_taskID, "SUCCEEDED"] call BIS_fnc_taskSetState;
|
||||
if (_endSuccess) then {
|
||||
["MissionSuccess", false] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
|
||||
// ["advance", _ratingSuccess] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingSuccess] call EFUNC(org,addReputation);
|
||||
[format ["Task succeeded: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[format ["Task completed: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endSuccess) then { ["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
// ["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||
[_companyFunds] call EFUNC(org,addFunds);
|
||||
[format ["Task succeeded: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
};
|
@ -13,12 +13,7 @@
|
||||
* 5: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
||||
* 6: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||
* 7: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||
* 8: Amount of time before target(s) escape <NUMBER> (default: -1)
|
||||
* 9: Equipment rewards <ARRAY> (default: [])
|
||||
* 10: Supply rewards <ARRAY> (default: [])
|
||||
* 11: Weapon rewards <ARRAY> (default: [])
|
||||
* 12: Vehicle rewards <ARRAY> (default: [])
|
||||
* 13: Special rewards <ARRAY> (default: [])
|
||||
* 8: Amount of time before target(s) escape <NUMBER> (default: nil)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -30,22 +25,7 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [
|
||||
["_taskID", "", [""]],
|
||||
["_limitFail", -1, [0]],
|
||||
["_limitSuccess", -1, [0]],
|
||||
["_companyFunds", 0, [0]],
|
||||
["_ratingFail", 0, [0]],
|
||||
["_ratingSuccess", 0, [0]],
|
||||
["_endSuccess", false, [false]],
|
||||
["_endFail", false, [false]],
|
||||
["_time", -1, [0]],
|
||||
["_equipmentRewards", [], [[]]],
|
||||
["_supplyRewards", [], [[]]],
|
||||
["_weaponRewards", [], [[]]],
|
||||
["_vehicleRewards", [], [[]]],
|
||||
["_specialRewards", [], [[]]]
|
||||
];
|
||||
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_endSuccess", false], ["_endFail", false], "_time"];
|
||||
|
||||
private _result = 0;
|
||||
|
||||
@ -77,39 +57,37 @@ waitUntil {
|
||||
if (_result == 1) then {
|
||||
{ deleteVehicle _x } forEach _targets;
|
||||
|
||||
private _penalties = createHashMap;
|
||||
_penalties set ["reputation", _ratingFail];
|
||||
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||
|
||||
[_taskID, _penalties] call FUNC(handleTaskRewards);
|
||||
if (_endFail) then {
|
||||
["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
// ["deduct", _ratingFail] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingFail] call EFUNC(org,addReputation);
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endFail) then { ["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
} else {
|
||||
{ deleteVehicle _x } forEach _targets;
|
||||
|
||||
private _rewards = createHashMap;
|
||||
_rewards set ["funds", _companyFunds];
|
||||
_rewards set ["reputation", _ratingSuccess];
|
||||
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||
|
||||
if (count _equipmentRewards > 0) then { _rewards set ["equipment", _equipmentRewards]; };
|
||||
if (count _supplyRewards > 0) then { _rewards set ["supplies", _supplyRewards]; };
|
||||
if (count _weaponRewards > 0) then { _rewards set ["weapons", _weaponRewards]; };
|
||||
if (count _vehicleRewards > 0) then { _rewards set ["vehicles", _vehicleRewards]; };
|
||||
if (count _specialRewards > 0) then { _rewards set ["special", _specialRewards]; };
|
||||
|
||||
[_taskID, _rewards] call FUNC(handleTaskRewards);
|
||||
[_taskID, "SUCCEEDED"] call BIS_fnc_taskSetState;
|
||||
if (_endSuccess) then {
|
||||
["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
// ["advance", _ratingSuccess] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingSuccess] call EFUNC(org,addReputation);
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
sleep 1;
|
||||
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
|
||||
// ["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||
[_companyFunds] call EFUNC(org,addFunds);
|
||||
[format ["Task completed: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endSuccess) then { ["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
};
|
@ -1,118 +0,0 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Author: IDSolutions
|
||||
* Handles task completion rewards for organizations
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Task ID <STRING>
|
||||
* 1: Reward Data <HASHMAP>
|
||||
* - funds: Amount of money to award <NUMBER>
|
||||
* - reputation: Amount of reputation to award <NUMBER>
|
||||
* - equipment: Array of equipment classnames to award <ARRAY>
|
||||
* - supplies: Array of supply classnames to award <ARRAY>
|
||||
* - weapons: Array of weapon classnames to award <ARRAY>
|
||||
* - vehicles: Array of vehicle classnames to award <ARRAY>
|
||||
* - special: Array of special item classnames to award <ARRAY>
|
||||
*
|
||||
* Return Value:
|
||||
* Success <BOOLEAN>
|
||||
*
|
||||
* Example:
|
||||
* private _rewards = createHashMapFromArray [
|
||||
* ["funds", 10000],
|
||||
* ["reputation", 50],
|
||||
* ["equipment", ["ItemGPS", "ItemCompass"]],
|
||||
* ["supplies", ["FirstAidKit", "Medikit"]],
|
||||
* ["weapons", ["arifle_MX_F"]],
|
||||
* ["vehicles", ["B_MRAP_01_F"]],
|
||||
* ["special", ["B_UAV_01_F"]]
|
||||
* ];
|
||||
* ["task_1", _rewards] call forge_client_task_fnc_handleTaskRewards;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params [["_taskID", ""], ["_rewards", createHashMap]];
|
||||
|
||||
if (_taskID == "") exitWith {
|
||||
diag_log "ERROR: No task ID provided for rewards";
|
||||
false
|
||||
};
|
||||
|
||||
private _store = call EFUNC(org,verifyOrgStore);
|
||||
if (isNil "_store") exitWith {
|
||||
["No organization found to receive rewards", "error", 5, "right"] call EFUNC(misc,notify);
|
||||
false
|
||||
};
|
||||
|
||||
private _success = true;
|
||||
private _funds = _rewards getOrDefault ["funds", 0];
|
||||
if (_funds > 0) then {
|
||||
if !([_funds] call EFUNC(org,addFunds)) then {
|
||||
diag_log format ["Failed to award funds %1 for task %2", _funds, _taskID];
|
||||
_success = false;
|
||||
};
|
||||
};
|
||||
|
||||
private _reputation = _rewards getOrDefault ["reputation", 0];
|
||||
if (_reputation > 0) then {
|
||||
if !([_reputation] call EFUNC(org,addReputation)) then {
|
||||
diag_log format ["Failed to award reputation %1 for task %2", _reputation, _taskID];
|
||||
_success = false;
|
||||
};
|
||||
};
|
||||
|
||||
private _fnc_addAssets = {
|
||||
params ["_type", "_items"];
|
||||
{
|
||||
private _properties = createHashMap;
|
||||
_properties set ["source", format ["Task Reward: %1", _taskID]];
|
||||
_properties set ["acquired", call EFUNC(misc,getSystemTime)];
|
||||
|
||||
if !([_type, _x, _properties] call EFUNC(org,addAsset)) then {
|
||||
diag_log format ["Failed to award %1 asset %2 for task %3", _type, _x, _taskID];
|
||||
_success = false;
|
||||
};
|
||||
} forEach _items;
|
||||
};
|
||||
|
||||
private _equipment = _rewards getOrDefault ["equipment", []];
|
||||
if (count _equipment > 0) then {
|
||||
["equipment", _equipment] call _fnc_addAssets;
|
||||
};
|
||||
|
||||
private _supplies = _rewards getOrDefault ["supplies", []];
|
||||
if (count _supplies > 0) then {
|
||||
["supply", _supplies] call _fnc_addAssets;
|
||||
};
|
||||
|
||||
private _weapons = _rewards getOrDefault ["weapons", []];
|
||||
if (count _weapons > 0) then {
|
||||
["weapon", _weapons] call _fnc_addAssets;
|
||||
};
|
||||
|
||||
private _vehicles = _rewards getOrDefault ["vehicles", []];
|
||||
if (count _vehicles > 0) then {
|
||||
["vehicle", _vehicles] call _fnc_addAssets;
|
||||
};
|
||||
|
||||
private _special = _rewards getOrDefault ["special", []];
|
||||
if (count _special > 0) then {
|
||||
["special", _special] call _fnc_addAssets;
|
||||
};
|
||||
|
||||
if (_success) then {
|
||||
private _rewardText = "Task Rewards:";
|
||||
if (_funds > 0) then { _rewardText = _rewardText + format ["\n- $%1", _funds call EFUNC(misc,formatNumber)]; };
|
||||
if (_reputation > 0) then { _rewardText = _rewardText + format ["\n- %1 Reputation", _reputation]; };
|
||||
if (count _equipment > 0) then { _rewardText = _rewardText + format ["\n- %1 Equipment Items", count _equipment]; };
|
||||
if (count _supplies > 0) then { _rewardText = _rewardText + format ["\n- %1 Supply Items", count _supplies]; };
|
||||
if (count _weapons > 0) then { _rewardText = _rewardText + format ["\n- %1 Weapons", count _weapons]; };
|
||||
if (count _vehicles > 0) then { _rewardText = _rewardText + format ["\n- %1 Vehicles", count _vehicles]; };
|
||||
if (count _special > 0) then { _rewardText = _rewardText + format ["\n- %1 Special Items", count _special]; };
|
||||
|
||||
[_rewardText, "success", 10, "right"] call EFUNC(misc,notify);
|
||||
};
|
||||
|
||||
_success
|
@ -15,13 +15,8 @@
|
||||
* 7: Subcategory of task <ARRAY> (default: [false, true])
|
||||
* 8: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||
* 9: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||
* 10: Amount of time before hostage(s) die <NUMBER> (default: -1)
|
||||
* 11: Marker name for the cbrn zone <STRING> (default: "")
|
||||
* 12: Equipment rewards <ARRAY> (default: [])
|
||||
* 13: Supply rewards <ARRAY> (default: [])
|
||||
* 14: Weapon rewards <ARRAY> (default: [])
|
||||
* 15: Vehicle rewards <ARRAY> (default: [])
|
||||
* 16: Special rewards <ARRAY> (default: [])
|
||||
* 10: Amount of time before hostage(s) die <NUMBER> (default: nil)
|
||||
* 11: Marker name for the cbrn zone <STRING> (default: nil)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -34,25 +29,7 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [
|
||||
["_taskID", ""],
|
||||
["_limitFail", -1],
|
||||
["_limitSuccess", -1],
|
||||
["_extZone", ""],
|
||||
["_companyFunds", 0],
|
||||
["_ratingFail", 0],
|
||||
["_ratingSuccess", 0],
|
||||
["_type", [["_cbrn", false, [false]], ["_hostage", true, [false]]]],
|
||||
["_endSuccess", false, [false]],
|
||||
["_endFail", false, [false]],
|
||||
["_time", -1, [0]],
|
||||
["_cbrnZone", "", [""]]
|
||||
["_equipmentRewards", [], [[]]],
|
||||
["_supplyRewards", [], [[]]],
|
||||
["_weaponRewards", [], [[]]],
|
||||
["_vehicleRewards", [], [[]]],
|
||||
["_specialRewards", [], [[]]]
|
||||
];
|
||||
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_extZone", ""], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_type", [["_cbrn", false], ["_hostage", true]]], ["_endSuccess", false], ["_endFail", false], "_time", ["_cbrnZone", ""]];
|
||||
|
||||
private _cbrn = (_this select 7) select 0;
|
||||
private _hostage = (_this select 7) select 1;
|
||||
@ -72,7 +49,7 @@ waitUntil {
|
||||
|
||||
private _hostages = GVAR(allHostages) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
||||
private _shooters = GVAR(allShooters) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
||||
private _startTime = if (_time isNotEqualTo -1) then { floor(time) } else { nil };
|
||||
private _startTime = if (!isNil "_time") then { floor(time) } else { nil };
|
||||
|
||||
waitUntil {
|
||||
sleep 1;
|
||||
@ -82,7 +59,7 @@ waitUntil {
|
||||
private _hostagesKilled = ({ !alive _x } count _hostages);
|
||||
private _shootersAlive = ({ alive _x } count _shooters);
|
||||
|
||||
if (_time isNotEqualTo -1) then {
|
||||
if (!isNil "_time") then {
|
||||
private _timeExpired = (floor time - _startTime >= _time);
|
||||
|
||||
if (_hostagesFreed < _limitSuccess && _timeExpired) then { _result = 1; };
|
||||
@ -134,40 +111,38 @@ if (_result == 1) then {
|
||||
{ deleteVehicle _x } forEach _hostages;
|
||||
{ deleteVehicle _x } forEach _shooters;
|
||||
|
||||
private _penalties = createHashMap;
|
||||
_penalties set ["reputation", _ratingFail];
|
||||
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||
|
||||
[_taskID, _penalties] call FUNC(handleTaskRewards);
|
||||
if (_endFail) then {
|
||||
["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
// ["deduct", _ratingFail] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingFail] call EFUNC(org,addReputation);
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endFail) then { ["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
} else {
|
||||
{ deleteVehicle _x } forEach _hostages;
|
||||
{ deleteVehicle _x } forEach _shooters;
|
||||
|
||||
private _rewards = createHashMap;
|
||||
_rewards set ["funds", _companyFunds];
|
||||
_rewards set ["reputation", _ratingSuccess];
|
||||
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||
|
||||
if (count _equipmentRewards > 0) then { _rewards set ["equipment", _equipmentRewards]; };
|
||||
if (count _supplyRewards > 0) then { _rewards set ["supplies", _supplyRewards]; };
|
||||
if (count _weaponRewards > 0) then { _rewards set ["weapons", _weaponRewards]; };
|
||||
if (count _vehicleRewards > 0) then { _rewards set ["vehicles", _vehicleRewards]; };
|
||||
if (count _specialRewards > 0) then { _rewards set ["special", _specialRewards]; };
|
||||
|
||||
[_taskID, _rewards] call FUNC(handleTaskRewards);
|
||||
[_taskID, "SUCCEEDED"] call BIS_fnc_taskSetState;
|
||||
if (_endSuccess) then {
|
||||
["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
// ["advance", _ratingSuccess] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingSuccess] call EFUNC(org,addReputation);
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
sleep 1;
|
||||
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
|
||||
// ["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||
[_companyFunds] call EFUNC(org,addFunds);
|
||||
[format ["Task completed: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endSuccess) then { ["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
};
|
@ -15,12 +15,7 @@
|
||||
* 7: Subcategory of task <ARRAY> (default: [true, false])
|
||||
* 8: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||
* 9: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||
* 10: Amount of time before hvt(s) die <NUMBER> (default: -1)
|
||||
* 11: Equipment rewards <ARRAY> (default: [])
|
||||
* 12: Supply rewards <ARRAY> (default: [])
|
||||
* 13: Weapon rewards <ARRAY> (default: [])
|
||||
* 14: Vehicle rewards <ARRAY> (default: [])
|
||||
* 15: Special rewards <ARRAY> (default: [])
|
||||
* 10: Amount of time before hvt(s) die <NUMBER> (default: nil)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -34,24 +29,7 @@
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params [
|
||||
["_taskID", "", [""]],
|
||||
["_limitFail", -1, [0]],
|
||||
["_limitSuccess", -1, [0]],
|
||||
["_extZone", "", [""]],
|
||||
["_companyFunds", 0, [0]],
|
||||
["_ratingFail", 0, [0]],
|
||||
["_ratingSuccess", 0, [0]],
|
||||
["_type", [["_capture", true, [false]], ["_eliminate", false, [false]]]],
|
||||
["_endSuccess", false, [false]],
|
||||
["_endFail", false, [false]],
|
||||
["_time", -1, [0]],
|
||||
["_equipmentRewards", [], [[]]],
|
||||
["_supplyRewards", [], [[]]],
|
||||
["_weaponRewards", [], [[]]],
|
||||
["_vehicleRewards", [], [[]]],
|
||||
["_specialRewards", [], [[]]]
|
||||
];
|
||||
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_extZone", ""], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_type", [["_capture", true], ["_eliminate", false]]], ["_endSuccess", false], ["_endFail", false], "_time"];
|
||||
|
||||
private _capture = (_this select 7) select 0;
|
||||
private _eliminate = (_this select 7) select 1;
|
||||
@ -91,39 +69,37 @@ waitUntil {
|
||||
if (_result == 1) then {
|
||||
{ deleteVehicle _x } forEach _hvts;
|
||||
|
||||
private _penalties = createHashMap;
|
||||
_penalties set ["reputation", _ratingFail];
|
||||
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||
|
||||
[_taskID, _penalties] call FUNC(handleTaskRewards);
|
||||
if (_endFail) then {
|
||||
["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
// ["deduct", _ratingFail] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingFail] call EFUNC(org,addReputation);
|
||||
[format ["Task failed: %1 reputation", _ratingFail], "warning", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endFail) then { ["MissionFail", false] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
sleep 1;
|
||||
|
||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
} else {
|
||||
{ deleteVehicle _x } forEach _hvts;
|
||||
|
||||
private _rewards = createHashMap;
|
||||
_rewards set ["funds", _companyFunds];
|
||||
_rewards set ["reputation", _ratingSuccess];
|
||||
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||
|
||||
if (count _equipmentRewards > 0) then { _rewards set ["equipment", _equipmentRewards]; };
|
||||
if (count _supplyRewards > 0) then { _rewards set ["supplies", _supplyRewards]; };
|
||||
if (count _weaponRewards > 0) then { _rewards set ["weapons", _weaponRewards]; };
|
||||
if (count _vehicleRewards > 0) then { _rewards set ["vehicles", _vehicleRewards]; };
|
||||
if (count _specialRewards > 0) then { _rewards set ["special", _specialRewards]; };
|
||||
|
||||
[_taskID, _rewards] call FUNC(handleTaskRewards);
|
||||
[_taskID, "SUCCEEDED"] call BIS_fnc_taskSetState;
|
||||
if (_endSuccess) then {
|
||||
["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide];
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
// ["advance", _ratingSuccess] remoteExecCall ["forge_server_rating_fnc_handleRating", 2];
|
||||
[_ratingSuccess] call EFUNC(org,addReputation);
|
||||
[format ["Task succeeded: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
sleep 1;
|
||||
|
||||
[format ["Task completed: %1 reputation", _ratingSuccess], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
[format ["Task completed: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
|
||||
if (_endSuccess) then { ["MissionSuccess", true] remoteExecCall ["BIS_fnc_endMission", playerSide]; };
|
||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||
|
||||
// ["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||
[_companyFunds] call EFUNC(org,addFunds);
|
||||
[format ["Task succeeded: %1 funds", _companyFunds], "success", 5, "right"] call EFUNC(misc,notify);
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user