Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private ["_humanity", "_foodList","_meatList","_drinkList","_backpackList","_pistolList","_riflelist","_meleeList","_extraMagsList","_extraWeaponsList", "_foodCount", "_meatCount",
- "_drinkCount", "_trashCount", "_msg", "_vehList", "_vehClass","_ammo","_rifle","_pistol","_vehicle","_objectID","_box", "_melee"];
- _p = _this select 0; //player
- _w = _this select 1; // worldspace
- _humanity = _p getVariable ["humanity",0];
- diag_log(format ["DZLD: Player: %1, Humanity: %2, Worldspace: %3", name _p, _humanity,_w]);
- //_isHero = (player getVariable ["humanity",0] > 5000);
- //_isBandit = (player getVariable ["humanity",0] < -2000);
- //if (_humanity > 5000) then {
- // _isHero=true;
- //};
- //_humanity = 152500;
- _backpackList = [];
- _pistolList = [];
- _riflelist = [];
- _meleeList = [];
- _extraMagsList = [];
- _extraWeaponsList = [];
- _foodCount = 0;
- _meatCount = 0;
- _drinkCount = 0;
- _trashCount = 6;
- // _msg = "";
- _vehList = [];
- _foodList = ["FoodNutmix","FoodCanBakedBeans","FoodCanSardines","FoodCanFrankBeans","FoodCanPasta","FoodCanBadguy","FoodCanBoneboy","FoodCanCorn","FoodCanCurgon", "FoodCanDemon",
- "FoodCanFraggleos","FoodCanBeef","FoodCanHerpy","FoodCanDerpy","FoodCanOrlok","FoodCanPowell","FoodCanTylers","FoodCanUnlabeled","FoodPistachio", "FoodChipsSulahoops",
- "FoodChipsMysticales","FoodCandyAnders","FoodCandyLegacys","FoodCandyMintception","FoodCanRusStew","FoodCanRusPork","FoodCanRusPeas","FoodCanRusMilk", "FoodCanRusCorn",
- "FoodCakeCremeCakeClean"];
- _meatList = ["FoodSteakCooked","FoodSteakRaw", "FoodmeatCooked", "FoodmeatRaw", "FoodbeefCooked", "FoodbeefRaw", "FoodmuttonCooked", "FoodmuttonRaw", "FoodchickenCooked", "FoodchickenRaw",
- "FoodrabbitCooked", "FoodrabbitRaw", "FoodbaconCooked", "FoodbaconRaw", "FoodgoatCooked", "FoodgoatRaw", "FishCookedTrout", "FishRawTrout", "FishCookedSeaBass", "FishRawSeaBass",
- "FishCookedTuna", "FishRawTuna"];
- _drinkList = ["ItemWaterBottleBoiled","ItemWaterbottle","ItemSodaLirik","ItemSodaPeppsy","ItemSodaMtngreen","ItemSodaR4z0r","ItemSodaClays","ItemSodaSmasht","ItemSodaDrwaste","ItemSodaLemonade",
- "ItemSodaLvg","ItemSodaMzly","ItemSodaRabbit"];
- _trashList = ["ItemSodaSmashtEmpty","ItemTrashToiletpaper","FoodCanBeefEmpty","TrashJackDaniels","FoodChipsChocolateEmpty","ItemKosmosSmokes","ItemSodaR4z0rEmpty","ItemTrashPaper",
- "FoodCanOrlokEmpty","ItemTrashPaperMusic", "ItemBookBible", "ItemWire","equip_scrapelectronics","FoodCanTylersEmpty","equip_2inch_metal_pipe", "equip_pvc_box"];
- _vclassList = ["AH6X_DZ", "AN2_2_DZ", "AN2_DZ", "ATV_US_EP1", "BAF_Offroad_D", "BAF_Offroad_W", "car_hatchback", "car_sedan", "datsun1_civil_2_covered", "datsun1_civil_3_open", "Fishing_Boat",
- "hilux1_civil_1_open", "hilux1_civil_2_covered", "hilux1_civil_3_open", "HMMWV_DZ", "Ikarus", "Ikarus_TK_CIV_EP1", "ladalm", "LandRover_CZ_EP1", "LandRover_TK_CIV_EP1", "M1030", "MH6J_DZ", "Mi17_DZ",
- "Offroad_DSHKM_INS", "Old_bike_TK_CIV_EP1", "Old_moto_TK_Civ_EP1", "PBX", "Pickup_PK_INS", "S1203_TK_CIV_EP1", "Skoda", "SkodaBlue", "SkodaGreen", "Smallboat_1", "SUV_DZ", "Tractor", "TT650_Ins",
- "TT650_TK_CIV_EP1", "UAZ_RU", "UAZ_Unarmed_TK_CIV_EP1", "UAZ_Unarmed_TK_EP1", "UAZ_Unarmed_UN_EP1", "UH1H_2_DZ", "UH1H_DZ", "UralCivil", "UralCivil2", "UralOpen_INS", "Ural_CDF", "Ural_INS", "Ural_TK_CIV_EP1",
- "V3S_Civ", "VolhaLimo_TK_CIV_EP1", "Volha_1_TK_CIV_EP1", "Volha_2_TK_CIV_EP1"];
- // BANDIT
- if (_humanity < -2000) then {
- _backpackList = [];
- _pistolList = [];
- _riflelist = [];
- _meleeList = ["MeleeBaseBallBatNails", "MeleeBaseBallBatBarbed","MeleeBaseBallBat"];
- _extraMagsList = ["ItemPainkiller", "ItemTrashToiletpaper","TrashJackDaniels","ItemKosmosSmokes"];
- _extraWeaponsList = ["ItemCompass"];
- _foodCount = 0;
- _meatCount = 0;
- _drinkCount = 0;
- _msg = "You are an APPRENTICE BANDIT.";
- if ( (_humanity < -25000) && (_humanity > -50000) ) then {
- _backpackList = ["DZ_Assault_Pack_EP1","DZ_ALICE_Pack_EP1"];
- _pistolList = ["PDW_DZ", "Makarov_DZ"];
- _riflelist = ["Bizon_DZ","MP5_SD_DZ"];
- _foodCount = 1;
- _drinkCount = 1;
- _msg = "You are a ENTHUSIASTIC BANDIT.";
- };
- if ( (_humanity < -49999) && (_humanity > -100000) ) then {
- _backpackList = ["DZ_Assault_Pack_EP1","DZ_ALICE_Pack_EP1"];
- _pistolList = ["PDW_DZ", "Makarov_DZ"];
- _riflelist = ["MP5_SD_DZ","AKM_DZ","Mosin_Nagant"];
- _vehList = ["Old_bike_TK_CIV_EP1","Old_moto_TK_Civ_EP1"];
- _foodCount = 1;
- _meatCount = 1;
- _drinkCount = 1;
- _msg = "You are a COMMITTED BANDIT.";
- };
- if (_humanity < -99999) then {
- _backpackList = ["DZ_Assault_Pack_EP1","DZ_ALICE_Pack_EP1"];
- _pistolList = ["PDW_DZ", "Makarov_DZ"];
- _riflelist = ["AKS74U_Kobra_DZ","M16A4_DZ","AK74_Kobra_DZ","LeeEnfield_DZ"];
- _extraMagsList = ["ItemPainkiller", "ItemBandage", "ItemBandage","ItemBandage", "ItemBandage", "ItemMorphine", "ItemAntibiotic"];
- _vehList = ["SkodaBlue","Old_bike_TK_CIV_EP1","Skoda","Old_bike_TK_CIV_EP1","SkodaGreen"];
- _foodCount = 2;
- _meatCount = 2;
- _drinkCount = 2;
- _msg = "You are a DEVOTED BANDIT.";
- };
- };
- if (_humanity > 5000) then { // HERO
- _backpackList = ["DZ_Assault_Pack_EP1","DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1"];
- _pistolList = ["M1911_DZ","Revolver_DZ","G17_DZ","M9_DZ"];
- _riflelist = ["M4A1_DZ","M16A4_DZ","M16A2_DZ"];
- _meleeList = ["ItemHatchet", "ItemCrowbar"];
- _extraMagsList = ["ItemPainkiller", "ItemBandage", "ItemBandage","ItemBandage", "ItemBandage", "ItemMorphine", "ItemAntibiotic","equip_comfreyleafs","equip_comfreyleafs"];
- _extraWeaponsList = ["ItemFlashlight", "ItemMap", "ItemMatchbox", "Binocular", "ItemKnife"];
- _foodCount = 2;
- _drinkCount = 2;
- _msg = "You are a HERO!";
- _vehList = ["Old_bike_TK_CIV_EP1"];
- if ( (_humanity > 9999) && (_humanity < 25000) ) then { // Awesome Hero
- _backpackList = ["DZ_Assault_Pack_EP1","DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1", "DZ_Czech_Vest_Puch","DZ_British_ACU"];
- _riflelist = ["L85_Holo_DZ","G36K_Camo_DZ"];
- _vehList = ["Old_bike_TK_CIV_EP1", "M1030", "TT650_Ins", "TT650_TK_CIV_EP1", "Old_moto_TK_Civ_EP1","ATV_US"];
- _foodCount = 3;
- _meatCount = 1;
- _drinkCount = 3;
- _msg = "You are an AWESOME HERO!";
- };
- if ( (_humanity > 24999) && (_humanity < 50000) ) then { // AmazingHero
- _backpackList = ["DZ_Assault_Pack_EP1","DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1", "DZ_CivilBackpack_EP1","DZ_Backpack_EP1"];
- _riflelist = ["SA58_ACOG_DZ","SVD_DZ","G36K_Camo_DZ"];
- _vehList = ["Old_bike_TK_CIV_EP1","hilux1_civil_1_open","hilux1_civil_2_covered", "hilux1_civil_3_open"];
- _foodCount = 4;
- _meatCount = 2;
- _drinkCount = 4;
- _msg = "You are an AMAZING HERO!";
- };
- if ( (_humanity > 49999) && (_humanity < 100000) ) then { // EpicHero
- _backpackList = ["DZ_Assault_Pack_EP1","DZ_ALICE_Pack_EP1","DZ_Backpack_EP1"];
- _riflelist = ["M14_DZ","SA58_ACOG_DZ","DMR_DZ","SVD_DZ"];
- _vehList = ["TT650_TK_CIV_EP1","UAZ_RU","UAZ_Unarmed_TK_CIV_EP1", "UAZ_Unarmed_TK_EP1", "UAZ_Unarmed_UN_EP1", "Old_moto_TK_Civ_EP1"];
- _extraWeaponsList = ["ItemFlashlight", "ItemMap", "ItemMatchbox", "Binocular", "ItemKnife", "ItemGPS"];
- _foodCount = 5;
- _meatCount = 3;
- _drinkCount = 5;
- _msg = "You are an EPIC HERO!";
- };
- if (_humanity > 99999) then { // UltimateHero
- _backpackList = ["DZ_TK_Assault_Pack_EP1", "DZ_CivilBackpack_EP1","DZ_Backpack_EP1"];
- _riflelist = ["M14_DZ","DMR_DZ","M240_DZ","M249_DZ"];
- _vehList = ["ATV_US","SUV_DZ","LandRover_CZ_EP1", "LandRover_TK_CIV_EP1", "M1030", "BAF_Offroad_D", "BAF_Offroad_W"];
- _extraWeaponsList = ["ItemFlashlight", "ItemMap", "ItemMatchbox", "Binocular", "ItemKnife","ItemGPS", "Binocular_Vector"];
- _foodCount = 6;
- _drinkCount = 6;
- _msg = "You are the ULTIMATE HERO!";
- };
- } else { // SURVIVOR
- _backpackList = ["DZ_Patrol_Pack_EP1", "DZ_Czech_Vest_Puch"];
- _pistolList = ["Revolver_DZ", "M1911_DZ"];
- _riflelist = ["CZ550_DZ","M1014_DZ","LeeEnfield_DZ","CZ550_DZ","M1014_DZ"];
- _meleeList = ["ItemMachete", "ItemCrowbar"];
- _extraMagsList =["ItemPainkiller", "ItemBandage", "ItemBandage","equip_string", "PartWoodPile", "PartWoodPile"];
- _extraWeaponsList = ["ItemFlashlight", "ItemCompass"];
- _foodCount = 1;
- _meatCount = 1;
- _drinkCount = 1;
- _msg = "You are a SURVIVOR.";
- };
- //systemChat (_msg);
- _p setVariable ["lMsg", _msg, true];
- //_coords = position _p;
- _coords = _w;
- diag_log(format ["DZLD: x: %1, y: %2, z: %3", (_coords select 0), (_coords select 1), (_coords select 2)]);
- // Make sure there isn't already a vehicle there. Argh, need a meta list of all vehicles....
- // This could give a false positive, but so what
- _vehNear = nearestObjects [_coords, _vclassList, 25];
- // _vehCount = count _vehNear;
- // if ( (!isNil "_vehClass") && (round(random 100)%5==0) ) then {
- if ( (count _vehList) > 0 && (count _vehNear) < 1 ) then {
- _vehClass = _vehList call BIS_fnc_selectRandom;
- _vehicle = createVehicle [_vehClass,[(_coords select 0) - 4, (_coords select 1) + 4,0],[], 0, "CAN_COLLIDE"];
- _objectID = str(round(random 999999));
- _vehicle setVariable ["ObjectID", _objectID, true];
- _vehicle setVariable ["ObjectUID", _objectID, true];
- diag_log(format ["DZLD1: Player: %1, Humanity: %2, VehicleClass: %3", name _p, _humanity, _vehClass]);
- // _vehicle setVariable ["Mission",1,true];
- dayz_serverObjectMonitor set [count dayz_serverObjectMonitor, _vehicle];
- waitUntil {(!isNull _vehicle)};
- _ranFuel = random 1;
- if (_ranFuel < .25) then {_ranFuel = .25;};
- _vehicle setFuel _ranFuel;
- _vehicle setvelocity [0,0,1];
- _vehicle setDir (round(random 360));
- _vehicle setVehicleLock "UNLOCKED";
- diag_log(format ["DZLD2: Player: %1, Humanity: %2, VehicleClass: %3", name _p, _humanity, _vehClass]);
- clearMagazineCargo _vehicle;
- clearWeaponCargo _vehicle;
- //_vehicle addMagazineCargoGlobal ["ItemJerryCan"];
- _vehicle addEventHandler ["GetIn",{
- _nil = [nil,(_this select 2),"loc",rTITLETEXT,"Warning: This vehicle will disappear on server restart!","PLAIN DOWN",5] call RE;
- }];
- // _vehicle setVariable ["lName", _p name, true];
- // _vehicle addEventHandler ["GetIn",{
- // if ((_this select 0) getVariable ["lName",0] != (_this select 2) name ) then { (_this select 2) action ["eject", (_this select 0) (_this select 2)]; }
- // }];
- //titleText ["Warning: This vehicle will disappear on server restart!", "PLAIN DOWN", 3];
- };
- //AmmoBoxBig(works) ,Foodbox0 (disappears - like medbox0?), TentStorage (works)
- // Make sure there isn't already a box there. You could go in/out of the lobby.
- // This could give a false positive, but so what
- _boxesNear = nearestObjects [_coords, ["AmmoBoxBig"], 10];
- _boxcount = count _boxesNear;
- if ((_boxcount) < 1) then {
- _box = createVehicle ["AmmoBoxBig",[(_coords select 0) - 2, (_coords select 1) - 2,0],[], 0, "CAN_COLLIDE"];
- _box setVariable ["permaLoot",true];
- _box setVariable ["Mission",1,true];
- clearWeaponCargoGlobal _box;
- clearMagazineCargoGlobal _box;
- clearBackPackCargoGlobal _box;
- //titleText ["Warning: Get your loadout now. The Supply Box will disappear when you walk away!", "PLAIN DOWN", 3];
- if ((count _backpackList)>0) then {
- _box addBackpackCargoGlobal [_backpackList call BIS_fnc_selectRandom, 1];
- };
- if ((count _pistolList)>0) then {
- _pistol = _pistolList call BIS_fnc_selectRandom;
- _box addWeaponCargoGlobal [_pistol, 1];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _pistol >> "magazines");
- if ((count _ammo) > 0) then {
- _box addMagazineCargoGlobal [(_ammo select 0),(round(random 2)+1)];
- };
- };
- if ((count _rifleList)>0) then {
- _rifle = _rifleList call BIS_fnc_selectRandom;
- _box addWeaponCargoGlobal [_rifle, 1];
- _ammo = [] + getArray (configFile >> "cfgWeapons" >> _rifle >> "magazines");
- if ((count _ammo) > 0) then {
- _box addMagazineCargoGlobal [(_ammo select 0),(round(random 4)+1)];
- };
- };
- if ((count _meleeList)>0) then {
- _melee = _meleeList call BIS_fnc_selectRandom;
- _box addWeaponCargoGlobal [_melee, 1];
- };
- if ((count _extraMagsList)>0) then {
- {_box addMagazineCargoGlobal [_x, 1];} forEach _extraMagsList;
- };
- if ((count _extraWeaponsList)>0) then {
- {_box addWeaponCargoGlobal [_x, 1];} forEach _extraWeaponsList;
- };
- for "_i" from 1 to _foodCount do { _box addMagazineCargoGlobal [_foodList call BIS_fnc_selectRandom, 1]; };
- for "_i" from 1 to _meatCount do { _box addMagazineCargoGlobal [_meatList call BIS_fnc_selectRandom, 1]; };
- for "_i" from 1 to _drinkCount do { _box addMagazineCargoGlobal [_drinkList call BIS_fnc_selectRandom, 1]; };
- for "_i" from 1 to _trashCount do { _box addMagazineCargoGlobal [_trashList call BIS_fnc_selectRandom, 1]; };
- // for "_i" from 1 to _medCount do { _box addMagazineCargoGlobal [_medList call BIS_fnc_selectRandom, 1]; };
- //uisleep 5;
- diag_log("DZLD: AmmoBoxBig Spawned");
- };
- // Probably need to also delete on alive player. What about logout???
- // not alive player
- // OR !(alive player)
- // waitUntil {(_p distance _box) < 5};
- // waitUntil {(_p distance _box) > 5};
- // deleteVehicle _box;
- // diag_log("DZLD: AmmoBoxBig Removed");
- //} else {
- // titleText ["Hmmm, there seems to already be a supply box here.", "PLAIN DOWN", 3];
- //
- // _box = _boxesNear select 0;
- // waitUntil {(_p distance _box) > 5};
- // deleteVehicle _box;
- // {deleteVehicle _x;} forEach _boxesNear;
- //};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement