From 04d263fb8c0c781eb607eb270d930257dbb67780 Mon Sep 17 00:00:00 2001 From: second_coming Date: Thu, 12 May 2016 12:29:02 +0100 Subject: [PATCH] SC submit v1 --- @ExileServer/addons/a3_dms/config.cpp | 2 +- .../a3_dms/missions/static/occupation.sqf | 288 ++++++++++++++++++ .../a3_dms/scripts/fn_PlayerAwardOnAIKill.sqf | 2 +- .../a3_dms/scripts/fn_SpawnAISoldier.sqf | 2 +- 4 files changed, 291 insertions(+), 3 deletions(-) create mode 100644 @ExileServer/addons/a3_dms/missions/static/occupation.sqf diff --git a/@ExileServer/addons/a3_dms/config.cpp b/@ExileServer/addons/a3_dms/config.cpp index 12aae08..d09b50e 100644 --- a/@ExileServer/addons/a3_dms/config.cpp +++ b/@ExileServer/addons/a3_dms/config.cpp @@ -4,7 +4,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; - a3_DMS_version = "May 6, 2016 (TEST)"; + a3_DMS_version = "May 12, 2016 (TEST)"; requiredVersion = 1.36; requiredAddons[] = {"exile_client","exile_server_config"}; }; diff --git a/@ExileServer/addons/a3_dms/missions/static/occupation.sqf b/@ExileServer/addons/a3_dms/missions/static/occupation.sqf new file mode 100644 index 0000000..0557215 --- /dev/null +++ b/@ExileServer/addons/a3_dms/missions/static/occupation.sqf @@ -0,0 +1,288 @@ +/* + "Occupation" static mission for Altis, Chernarus, Namalsk and Taviana + Created by second_coming +*/ + +private["_wp","_wp2","_wp3"]; + +// For logging purposes +_num = DMS_MissionCount; + + +// Set mission side (only "bandit" is supported for now) +_side = "bandit"; + +// Default config is for Chernarus +_pos = [3810,8887,0]; +_missionName = "Vybor Occupation"; +_msgStart = ['#FFFF00',"Vybor is under martial law! There are reports they have a large weapon cache..."]; +_msgWIN = ['#0080FF',"Convicts have successfully assaulted the town of Vybor and secured the cache!"]; +_msgLOSE = ['#FF0000',"The troops have left Vybor, taking the cache with them..."]; + +if (worldName == 'Altis') then +{ + _pos = [12571,14337,0]; + _missionName = "Neochori Occupation"; + _msgStart = ['#FFFF00',"Neochori is under martial law! There are reports they have a large weapon cache..."]; + _msgWIN = ['#0080FF',"Convicts have successfully assaulted the town of Neochori and secured the cache!"]; + _msgLOSE = ['#FF0000',"The troops have left Neochori, taking the cache with them..."]; + +}; + +if (worldName == 'Taviana') then +{ + _pos = [14000,12220,0]; + _missionName = "Solibor Occupation"; + _msgStart = ['#FFFF00',"Solibor is under martial law! There are reports they have a large weapon cache..."]; + _msgWIN = ['#0080FF',"Convicts have successfully assaulted the town of Solibor and secured the cache!"]; + _msgLOSE = ['#FF0000',"The troops have left Solibor, taking the cache with them..."]; + +}; + +if (worldName == 'Namalsk') then +{ + _pos = [3926,7523,0]; + _missionName = "Norinsk Occupation"; + _msgStart = ['#FFFF00',"Norinsk is under martial law! There are reports they have a large weapon cache..."]; + _msgWIN = ['#0080FF',"Convicts have successfully assaulted the town of Norinsk and secured the cache!"]; + _msgLOSE = ['#FF0000',"The troops have left Norinsk, taking the cache with them..."]; + +}; + +diag_log text "[DMS]: Town Occupation Mission Started"; +_sc_xpos = _pos select 0; +_sc_ypos = _pos select 1; + +if ([_pos,DMS_StaticMinPlayerDistance] call DMS_fnc_IsPlayerNearby) exitWith {"delay"}; + + +// Set general mission difficulty +_difficulty = "hardcore"; + + +// Create AI +_AICount = 27; +_group1Count = ceil(_AICount/3); +_group2Count = ceil(_AICount/3); +_group3Count = ceil(_AICount/3); + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Get AI to defend the position +////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +_group = [_pos, _group1Count, _difficulty, "random", _side] call DMS_fnc_SpawnAIGroup; +[ _group,_pos,_difficulty,"COMBAT" ] call DMS_fnc_SetGroupBehavior; + +_buildings = _pos nearObjects ["building", 200]; +{ + _buildingPositions = [_x, 10] call BIS_fnc_buildingPositions; + if(count _buildingPositions > 0) then + { + _y = _x; + // Find Highest Point + _highest = [0,0,0]; + { + if(_x select 2 > _highest select 2) then + { + _highest = _x; + }; + + } foreach _buildingPositions; + _spawnPosition = _highest; + + _i = _buildingPositions find _spawnPosition; + _wp = _group addWaypoint [_spawnPosition,0] ; + _wp setWaypointFormation "Column"; + _wp setWaypointBehaviour "AWARE"; + _wp setWaypointCombatMode "RED"; + _wp setWaypointCompletionRadius 1; + _wp waypointAttachObject _y; + _wp setwaypointHousePosition _i; + _wp setWaypointType "MOVE"; + + }; + +} foreach _buildings; +if(count _buildings > 0 ) then +{ + _wp setWaypointType "CYCLE"; +}; + + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +_group2 = [ _pos, _group2Count, _difficulty, "random", _side] call DMS_fnc_SpawnAIGroup; +[ _group2,_pos,_difficulty,"COMBAT" ] call DMS_fnc_SetGroupBehavior; + +_buildings = _pos nearObjects ["building", 100]; +{ + _buildingPositions = [_x, 10] call BIS_fnc_buildingPositions; + if(count _buildingPositions > 0) then + { + _y = _x; + // Find Highest Point + _highest = [0,0,0]; + { + if(_x select 2 > _highest select 2) then + { + _highest = _x; + }; + + } foreach _buildingPositions; + _spawnPosition = _highest; + + _i = _buildingPositions find _spawnPosition; + _wp2 = _group2 addWaypoint [_spawnPosition,0] ; + _wp2 setWaypointFormation "Column"; + _wp2 setWaypointBehaviour "AWARE"; + _wp2 setWaypointCombatMode "RED"; + _wp2 setWaypointCompletionRadius 1; + _wp2 waypointAttachObject _y; + _wp2 setwaypointHousePosition _i; + _wp2 setWaypointType "MOVE"; + }; + +} foreach _buildings; +if(count _buildings > 0 ) then +{ + _wp2 setWaypointType "CYCLE"; +}; + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +_group3 = [_pos, _group3Count, _difficulty, "random", _side] call DMS_fnc_SpawnAIGroup; +[ _group3,_pos,_difficulty,"COMBAT" ] call DMS_fnc_SetGroupBehavior; + +_buildings = _pos nearObjects ["building", 100]; +{ + _buildingPositions = [_x, 10] call BIS_fnc_buildingPositions; + if(count _buildingPositions > 0) then + { + _y = _x; + // Find Highest Point + _highest = [0,0,0]; + { + if(_x select 2 > _highest select 2) then + { + _highest = _x; + }; + + } foreach _buildingPositions; + _spawnPosition = _highest; + + _i = _buildingPositions find _spawnPosition; + _wp3 = _group2 addWaypoint [_spawnPosition,0] ; + _wp3 setWaypointFormation "Column"; + _wp3 setWaypointBehaviour "AWARE"; + _wp3 setWaypointCombatMode "RED"; + _wp3 setWaypointCompletionRadius 1; + _wp3 waypointAttachObject _y; + _wp3 setwaypointHousePosition _i; + _wp3 setWaypointType "MOVE"; + + }; + +} foreach _buildings; +if(count _buildings > 0 ) then +{ + _wp3 setWaypointType "CYCLE"; +}; + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// Get the AI to shut the fuck up :) +enableSentences false; +enableRadio false; + +// Create Crate +_crate = ["I_CargoNet_01_ammo_F",_pos] call DMS_fnc_SpawnCrate; + + +// Define mission-spawned AI Units +_missionAIUnits = +[ + [_group,_group2,_group3] +]; + +// Define the group reinforcements +_groupReinforcementsInfo = []; + +// Define mission-spawned objects and loot values +_missionObjs = +[ + [_missionAIUnits], // armed AI vehicle and static gun(s). Note, we don't add the base itself because we don't want to delete it and respawn it if the mission respawns. + [], + [[_crate,[30 + (random 20),100 + (random 40),15 + (random 5)]]] // weapons,items,backpacks +]; + +// Create Markers +_markers = +[ + _pos, + _missionName, + _difficulty +] call DMS_fnc_CreateMarker; + +(_markers select 1) setMarkerSize [500,500]; + +// Record time here (for logging purposes, otherwise you could just put "diag_tickTime" into the "DMS_AddMissionToMonitor" parameters directly) +_time = diag_tickTime; + +// Parse and add mission info to missions monitor +_added = +[ + _pos, + [ + [ + "kill", + [_group,_group2,_group3] + ], + [ + "playerNear", + [_pos,100] + ] + ], + _groupReinforcementsInfo, + [ + _time, + DMS_StaticMissionTimeOut call DMS_fnc_SelectRandomVal + ], + _missionAIUnits, + _missionObjs, + [_missionName,_msgWIN,_msgLOSE], + _markers, + _side, + _difficulty, + [[],[]] +] call DMS_fnc_AddMissionToMonitor_Static; + +// Check to see if it was added correctly, otherwise delete the stuff +if !(_added) exitWith +{ + diag_log format ["DMS ERROR :: Attempt to set up mission %1 with invalid parameters for DMS_fnc_AddMissionToMonitor_Static! Deleting mission objects and resetting DMS_MissionCount.",_missionName]; + + _cleanup = []; + { + _cleanup pushBack _x; + } forEach _missionAIUnits; + + _cleanup pushBack ((_missionObjs select 0)+(_missionObjs select 1)); + + { + _cleanup pushBack (_x select 0); + } foreach (_missionObjs select 2); + + _cleanup call DMS_fnc_CleanUp; + + + // Delete the markers directly + {deleteMarker _x;} forEach _markers; + + + // Reset the mission count + DMS_MissionCount = DMS_MissionCount - 1; +}; + + +// Notify players +[_missionName,_msgStart] call DMS_fnc_BroadcastMissionStatus; + + +(format ["MISSION: (%1) :: Mission #%2 started at %3 with %4 AI units and %5 difficulty at time %6",_missionName,_num,_pos,_AICount,_difficulty,_time]) call DMS_fnc_DebugLog; \ No newline at end of file diff --git a/@ExileServer/addons/a3_dms/scripts/fn_PlayerAwardOnAIKill.sqf b/@ExileServer/addons/a3_dms/scripts/fn_PlayerAwardOnAIKill.sqf index c740cf5..cadd1c5 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_PlayerAwardOnAIKill.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_PlayerAwardOnAIKill.sqf @@ -97,7 +97,7 @@ if ((!isNull _playerObj) && {(_playerUID != "") && {_playerObj isKindOf "Exile_U { // Change message for players when they're actually LOSING poptabs _msgType = "notificationRequest"; - _msgParams = ["Whoops",[format ["Lost %1 poptabs from running over a %2 AI!",abs _moneyChange,_AIType]]]; + _msgParams = ["Whoops",[format ["Lost %1 poptabs for killing %2 AI!",abs _moneyChange,_AIType]]]; //changed wording, negative result is not necessarily a roadkill // With the error message the money value won't be updated on the client, so I just directly PVC the value. ExileClientPlayerMoney = _playerMoney; diff --git a/@ExileServer/addons/a3_dms/scripts/fn_SpawnAISoldier.sqf b/@ExileServer/addons/a3_dms/scripts/fn_SpawnAISoldier.sqf index 520e3da..415b046 100644 --- a/@ExileServer/addons/a3_dms/scripts/fn_SpawnAISoldier.sqf +++ b/@ExileServer/addons/a3_dms/scripts/fn_SpawnAISoldier.sqf @@ -129,7 +129,7 @@ else }; // Unit name -_unit setName format["[DMS %1 %2 %3]",toUpper _side,_class,floor(random 1000)]; +//_unit setName format["[DMS %1 %2 %3]",toUpper _side,_class,floor(random 1000)]; if (_customGearSet isEqualTo []) then {