Initial
This commit is contained in:
.gitignore24_napf.bat24_napf.cfgrules.sqf
@DayZ_Epoch_Server
HiveExt.dll
addons
dayz_server.pbo
dayz_server
$PREFIX$
AdminTools
DZAI
SHK_pos
shk_pos_fnc_findclosestposition.sqfshk_pos_fnc_getmarkercorners.sqfshk_pos_fnc_getmarkershape.sqfshk_pos_fnc_getpos.sqfshk_pos_fnc_getposfromcircle.sqfshk_pos_fnc_getposfromellipse.sqfshk_pos_fnc_getposfromrectangle.sqfshk_pos_fnc_getposfromsquare.sqfshk_pos_fnc_isblacklisted.sqfshk_pos_fnc_isincircle.sqfshk_pos_fnc_isinellipse.sqfshk_pos_fnc_isinrectangle.sqfshk_pos_fnc_issameposition.sqfshk_pos_fnc_rotateposition.sqfshk_pos_getpos.sqfshk_pos_getposmarker.sqfshk_pos_init.sqf
compile
BIN_taskPatrol.sqfai_alertzombies.sqfai_death.sqfai_fired.sqfai_generate_loot.sqfai_killed_air.sqfai_killed_all.sqfai_killed_dynamic.sqfai_killed_land.sqfai_killed_random.sqfai_killed_static.sqfai_setup_loadout.sqfai_unconscious.sqfcreateRandomSpawns.sqffn_abortdynspawn.sqffn_abortrandspawn.sqffn_checkclassname.sqffn_countkills.sqffn_createStaticSpawn.sqffn_customSpawnUnits.sqffn_damageHandlerAI2.sqffn_findKiller.sqffn_findspawnpos.sqffn_init_trigger.sqffn_refreshmarker.sqffn_seekPlayer.sqffn_selectRandom.sqffn_selectRandomWeighted.sqffn_skillboost.sqffn_spawnGroup.sqfgroup_manager.sqfheli_airlanding.sqfheli_awareness.sqfheli_destroyed.sqfheli_detectplayers.sqfheli_handledamage.sqfheli_parachute.sqfheli_randompatrol.sqfheli_reinforce.sqfveh_destroyed.sqfveh_handledamage.sqfveh_randompatrol.sqfveh_regroup.sqf
init
DZAI_version.txtdzai_config.sqfdzai_functions.sqfdzai_initserver.sqf
world_classname_configs
#readme - Read this before editing classnames.txtdayz_epoch.sqfdayz_huntinggrounds.sqfdayz_overwatch.sqfdayz_unleashed.sqf
default_classnames
world_spawn_configs
#readme - directory guide and custom spawn info.txt
custom_markers
cust_markers_caribou.sqfcust_markers_chernarus.sqfcust_markers_cmr_ovaron.sqfcust_markers_fallujah.sqfcust_markers_isladuala.sqfcust_markers_lingor.sqfcust_markers_mbg_celle2.sqfcust_markers_namalsk.sqfcust_markers_napf.sqfcust_markers_oring.sqfcust_markers_panthera2.sqfcust_markers_podagorsk.sqfcust_markers_sara.sqfcust_markers_sauerland.sqfcust_markers_takistan.sqfcust_markers_tavi.sqfcust_markers_trinity.sqfcust_markers_utes.sqfcust_markers_zargabad.sqf
custom_spawns
cust_spawns_caribou.sqfcust_spawns_chernarus.sqfcust_spawns_cmr_ovaron.sqfcust_spawns_fallujah.sqfcust_spawns_isladuala.sqfcust_spawns_lingor.sqfcust_spawns_mbg_celle2.sqfcust_spawns_namalsk.sqfcust_spawns_napf.sqfcust_spawns_oring.sqfcust_spawns_panthera2.sqfcust_spawns_podagorsk.sqfcust_spawns_sara.sqfcust_spawns_sauerland.sqfcust_spawns_takistan.sqfcust_spawns_tavi.sqfcust_spawns_trinity.sqfcust_spawns_utes.sqfcust_spawns_zargabad.sqf
spawn_areas
areas_caribou.sqfareas_chernarus.sqfareas_napf.sqfareas_podagorsk.sqfareas_sauerland.sqfareas_taviana.sqfareas_trinity.sqf
spawn_markers
markers_caribou.sqfmarkers_chernarus.sqfmarkers_cmr_ovaron.sqfmarkers_fallujah.sqfmarkers_isladuala.sqfmarkers_lingor.sqfmarkers_mbg_celle2.sqfmarkers_namalsk.sqfmarkers_napf.sqfmarkers_oring.sqfmarkers_panthera2.sqfmarkers_podagorsk.sqfmarkers_sara.sqfmarkers_sauerland.sqfmarkers_takistan.sqfmarkers_tavi.sqfmarkers_trinity.sqfmarkers_utes.sqfmarkers_zargabad.sqf
world_caribou.sqfworld_chernarus.sqfworld_cmr_ovaron.sqfworld_dayzunleashed.sqfworld_fallujah.sqfworld_fdf_isle1_a.sqfworld_isladuala.sqfworld_lingor.sqfworld_mbg_celle2.sqfworld_namalsk.sqfworld_napf.sqfworld_oring.sqfworld_panthera2.sqfworld_sara.sqfworld_sauerland.sqfworld_smd_sahrani_a2.sqfworld_takistan.sqfworld_tavi.sqfworld_tavi_old.sqfworld_trinity.sqfworld_utes.sqfworld_zargabad.sqfscripts
DZAI_serverMonitor.sqfDZAI_startup.sqfbuildWeaponArrays.sqfbuildWeightedTables.sqfbuildingpatch_all.sqfdynamicSpawn_manager.sqfsetup_autoStaticSpawns.sqfsetup_blacklist_areas.sqfsetup_locations.sqfsetup_playerspawn_areas.sqfsetup_veh_patrols.sqfverifyTables.sqf
spawn_functions
despawnBandits.sqfdespawnBandits_dynamic.sqfdespawnBandits_random.sqfrespawnBandits.sqfrespawnHandler1.sqfrespawnHandler2.sqfspawnBandits.sqfspawnBandits_custom.sqfspawnBandits_dynamic.sqfspawnBandits_dynamicV2.sqfspawnBandits_initialize.sqfspawnBandits_random.sqfspawnVehiclePatrol.sqfspawnVehicle_custom.sqf
DZMS
DZMSConfig.sqfDZMSInit.sqf
ExtConfig
Missions
AN2_Cargo_Drop.sqfAPC_Mission.sqfArmed_Vehicles.sqfC130_Crash.sqfConstruction_Site.sqfFirebase.sqfGeneral_Store.sqfHelicopter_Crash.sqfHelicopter_Landing.sqfHumvee_Crash.sqfMedical_Cache.sqfMedical_Camp.sqfMedical_Outpost.sqfSMA1.sqfSMA2.sqfSMA3.sqfSMA4.sqfSMA5.sqfSMA6.sqfSMI1.sqfSMI2.sqfSMI3.sqfSMI4.sqfSMI5.sqfSMI6.sqfSquad.sqfStash_House.sqfUral_Ambush.sqfWeapons_Cache.sqfWeapons_Truck.sqf
Scripts
WAI
compile
airdrop_winorfail.sqfauto_claim.sqfcustom_publish_vehicle.sqfdynamic_crate.sqffind_position.sqffunctions.sqfgroup_waypoints.sqfheli_para.sqfheli_patrol.sqfload_ammo.sqfminefield.sqfmission_winorfail.sqfon_kill.sqfpatrol_winorfail.sqfposition_functions.sqfspawn_group.sqfspawn_objects.sqfspawn_static.sqfstatic_spawn_manager.sqfvehicle_patrol.sqf
config.sqfconfigs
init.sqfmissions
MISSION_EXAMPLE.sqfMISSION_EXAMPLE_WITH_SINGLE_SPAWN_POINT.sqf
missions
abandoned_trader.sqfapc.sqfarmed_vehicle.sqfarmybase.sqfbase.sqfblack_hawk_crash.sqfbroken_down_ural.sqfcannibal_cave.sqfcaptured_mv22.sqfcargo.sqfcastle_grayskull.sqfcrop_raider.sqfdrone_pilot.sqfdrugbust.sqffallen_satellite.sqffarmer.sqffirestation.sqfgem_tower.sqfgold_mine.sqfikea_convoy.sqfjunkyard.sqflumberjack.sqfmacdonald.sqfmayors_mansion.sqfmedi_camp.sqfoil_depot.sqfoutpost.sqfpatrol.sqfpresidents_mansion.sqfradioshack.sqfrefugee.sqfscout_patrol.sqfslaughter_house.sqfsniper_extraction.sqftankcolumn.sqfvehicle_drop.sqfweapon_cache.sqfwuhan_lab.sqf
static
bankTraders
compile
EAT_crateSpawn.sqfEAT_serverAiSpawn.sqfEAT_vehSpawn.sqfKK_Functions.sqf
config.cppgarage
init.sqfserver_maintainVehicles.sqfserver_queryVehicle.sqfserver_spawnVehicle.sqfserver_storeVehicle.sqf
server_changeCode.sqfserver_checkIfTowed.sqfserver_deleteObj.sqfserver_deleteObjDirect.sqfserver_handleSafeGear.sqfserver_maintainArea.sqfserver_onPlayerDisconnect.sqfserver_plantSpawner.sqfserver_playerDeaths.sqfserver_playerDied.sqfserver_playerLogin.sqfserver_playerSetup.sqfserver_playerSync.sqfserver_publishObject.sqfserver_publishVehicle.sqfserver_publishVehicle2.sqfserver_publishVehicle3.sqfserver_spawnTraders.sqfserver_swapObject.sqfserver_toggle_debug.hppserver_tradeObject.sqfserver_updateObject.sqfserver_verifySender.sqfspawn_ammosupply.sqfspawn_mineveins.sqfspawn_roadblocks.sqfspawn_vehicles.sqfui_selectSlot.sqfupdateObject_functions.sqfzombie_Wildgenerate.sqfzombie_findOwner.sqfeventHandlers
init
modules
Care_Packages.sqfCrashSites.sqfInfected_Camps.sqfabandoned_vaults.sqfbuilding_supplies.sqfdrop_bombs.sqffuelstationbomb.sqflabyrinth.sqfmechanics_truck.sqfpirate_treasure.sqfrubble_town.sqfspecial_forces.sqfun_supply.sqf
system
dynamic_vehicle.sqflit_fireplaces.sqf
scheduler
sched_corpses.sqfsched_dzms.sqfsched_event.sqfsched_init.sqfsched_lootpiles.sqfsched_safetyVehicle.sqfsched_sync.sqfsched_traps.sqfsched_wai.sqf
server_monitor.sqfserver_vehicleSync.fsmserver_weather.fsmtraders
BattlEye
BEClient.dllBELauncher.iniBEServer.cfgBEServer.dllBEService.exeBEService_x64.exeBE_AEG.exeaddbackpackcargo.txtaddmagazinecargo.txtaddweaponcargo.txtattachto.txtbeserver.socreatevehicle.txtdeleteVehicle.txtmpeventhandler.txtpublicvariable.txtpublicvariableval.txtremotecontrol.txtremoteexec.txtscripts.txtselectplayer.txtsetdamage.txtsetpos.txtsetvariable.txtsetvariableval.txtteamswitch.txtwaypointcondition.txtwaypointstatement.txt
DatabaseMySql.dllDatabasePostgre.dllEATadminLogger.dllEATbaseExporter.dllHiveExt.iniKeys
MPMissions/DayZ_Epoch_24.Napf
ActionMenu
actionmenu_activate.sqfactionmenu_execute.sqfactionmenu_main.sqf
donations
fog
1000.sqf10000.sqf1250.sqf1500.sqf1750.sqf2000.sqf20000.sqf250.sqf2500.sqf3000.sqf4000.sqf500.sqf5000.sqf750.sqf
sky
tools
CfgServerTraderZSC
Category
AirVehicles.hppAmmunition.hppBandit.hppBlackMarket.hppBoats.hppCurrency.hppGeneralStore.hppHero.hppMedicalSupplies.hppParts.hppVehicles.hppWeapons.hppWholesale.hpp
DayZ Epoch Currency Values.txtcfgServerTrader.hppStats
dayz_code
description.extdialog.hppinit.sqflogistic
mission.sqmrlnt
client/init
dialogs
functions
scripts/Weapon HUD
scripts
clickActions
deployAnything
locateVehicle.sqfmarker_manager.sqfremoteVehicle
safe_zones.sqfservicePoints
takeClothes.sqfvirtualGarage
player_MaintainVG.sqfplayer_getVehicle.sqfplayer_removePad.sqfplayer_storeVehicle.sqfvehicleInfo.sqfvirtualGarage.hppvirtualGarage.sqf
vkc
spawn
config.sqfdialogs.hpp
stringtable.xmlfunctions
class_fillItems.sqfclass_fillList.sqfclass_pick.sqfclass_preview.sqfclass_randomMags.sqfclass_randomTools.sqfclass_wipeGear.sqfcleanup.sqffinish.sqfspawn_fill.sqfspawn_map.sqfspawn_pick.sqf
init.sqfmain.sqfUsers/server
epoch.sql
218
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_corpses.sqf
Executable file
218
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_corpses.sqf
Executable file
@ -0,0 +1,218 @@
|
||||
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
|
||||
|
||||
if (isNil "DZE_NPC_CleanUp_Time") then {DZE_NPC_CleanUp_Time = -1;};
|
||||
|
||||
sched_co_deleteVehicle = {
|
||||
private "_group";
|
||||
_this removeAllMPEventHandlers "mpkilled";
|
||||
_this removeAllMPEventHandlers "mphit";
|
||||
_this removeAllMPEventHandlers "mprespawn";
|
||||
_this removeAllEventHandlers "FiredNear";
|
||||
_this removeAllEventHandlers "HandleDamage";
|
||||
_this removeAllEventHandlers "Killed";
|
||||
_this removeAllEventHandlers "Fired";
|
||||
_this removeAllEventHandlers "GetIn";
|
||||
_this removeAllEventHandlers "GetOut";
|
||||
_this removeAllEventHandlers "Local";
|
||||
_this removeAllEventHandlers "Respawn";
|
||||
|
||||
clearVehicleInit _this;
|
||||
_group = group _this;
|
||||
deleteVehicle _this;
|
||||
if (count units _group == 0) then {
|
||||
deleteGroup _group;
|
||||
};
|
||||
|
||||
_this = nil;
|
||||
};
|
||||
|
||||
|
||||
sched_corpses = {
|
||||
private ["_delQtyG","_delQtyZ","_delQtyP","_addFlies","_x","_deathTime","_onoff","_delQtyAnimal","_sound","_deathPos","_cpos","_animal","_nearPlayer","_delQtyV","_delQtyAI"];
|
||||
// EVERY 2 MINUTE
|
||||
// DELETE UNCONTROLLED ZOMBIES --- PUT FLIES ON FRESH PLAYER CORPSES --- REMOVE OLD FLIES & CORPSES
|
||||
_delQtyZ = 0;
|
||||
_delQtyP = 0;
|
||||
_delQtyG = 0;
|
||||
_delQtyV = 0;
|
||||
_addFlies = 0;
|
||||
_delQtyAI = 0;
|
||||
{
|
||||
if (local _x && {_x isKindOf "CAManBase"}) then {
|
||||
if (_x isKindOf "zZombie_Base") then {
|
||||
_x call sched_co_deleteVehicle;
|
||||
_delQtyZ = _delQtyZ + 1;
|
||||
} else {
|
||||
//Only spawn flies on actual dead player, otherwise delete the body (clean up left over ghost from relogging, sometimes it is not deleted automatically by Arma or onPlayerDisconnect)
|
||||
//AI mods will need to setVariable "bodyName" on their dead units to prevent them being cleaned up
|
||||
_deathTime = _x getVariable ["sched_co_deathTime", -1];
|
||||
if (_x getVariable["bodyName",""] != "") then {
|
||||
if (_deathTime == -1) then {
|
||||
/*_deathPos = _x getVariable ["deathPos",respawn_west_original];
|
||||
_cpos = getPosATL _x;
|
||||
// forbid a move further than 50 meters, or burried body (antihack)
|
||||
if (_deathPos distance _cpos > 50 or _deathPos select 2 < -0.2) then {
|
||||
diag_log [ __FILE__, "Corpse should have been moved! CID#",(_x getVariable["characterID", "?"]),"from:", _cpos, "to:", _deathPos ];
|
||||
//_x setPosATL _deathPos;
|
||||
};*/
|
||||
_deathTime = diag_tickTime;
|
||||
_x setVariable ["sched_co_deathTime", _deathTime];
|
||||
if (dayz_enableFlies) then {
|
||||
_x setVariable ["sched_co_fliesAdded", true];
|
||||
_addFlies = _addFlies + 1;
|
||||
};
|
||||
};
|
||||
// 60 * DZE_NPC_CleanUp_Time = how long an NPC corpse stays on the map
|
||||
if (DZE_NPC_CleanUp_Time != -1 && {diag_tickTime - _deathTime > (60 * DZE_NPC_CleanUp_Time)} && {_x getVariable["bodyName",""] == "NPC"}) then {
|
||||
if (_x getVariable["sched_co_fliesDeleted",false] or !dayz_enableFlies) then {
|
||||
// flies have been switched off, we can delete body
|
||||
_sound = _x getVariable ["sched_co_fliesSource", nil];
|
||||
|
||||
if !(isNil "_sound") then {
|
||||
detach _sound;
|
||||
deleteVehicle _sound;
|
||||
};
|
||||
|
||||
_x call sched_co_deleteVehicle;
|
||||
_delQtyAI = _delQtyAI + 1;
|
||||
} else {
|
||||
PVCDZ_flies = [ 0, _x ];
|
||||
publicVariable "PVCDZ_flies";
|
||||
_x setVariable ["sched_co_fliesDeleted", true];
|
||||
// body will be deleted at next round
|
||||
};
|
||||
};
|
||||
// 40 minutes = how long a player corpse stays on the map
|
||||
if ((diag_tickTime - _deathTime > 40*60) && {_x getVariable["bodyName",""] != "NPC"}) then {
|
||||
if (_x getVariable["sched_co_fliesDeleted",false] or !dayz_enableFlies) then {
|
||||
// flies have been switched off, we can delete body
|
||||
_sound = _x getVariable ["sched_co_fliesSource", nil];
|
||||
|
||||
if !(isNil "_sound") then {
|
||||
detach _sound;
|
||||
deleteVehicle _sound;
|
||||
};
|
||||
|
||||
_x call sched_co_deleteVehicle;
|
||||
_delQtyP = _delQtyP + 1;
|
||||
} else {
|
||||
PVCDZ_flies = [ 0, _x ];
|
||||
publicVariable "PVCDZ_flies";
|
||||
_x setVariable ["sched_co_fliesDeleted", true];
|
||||
// body will be deleted at next round
|
||||
};
|
||||
} else {
|
||||
// Do not spawn flies immediately after death. Wait 10 minutes.
|
||||
if ((diag_tickTime - _deathTime < 10*60) or !dayz_enableFlies) exitWith {};
|
||||
_onoff = 1;
|
||||
// remove flies on heavy rain.
|
||||
if (rain > 0.25) then { _onoff = 0; };
|
||||
// switch flies sound on/off.
|
||||
// sound must be deleted/respawned periodically because new players won't ear it otherwise,
|
||||
// and other players would ear it several times (very loud noise)
|
||||
_sound = _x getVariable ["sched_co_fliesSource", nil];
|
||||
if !(isNil "_sound") then {
|
||||
detach _sound;
|
||||
deleteVehicle _sound;
|
||||
_x setVariable ["sched_co_fliesSource", nil];
|
||||
//diag_log "delete sound";
|
||||
};
|
||||
if (_onoff == 1) then {
|
||||
_sound = createSoundSource["Sound_Flies",getPosATL _x,[],0];
|
||||
_sound attachTo [_x];
|
||||
_x setVariable ["sched_co_fliesSource", _sound];
|
||||
//diag_log "create sound";
|
||||
};
|
||||
// broadcast flies status for everyone periodically, to update visible swarm
|
||||
PVCDZ_flies = [ _onoff, _x ];
|
||||
publicVariable "PVCDZ_flies";
|
||||
};
|
||||
} else {
|
||||
if (_deathTime == -1) then {
|
||||
_deathTime = diag_tickTime;
|
||||
_x setVariable ["sched_co_deathTime", _deathTime];
|
||||
} else {
|
||||
// Wait 30s to make sure the server had time to setVariable "bodyName". PVDZ_plr_Death can be delayed by a few seconds.
|
||||
if (diag_tickTime - _deathTime > 30) then {
|
||||
_x call sched_co_deleteVehicle;
|
||||
_delQtyG = _delQtyG + 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (_x in vehicles) then {
|
||||
_deathTime = _x getVariable ["sched_co_deathTime", -1];
|
||||
|
||||
if (_deathTime == -1) then {
|
||||
_deathTime = diag_tickTime;
|
||||
_x setVariable ["sched_co_deathTime", _deathTime];
|
||||
};
|
||||
|
||||
// 5 minutes = how long a destroyed vehicle stays on the map
|
||||
if (diag_tickTime - _deathTime > 5*60) then {
|
||||
{deleteVehicle _x} forEach (_x nearObjects ["CraterLong",50]);
|
||||
_x call sched_co_deleteVehicle;
|
||||
_delQtyV = _delQtyV + 1;
|
||||
};
|
||||
};
|
||||
} forEach allDead;
|
||||
|
||||
_delQtyAnimal = 0;
|
||||
{
|
||||
_animal = _x;
|
||||
if (local _animal) then {
|
||||
_nearPlayer = {isPlayer _x} count (_animal nearEntities ["CAManBase",150]);
|
||||
if (_nearPlayer == 0) then {
|
||||
_animal call sched_co_deleteVehicle;
|
||||
_delQtyAnimal = _delQtyAnimal + 1;
|
||||
};
|
||||
};
|
||||
} forEach entities "CAAnimalBase";
|
||||
|
||||
_delQtyGrp=0;
|
||||
{
|
||||
if (count units _x==0) then {
|
||||
deleteGroup _x;
|
||||
_delQtyGrp = _delQtyGrp + 1;
|
||||
};
|
||||
} forEach allGroups;
|
||||
|
||||
#ifdef SERVER_DEBUG
|
||||
if (_delQtyZ+_delQtyP+_addFlies+_delQtyGrp+_delQtyG+_delQtyV > 0) then {
|
||||
diag_log format ["%1: Deleted %2 uncontrolled zombies, %3 uncontrolled animals, %4 dead character bodies, %7 ghosts, %8 destroyed vehicles, %9 dead mission ai and %5 empty groups. Added %6 flies.",__FILE__,
|
||||
_delQtyZ,_delQtyAnimal,_delQtyP,_delQtyGrp,_addFlies,_delQtyG,_delQtyV,_delQtyAI];
|
||||
};
|
||||
#endif
|
||||
|
||||
objNull
|
||||
};
|
||||
|
||||
/*
|
||||
sched_disconnectedPlayers = {
|
||||
private ["_x","_disconnectTime"];
|
||||
{
|
||||
diag_log (_x);
|
||||
if (local _x) then {
|
||||
_disconnectTime = _x getVariable ["sched_co_disconnectTime", -1];
|
||||
if (_disconnectTime == -1) then {
|
||||
_disconnectTime = diag_tickTime;
|
||||
_x setVariable ["sched_co_disconnectTime", _disconnectTime];
|
||||
};
|
||||
if (diag_tickTime - _disconnectTime > dayz_ghostTimer) then {
|
||||
if (alive _x) then {
|
||||
[_x,nil] call server_playerSync;
|
||||
};
|
||||
|
||||
dayz_disconnectPlayers = dayz_disconnectPlayers - [_x];
|
||||
|
||||
_x call sched_co_deleteVehicle;
|
||||
};
|
||||
diag_log format["%1 - %2",_x,_disconnectTime];
|
||||
};
|
||||
} forEach dayz_disconnectPlayers;
|
||||
|
||||
objNull
|
||||
};
|
||||
*/
|
52
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_dzms.sqf
Executable file
52
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_dzms.sqf
Executable file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
This scheduled task checks for running DZMS missions and starts them appropriately.
|
||||
*/
|
||||
|
||||
sched_dzms_init = {
|
||||
diag_log("[DZMS]: Scheduler Started");
|
||||
local _array = +DZMSMissionArray;
|
||||
local _timeBandit = ((random(DZMSBanditMax - DZMSBanditMin) + DZMSBanditMin) * 60);
|
||||
local _timeHero = ((random(DZMSHeroMax - DZMSHeroMin) + DZMSHeroMin) * 60);
|
||||
[_array,_timeBandit,_timeHero]
|
||||
};
|
||||
|
||||
sched_dzms = {
|
||||
local _array = _this select 0;
|
||||
local _timeBandit = _this select 1;
|
||||
local _timeHero = _this select 2;
|
||||
local _varName = "";
|
||||
|
||||
// Bandit mission timer
|
||||
if (((diag_tickTime - DZMSBanditEndTime) >= _timeBandit) && {DZMSBanditRunning < DZMSBanditLimit} && {DZMSMarkerReady}) then {
|
||||
DZMSMarkerReady = false;
|
||||
_varName = _array call BIS_fnc_selectRandom;
|
||||
DZMSMissionData = DZMSMissionData + [[0,[],[],[],[],[]]];
|
||||
DZMSBanditEndTime = diag_tickTime;
|
||||
DZMSBanditRunning = DZMSBanditRunning + 1;
|
||||
["Bandit"] execVM format ["\z\addons\dayz_server\DZMS\Missions\%1.sqf",_varName];
|
||||
if (DZMSDebug) then {diag_log text format ["[DZMS]: Running Bandit Mission %1.",_varName];};
|
||||
};
|
||||
|
||||
// Hero mission timer
|
||||
if (((diag_tickTime - DZMSHeroEndTime) >= _timeHero) && {DZMSHeroRunning < DZMSHeroLimit} && {DZMSMarkerReady}) then {
|
||||
DZMSMarkerReady = false;
|
||||
_varName = _array call BIS_fnc_selectRandom;
|
||||
DZMSMissionData = DZMSMissionData + [[0,[],[],[],[],[]]];
|
||||
DZMSHeroEndTime = diag_tickTime;
|
||||
DZMSHeroRunning = DZMSHeroRunning + 1;
|
||||
["Hero"] execVM format ["\z\addons\dayz_server\DZMS\Missions\%1.sqf",_varName];
|
||||
if (DZMSDebug) then {diag_log text format ["[DZMS]: Running Hero Mission %1.",_varName];};
|
||||
};
|
||||
|
||||
// Remove mission from array and reset array if necessary
|
||||
_array = _array - [_varName];
|
||||
if (count _array == 0) then {
|
||||
_array = +DZMSMissionArray;
|
||||
};
|
||||
|
||||
// Reset times
|
||||
_timeBandit = ((random(DZMSBanditMax - DZMSBanditMin) + DZMSBanditMin) * 60);
|
||||
_timeHero = ((random(DZMSHeroMax - DZMSHeroMin) + DZMSHeroMin) * 60);
|
||||
|
||||
[_array,_timeBandit,_timeHero]
|
||||
};
|
74
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_event.sqf
Executable file
74
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_event.sqf
Executable file
@ -0,0 +1,74 @@
|
||||
/*
|
||||
DayZ Epoch Event Scheduler
|
||||
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
|
||||
*/
|
||||
|
||||
epoch_eventIsAny = {
|
||||
private ["_boolReturn","_event","_date","_bool","_index"];
|
||||
_event = _this select 0;
|
||||
_date = _this select 1;
|
||||
|
||||
_boolReturn = false;
|
||||
|
||||
_index = 0;
|
||||
{
|
||||
_bool = false;
|
||||
if (typeName _x == "STRING") then {
|
||||
_boolReturn = true;
|
||||
} else {
|
||||
_boolReturn = ((_date select _index) == _x);
|
||||
};
|
||||
if (!_boolReturn) exitWith {};
|
||||
_index = _index + 1;
|
||||
} count _event;
|
||||
|
||||
_boolReturn
|
||||
};
|
||||
|
||||
sched_event_init = {
|
||||
diag_log("EPOCH EVENTS INIT");
|
||||
""
|
||||
};
|
||||
|
||||
sched_event = {
|
||||
private ["_date","_key","_result","_outcome","_handle","_datestr","_lastTime"];
|
||||
// Find current time from server
|
||||
_lastTime = _this;
|
||||
_key = "CHILD:307:";
|
||||
_result = _key call server_hiveReadWrite;
|
||||
_outcome = _result select 0;
|
||||
if(_outcome == "PASS") then {
|
||||
_date = _result select 1;
|
||||
_datestr = str(_date);
|
||||
if (_lastTime != _datestr) then {
|
||||
|
||||
// internal timestamp
|
||||
ServerCurrentTime = _date;
|
||||
|
||||
// Once a minute.
|
||||
_lastTime = _datestr;
|
||||
|
||||
//diag_log ("EVENTS: Local Time is: " + _datestr);
|
||||
if (count EpochEvents == 0) exitWith {};
|
||||
{
|
||||
|
||||
// Run event at server start when minutes are set to -1
|
||||
if ((_x select 4) == -1) then {
|
||||
diag_log ("RUNNING EVENT: " + (_x select 5) + " on " + _datestr);
|
||||
_handle = [] execVM "\z\addons\dayz_server\modules\" + (_x select 5) + ".sqf";
|
||||
|
||||
// Remove event from array so it doesn't run again.
|
||||
_lastIndex = (count EpochEvents) - 1;
|
||||
if (_lastIndex != _forEachIndex) then {EpochEvents set [_forEachIndex, EpochEvents select _lastIndex];};
|
||||
EpochEvents resize _lastIndex;
|
||||
} else {
|
||||
if([[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4)],_date] call epoch_eventIsAny) then {
|
||||
diag_log ("RUNNING EVENT: " + (_x select 5) + " on " + _datestr);
|
||||
_handle = [] execVM "\z\addons\dayz_server\modules\" + (_x select 5) + ".sqf";
|
||||
};
|
||||
};
|
||||
} forEach EpochEvents;
|
||||
};
|
||||
};
|
||||
_lastTime
|
||||
};
|
37
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_init.sqf
Executable file
37
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_init.sqf
Executable file
@ -0,0 +1,37 @@
|
||||
#define PATH "z\addons\dayz_server\system\scheduler\"
|
||||
|
||||
call compile preprocessFileLineNumbers (PATH+"sched_corpses.sqf");
|
||||
call compile preprocessFileLineNumbers (PATH+"sched_lootpiles.sqf");
|
||||
call compile preprocessFileLineNumbers (PATH+"sched_sync.sqf");
|
||||
call compile preprocessFileLineNumbers (PATH+"sched_safetyVehicle.sqf");
|
||||
call compile preprocessFileLineNumbers (PATH+"sched_dzms.sqf");
|
||||
call compile preprocessFileLineNumbers (PATH+"sched_wai.sqf");
|
||||
call compile preprocessFileLineNumbers (PATH+"sched_event.sqf");
|
||||
call compile preprocessFileLineNumbers (PATH+"sched_traps.sqf");
|
||||
|
||||
[
|
||||
// period offset code <-> ctx init code ->ctx
|
||||
[ 60, 0, sched_event, sched_event_init ],
|
||||
[ 60, 224, sched_corpses ],
|
||||
[ 300, 336, sched_lootpiles_5m, sched_lootpiles_5m_init ],
|
||||
[ 90, 60, sched_dzms, sched_dzms_init ],
|
||||
[ 90, 60, sched_wai, sched_wai_init ],
|
||||
[ 6, 340, sched_lootpiles ],
|
||||
[ 900, 0, sched_sync ],
|
||||
[ 120, 48, sched_safetyVehicle ],
|
||||
[ 360, 480, sched_fps ],
|
||||
[ 30, 60, sched_traps, sched_traps_init ]
|
||||
] execFSM ("z\addons\dayz_code\system\scheduler\scheduler.fsm");
|
||||
|
||||
//diag_log [ __FILE__, "Scheduler started"];
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
// (see ViralZeds.hpp -> zombie_agent.fsm -> zombie_findOwner.sqf), called when a zombie becomes "local" to the server after the player disconnected
|
||||
zombie_findOwner = {
|
||||
(_this select 0) call fa_deleteVehicle;
|
||||
};
|
||||
*/
|
||||
|
115
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_lootpiles.sqf
Executable file
115
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_lootpiles.sqf
Executable file
@ -0,0 +1,115 @@
|
||||
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
|
||||
|
||||
sched_lootpiles_5m_init = {
|
||||
sched_lp_state = 0;
|
||||
sched_lp_var1 = 0;
|
||||
sched_lp_lootTotal = 0;
|
||||
sched_lp_delqty = 0;
|
||||
sched_lp_players = [];
|
||||
sched_lp_list = [];
|
||||
|
||||
objNull
|
||||
};
|
||||
|
||||
sched_lootpiles_5m = {
|
||||
private ["_created","_kind","_x"];
|
||||
if (sched_lp_state == 0) then {
|
||||
sched_lp_list = [];
|
||||
sched_lp_lootTotal = 0;
|
||||
{
|
||||
_kind = _x;
|
||||
{
|
||||
_created = _x getVariable ["created",-1];
|
||||
if (_created == -1) then {
|
||||
_created = diag_tickTime;
|
||||
_x setVariable ["created",_created];
|
||||
};
|
||||
if (!(_x getVariable ["permaLoot",false]) AND {(diag_tickTime - _created > 1500)}) then {
|
||||
sched_lp_list set [ count sched_lp_list, _x ];
|
||||
};
|
||||
sched_lp_lootTotal = sched_lp_lootTotal + 1;
|
||||
} forEach allMissionObjects _kind;
|
||||
} forEach [ "Blood_Trail_DZ", "ReammoBox", "Land_Fire_DZ", "flamable_DZ" ];
|
||||
#ifdef SERVER_DEBUG
|
||||
diag_log ["sched_lootpiles_5mn: reset lootpiles check, total visited:", sched_lp_lootTotal, "listed:", count sched_lp_list];
|
||||
#endif
|
||||
if (count sched_lp_list > 0) then {
|
||||
sched_lp_state = 1;
|
||||
sched_lp_var1 = 0;
|
||||
sched_lp_players = +(playableUnits);
|
||||
};
|
||||
};
|
||||
objNull
|
||||
};
|
||||
|
||||
sched_lootpiles = {
|
||||
private ["_plrBatch","_chunkSize","_imax","_plr","_i","_x", "_changed"];
|
||||
// EVERY 5 MINUTES, ONE OF THESE TASKS SPACED BY 5 SECONDS:
|
||||
// LOOK FOR OLD LOOTPILES -OR- IGNORE LOOTPILES NEAR _plrBatch PLAYERS -OR- REMOVE REMAINING _chunkSize LOOTPILES
|
||||
_chunkSize = 50;
|
||||
_plrBatch = 10;
|
||||
switch true do {
|
||||
case (sched_lp_state == 1): { // forEach players -> ignore nearby loot
|
||||
_imax = (count sched_lp_players) min (sched_lp_var1 + _plrBatch);
|
||||
//diag_log format ["%1: lootpiles foreach players from:%2 to:%3 players:%4 old:%5 total:%6", __FILE__, sched_lp_var1, _imax, count sched_lp_players, count sched_lp_list, sched_lp_lootTotal ];
|
||||
for "_i" from sched_lp_var1 to _imax-1 do {
|
||||
_plr = (sched_lp_players select _i);
|
||||
if (!(isNull _plr) AND {(isPlayer _plr)}) then {
|
||||
_plr = vehicle _plr;
|
||||
{
|
||||
if (_x IN sched_lp_list) then {
|
||||
sched_lp_list = sched_lp_list - [_x];
|
||||
};
|
||||
} forEach ((getPosATL _plr) nearObjects ["ReammoBox",250]);
|
||||
}/*
|
||||
else {
|
||||
diag_log format [ "%1 player left? %2", __FILE__, _x ];
|
||||
}*/;
|
||||
};
|
||||
sched_lp_var1 = _imax;
|
||||
_changed = false;
|
||||
if (_imax == count sched_lp_players) then { // catch the few players who entered meanwhile
|
||||
{
|
||||
if !(_x in sched_lp_players) then {
|
||||
sched_lp_players set [ count sched_lp_players, _x ];
|
||||
_changed = true;
|
||||
};
|
||||
} forEach playableUnits;
|
||||
};
|
||||
if (!_changed) then {
|
||||
sched_lp_state = 2;
|
||||
sched_lp_var1 = 0;
|
||||
sched_lp_delqty = count sched_lp_list;
|
||||
#ifdef SERVER_DEBUG
|
||||
diag_log [ "sched_lootpiles:Will delete",sched_lp_delqty,"lootpiles"];
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
#ifdef SERVER_DEBUG
|
||||
diag_log [ "sched_lootpiles:Extended loop for new players", _imax, count sched_lp_players];
|
||||
#endif
|
||||
};
|
||||
};
|
||||
case (sched_lp_state == 2): { // forEAch remaining lootpiles -> delete
|
||||
_imax = (sched_lp_delqty) min (sched_lp_var1 + _chunkSize);
|
||||
//diag_log format ["%1: lootpiles foreach loot to del from:%2 to:%3 old:%4 total:%5", __FILE__, sched_lp_var1, _imax, sched_lp_delqty, sched_lp_lootTotal ];
|
||||
for "_i" from sched_lp_var1 to _imax-1 do {
|
||||
_x = sched_lp_list select _i;
|
||||
if (!isNull _x) then {
|
||||
deleteVehicle _x;
|
||||
};
|
||||
};
|
||||
sched_lp_var1 = _imax;
|
||||
if (_imax == sched_lp_delqty) then {
|
||||
sched_lp_state = 0;
|
||||
sched_lp_list = [];
|
||||
#ifdef SERVER_DEBUG
|
||||
diag_log format ["%1: deleted %2 lootpiles from %3 total", __FILE__, sched_lp_delqty, sched_lp_lootTotal ];
|
||||
#endif
|
||||
};
|
||||
};
|
||||
}; // switch
|
||||
|
||||
objNull
|
||||
};
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
sched_safetyVehicle = {
|
||||
{
|
||||
if (vehicle _x != _x && !(vehicle _x in dayz_serverObjectMonitor) && !((typeOf vehicle _x) in DZE_safeVehicle)) then {
|
||||
diag_log [ __FILE__, "KILLING A HACKER", name _x, " IN ", typeOf vehicle _x ];
|
||||
(vehicle _x) setDamage 1;
|
||||
_x setDamage 1;
|
||||
};
|
||||
} forEach allUnits;
|
||||
|
||||
objNull
|
||||
};
|
62
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_sync.sqf
Executable file
62
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_sync.sqf
Executable file
@ -0,0 +1,62 @@
|
||||
/*
|
||||
Instructions for using day/night schedule.
|
||||
|
||||
1. In your server config folder, edit file HiveExt.ini. Change [Time] Type to Local...Type = Local.
|
||||
2. Uncomment line 16 in this file: //#define DAY_NIGHT_SCHEDULE
|
||||
3. Adjust the hours of the day that you want to have night time in the arrays.
|
||||
|
||||
NOTES:
|
||||
The date/time is local to the server's time zone.
|
||||
The days referred to here are days of the month, not days of the week.
|
||||
You can configure odd and even days of the month to have different night time hours.
|
||||
Coordinate the hours with BEC server restarts defined in scheduler.xml.
|
||||
The default arrays alternate between day and night on a 4 hour schedule based on 0000, 0400, 0800, 1200, 1600, and 2000 restarts.
|
||||
*/
|
||||
|
||||
//#define DAY_NIGHT_SCHEDULE // Uncomment this line to enable day/night schedule.
|
||||
#define EVEN_DAY_NIGHT_HOURS [0,1,2,3,8,9,10,11,16,17,18,19] // These are the hours of the even numbered monthly days you wish to have night.
|
||||
#define ODD_DAY_NIGHT_HOURS [0,1,2,3,8,9,10,11,16,17,18,19] // These are the hours of the odd numbered monthly days you wish to have night.
|
||||
|
||||
|
||||
sched_sync = {
|
||||
private ["_date","_hour","_minute"];
|
||||
// RESYNC TIME ON ALL MACHINES EVERY 15 MINUTES
|
||||
// Date format [Year,Month,Day of the month,Hour,Minute]
|
||||
|
||||
_date = ServerCurrentTime; // ServerCurrentTime is set at server start in sched_event and updated every 60 seconds.
|
||||
_day = _date select 2;
|
||||
_hour = _date select 3;
|
||||
_minute = _date select 4;
|
||||
|
||||
#ifdef DAY_NIGHT_SCHEDULE
|
||||
_date set[3, 12]; // daytime unless overwritten below.
|
||||
|
||||
if (_day % 2 == 0) then { // check if day of the month is divisible by 2.
|
||||
if (_hour in EVEN_DAY_NIGHT_HOURS) then {
|
||||
_date set[3, 20]; // set hour to 20.
|
||||
};
|
||||
} else {
|
||||
if (_hour in ODD_DAY_NIGHT_HOURS) then {
|
||||
_date set[3, 20]; // set hour to 20.
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
if(dayz_ForcefullmoonNights) then {
|
||||
_date = [2012,8,2,(_date select 3),_minute];
|
||||
};
|
||||
|
||||
dayz_storeTimeDate = _date; // dayz_storeTimeDate is used to set the date on client connections.
|
||||
|
||||
setDate _date;
|
||||
dayzSetDate = _date;
|
||||
publicVariable "dayzSetDate";
|
||||
diag_log [ __FILE__, "TIME SYNC: Local Time set to:", _date, "Fullmoon:",dayz_ForcefullmoonNights, "Date given by HiveExt.dll:", _date];
|
||||
|
||||
objNull
|
||||
};
|
||||
|
||||
sched_fps = {
|
||||
diag_log format["SERVER FPS: %1 PLAYERS: %2",round diag_fps,playersNumber west];
|
||||
objNull
|
||||
};
|
49
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_traps.sqf
Executable file
49
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_traps.sqf
Executable file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
This scheduled task checks for changes in the number of bear traps set by players.
|
||||
It is set to run every 30 seconds by default in sched_init.
|
||||
For each of the traps, it gets the "armed" variable and calls the appropriate script
|
||||
to arm or disarm the bear trap. Lazy eval has been added so that the function evaluates
|
||||
quickly. Bear traps are not a popular feature in DayZ Epoch.
|
||||
*/
|
||||
|
||||
sched_traps_init = {
|
||||
//diag_log("Bear Trap Monitor Started");
|
||||
[str dayz_traps,str dayz_traps_active,str dayz_traps_trigger]
|
||||
};
|
||||
|
||||
sched_traps = {
|
||||
private ["_array","_array2","_array3","_script","_armed"];
|
||||
_array = _this select 0;
|
||||
_array2 = _this select 1;
|
||||
_array3 = _this select 2;
|
||||
|
||||
if ((str dayz_traps != _array) || {str dayz_traps_active != _array2} || {str dayz_traps_trigger != _array3}) then {
|
||||
_array = str dayz_traps;
|
||||
_array2 = str dayz_traps_active;
|
||||
_array3 = str dayz_traps_trigger;
|
||||
//diag_log "DEBUG: traps";
|
||||
//diag_log format["dayz_traps (%2) -> %1", dayz_traps, count dayz_traps];
|
||||
//diag_log format["dayz_traps_active (%2) -> %1", dayz_traps_active, count dayz_traps_active];
|
||||
//diag_log format["dayz_traps_trigger (%2) -> %1", dayz_traps_trigger, count dayz_traps_trigger];
|
||||
//diag_log "DEBUG: end traps";
|
||||
};
|
||||
|
||||
{
|
||||
if (isNull _x) then {
|
||||
dayz_traps = dayz_traps - [_x];
|
||||
_armed = false;
|
||||
_script = {};
|
||||
} else {
|
||||
_armed = _x getVariable ["armed", false];
|
||||
_script = call compile getText (configFile >> "CfgVehicles" >> typeOf _x >> "script");
|
||||
};
|
||||
|
||||
if (_armed) then {
|
||||
if !(_x in dayz_traps_active) then {["arm", _x] call _script;};
|
||||
} else {
|
||||
if (_x in dayz_traps_active) then {["disarm", _x] call _script;};
|
||||
};
|
||||
} forEach dayz_traps;
|
||||
|
||||
[_array,_array2,_array3]
|
||||
};
|
78
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_wai.sqf
Executable file
78
@DayZ_Epoch_Server/addons/dayz_server/system/scheduler/sched_wai.sqf
Executable file
@ -0,0 +1,78 @@
|
||||
/*
|
||||
This scheduled task checks for running WAI missions and starts them appropriately.
|
||||
*/
|
||||
|
||||
sched_wai_init = {
|
||||
diag_log("WAI: Scheduler Started");
|
||||
local _hArray = +wai_hero_missions;
|
||||
local _bArray = +wai_bandit_missions;
|
||||
local _hTime = (random((wai_mission_timer select 1) - (wai_mission_timer select 0)) + (wai_mission_timer select 0)) * 60;
|
||||
local _bTime = (random((wai_mission_timer select 1) - (wai_mission_timer select 0)) + (wai_mission_timer select 0)) * 60;
|
||||
[_hArray,_bArray,_bTime,_hTime]
|
||||
};
|
||||
|
||||
sched_wai = {
|
||||
local _hArray = _this select 0;
|
||||
local _bArray = _this select 1;
|
||||
local _bTime = _this select 2;
|
||||
local _hTime = _this select 3;
|
||||
local _mission = "";
|
||||
|
||||
// Bandit mission timer
|
||||
if (WAI_MarkerReady && {diag_tickTime - wai_b_starttime >= _bTime} && {b_missionsrunning < wai_bandit_limit}) then {
|
||||
WAI_MarkerReady = false;
|
||||
local _selected = false;
|
||||
|
||||
while {!_selected} do {
|
||||
if (wai_debug_mode) then {diag_log format["WAI: Bandit Array: %1",_bArray];};
|
||||
_mission = _bArray select (floor (random (count _bArray)));
|
||||
_index = [_bArray, (_mission select 0)] call BIS_fnc_findNestedElement select 0;
|
||||
_bArray = [_bArray,_index] call fnc_deleteAt;
|
||||
if (count _bArray == 0) then {_bArray = +wai_bandit_missions;};
|
||||
if ((_mission select 1) >= random 1) then {
|
||||
_selected = true;
|
||||
if (wai_debug_mode) then {diag_log format["WAI: Bandit mission %1 selected.",(_mission select 0)];};
|
||||
} else {
|
||||
if (wai_debug_mode) then {diag_log format["WAI: Bandit mission %1 NOT selected.",(_mission select 0)];};
|
||||
};
|
||||
};
|
||||
|
||||
b_missionsrunning = b_missionsrunning + 1;
|
||||
wai_b_starttime = diag_tickTime;
|
||||
wai_mission_markers set [(count wai_mission_markers), ("MainBandit" + str(count wai_mission_data))];
|
||||
wai_mission_data = wai_mission_data + [[0,[],[],[],[],[],[]]];
|
||||
["MainBandit","Hero"] execVM format ["\z\addons\dayz_server\WAI\missions\missions\%1.sqf",(_mission select 0)];
|
||||
};
|
||||
|
||||
// Hero mission timer
|
||||
if (WAI_MarkerReady && {diag_tickTime - wai_h_starttime >= _hTime} && {h_missionsrunning < wai_hero_limit}) then {
|
||||
WAI_MarkerReady = false;
|
||||
local _selected = false;
|
||||
|
||||
while {!_selected} do {
|
||||
if (wai_debug_mode) then {diag_log format["WAI: Hero Array: %1",_hArray];};
|
||||
_mission = _hArray select (floor (random (count _hArray)));
|
||||
_index = [_hArray, (_mission select 0)] call BIS_fnc_findNestedElement select 0;
|
||||
_hArray = [_hArray,_index] call fnc_deleteAt;
|
||||
if (count _hArray == 0) then {_hArray = +wai_hero_missions;};
|
||||
if ((_mission select 1) >= random 1) then {
|
||||
_selected = true;
|
||||
if (wai_debug_mode) then {diag_log format["WAI: Hero mission %1 selected.",(_mission select 0)];};
|
||||
} else {
|
||||
if (wai_debug_mode) then {diag_log format["WAI: Hero mission %1 NOT selected.",(_mission select 0)];};
|
||||
};
|
||||
};
|
||||
|
||||
h_missionsrunning = h_missionsrunning + 1;
|
||||
wai_h_starttime = diag_tickTime;
|
||||
wai_mission_markers set [(count wai_mission_markers), ("MainHero" + str(count wai_mission_data))];
|
||||
wai_mission_data = wai_mission_data + [[0,[],[],[],[],[],[]]];
|
||||
["MainHero","Bandit"] execVM format ["\z\addons\dayz_server\WAI\missions\missions\%1.sqf",(_mission select 0)];
|
||||
};
|
||||
|
||||
// Reset times
|
||||
_hTime = (random((wai_mission_timer select 1) - (wai_mission_timer select 0)) + (wai_mission_timer select 0)) * 60;
|
||||
_bTime = (random((wai_mission_timer select 1) - (wai_mission_timer select 0)) + (wai_mission_timer select 0)) * 60;
|
||||
|
||||
[_hArray,_bArray,_bTime,_hTime]
|
||||
};
|
Reference in New Issue
Block a user