Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Server Cleanup">*/
- /*%FSM<HEAD>*/
- /*
- item0[] = {"init",0,250,-75.000000,-425.000000,25.000000,-375.000000,0.000000,"init"};
- item1[] = {"true",8,218,-75.000000,-200.000000,25.000000,-150.000000,0.000000,"true"};
- item2[] = {"waiting",2,250,-75.000000,-125.000000,25.000000,-75.000000,0.000000,"waiting"};
- item3[] = {"too_many_dead",4,218,-125.000000,0.000000,-25.000000,50.000000,2.000000,"too many" \n "dead"};
- item4[] = {"cleanup_dead",2,250,-125.000000,75.000000,-25.000000,125.000000,0.000000,"cleanup" \n "dead"};
- item5[] = {"too_many_objects",4,218,175.000000,0.000000,275.000000,50.000000,2.000000,"too many" \n "objects"};
- item6[] = {"cleanup_objects",2,250,175.000000,75.000000,275.000000,125.000000,0.000000,"cleanup" \n "objects"};
- item7[] = {"time_sync",4,218,-225.000000,0.000000,-125.000000,50.000000,1.000000,"time" \n "sync"};
- item8[] = {"sync_the_time",2,4346,-225.000000,175.000000,-125.000000,225.000000,0.000000,"sync" \n "the time"};
- item9[] = {"true",8,218,-75.000000,250.000000,25.000000,300.000000,0.000000,"true"};
- item10[] = {"general_cleanup",2,250,-75.000000,350.000000,25.000000,400.000000,0.000000,"general" \n "cleanup"};
- item11[] = {"",7,210,-254.000015,371.000000,-246.000000,379.000031,0.000000,""};
- item12[] = {"",7,210,-254.000015,-179.000000,-246.000000,-171.000000,0.000000,""};
- item13[] = {"initialized",4,218,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"initialized"};
- item14[] = {"prepare",2,250,-75.000000,-275.000000,25.000000,-225.000000,0.000000,"prepare"};
- item15[] = {"update_objects",2,250,-25.000000,75.000000,75.000000,125.000000,0.000000,"update objects"};
- item16[] = {"Objects_need_upd",4,218,-25.000000,0.000000,75.000000,50.000000,1.000000,"Objects" \n "need update"};
- item17[] = {"LootSpawn",4,218,500.000000,-50.000000,600.000000,0.000000,2.000000,"LootSpawn"};
- item18[] = {"",7,210,-29.000000,-41.500000,-21.000000,-33.499996,0.000000,""};
- item19[] = {"",7,210,20.999998,-41.500000,29.000000,-33.500000,0.000000,""};
- item20[] = {"",7,210,121.000000,-41.500000,129.000000,-33.500000,0.000000,""};
- item21[] = {"",7,210,-79.000000,-41.500000,-71.000000,-33.500000,0.000000,""};
- item22[] = {"",7,210,-179.000000,-41.499996,-171.000000,-33.500000,0.000000,""};
- item23[] = {"",7,210,-79.000000,146.000000,-71.000000,154.000000,0.000000,""};
- item24[] = {"",7,210,21.000000,146.000000,28.999998,154.000000,0.000000,""};
- item25[] = {"",7,210,-29.000000,146.000000,-20.999998,154.000000,0.000000,""};
- item26[] = {"",7,210,308.500000,-104.000000,316.500000,-96.000000,0.000000,""};
- item27[] = {"",7,210,308.500031,271.000000,316.499969,279.000000,0.000000,""};
- item28[] = {"",7,210,-179.000000,271.000000,-171.000000,279.000000,0.000000,""};
- item29[] = {"",7,210,221.000000,-41.500000,229.000000,-33.500000,0.000000,""};
- item30[] = {"Start_Loot_Spawn",2,250,500.000000,350.000000,600.000000,400.000000,0.000000,"Start Loot" \n "Spawner"};
- item31[] = {"true",8,218,75.000000,350.000000,175.000000,400.000000,0.000000,"true"};
- item32[] = {"New_Cleanup_Obje",2,250,375.000000,75.000000,475.000000,125.000000,0.000000,"New Cleanup" \n "Objects"};
- item33[] = {"",7,210,221.000031,271.000000,228.999969,279.000000,0.000000,""};
- item34[] = {"_",2,250,-425.000000,0.000000,-325.000000,50.000000,0.000000,""};
- item35[] = {"_",4,218,-425.000000,175.000000,-325.000000,225.000000,0.000000,""};
- item36[] = {"____FAKE____",9,1440,0.000000,0.000000,0.000000,0.000000,0.000000,"____FAKE____"};
- link0[] = {0,13};
- link1[] = {1,2};
- link2[] = {2,18};
- link3[] = {2,26};
- link4[] = {3,4};
- link5[] = {4,23};
- link6[] = {5,6};
- link7[] = {6,33};
- link8[] = {7,8};
- link9[] = {8,28};
- link10[] = {9,10};
- link11[] = {10,11};
- link12[] = {11,12};
- link13[] = {12,1};
- link14[] = {13,14};
- link15[] = {14,1};
- link16[] = {15,24};
- link17[] = {16,15};
- link18[] = {17,30};
- link19[] = {18,19};
- link20[] = {18,21};
- link21[] = {19,16};
- link22[] = {19,20};
- link23[] = {20,29};
- link24[] = {21,3};
- link25[] = {21,22};
- link26[] = {22,7};
- link27[] = {23,25};
- link28[] = {24,25};
- link29[] = {25,9};
- link30[] = {26,27};
- link31[] = {27,33};
- link32[] = {28,9};
- link33[] = {29,5};
- link34[] = {30,31};
- link35[] = {31,10};
- link36[] = {33,9};
- link37[] = {34,35};
- link38[] = {36,17};
- link39[] = {35,36};
- globals[] = {25.000000,1,0,0,0,640,480,1,13,6316128,1,-576.163574,585.050720,444.212921,-448.684845,779,599,1};
- window[] = {2,-1,-1,-1,-1,903,175,1504,175,3,797};
- *//*%FSM</HEAD>*/
- class FSM
- {
- fsmName = "DayZ Server Cleanup";
- class States
- {
- /*%FSM<STATE "init">*/
- class init
- {
- name = "init";
- init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "initialized">*/
- class initialized
- {
- priority = 0.000000;
- to="prepare";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"!isnil ""bis_fnc_init"""/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "waiting">*/
- class waiting
- {
- name = "waiting";
- init = /*%FSM<STATEINIT""">*/"//diag_log ""CLEANUP: Waiting for next task"";" \n
- "" \n
- "_numDead = {local _x} count allDead;" \n
- ""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "too_many_dead">*/
- class too_many_dead
- {
- priority = 2.000000;
- to="cleanup_dead";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"(_numDead > 100)"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "too_many_objects">*/
- class too_many_objects
- {
- priority = 2.000000;
- to="cleanup_objects";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _timeNem) > 150)" \n
- "//(((count dayz_deseedloot) > 0) && (!isNil ""sm_done""))"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"_timeNem = diag_tickTime;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "time_sync">*/
- class time_sync
- {
- priority = 1.000000;
- to="sync_the_time";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastUpdate) > 300)"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"_lastUpdate = diag_tickTime;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "Objects_need_upd">*/
- class Objects_need_upd
- {
- priority = 1.000000;
- to="update_objects";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"(( (count needUpdate_objects) > 0) && (diag_tickTime -_lastNeedUpdate> 5) && (!isNil ""sm_done""))"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"_lastNeedUpdate = diag_tickTime;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "cleanup_dead">*/
- class cleanup_dead
- {
- name = "cleanup_dead";
- init = /*%FSM<STATEINIT""">*/"diag_log (""CLEANUP: PERFORMING BODY CLEANUP"");" \n
- "" \n
- "diag_log (""CLEANUP:TOTAL BODYS: "" + str(_numDead));" \n
- "" \n
- "_delQtyP = 0;" \n
- "_delQtyZ = 0;" \n
- "_delQtyFL = 0;" \n
- "_delQtyFL1 = 0;" \n
- "_delQtyFP = 0;" \n
- "" \n
- "{" \n
- " if (local _x) then {" \n
- " if (_x isKindOf ""zZombie_Base"") then {" \n
- " deleteVehicle _x;" \n
- " _delQtyZ = _delQtyZ + 1;" \n
- " };" \n
- "" \n
- " if (_x isKindOf ""CAManBase"") then {" \n
- " _deathTime = _x getVariable [""processedDeath"", diag_tickTime];" \n
- " if (diag_tickTime - _deathTime > 1200) then {" \n
- " /*" \n
- " _flies = nearestObject [_x, ""Sound_Flies""];" \n
- " if (!isNull _flies) then {" \n
- " deleteVehicle _flies;" \n
- " _delQtyFL = _delQtyFL + 1;" \n
- " }; " \n
- " */" \n
- " deleteVehicle _x;" \n
- " _delQtyP = _delQtyP + 1;" \n
- " };" \n
- " };" \n
- " if (_x isKindOf ""Seagull"") then {" \n
- " _myGroupX = group _x;" \n
- " _x removeAllMPEventHandlers ""mpkilled"";" \n
- " _x removeAllMPEventHandlers ""mphit"";" \n
- " _x removeAllMPEventHandlers ""mprespawn"";" \n
- " _x removeAllEventHandlers ""FiredNear"";" \n
- " _x removeAllEventHandlers ""HandleDamage"";" \n
- " _x removeAllEventHandlers ""Killed"";" \n
- " _x removeAllEventHandlers ""Fired"";" \n
- " _x removeAllEventHandlers ""GetOut"";" \n
- " _x removeAllEventHandlers ""Local"";" \n
- " clearVehicleInit _x;" \n
- " deleteVehicle _x;" \n
- " deleteGroup _myGroupX;" \n
- " _x = nil;" \n
- " };" \n
- " _myGroupX = group _x;" \n
- " _x removeAllMPEventHandlers ""mpkilled"";" \n
- " _x removeAllMPEventHandlers ""mphit"";" \n
- " _x removeAllMPEventHandlers ""mprespawn"";" \n
- " _x removeAllEventHandlers ""FiredNear"";" \n
- " _x removeAllEventHandlers ""HandleDamage"";" \n
- " _x removeAllEventHandlers ""Killed"";" \n
- " _x removeAllEventHandlers ""Fired"";" \n
- " _x removeAllEventHandlers ""GetOut"";" \n
- " _x removeAllEventHandlers ""Local"";" \n
- " clearVehicleInit _x;" \n
- " deleteVehicle _x;" \n
- " deleteGroup _myGroupX;" \n
- " _x = nil; " \n
- " };" \n
- "} forEach allDead;" \n
- "" \n
- "{" \n
- " if ({!alive _x} count (nearestObjects [_x, [""CAManBase""], 10]) >= 0) then {" \n
- " deleteVehicle _x;" \n
- " _delQtyFL1 = _delQtyFL1 + 1;" \n
- " };" \n
- "} forEach allMissionObjects ""Sound_Flies"";" \n
- "" \n
- "{" \n
- " if (local _x) then {" \n
- " deleteVehicle _x;" \n
- " _delQtyFP = _delQtyFP + 1;" \n
- " };" \n
- "} forEach allMissionObjects ""Land_Fire_DZ"";" \n
- "" \n
- "diag_log (format[""CLEANUP: Deleted %1 players, %2 zombies, %3/%5 flies and %4 fireplaces."",_delQtyP,_delQtyZ,_delQtyFL,_delQtyFP,_delQtyFL1]);" \n
- "" \n
- "//diag_log (""CLEANUP: Deleted "" + str(_delQtyP) + "" players, "" + str(_delQtyZ) + "" zombies, "" + str(_delQtyFL) + "" flies, and "" + str(_delQtyFP) + "" fireplaces"");"/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "cleanup_objects">*/
- class cleanup_objects
- {
- name = "cleanup_objects";
- init = /*%FSM<STATEINIT""">*/"_missionObjs = allMissionObjects ""ReammoBox"";" \n
- "_qty = count _missionObjs;" \n
- "" \n
- "diag_log (""CLEANUP:TOTAL "" + str(_qty) + "" LOOT BAGS"");" \n
- "_dateNow = diag_ticktime;" \n
- "_delQty = 0;" \n
- "" \n
- "{" \n
- " _created = (_x getVariable [""created"",-0.1]);" \n
- " if (_created == -0.1) then {" \n
- " _x setVariable [""created"",diag_ticktime,false];" \n
- " _created = diag_ticktime;" \n
- " };" \n
- "" \n
- " _keep = _x getVariable [""permaLoot"",false];" \n
- " _age = (_dateNow - _created);" \n
- " _nearby = {(isPlayer _x) and (alive _x)} count (_x nearEntities [[""CAManBase"",""AllVehicles""], 130]);" \n
- " if ( (!_keep) && (_nearby==0) && (_age > 20)) then {" \n
- " deleteVehicle _x;" \n
- " _delQty = _delQty + 1;" \n
- " };" \n
- "" \n
- "} forEach _missionObjs;" \n
- "" \n
- "if (_delQty > 0) then {" \n
- " diag_log (""CLEANUP: DELETED "" + str(_delQty) + "" LOOT BAGS"");" \n
- "};"/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "sync_the_time">*/
- class sync_the_time
- {
- name = "sync_the_time";
- init = /*%FSM<STATEINIT""">*/"//Send request" \n
- "_key = ""CHILD:307:"";" \n
- "_result = _key call server_hiveReadWrite;" \n
- "_outcome = _result select 0;" \n
- "" \n
- "if(_outcome == ""PASS"") then {" \n
- " _date = _result select 1;" \n
- "" \n
- " //date setup" \n
- " _year = _date select 0;" \n
- " _month = _date select 1;" \n
- " _day = _date select 2;" \n
- " _hour = _date select 3;" \n
- " _minute = _date select 4;" \n
- "" \n
- " if (dayz_ForcefullmoonNights) then {" \n
- " _date = [2012,6,6,_hour,_minute];" \n
- " };" \n
- "" \n
- " setDate _date;" \n
- " dayzSetDate = _date;" \n
- " publicVariable ""dayzSetDate"";" \n
- " diag_log (""TIME SYNC: Local Time set to "" + str(_date));" \n
- "}"/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "general_cleanup">*/
- class general_cleanup
- {
- name = "general_cleanup";
- init = /*%FSM<STATEINIT""">*/"//Clean groups" \n
- "{" \n
- " //diag_log (""CLEANUP: CHECKING GROUP WITH "" + str(count units _x) + "" UNITS"");" \n
- " if (count units _x==0) then {" \n
- " deleteGroup _x;" \n
- " //diag_log (""CLEANUP: DELETING A GROUP"");" \n
- " };" \n
- "} forEach allGroups;" \n
- "" \n
- "//Check for hackers" \n
- " {" \n
- " if(vehicle _x != _x && !(vehicle _x in _safety) && (typeOf vehicle _x) != ""ParachuteWest"" && (vehicle _x getVariable [""SafeVehicle"",0] != 1)) then {" \n
- " diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
- " (vehicle _x) setDamage 1;" \n
- " _x setDamage 1;" \n
- " };" \n
- " } forEach allUnits;" \n
- "" \n
- "dayz_serverObjectMonitor = _safety;"/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="waiting";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "prepare">*/
- class prepare
- {
- name = "prepare";
- init = /*%FSM<STATEINIT""">*/"diag_log (""CLEANUP: INITIALIZING CLEANUP SCRIPT"");" \n
- "" \n
- "_safety = dayz_serverObjectMonitor;" \n
- "_dateNow = (DateToNumber date);" \n
- "" \n
- "_lastUpdate = diag_tickTime;" \n
- "_timeNem =diag_tickTime;" \n
- "_deadBodies = [];" \n
- "_lastNeedUpdate = diag_tickTime;" \n
- "_timeout = diag_tickTime;" \n
- "_maxBodies = 15;" \n
- "" \n
- "_lootspawnerfdbykr = diag_tickTime; " \n
- "_reseedloot = false;" \n
- "" \n
- "_amount = 0;" \n
- "_hour = 0;" \n
- "_minute = 0;"/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="waiting";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "update_objects">*/
- class update_objects
- {
- name = "update_objects";
- init = /*%FSM<STATEINIT""">*/"diag_log format[""DEBUG: needUpdate_objects=%1"",needUpdate_objects];" \n
- "" \n
- "{" \n
- "// _x setVariable [""needUpdate"",false,true];" \n
- " needUpdate_objects = needUpdate_objects - [_x];" \n
- " [_x,""damage"",true] call server_updateObject;" \n
- "} forEach needUpdate_objects;" \n
- ""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "Start_Loot_Spawn">*/
- class Start_Loot_Spawn
- {
- name = "Start_Loot_Spawn";
- init = /*%FSM<STATEINIT""">*/"" \n
- "{" \n
- " diag_log (""Starting reseed Loot"");" \n
- "" \n
- " _x spawn dayz_reseed;" \n
- "" \n
- " dayz_seedloot set [0,-1];" \n
- " dayz_seedloot = dayz_seedloot - [-1];" \n
- "" \n
- "" \n
- "} forEach dayz_seedloot;" \n
- "" \n
- ""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "true">*/
- class true
- {
- priority = 0.000000;
- to="general_cleanup";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"diag_log (""Started reseeding Loot"");" \n
- "" \n
- "_reseedloot = false;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "New_Cleanup_Obje">*/
- class New_Cleanup_Obje
- {
- name = "New_Cleanup_Obje";
- init = /*%FSM<STATEINIT""">*/"" \n
- "_lootingrids = [];" \n
- "" \n
- "{" \n
- " _loc = _x select 0;" \n
- " _ref = _x select 1;" \n
- "" \n
- " _nearBy = nearestObjects [_loc, [""ReammoBox""], 1500];" \n
- " {" \n
- " _lootingrids set [count _lootingrids,[_x,_ref]];" \n
- " } foreach _nearBy;" \n
- "" \n
- " dayz_deseedloot set [0,-1];" \n
- " dayz_deseedloot = dayz_deseedloot - [-1];" \n
- "" \n
- "}foreach dayz_deseedloot;" \n
- "" \n
- "_qty = count _lootingrids;" \n
- "diag_log (""CLEANUP:TOTAL "" + str(_qty) + "" LOOT BAGS"");" \n
- "" \n
- "_delQty = 0;" \n
- "_delQtyDroped = 0;" \n
- "_delQtySpawned = 0;" \n
- "_delQtyPerma = 0;" \n
- "" \n
- "{" \n
- " " \n
- " _obj = _x select 0;" \n
- " _ref = _x select 1;" \n
- "" \n
- " diag_log format [""%1,%2"", _obj, _ref];" \n
- "" \n
- " _Dropped = (_obj getVariable [""Dropped"",false]);" \n
- " _Spawned = (_obj getVariable [""spawnedLoot"",false]);" \n
- " _Perma = (_obj getVariable [""permaLoot"",false]);" \n
- "" \n
- " if (!_Spawned and !_Perma) then {" \n
- " _obj setVariable [""Dropped"",true];" \n
- " };" \n
- "" \n
- " //Dropped loot" \n
- " if (_Dropped) then {" \n
- " " \n
- " [""Dropped_Loot"",_obj,_ref] call server_systemCleanup;" \n
- " _delQtyDroped = _delQtyDroped + 1;" \n
- "" \n
- " };" \n
- "" \n
- " //Spawned Loot" \n
- " if (_Spawned) then {" \n
- "" \n
- " [""Spawned_Loot"",_obj,_ref] call server_systemCleanup;" \n
- " _delQtySpawned = _delQtySpawned + 1; " \n
- " " \n
- " };" \n
- "" \n
- " //Permaloot" \n
- " if (_Perma) then {" \n
- "" \n
- " _delQtyPerma = _delQtyPerma + 1;" \n
- "" \n
- " };" \n
- "" \n
- "} foreach _lootingrids;" \n
- "" \n
- "if ((_delQtySpawned > 0) or (_delQtyDroped > 0) or (_delQtyPerma > 0)) then {" \n
- " //diag_log (""CLEANUP: DELETED "" + str(_delQty) + "" LOOT BAGS"");" \n
- " diag_log format [""CLEANUP: (DELETED, DroppedLoot: %1, SpawnedLoot: %2), (KEPT, PermaLoot: %3)"", _delQtyDroped, _delQtySpawned, _delQtyPerma];" \n
- "};" \n
- ""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "_">*/
- class _
- {
- name = "_";
- init = /*%FSM<STATEINIT""">*/"_key = ""CHILD:307:"";" \n
- "_result = _key call server_hiveReadWrite;" \n
- "_outcome = _result select 0;" \n
- "" \n
- "" \n
- ""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "_">*/
- class _
- {
- priority = 0.000000;
- to="____FAKE____";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"(_outcome == ""PASS"")"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"_date = _result select 1;" \n
- "" \n
- "_y = _date select 0;" \n
- "_mn = _date select 1;" \n
- "_d =_date select 2;" \n
- "_h = _date select 3;" \n
- "_m = _date select 4;" \n
- "" \n
- "if ((_h > 20) or (_h < 4)) then {" \n
- " _h = 5;" \n
- "};" \n
- "" \n
- "_date = [_y,_mn,_d,_h,_m];"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- /*%FSM<STATE "____FAKE____">*/
- class ____FAKE____
- {
- name = "____FAKE____";
- init = /*%FSM<STATEINIT""">*/""/*%FSM</STATEINIT""">*/;
- precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
- class Links
- {
- /*%FSM<LINK "LootSpawn">*/
- class LootSpawn
- {
- priority = 2.000000;
- to="Start_Loot_Spawn";
- precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
- condition=/*%FSM<CONDITION""">*/"(((count dayz_seedloot) > 0) && (!isNil ""sm_done""))"/*%FSM</CONDITION""">*/;
- action=/*%FSM<ACTION""">*/"_lootspawnerfdbykr = diag_tickTime;"/*%FSM</ACTION""">*/;
- };
- /*%FSM</LINK>*/
- };
- };
- /*%FSM</STATE>*/
- };
- initState="init";
- finalStates[] =
- {
- };
- };
- /*%FSM</COMPILE>*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement