This commit is contained in:
Aaron Clark
2012-11-04 20:28:50 -06:00
commit 76e9a0582e
1049 changed files with 94406 additions and 0 deletions

1
dayz_code/$PBOPREFIX$ Normal file
View File

@@ -0,0 +1 @@
z\addons\dayz_code

View File

@@ -0,0 +1,441 @@
HOTFIX : 27th OCTOBER 2012
Affected addons:
* dayz_code 1.7.2.*
* dayz_server (server admins only)
Developer's Note:
*
Developer Changelog:
*
Community Notes:
*
Community Changelog:
Client.pbo
* [NEW] Tents can no longer be placed on concrete.
* [FIXED] Building checks for tent placement (No longer place tents in buildings).
* [FIXED] Tents now are one click place.
* [FIXED] Fixed function for checking if in buildings.
* [UPDATED] Vehicle repair menus now all replaced.
* [NEW] Vehicle menus now list all damaged parts no matter if you have the item or not.
* [NEW] Vehicle repair menus will now let you know the exact item you need to repair on failed repair attempts.
* [FIXED] Vehicle Damage is now fully working.
* [FIXED] Vehicle Killed is now in effect fully destroyed vehilces will now set corret in db.
* [FIXED] Tents Now add and remove from db.
* [FIXED] Food can no longer be consumed if the player does not have in inventory.
* [FIXED] water can no longer be consumed if the player does not have in inventory.
* [UPDATED] Updated UI control.
* [NEW] Toolbox is now needed for all repiars.
* [NEW] New Combat System If you fire a weapon, someone fires a weapon near you, or a bullet/object impacts near you, then you go into combat. During combat, "ABORT" is disabled. (Need to look at the effects with high player counts)
* [NEW] Alt-f4 is now locked and will only open your status menu.
* [Fixed] No longer possible to drink/eat/pitch a tent/put on clothes/build sand bags/cat wire/hedgehogs/consume medical supplies/free filled water without consuming the item.
* [FIXED] No longer possible to create axes out of thin air if you already have one
* [FIXED] Switching skins no longer repairs pain shakes/broken legs/resets/dupes/screws/resets ammo
* [FIXED] Duping no longer possible through zombie corpses/backpacks/etc
* [FIXED] Tents Now add and remove from db.
* [FIXED] It should now be impossible for a new spawn to spawn unconscious.
* [FIXED] You can no longer cook infinite free meat from camp fires
* [FIXED] Survivors should no longer pickup a single item at the same time and both receive it.
* [FIXED] You can no longer generate multiple tents while packing up a deployed tent.
* [FIXED] You can no longer change clothes/eat/drink/etc. while in a vehicle
* [NEW] combat 30 sec timer.
* [UPDATED] ItemWire reduced from 0.06 to 0.01
* [UPDATED] PartEngine updated from 0.01 to 0.06
* [UPDATED] Version info is now displayed correct
Server.pbo
* [FIXED] Object Gear syncs happen based on radius not just on menu.
* [FIXED] Vehicle Position is now updated with client position.
* [FIXED] Vehicles save fuel properly
_____________________________________
HOTFIX : 6 SEPTEMBER 2012
Affected addons:
* dayz 1.something.somethingelse
* dayz_code 1.7.2.6
* dayz_server (server admins only)
Developer's Note:
* To change your DayZ UI options, go to OPTIONS > GAME OPTIONS > DayZ UI. This will only affect the DayZ UI elements, unfortunately it is not saving to the config file so each time you restart ArmA2 you will need to change this setting.
* DayZ UI Debug option might not always work properly. deal-with-it.jpg
Changelog:
* [NEW] Bear trap has chance to spawn on infected hunters
* [FIXED] Graphical glitches with dead bodies (Bodies should now not display graphical glitches)
* [NEW] Three UI options available: Default (indicators only), Debug (indicators + debug window), None (only base ArmA2 UI)
* [FIXED] Converting between magazine types resets ammo count (Now only contains previous number of rounds)
_____________________________________
HOTFIX : 8 AUGUST 2012
Affected addons:
* dayz_code 1.7.2.5
* dayz_server (server admins only)
Developer's Note:
*
Changelog:
* [FIXED] Ammunition amounts not loaded in properly (Now records used ammunition correctly)
* [FIXED] Graphical glitches with barbed wire (Rebinarized file should no longer produce graphical artifacts)
* [NEW] Additional optimizations to login process (further use of publicVariableClient to reduce network transmission)
* [FIXED] Respawn button not enabled when legs fractured (Now enables for fractured legs https://dev-heaven.net/issues/39161 )
* [FIXED] Excessive logging of player data in server logs (Disabled https://dev-heaven.net/issues/38784 )
* [FIXED] Graphical glitches with dead bodies (Rebinarized file should no longer produce graphical artifacts)
_____________________________________
HOTFIX : 26 JULY 2012
Affected addons:
* dayz_code 1.7.2.4
* dayz 1.3.2
* dayz_anim 0.5
* dayz_server (server admins only)
Developer's Note:
* Should be used with Build 95310 and above on 1.62
* 5 second timeout on disconnect is NOT implemented, as the engine is preventing it currently
Changelog:
* [NEW] Respawn button is disabled during DayZ play
* [NEW] Optimized authentication process on login
* [NEW] Singleplayer mode disabled when DayZ is loaded
* [NEW] DayZ Logo and Version Number appear in game when DayZ is loaded
* [NEW] Hive now tracks login/logout (to assist in analysis for an ALT+F4 solution)
* [FIXED] Infected cannot hear weapon firing (now they actually hear again)
* [FIXED] Clothing no longer spawning (now it spawns as it used too)
* [FIXED] Tents and items with ID's above 1 million don't syncronize (now it should syncronize, players to confirm)
* [NEW] Respawn button is enabled if the player has a fracture
* [FIXED] Players switched to non-player skins (by hackers) sync to database (updates no longer saved for objects non-authorized skins)
* [NEW] Players spawning in debug area or "water world" will spawn on beach on next login (with their gear)
* [NEW] Client will automatically spawn player out of debug and waterworld to last known position
* [NEW] Radar removed from helicopter (UH1H will be added back to vehicle spawns)
______________________________________
UPDATE : 13 JULY 2012
Affected addons:
* dayz_code 1.7.2.2
* dayz_anim 0.4
* dayz_server (server admins only)
Developer's Note:
* Make sure you run ArmA2 Beta build 94759 or above
Changelog:
* [FIXED] Ghillie and skin removal on login ( https://dev-heaven.net/issues/36666 )
* [FIXED] Arma X stuck on loading screen ( https://dev-heaven.net/issues/36647 )
* [FIXED] AKS_74_kobra classname incorrectly named ( https://dev-heaven.net/issues/36680 )
* [NEW] Server side performance tweaks and improvments
* [FIXED] Infected detect players from too far away (reduced by about 20%)
* [FIXED] Disconnect updates not being correctly applied (caused inventory issues)
* [FIXED] Bear traps not appearing for spawn (low spawn)
______________________________________
HOTFIX : 10 JULY 2012
Affected addons:
* dayz_code 1.7.2.1
* dayz_anim 0.3.1
* dayz_server (only for servers)
Developer's Note:
Changelog:
* [FIXED] Infected attack those they cannot see ( https://dev-heaven.net/issues/36375 )
* [FIXED] Wearing clothes makes you invisible ( https://dev-heaven.net/issues/36371 )
* [FIXED] New authentication method causing lockups on full servers (Reverted use of publicVariableServer)
* [FIXED] Pressing ALT key caused spamming of server sync ( No longer spams for sync'ing a character )
______________________________________
UPDATE : 9 JULY 2012
Affected addons:
* dayz_code 1.7.2
* dayz 1.3.1
* dayz_equip 1.3.4
* dayz_anim 0.3
Developer's Note:
Changelog:
* [FIXED] Infected hear perfectly through objects (noise reduced by 50% through an object)
* [FIXED] Animal bodies despawn way too fast (now despawn automatically after 2 minutes)
* [FIXED] Corrupted update data causes people to spawn in debug forest (now will not save corrupted position data)
* [FIXED] States where animal might stop walking around (now should walk around more)
* [FIXED] Animal AI routines consuming large amounts of FPS (now in line with Infected AI routines, reduced FPS usage)
* [NEW] Player Syncing system replaced (increased performance and ammo quantity tracking)
* [FIXED] Error reports are almost invisible (has now been fixed)
* [FIXED] Daylight calculations causing slight FPS issue
* [NEW] Visibility now smoothly alters based on sun, moon, cloud, rain, and fog state
* [NEW] Aubility now dampened in rain and increased by fog
* [FIXED] Object cleanup causing significant (huge) performance issue on servers (reduced by up to 50%, means more players + zombies possible)
* [FIXED] Use of "allMissionObjects" causing performance issue on clients (new engine command "entities" used to improve FPS on clients)
* [FIXED] Too easy to break legs due to infected (reduced probability of leg damage, reduced amount of leg damage)
* [FIXED] Inspection of dead bodies does not work (fix only applies with ArmA2 Beta 94033 and above)
* [NEW] Exponent driven probability introduced into visibility calculation
* [FIXED] Hatchet/Crowbar requires reloading ( https://dev-heaven.net/issues/34903 )
* [FIXED] Unlimited Wire fence/Sandbag/Tank Trap Bug ( https://dev-heaven.net/issues/34283 )
* [FIXED] Duplication Exploit on object pickup ( https://dev-heaven.net/issues/34031 )
* [FIXED] Not full magazines disappear when you reconnect ( https://dev-heaven.net/issues/33998 )
* [FIXED] Dead bodies still have the heart beat for low humanity ( https://dev-heaven.net/issues/35050 )
* [NEW] Set Bear Traps that break player and infected legs, kills animals, when activated
* [NEW] Authentication process streamlined with new ArmA2 Beta commands (publicVariableServer and publicVariableClient)
* [NEW] Authentication for duplicate IDs supportive of the new beta patch (ArmAX users)
______________________________________
HOTFIX : 20 JUNE 2012
Affected addons:
* dayz_code 1.7.1.5
* dayz_equip 1.3.3
* dayz_weapons 1.3.2
Developer's Note:
* A designation of [NEW] doesn't necessarily mean a new feature, 4chan, it means a change in operation not directly related to a bug. Could be for better performance or rebalancing.
Changelog:
* [NEW] Infected raycast for line-of-sight less often (improves performance)
* [FIXED] Infected can see through terrain ( https://dev-heaven.net/issues/33787 )
* [FIXED] Raycasting being taken from wrong body position (ensured it is from eye level)
* [FIXED] Infected sometimes spawn close to a player (previous check once, now up to ten times)
* [NEW] Infected bodies will despawn after 5 minutes of their death (improves performance)
* [FIXED] Sometimes infected will stand still after loosing line-of-sight ( https://dev-heaven.net/issues/33715 )
* [FIXED] Can dupe tent's by right clicking (forgot to close the window)
* [FIXED] Poor performance caused by infected search behavior (MAJOR performance increase during closed testing)
* [FIXED] Audibility is far to high (completely rebalanced, in line with how it was in previous updates)
* [FIXED] Can dupe food during cooking if click really fast (now you cannot)
* [FIXED] Trying to pick up a hatchet would create fake ammo (now will not)
* [FIXED] Hatchet takes up too much room (can now be transferred between toolbelt and primary slot through gear action)
* [REVERT] Hatchet now collected as an Item (toolbelt) and can be equipped to primary (gear action)
* [NEW] Flashlights can now be packed to toolbelt also (gear action)
* [NEW] New players will spawn with flashlight added to their toolbelt not backpack
* [FIXED] Infected sometimes not inspecting thrown items (they will walk to the location of a noise, 20-40m away)
* [FIXED] Unlimited Infected spawning (now has a cooldown enabled so it won't spawn too many at once)
* [FIXED] Melee weapon sounds non-existent/terrible (now has placeholder sounds)
______________________________________
HOTFIX : 19 JUNE 2012
Affected addons:
* dayz_code 1.7.1.4
* dayz_equip 1.3.2
Changelog:
* [FIXED] Performance issue with equipment proxies (improves FPS)
______________________________________
HOTFIX : 19 JUNE 2012
Affected addons:
* dayz_code 1.7.1.3
* dayz_weapons 1.3.1
* dayz_server (server admins only)
Developer's Note:
* Requires ArmA2 Beta.
* Big thanks to JoeKurtz for his excellent bug reports
Changelog:
* [FIXED] Melee items causing magazine glitching and eventual server death (fixed)
* [FIXED] Unconscious UI Image displays incorrectly
* [FIXED] Bleeding never stops unless bandaged (chance of spontanious bleeding stopping now works)
* [FIXED] Interior infected spawning inside of building walls etc... (interior infected now spawn inside correctly)
* [FIXED] Speed not correctly utilized for checking stealth levels ( https://dev-heaven.net/issues/33630 )
* [FIXED] Posture error can occur on stealth check ( https://dev-heaven.net/issues/33628 )
* [FIXED] Config error messages on popup (Caused by legacy classnames, error handling implemented to prevent this)
* [FIXED] Unable to repair helicopter fuel leak (repair all parts to 95% or above and fuel leak will stop)
* [FIXED] Massive lag and desync on some servers (mostly caused by the invisible replicating magazines)
* [REVERT] Nerf of sickness damage (now will reduce your blood to 6000 rather than 10000)
* [FIXED] Losing blood from starvation/dehydration cannot receive transfusion ( https://dev-heaven.net/issues/33677 )
* [FIXED] Hunger and Thirst no longer continue to drop while you are offline (only ingame time counts)
* [NEW] Once infected lose line-of-sight they will try investigate where you are
* [FIXED] Flies still heard around removed/hidden bodies ( https://dev-heaven.net/issues/33472 )
* [NEW] Significant loot rebalancing
* [FIXED] "Fus ro dah" melee (now should be the correct release files)
______________________________________
HOTFIX : 19 JUNE 2012
Affected addons:
* dayz_code 1.7.1.2
* dayz_weapons 1.3
* dayz_equip 1.3.1
* dayz_server (server admins only)
Developer's Note:
* YES: I know this hotfix has content in it. It was content that didn't make it into the last update, and some of the fixes are bundled with this content, so it was easier to release the content than try to remove it.
* Requires ArmA2 Beta.
* NOTE: VERY IMPORTANT: MELEE WEAPONS ARE QUITE UNDER POWERED CURRENTLY. THEY WILL BE ADJUSTED UPWARDS OVER THE NEXT FEW WEEKS. EACH HAVE DIFFERENT DAMAGE VALUES.
* ALSO NOTE: Melee is just in testing. They may not stay, they are just being tested to see how they perform. They are missing their sound effects, and tweaking of effects also.
Changelog:
* [NEW] Tone Mapping to enhance nightlighting conditions
* [FIXED] Generic Loot not spawning (such as food etc...)
* [FIXED] Animals stand still and HURR DURRR (they now walk around)
* [FIXED] New blood values not being saved when a player eats (they do now)
* [FIXED] Duplicate players not being removed (should now be removed on login)
* [NEW] Melee Weapon introduced: Hatchet (can only drop through right click in gear menu)
* [NEW] Maximum animals increased
* [NEW] Melee Weapon introduced: Crowbar (can only drop through right click in gear menu)
* [NEW] Double Barrelled shotgun sound
* [FIXED] Gender assignment broken (working correctly)
______________________________________
HOTFIX : 17 JUNE 2012
Affected addons:
* dayz_code 1.7.1.1
* dayz_server (only for server admins)
Developer's Note:
* Performance issues were associated with loot cleanup not working. This has been fixed.
* Each time you start a new character, you will get the gender selection dialog.
* INFECTED AND LOOT RESPAWN IS STILL QUITE BUGGED. NEEDS ALOT OF WORK. BUT IT SHOULD BE MANAGEABLE NOW.
Changelog:
* [FIXED] Server item cleanup error (thanks Dwarden for identifying)
* [FIXED] Server weighted random object error (thanks Dwarden for identifying)
* [REVERT] 5 second delay for disconnecting (will need to wait till new method developed)
* [REVERT] Disabling of interior raycasting (will mean some buildings you will be invisible/can't be hit in for the moment as they don't have view LODs)
* [REVERT] Infected sight based on head not body direction (infected glace around alot, this meant that they had super view directions. Now locked at body direction)
* [FIXED] Area not checked for existing infected before spawning new ones ("blind faith" that it had not made a mistake didn't work)
* [FIXED] Crippling performance issues caused by loot items never being cleaned up (loot now cleaned up)
* [FIXED] Tent pitching (Who the hell codes tent location checks TWICE before pitching? Oh apparently I do)
* [NEW] Marakov spawn rate increased
* [NEW] Small chance Mararov ammo will spawn on an infected
* [FIXED] Converting magazines didn't work if you had MORE than one of that magazine type (now works as intended)
* [NEW] Tweaked audibility and visibility values for kneel walking
* [REVERT] Secret nerf of prone (you noticed)
* [NEW] Can select gender for each new character
* [FIXED] Toolboxes aren't spawning (classname error in loot table)
* [NEW] Small tweaks to AI zombie routines to improve performance
* [REVERT] New spawn timer mechanism (back to the old one for now)
* [FIXED] Infected will stay in one place after losing line-of-sight (now will loiter)
______________________________________
UPDATE : 17 JUNE 2012
Community Shout-out this update:
www.armaholic.com
One of the community websites hosting anything and everything ArmA2. You thought DayZ was good? Well, it is just the tip of the iceberg.
You can download missions, vehicles, addons, even other total conversions. And it's all FREE!
Run by foxhound who also happens to be a cool guy
Affected addons:
* dayz_code 1.7.1
* dayz_sfx 1.2
* dayz 1.3
* dayz_equip 1.3
* dayz_weapons 1.2
* dayz_anim 0.2
Developer's Note:
* Requires ArmA2 Beta.
* Raytracing doesn't work so well inside some buildings at the moment so interiors will ignore raytracing
* Infected sprinting animation not included yet
* On respawn, your flashlight spawns in your BACKPACK. I did this because nothing would have said NOOB more than all the new players running around in the day with torches with no idea what the fuck to do.
Changelog:
* [FIXED] Wire Spools, Toolboxes, hedgehog (tank trap) kits not spawning
* [FIXED] Bodies still being deleted too quickly sometimes
* [FIXED] No backpacks or medical boxes spawning
* [FIXED] "No Speaker..." debug report spam
* [FIXED] Infected spawning too close to players (minimum 30m now)
* [FIXED] Infected not spawning inside buildings any more
* [FIXED] General Server Script Errors (big thanks to Dwarden for fixing these!)
* [FIXED] Loot/Infected spawning time delay desync'ing with server
* [NEW] Infected can't attack through walls
* [NEW] Infected can't see through objects any more
* [NEW] Infected visibility increased (but limited by LOS)
* [NEW] Infected attack range increased (but limited by LOS)
* [NEW] Infected can cause greater damage when they hit you
* [NEW] You can hide from an infected chasing you
* [NEW] Optimized server cleanup routine
* [NEW] Player body exists for five seconds after disconnect (UNCONFIRMED IF WORKING)
* [NEW] Infected see based on eye direction, not on body direction as before
* [NEW] 30Rnd_545x39_AK added to loot table
* [NEW] More infected attack animations
* [NEW] More infected feeding animations
* [NEW] Replaced monkey infected crawing run animation
* [NEW] Heartbeat when cursor on a player with very low humanity (heart beats faster the lower it is)
* [NEW] Humanity GUI indicator removed
* [NEW] New Infected and Action sound effects (more AWESOME stuff by Michael Manning)
* [NEW] Initial version of double-barreled shotgun added (by Artyom)
* [FIXED] CZ550 spawning far too often in farms
* [FIXED] Winchester decreased spawnrate (% given to double barrel shotty)
* [NEW] Recombine shotgun rounds between 2 and 8 rounds
* [NEW] Recombine 45ACP rounds between M1911 and Revolver rounds
* [FIXED] Tent placement is completely screwed (now can place anywhere except in building)
* [FIXED] Items for Eating and Drinking not removed instantly (allowed some duping)
* [NEW] DayZ: Now with additional cruelty! Spawn with only a bandage, painkillers, and a torch.
______________________________________
UPDATE : 27 MAY 2012
Affected addons:
* dayz_code 1.7.0
Changelog:
* [FIXED] Long (sometimes infinite) loading times
* [FIXED] Saving sometimes will not happen
* [FIXED] Vehicles not initialized reliably on servers running multiple instances
* [FIXED] Very poor framerate on servers after some time (dead bodies causing it)
* [NEW] Server Side Architecture completely rewritten
______________________________________
HOTFIX : 24 MAY 2012
Affected addons:
* dayz_code 1.5.8.4
Changelog:
* [NEW] Support for more than 1,000,000 characters
______________________________________
UPDATE : 27 MAY 2012
Affected addons:
* dayz_code 1.6
* dayz_equip 1.2.5
* dayz_weapons 1.1.2
* dayz 1.2.6
* dayz_sfx 1.1.2
Developer's Note:
* To collect firewood, you can either find it in loot piles, or go into a forest and use the hatchet (gear > Right Click). I will expand this mechanic but its enough for now.
* You get a ONE TIME OFFER to change your player gender!
* Only two types of new skins are available in this update, "Camo" and "Ghillie Suit" in addition to normal survivor
* Skins a player is wearing are NOT lootable.
* When you change skin (right click on clothing package in inventory) your old skin will appear in inventory
* If you want a players skin, you will need to make them take it off first
Changelog:
* [FIXED] Bodies being deleted immediately (now will stay around for 15 minutes)
* [FIXED] Player profiles sometimes corrupting and causing stuck in loading issues (error handling by engine)
* [FIXED] Temperature listed in percent and not degrees (now displayed in degrees)
* [FIXED] Loosing temperature inside vehicles (now will slowly gain or be static in vehicles)
* [FIXED] ItemPainkillers popup error (no longer happens: thanks Norbert!)
* [FIXED] Spawning in Ocean when switching models (player morphing optimized by TeeTime)
* [FIXED] Loosing gear when switching models (player morphing optimized by TeeTime)
* [FIXED] Wrong M107 is spawning on occasion (Correct one spawns)
* [FIXED] Crashed heli uber-loot not spawning (does now thanks to GhostBear!)
* [FIXED] Wire Fencing Kit caused graphical glitches (new model)
* [FIXED] Tank Trap Kit caused graphical glitches (new model)
* [FIXED] Invisible character models occuring (No longer invisible models)
* [FIXED] Panic not being activated (Your character will sometimes panic)
* [FIXED] Blood washout sometimes not being displayed (now will always wash out color depending on blood level)
* [NEW] Hatchet for chopping wood in forests
* [NEW] Wire Fencing kit model by Artyom Troshin
* [NEW] Tank Trap kit model by Artyom Troshin
* [NEW] Construction options moved to items in gear menu (right click wire fencing kit to use etc...)
* [NEW] Hospital Loot Spawn probabilities changed
* [NEW] Players can choose to be a female survivor (once only per CD-Key)
* [NEW] Heat packs for increasing temperature in an emergency
* [NEW] Bandit Skin transition for low humanity is removed
* [NEW] Players will receive an error message if the server they are on is running an incorrect HIVE version

View File

@@ -0,0 +1,43 @@
private["_location","_isOk","_dir","_classname","_item"];
_location = player modeltoworld [0,1,0];
_location set [2,0];
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_isWater = (surfaceIsWater _location) or dayz_isSwimming;
if(_isWater) exitWith {cutText [localize "str_player_26", "PLAIN DOWN"];};
if(_onLadder) exitWith {cutText [localize "str_player_21", "PLAIN DOWN"];};
if (vehicle player != player) exitWith {cutText ["You may not build while in a vehicle", "PLAIN DOWN"]};
_item = _this;
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
_hasbuilditem = _this in magazines player;
if (!_hasbuilditem) exitWith {cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]};
_dir = getDir player;
player removeMagazine _item;
player playActionNow "Medic";
sleep 1;
[player,"repair",0,false] call dayz_zombieSpeak;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
player allowDamage false;
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
_object setDir _dir;
player reveal _object;
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
publicVariable "dayzPublishObj";
if (isServer) then {
dayzPublishObj call server_publishObj;
};
sleep 2;
player allowDamage true;

View File

@@ -0,0 +1,36 @@
private["_hasFoodMeat","_hasFoodTin","_item","_wait"];
player removeAction s_player_cook;
s_player_cook = -1;
_qty = {_x == "FoodSteakRaw"} count magazines player;
_wait = 5 - _qty;
if ("FoodSteakRaw" in magazines player) then {
player playActionNow "Medic";
[player,"cook",0,false] call dayz_zombieSpeak;
_id = [player,70,true,(getPosATL player)] spawn player_alertZombies;
sleep _wait;
for "_x" from 1 to _qty do {
_hasFoodMeat = "FoodSteakRaw" in magazines player;
if (!_hasFoodMeat) exitWith {cutText [format[(localize "str_player_31"),_text,"cook"] , "PLAIN DOWN"]};
player removeMagazine "FoodSteakRaw";
player addMagazine "FoodSteakCooked";
sleep 1;
};
cutText [format[(localize "str_success_cooked"),_qty,(localize "STR_EQUIP_NAME_24")], "PLAIN DOWN"];
};
/*
_hasFoodMeat = "FoodSteakRaw" in magazines player;
_qty = {_x == "ItemWaterbottleUnfilled"} count magazines player;
if (_hasFoodMeat) then {
player removeMagazine "FoodSteakRaw";
player playActionNow "Medic";
[player,"eat",0,false] call dayz_zombieSpeak;
sleep 6;
player addMagazine "FoodSteakCooked";
cutText [localize "str_success_cooked_steak", "PLAIN DOWN"];
};
*/

View File

@@ -0,0 +1,9 @@
_array = _this select 3;
_object = _array select 0;
_inventory = _array select 1;
player playActionNow "Medic";
sleep 8;
{player addMagazine _x} forEach _inventory;
deleteVehicle _object;
r_action = false;
call fnc_usec_medic_removeActions;

View File

@@ -0,0 +1,21 @@
_dog = _this select 0;
_array = _this select 3;
_handle = _array select 0;
_type = _array select 1;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
player playActionNow "PutDown";
switch (_type) do {
case 0: {
player removeMagazine "FoodSteakRaw";
_handle setFSMVariable ["_hunger",0];
};
case 1: {
player removeMagazine "ItemWaterbottle";
player addMagazine "ItemWaterbottleUnfilled";
_handle setFSMVariable ["_hunger",0];
};
};

View File

@@ -0,0 +1,13 @@
_dog = _this select 0;
_array = _this select 3;
_handle = _array select 0;
_whistle = _array select 1;
if(_whistle) then {
[nil,player,rSAY,["dog_callBack", 120]] call RE;
};
sleep 1;
_handle setFSMVariable ["_command","none"];

View File

@@ -0,0 +1,19 @@
_dog = _this select 0;
_dog playActionNow "GestureBark";
[_dog,"dog_bark",0,false] call dayz_zombieSpeak;
/*
_anim = animationState _dog;
_sitDown = false;
if(_anim == "Dog_SitDown") then {
[objNull, _dog, rSwitchMove,"Dog_SitUp"] call RE;
sleep 1;
_sitDown = true;
};
[objNull, _dog, rSwitchMove,"Dog_StopV2"] call RE;
if (_sitDown) then {
waitUntil{(animationState _dog) != "Dog_StopV2"};
[objNull, _dog, rSwitchMove,"Dog_SitDown"] call RE;
};
*/

View File

@@ -0,0 +1,33 @@
//_dog = _this select 0;
_array = _this select 3;
_handle = _array select 0;
_whistle = _array select 1;
_forceWalk = _array select 2;
_dog = _handle getFSMVariable "_dog";
_maxSpeed = _handle getFSMVariable "_maxSpeed";
if(player distance _dog < 5) then {
_whistle = false;
};
if(_forceWalk) then {
_maxSpeed = _maxSpeed - 1;
if (_maxSpeed < 0) then {
_maxSpeed = 0;
};
if(_whistle) then {
[nil,player,rSAY,["dog_slowDown", 120]] call RE;
};
} else {
_maxSpeed = _maxSpeed + 1;
if (_maxSpeed > 2) then {
_maxSpeed = 2;
};
if(_whistle) then {
[nil,player,rSAY,["dog_speedUp", 120]] call RE;
};
};
_handle setFSMVariable ["_maxSpeed",_maxSpeed];
_handle setFSMVariable ["_forceChange",true];

View File

@@ -0,0 +1,12 @@
_dog = _this select 0;
_handle = _this select 3;
_standing = _handle getFSMVariable "_standing";
_handle setFSMVariable ["_command","stay"];
_watchDog = _handle getFSMVariable "_watchDog";
_anim = animationState _dog;
if (_anim == "Dog_SitDown" and _watchDog) then {
[objNull, _dog, rSwitchMove,"Dog_SitUp"] call RE;
sleep 0.5;
[objNull, _dog, rSwitchMove,"Dog_LieDown"] call RE;
};

View File

@@ -0,0 +1,8 @@
_array = _this select 3;
_handle = _array;
//_target = _array select 1;
_target = target1;
_handle setFSMVariable ["_command","track"];
_handle setFSMVariable ["_target",_target];

View File

@@ -0,0 +1,40 @@
_dog = _this select 0;
_array = _this select 3;
_handle = _array select 0;
_watchDog = _array select 1;
_handle setFSMVariable ["_watchDog",_watchDog];
_actionWarn = _handle getFSMVariable "_actionWarn";
_actionDir = _handle getFSMVariable "_actionDir";
_dog removeAction _actionWarn;
if (_watchDog) then {
_actionWarn = _dog addAction ["Quiet",_actionDir + "warn.sqf",[_handle,false], 2, false, true];
_handle setFSMVariable ["_actionWarn",_actionWarn];
_handle setFSMVariable ["_idleTime",5];
while {_watchDog and alive _dog} do {
_watchDog = _handle getFSMVariable "_watchDog";
_senseSkill = _handle getFSMVariable "_senseSkill";
if (_watchDog) then {
_nearby = (getPosATL _dog) nearEntities ["CAManBase",_senseSkill];
_nearby = _nearby - [player];
if (count _nearby > 0) then {
//_chance = (3 - (count _nearby));
//hintSilent str(_chance);
[_dog,"dog_growl",2,false] call dayz_zombieSpeak;
} else {
/*
_nearby = (getPosATL _dog) nearEntities ["CAAnimalBase",_senseSkill];
_nearby = _nearby - [_dog];
[_dog,"dog_bark",1,false] call dayz_zombieSpeak;
*/
};
};
sleep 2;
};
} else {
_actionWarn = _dog addAction ["Alert",_actionDir + "warn.sqf",[_handle,true], 2, false, true];
_handle setFSMVariable ["_actionWarn",_actionWarn];
_handle setFSMVariable ["_idleTime",1];
};

View File

@@ -0,0 +1,14 @@
_array = _this select 3;
_location = player modeltoworld [0,0.5,0];
_dir = (getDir player) + 180;
_classname = _array select 0;
_magazine = _array select 1;
player removeMagazine _magazine;
player playActionNow "Medic";
call fnc_usec_engineer_removeActions;
r_action_engineer = false;
sleep 8;
_weapon = _classname createVehicle _location;
_weapon setDir _dir;
_weapon setpos _location;
player reveal _weapon;

View File

@@ -0,0 +1,23 @@
_array = _this select 3;
_object = _array select 0;
_magazine = _array select 1;
_classname = _array select 2;
_dir = direction _object;
_location = getPosATL _object;
player removeMagazine _magazine;
player playActionNow "Medic";
r_action = false;
call fnc_usec_medic_removeActions;
sleep 8;
//Delete old Object
deleteVehicle _object;
//New Object
_weapon = _classname createVehicle _location;
_weapon setDir _dir;
_weapon setpos _location;
player reveal _weapon;

View File

@@ -0,0 +1,17 @@
private["_location","_isOk","_dir","_classname"];
_location = player modeltoworld [0,1,0];
_location set [2,0];
_isOk = count (_location isFlatEmpty [0.5,0,0,4,0,false,player]) > 0;
if (_isOk) then {
_dir = getDir player;
_classname = "Land_Fire";
player playActionNow "Medic";
sleep 6;
dayz_hasFire = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
dayz_hasFire setDir _dir;
player reveal dayz_hasFire;
cutText [localize "str_fireplace_01", "PLAIN DOWN"];
} else {
cutText [localize "str_fireplace_02", "PLAIN DOWN"];
};

View File

@@ -0,0 +1,11 @@
private["_obj"];
_obj = _this select 3;
player playActionNow "Medic";
sleep 6;
if(_obj isKindOf "Land_fire") then {
dayz_hasFire = objNull;
deleteVehicle _obj;
};
cutText [localize "str_fireplace_removed", "PLAIN DOWN"];
player removeAction s_player_fireout;
s_player_fireout = -1;

View File

@@ -0,0 +1,8 @@
private["_flare"];
_flare = _this select 3;
player removeAction s_player_dropflare;
detach _flare;
s_player_grabflare = -1;
s_player_removeflare = -1;
_flare setVariable ["owner",objNull,true];
dayz_hasLight = false;

View File

@@ -0,0 +1,25 @@
private["_flare"];
_flare = _this select 3;
player playActionNow "PutDown";
sleep 2;
_flare attachTo [player,[0,0,0],"granat2"];
[_flare, -90, -10] call object_setpitchbank;
_flare setPos (getPos _flare);
_flare setVariable ["owner",player,true];
player removeAction s_player_grabflare;
player removeAction s_player_removeflare;
dayz_hasLight = true;
//Add Drop Action
_text = getText (configFile >> "CfgAmmo" >> (typeOf _flare) >> "displayName");
s_player_dropflare = player addAction [format[localize "str_actions_medical_16",_text], "\z\addons\dayz_code\actions\flare_drop.sqf",_flare, 1, false, true, "", ""];
while {(alive _flare) and dayz_hasLight} do {
sleep 0.1;
};
if (dayz_hasLight) then {
dayz_hasLight = false;
player removeAction s_player_dropflare;
s_player_grabflare = -1;
s_player_removeflare = -1;
};

View File

@@ -0,0 +1,7 @@
private["_flare"];
_flare = _this select 3;
deleteVehicle _flare;
player removeAction s_player_grabflare;
player removeAction s_player_removeflare;
s_player_grabflare = -1;
s_player_removeflare = -1;

View File

@@ -0,0 +1,7 @@
private["_object"];
dayzUpdateVehicle = [_this select 3,"all"];
publicVariable "dayzUpdateVehicle";
if (isServer) then {
dayzUpdateVehicle call server_updateObject;
};

View File

@@ -0,0 +1,40 @@
private["_hasKnife","_qty","_item","_text","_string","_type","_loop","_meat","_timer"];
_item = _this select 3;
_hasKnife = "ItemKnife" in items player;
_type = typeOf _item;
_hasHarvested = _item getVariable["meatHarvested",false];
_config = configFile >> "CfgSurvival" >> "Meat" >> _type;
player removeAction s_player_butcher;
s_player_butcher = -1;
if (_hasKnife and !_hasHarvested) then {
//Get Animal Type
_loop = true;
_isListed = isClass (_config);
_text = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
player playActionNow "Medic";
[player,"gut",0,false] call dayz_zombieSpeak;
_item setVariable["meatHarvested",true,true];
_qty = 1;
if (_isListed) then {
_qty = getNumber (_config >> "yield");
};
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
_array = [_item,_qty];
if (local _item) then {
_array spawn local_gutObject;
} else {
dayzGutBody = _array;
publicVariable "dayzGutBody";
};
sleep 6;
_string = format[localize "str_success_gutted_animal",_text,_qty];
cutText [_string, "PLAIN DOWN"];
};

View File

@@ -0,0 +1,17 @@
private["_hasFood","_item","_text","_qty"];
player removeAction s_player_fillfuel;
s_player_fillfuel = -1;
_qty = {_x == "ItemJerrycanEmpty"} count magazines player;
if ("ItemJerrycanEmpty" in magazines player) then {
for "_x" from 1 to _qty do {
player removeMagazine "ItemJerrycanEmpty";
player addMagazine "ItemJerrycan";
};
[player,"refuel",0,false] call dayz_zombieSpeak;
cutText [format[(localize "str_player_09"),_qty], "PLAIN DOWN"];
} else {
cutText [(localize "str_player_10") , "PLAIN DOWN"];
};

View File

@@ -0,0 +1,60 @@
private["_array","_type","_classname","_holder","_config","_isOk","_muzzles","_playerID","_claimedBy","_text"];
_array = _this select 3;
_type = _array select 0;
_classname = _array select 1;
_holder = _array select 2;
_playerID = getPlayerUID player;
_text = getText (configFile >> _type >> _classname >> "displayName");
_holder setVariable["claimed",_playerID,true];
player playActionNow "PutDown";
if (_classname == "MeleeCrowbar") then {
player addMagazine 'crowbar_swing';
} else {
if (_classname == "MeleeHatchet") then {
player addMagazine 'hatchet_swing';
};
};
sleep 0.25;
_claimedBy = _holder getVariable["claimed",0];
if (_claimedBy != _playerID) exitWith {cutText [format[(localize "str_player_beinglooted"),_text] , "PLAIN DOWN"]};
if(_classname isKindOf "Bag_Base_EP1") then {
diag_log("Picked up a bag: " + _classname);
};
_config = (configFile >> _type >> _classname);
_isOk = [player,_config] call BIS_fnc_invAdd;
if (_isOk) then {
deleteVehicle _holder;
/*
if (_classname in ["MeleeHatchet","MeleeCrowbar"]) then {
if (_type == "cfgWeapons") then {
_muzzles = getArray(configFile >> "cfgWeapons" >> _classname >> "muzzles");
//_wtype = ((weapons player) select 0);
if (count _muzzles > 1) then {
player selectWeapon (_muzzles select 0);
} else {
player selectWeapon _classname;
};
};
};
*/
} else {
_holder setVariable["claimed",0,true];
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
if (_classname == "MeleeCrowbar") then {
player removeMagazine 'crowbar_swing';
} else {
if (_classname == "MeleeHatchet") then {
player removeMagazine 'hatchet_swing';
};
};
};

View File

@@ -0,0 +1,9 @@
_array = _this select 3;
_object = _array select 0;
_type = TypeOf(_object);
player playActionNow "Medic";
sleep 8;
player addBackpack format["%1_US_Bag_EP1",_type];
deleteVehicle _object;
r_action = false;
call fnc_usec_medic_removeActions;

View File

@@ -0,0 +1,60 @@
private["_item","_config","_onLadder","_create","_isOk","_config2","_consume"];
_item = _this;
_config = configFile >> "CfgWeapons" >> _item;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
_hastoolweapon = _this in weapons player;
_text = getText (_config >> "displayName");
if (!_hastoolweapon) exitWith {cutText [format[(localize "str_player_30"),_text] , "PLAIN DOWN"]};
call gear_ui_init;
//Add new item
_create = getArray (_config >> "ItemActions" >> "Toolbelt" >> "output") select 0;
_config2 = configFile >> "CfgWeapons" >> _create;
//Remove magazines if needed
if (_item in ["MeleeHatchet","MeleeCrowbar"]) then {
_magType = ([] + getArray (configFile >> "CfgWeapons" >> _item >> "magazines")) select 0;
_meleeNum = ({_x == _magType} count magazines player);
for "_i" from 1 to _meleeNum do {
player removeMagazine _magType;
};
};
_isOk = [player,_config2] call BIS_fnc_invAdd;
if (_isOk) then {
//Remove item
player removeWeapon _item;
//Add magazines if needed
if (_create in ["MeleeHatchet","MeleeCrowbar"]) then {
if (_create == "MeleeCrowbar") then {
player addMagazine 'crowbar_swing';
} else {
player addMagazine 'hatchet_swing';
};
if (_type == "cfgWeapons") then {
_muzzles = getArray(configFile >> "cfgWeapons" >> _create >> "muzzles");
_wtype = ((weapons player) select 0);
if (count _muzzles > 1) then {
player selectWeapon (_muzzles select 0);
} else {
player selectWeapon _wtype;
};
};
};
} else {
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
//Add magazines back
if (_item in ["MeleeHatchet","MeleeCrowbar"]) then {
if (_item == "MeleeCrowbar") then {
player addMagazine 'crowbar_swing';
} else {
player addMagazine 'hatchet_swing';
};
};
};

View File

@@ -0,0 +1,43 @@
private["_location","_isOk","_dir","_classname","_item"];
_location = player modeltoworld [0,1,0];
_location set [2,0];
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_isWater = (surfaceIsWater _location) or dayz_isSwimming;
call gear_ui_init;
if(_isWater) exitWith {cutText [localize "str_player_26", "PLAIN DOWN"];};
if(_onLadder) exitWith {cutText [localize "str_player_21", "PLAIN DOWN"];};
_item = _this;
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
_hasbuilditem = _this in magazines player;
if (!_hasbuilditem) exitWith {cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]};
_dir = getDir player;
player removeMagazine _item;
player playActionNow "Medic";
sleep 1;
[player,"repair",0,false] call dayz_zombieSpeak;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
player allowDamage false;
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
_object setDir _dir;
player reveal _object;
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
publicVariable "dayzPublishObj";
if (isServer) then {
dayzPublishObj call server_publishObj;
};
sleep 2;
player allowDamage true;

View File

@@ -0,0 +1,15 @@
private["_location","_isOk","_dir","_classname"];
private["_item"];
_item = _this;
call gear_ui_init;
if (["forest",dayz_surfaceType] call fnc_inString) then {
_result = [player,"PartWoodPile"] call BIS_fnc_invAdd;
if (_result) then {
cutText [localize "str_player_25", "PLAIN DOWN"];
} else {
cutText [localize "str_player_24", "PLAIN DOWN"];
};
} else {
cutText [localize "str_player_23", "PLAIN DOWN"];
};

View File

@@ -0,0 +1,55 @@
/*
count player magazines with ammo count
value = call player_countmagazines;
return all player magazines with ammo count
*/
private ["_dialog","_control","_magazineArray","_item","_val","_max","_created"];
disableSerialization;
disableUserInput true;
_dialog = findDisplay 106;
_created = false;
if ( isNull _dialog ) then {
startLoadingScreen [""];
createGearDialog [player, "RscDisplayGear"];
_dialog = findDisplay 106;
_created = true;
};
_magazineArray = [];
for "_i" from 109 to 120 do
{
_control = _dialog displayCtrl _i;
_item = gearSlotData _control;
_val = gearSlotAmmoCount _control;
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
if (_item != "") then {
if (_val != _max) then {
_magazineArray set [count _magazineArray,[_item,_val]];
} else {
_magazineArray set [count _magazineArray,_item];
};
};
};
for "_i" from 122 to 129 do
{
_control = _dialog displayCtrl _i;
_item = gearSlotData _control;
_val = gearSlotAmmoCount _control;
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
if (_item != "") then {
if (_val != _max) then {
_magazineArray set [count _magazineArray,[_item,_val]];
} else {
_magazineArray set [count _magazineArray,_item];
};
};
};
if ( _created ) then {
closeDialog 0;
endLoadingScreen;
};
disableUserInput false;
dayz_Magazines=_magazineArray;
_magazineArray

View File

@@ -0,0 +1,45 @@
private["_hasFood","_item","_text","_key","_config","_sfx"];
disableserialization;
call gear_ui_init;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
if (vehicle player != player) exitWith {cutText ["You may not drink while in a vehicle", "PLAIN DOWN"]};
_item = _this;
_hasdrinkitem = _this in magazines player;
_config = configFile >> "CfgMagazines" >> _item;
_text = getText (_config >> "displayName");
_sfx = getText (_config >> "sfx");
if (!_hasdrinkitem) exitWith {cutText [format[(localize "str_player_31"),_text,"drink"] , "PLAIN DOWN"]};
player playActionNow "PutDown";
player removeMagazine _item;
sleep 1;
[player,_sfx,0,false] call dayz_zombieSpeak;
if (_item == "ItemWaterbottle") then {
player addMagazine "ItemWaterbottleUnfilled";
};
player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
/*
_update = player getVariable["updatePlayer",[false,false,false,false,false]];
_update set [4,true];
player setVariable["updatePlayer",_update,true];
*/
_id = [player,20,true,(getPosATL player)] spawn player_alertZombies;
dayz_lastDrink = time;
dayz_thirst = 0;
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1302;
_control ctrlShow true;
cutText [format[(localize "str_player_consumed"),_text], "PLAIN DOWN"];

View File

@@ -0,0 +1,21 @@
private["_item"];
_item = _this;
_config = configFile >> "CfgWeapons" >> _item;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
call gear_ui_init;
_consume = ([] + getArray (_config >> "magazines")) select 0;
_meleeNum = ({_x == _consume} count magazines player);
for "_i" from 1 to _meleeNum do {
player removeMagazine _consume;
};
player removeWeapon _item;
_bag = createVehicle [format["WeaponHolder_%1",_item],getPosATL player,[], 0, "CAN_COLLIDE"];
_bag setdir (getDir player);
player reveal _bag;

View File

@@ -0,0 +1,57 @@
private["_hasFood","_item","_text","_key"];
disableserialization;
call gear_ui_init;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
if (vehicle player != player) exitWith {cutText ["You may not eat while in a vehicle", "PLAIN DOWN"]};
_item = _this;
_hasfoodmag = _this in magazines player;
_config = configFile >> "CfgMagazines" >> _item;
_text = getText (_config >> "displayName");
_regen = getNumber (_config >> "bloodRegen");
if (!_hasfoodmag) exitWith {cutText [format[(localize "str_player_31"),_text,"consume"] , "PLAIN DOWN"]};
player playActionNow "PutDown";
player removeMagazine _item;
sleep 1;
r_player_blood = r_player_blood + _regen;
if (r_player_blood > r_player_bloodTotal) then {
r_player_blood = r_player_bloodTotal;
};
player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
player setVariable["USEC_BloodQty",r_player_blood,true];
player setVariable["medForceUpdate",true];
[player,"eat",0,false] call dayz_zombieSpeak;
/*
_update = player getVariable["updatePlayer",[false,false,false,false,false]];
_update set [3,true];
player setVariable["updatePlayer",_update,true];
*/
dayzPlayerSave = player;
publicVariable "dayzPlayerSave";
if (isServer) then {
dayzPlayerSave call server_updatePlayer;
};
dayz_lastMeal = time;
dayz_hunger = 0;
_id = [player,20,true,(getPosATL player)] spawn player_alertZombies;
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1301;
_control ctrlShow true;
_bloodVal = r_player_blood / r_player_bloodTotal;
if (_bloodVal >= 0.2) then {
_ctrlBlood ctrlShow true;
};
cutText [format[(localize "str_player_consumed"),_text], "PLAIN DOWN"];

View File

@@ -0,0 +1,29 @@
private["_location","_isOk","_dir","_classname"];
_location = player modeltoworld [0,0.3,0];
if ((_location select 2) < 0) then {
_location set [2,0];
};
//_location set [2,0];
_isOk = true; //count (_location isFlatEmpty [0.3,0,0,4,0,false,player]) > 0;
_hasWood = "PartWoodPile" in magazines player;
if (_hasWood) then {
if (_isOk) then {
player removeMagazine "PartWoodPile";
_dir = getDir player;
_classname = "Land_Fire_DZ";
player playActionNow "Medic";
sleep 6;
_fire = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
_fire setDir _dir;
player reveal _fire;
_id = _fire spawn player_fireMonitor;
cutText [localize "str_fireplace_01", "PLAIN DOWN"];
} else {
cutText [localize "str_fireplace_02", "PLAIN DOWN"];
};
} else {
cutText [localize "str_player_22", "PLAIN DOWN"];
};

View File

@@ -0,0 +1,44 @@
private["_item"];
disableSerialization;
_item = _this;
_config = configFile >> "CfgMagazines" >> _item;
_consume = getArray (_config >> "ItemActions" >> "ReloadMag" >> "use");
_create = getArray (_config >> "ItemActions" >> "ReloadMag" >> "output");
_textConsume = getText(configFile >> "CfgMagazines" >> (_consume select 0) >> "displayName");
_textCreate = getText(configFile >> "CfgMagazines" >> (_create select 0) >> "displayName");
//_qtyConsume = getText(configFile >> "CfgMagazines" >> (_consume select 0) >> "count");
//_qtyCreate = getText(configFile >> "CfgMagazines" >> (_create select 0) >> "count");
_amountNeed = count _consume;
_amountHas = {_x == (_consume select 0)} count magazines player;
_amountMake = count _create;
_qty = 0;
if (_amountNeed == 1 and _amountMake == 1) then {
_control = uiNamespace getVariable 'uiControl';
_qty = gearSlotAmmoCount _control;
};
_hasInput = (_amountNeed <= _amountHas);
player playActionNow "PutDown";
if (_hasInput) then {
//Take Items
{
player removeMagazine _x;
} forEach _consume;
sleep 1;
//Give Items
{
if (_qty > 0) then {
player addMagazine [_x,_qty];
} else {
player addMagazine _x;
};
} forEach _create;
cutText [format[(localize "str_player_29"),_amountMake,_textCreate], "PLAIN DOWN"];
} else {
cutText [format[(localize "str_player_28"),_amountNeed,_textConsume], "PLAIN DOWN"];
};

View File

@@ -0,0 +1,28 @@
private["_item"];
_item = _this;
_config = configFile >> "CfgWeapons" >> _item;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
call gear_ui_init;
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
_consume = ([] + getArray (_config >> "magazines")) select 0;
_hastrapitem = _this in magazines player;
if (!_hastrapitem) exitWith {cutText [format[(localize "str_player_31"),_text,"place"] , "PLAIN DOWN"]};
player removeMagazine _item;
_location = getPosATL player;
player playActionNow "PutDown";
sleep 1;
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
_object setDir _dir;
player reveal _object;
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];

View File

@@ -0,0 +1,32 @@
private["_item"];
_item = _this;
call gear_ui_init;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
_hasmeditem = _this in magazines player;
_config = configFile >> "CfgMagazines" >> _item;
_text = getText (_config >> "displayName");
if (!_hasmeditem) exitWith {cutText [format[(localize "str_player_31"),_text,"use"] , "PLAIN DOWN"]};
switch (_item) do {
case "ItemBandage": {
_id = [0,0,0,[player]] execVM "\z\addons\dayz_code\medical\bandage.sqf";
};
case "ItemMorphine": {
_id = [0,0,0,[player]] execVM "\z\addons\dayz_code\medical\morphine.sqf";
};
case "ItemPainkiller": {
_id = [0,0,0,[player]] execVM "\z\addons\dayz_code\medical\painkiller.sqf";
};
case "ItemAntibiotic": {
_id = [0,0,0,[player]] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";
};
case "ItemHeatPack": {
player removeMagazine "ItemHeatPack";
dayz_temperatur = (dayz_temperatur + 5) max dayz_temperaturmax;
cutText [localize "str_player_27", "PLAIN DOWN"];
};
};

View File

@@ -0,0 +1,73 @@
private["_item","_isFemale","_itemNew","_item","_onLadder"];
_item = _this;
call gear_ui_init;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
_hasclothesitem = _this in magazines player;
_config = configFile >> "CfgMagazines" >> _item;
_text = getText (_config >> "displayName");
if (!_hasclothesitem) exitWith {cutText [format[(localize "str_player_31"),_text,"wear"] , "PLAIN DOWN"]};
if (vehicle player != player) exitWith {cutText ["You may not change clothes while in a vehicle", "PLAIN DOWN"]};
_isFemale = ((typeOf player == "SurvivorW2_DZ")||(typeOf player == "BanditW1_DZ"));
if (_isFemale) then {
if (_item != "Skin_Survivor2_DZ") exitWith {cutText ["Currently Female Characters cannot change to this skin. This will change in a future update.", "PLAIN DOWN"]};
};
_myModel = (typeOf player);
_itemNew = "Skin_Survivor2_DZ";
player removeMagazine _item;
_humanity = player getVariable ["humanity",0];
switch (_item) do {
case "Skin_Sniper1_DZ": {
_itemNew = "Skin_" + _myModel;
[dayz_playerUID,dayz_characterID,"Sniper1_DZ"] spawn player_humanityMorph;
};
case "Skin_Camo1_DZ": {
_itemNew = "Skin_" + _myModel;
[dayz_playerUID,dayz_characterID,"Camo1_DZ"] spawn player_humanityMorph;
};
case "Skin_Rocket_DZ": {
_itemNew = "Skin_" + _myModel;
[dayz_playerUID,dayz_characterID,"Rocket_DZ"] spawn player_humanityMorph;
};
case "Skin_Survivor2_DZ": {
_model = "Survivor2_DZ";
if (_isFemale) then {
_model = "SurvivorW2_DZ";
};
if (_humanity < -2000) then {
_model = "Bandit1_DZ";
if (_isFemale) then {
_model = "BanditW1_DZ";
};
};
if (_humanity > 5000) then {
_model = "Survivor3_DZ";
if (_isFemale) then {
_model = "SurvivorW2_DZ";
};
};
if (_model != _myModel) then {
[dayz_playerUID,dayz_characterID,_model] spawn player_humanityMorph;
};
};
case "Skin_Soldier1_DZ": {
_itemNew = "Skin_" + _myModel;
[dayz_playerUID,dayz_characterID,"Soldier1_DZ"] spawn player_humanityMorph;
};
};
_config = configFile >> "CfgMagazines" >> _itemNew;
_isClass = isClass (_config);
if (_isClass) then {
player addMagazine _itemNew;
};
player setVariable ["humanity",_humanity,true];

View File

@@ -0,0 +1,31 @@
private["_vehicle","_curFuel","_newFuel","_timeLeft"];
_vehicle = cursorTarget;
_canSize = getNumber(configFile >> "cfgMagazines" >> "ItemJerrycan" >> "fuelQuantity");
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
_capacity = getNumber(_configVeh >> "fuelCapacity");
_nameType = getText(_configVeh >> "displayName");
_curFuel = ((fuel _vehicle) * _capacity);
_newFuel = (_curFuel + _canSize);
if (_newFuel > _capacity) then {_newFuel = _capacity};
_newFuel = (_newFuel / _capacity);
player removeMagazine "ItemJerrycan";
player addMagazine "ItemJerrycanEmpty";
player playActionNow "Medic";
[player,"refuel",0,false] call dayz_zombieSpeak;
_id = [player,20,true,(getPosATL player)] spawn player_alertZombies;
sleep 6;
dayzSetFuel = [_vehicle,_newFuel];
dayzSetFuel spawn local_sefFuel;
publicVariable "dayzSetFuel";
cutText [format[localize "str_player_05",_nameType,_canSize], "PLAIN DOWN"];
sleep 1;
call fnc_usec_medic_removeActions;
r_action = false;

View File

@@ -0,0 +1,22 @@
/*
delete object from db
parameters: _obj
*/
private["_obj","_objectID","_objectUID"];
_obj = _this select 3;
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
player playActionNow "Medic";
sleep 1;
[player,"repair",0,false] call dayz_zombieSpeak;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
dayzDeleteObj = [_objectID,_objectUID];
publicVariable "dayzDeleteObj";
if (isServer) then {
dayzDeleteObj call local_deleteObj;
};
deleteVehicle _obj;

View File

@@ -0,0 +1,75 @@
private["_vehicle","_part","_hitpoint","_type","_selection","_array"];
_id = _this select 2;
_array = _this select 3;
_vehicle = _array select 0;
_part = _array select 1;
_hitpoint = _array select 2;
_type = typeOf _vehicle;
//
_hasToolbox = "ItemToolbox" in items player;
_section = _part in magazines player;
// moving this here because we need to know which part needed if we don't have it
_nameType = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
_namePart = getText(configFile >> "cfgMagazines" >> _part >> "displayName");
if (_section and _hasToolbox) then {
_damage = [_vehicle,_hitpoint] call object_getHit;
_vehicle removeAction _id;
//dont waste loot on undamaged parts
if (_damage > 0) then {
player removeMagazine _part;
//Fix the part
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
dayzSetFix = [_vehicle,_selection,0];
publicVariable "dayzSetFix";
if (local _vehicle) then {
dayzSetFix call object_setFixServer;
};
player playActionNow "Medic";
sleep 1;
[player,"repair",0,false] call dayz_zombieSpeak;
null = [player,50,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
_vehicle setvelocity [0,0,1];
//Success!
cutText [format["You have successfully attached %1 to the %2",_namePart,_nameType], "PLAIN DOWN"];
};
} else {
cutText [format["You need %1 to repair this",_namePart], "PLAIN DOWN"];
};
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
dayz_myCursorTarget = objNull;
//check if repaired fully
_hitpoints = _vehicle call vehicle_getHitpoints;
_allFixed = true;
{
_damage = [_vehicle,_x] call object_getHit;
if (_damage > 0) exitWith {
_allFixed = false;
};
} forEach _hitpoints;
//update if repaired
if (_allFixed) then {
_vehicle setDamage 0;
dayzUpdateVehicle = [_vehicle,"repair"];
if (isServer) then {
if (allowConnection) then {
dayzUpdateVehicle call server_updateObject;
};
} else {
publicVariable "dayzUpdateVehicle";
};
};

View File

@@ -0,0 +1,8 @@
private["_body","_name","_method","_methodStr"];
_body = _this select 3;
_name = _body getVariable["bodyName","unknown"];
_method = _body getVariable["deathType","unknown"];
_methodStr = localize format ["str_death_%1",_method];
cutText [format[(localize "str_player_studybody"),_name,_methodStr], "PLAIN DOWN"];

View File

@@ -0,0 +1,3 @@
private["_obj","_bag","_pos"];
_obj = _this select 3;
_obj spawn player_packTent;

View File

@@ -0,0 +1,64 @@
private["_position","_tent","_location","_isOk","_backpack","_tentType","_trg","_key"];
//check if can pitch here
call gear_ui_init;
_item = _this;
_hastentitem = _this in magazines player;
_location = player modeltoworld [0,2.5,0];
_location set [2,0];
_building = nearestObject [(vehicle player), "HouseBase"];
_isOk = [(vehicle player),_building] call fnc_isInsideBuilding;
//_isOk = true;
diag_log ("Pitch Tent: " + str(_isok) );
_config = configFile >> "CfgMagazines" >> _item;
_text = getText (_config >> "displayName");
if (!_hastentitem) exitWith {cutText [format[(localize "str_player_31"),_text,"pitch"] , "PLAIN DOWN"]};
//allowed
if (["forest",dayz_surfaceType] call fnc_inString) then { _isOk = false; diag_log ("surface forest"); };
//if (["grass",dayz_surfaceType] call fnc_inString) then { _isOk = false; diag_log ("surface grass"); };
//blocked
if (["concrete",dayz_surfaceType] call fnc_inString) then { _isOk = true; diag_log ("surface concrete"); };
//if (["wood",dayz_surfaceType] call fnc_inString) then { _isOk = true; diag_log ("surface concrete"); };
diag_log ("Pitch Tent Surface: " + str(_isok) );
if (!_isOk) then {
//remove tentbag
player removeMagazine _item;
_dir = round(direction player);
//wait a bit
player playActionNow "Medic";
sleep 1;
[player,"tentunpack",0,false] call dayz_zombieSpeak;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
//place tent (local)
_tent = createVehicle ["TentStorage", _location, [], 0, "CAN_COLLIDE"];
_tent setdir _dir;
_tent setpos _location;
player reveal _tent;
_location = getPosATL _tent;
_tent setVariable ["characterID",dayz_characterID,true];
//player setVariable ["tentUpdate",["Land_A_tent",_dir,_location,[dayz_tentWeapons,dayz_tentMagazines,dayz_tentBackpacks]],true];
dayzPublishObj = [dayz_characterID,_tent,[_dir,_location],"TentStorage"];
publicVariable "dayzPublishObj";
if (isServer) then {
dayzPublishObj call server_publishObj;
};
cutText [localize "str_success_tent_pitch", "PLAIN DOWN"];
} else {
cutText [localize "str_fail_tent_pitch", "PLAIN DOWN"];
};

View File

@@ -0,0 +1,13 @@
_array = _this select 3;
_location = player modeltoworld [0,1,0];
_dir = getDir player;
_classname = _array select 0;
removeBackpack player;
player playActionNow "Medic";
sleep 8;
player removeAction r_player_action_bag;
r_action_bag = false;
_weapon = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
_weapon setDir _dir;
//_weapon setpos _location;
player reveal _weapon;

View File

@@ -0,0 +1,65 @@
private["_hasFood","_item","_text","_qty"];
call gear_ui_init;
_playerPos = getPosATL player;
_canFill = count nearestObjects [_playerPos, ["Land_pumpa","Land_water_tank","Land_Misc_Well_L_EP1","Land_Misc_Well_C_EP1"], 4] > 0;
_isPond = false;
_isWell = false;
_pondPos = [];
_objectsWell = [];
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
_hasbottleitem = _this in magazines player;
_config = configFile >> "CfgMagazines" >> _item;
_text = getText (_config >> "displayName");
if (!_hasbottleitem) exitWith {cutText [format[(localize "str_player_31"),_text,"fill"] , "PLAIN DOWN"]};
if (!dayz_isSwimming) then {
player playActionNow "PutDown";
};
if (!_canFill) then {
_objectsWell = nearestObjects [_playerPos, [], 4];
{
//Check for Well
_isWell = ["_well",str(_x),false] call fnc_inString;
if (_isWell) then {_canFill = true};
} forEach _objectsWell;
};
if (!_canFill) then {
_objectsPond = nearestObjects [_playerPos, [], 50];
{
//Check for pond
_isPond = ["pond",str(_x),false] call fnc_inString;
if (_isPond) then {
_pondPos = (_x worldToModel _playerPos) select 2;
if (_pondPos < 0) then {
_canFill = true;
};
};
} forEach _objectsPond;
};
if (_canFill) then {
_qty = {_x == "ItemWaterbottleUnfilled"} count magazines player;
if ("ItemWaterbottleUnfilled" in magazines player) then {
for "_x" from 1 to _qty do {
player removeMagazine "ItemWaterbottleUnfilled";
player addMagazine "ItemWaterbottle";
};
[player,"fillwater",0,false] call dayz_zombieSpeak;
_id = [player,10,true,(getPosATL player)] spawn player_alertZombies;
cutText [format[(localize "str_player_01"),_qty], "PLAIN DOWN"];
} else {
cutText [(localize "str_player_02") , "PLAIN DOWN"];
};
} else {
cutText [(localize "str_player_20") , "PLAIN DOWN"];
};

View File

@@ -0,0 +1,96 @@
#define TEast 0
#define TWest 1
#define TGuerrila 2
#define TCivilian 3
#define TSideUnknown 4
#define TEnemy 5
#define TFriendly 6
#define TLogic 7
#define true 1
#define false 0
#define VSoft 0
#define VArmor 1
#define VAir 2
// type scope
#define private 0
#define protected 1
#define public 2
#define CanSeeRadar 1
#define CanSeeEye 2
#define CanSeeOptics 4
#define CanSeeEar 8
#define CanSeeCompass 16
#define CanSeeRadarC CanSeeRadar+CanSeeCompass
#define CanSeeAll 31
#define ReadAndWrite 0 //! any modifications enabled
#define ReadAndCreate 1 //! only adding new class members is allowed
#define ReadOnly 2 //! no modifications enabled
#define ReadOnlyVerified 3 //! no modifications enabled, CRC test applied
#define LockNo 0
#define LockCadet 1
#define LockYes 2
#define WeaponNoSlot 0 // dummy weapons
#define WeaponSlotPrimary 1 // primary weapons
#define WeaponSlotSecondary 4 // secondary weapons
#define WeaponSlotHandGun 2 // HandGun
#define WeaponSlotHandGunItem 16 // HandGun magazines
#define WeaponSlotItem 256 // items
#define WeaponSlotBinocular 4096 // binocular
#define WeaponHardMounted 65536
#define WeaponSlotInventory 131072 // inventory items
#define SPEED_STATIC 1e10
#define NEVER_DESTROY 1000 // for MP - destroying dead bodies
#define TracerEColor 0.2,0.8,0.1
#define TracerWColor 0.8,0.5,0.1
#define TracerGColor 0.7,0.7,0.5
#define TracerNColor 0,0,0 // used for sniper / silenced rifles
#define TracerEColorF {TracerEColor,0.040}
#define TracerWColorF {TracerWColor,0.040}
#define TracerGColorF {TracerGColor,0.040}
#define TracerNColorF {TracerNColor,0.005}
#define TracerSEColorF {TracerEColor,0.25}
#define TracerSWColorF {TracerWColor,0.25}
#define TRACER_W_ALWAYS tracerColor[]=TracerWColorF;tracerColorR[]=TracerWColorF
#define TRACER_W_OPTIONAL tracerColor[]=TracerWColorF;tracerColorR[]=TracerNColorF
#define TRACER_W_STRONG tracerColor[]=TracerSWColorF;tracerColorR[]=TracerSWColorF
#define TRACER_E_ALWAYS tracerColor[]=TracerEColorF;tracerColorR[]=TracerEColorF
#define TRACER_E_OPTIONAL tracerColor[]=TracerEColorF;tracerColorR[]=TracerNColorF
#define TRACER_E_STRONG tracerColor[]=TracerSEColorF;tracerColorR[]=TracerSEColorF
#define TRACER_G_ALWAYS tracerColor[]=TracerGColorF;tracerColorR[]=TracerGColorF
#define TRACER_G_OPTIONAL tracerColor[]=TracerGColorF;tracerColorR[]=TracerNColorF
#define TRACER_N_ALWAYS tracerColor[]=TracerNColorF;tracerColorR[]=TracerNColorF
#define LockNo 0
#define LockCadet 1
#define LockYes 2
enum
{
DestructNo,
DestructBuilding,
DestructEngine,
DestructTree,
DestructTent,
DestructMan,
DestructDefault,
DestructWreck
};
//#include "\ca\BasicDefines.hpp"

263
dayz_code/cfgAmmo.hpp Normal file
View File

@@ -0,0 +1,263 @@
class CfgAmmo {
delete MissileCore;
delete BombCore;
delete LaserBombCore;
delete RocketCore;
delete ArtilleryRocketCore;
//delete BulletCore;
//delete ShotgunCore;
delete ShellCore;
/*
delete GrenadeCore;
delete TimeBombCore;
delete PipeBombCore;
delete MineCore;
delete FlareCore;
delete SmokeShellCore;
delete FakeAmmo;
delete BulletBase;
delete FlareBase;
delete B_9x18_Ball;
delete B_9x18_SD;
delete B_9x19_Ball;
delete B_9x19_SD;
delete B_45ACP_Ball;
delete B_545x39_Ball;
delete B_545x39_SD;
delete B_556x45_Ball;
delete B_556x45_SD;
delete B_9x39_SP5;
delete B_12Gauge_74Slug;
delete B_762x39_Ball;
delete B_762x51_Ball;
delete B_762x51_3RndBurst;
delete B_762x51_noTracer;
delete B_762x54_Ball;
delete B_762x54_noTracer;
delete B_77x56_Ball;
delete B_127x99_Ball;
delete B_127x99_Ball_noTracer;
delete B_127x107_Ball;
delete B_127x108_Ball;
delete B_127x108_APHE;
delete B_145x115_AP;
*/
delete B_20mm_AP;
delete B_20mm_AA;
delete B_23mm_AA;
delete B_23mm_HE;
delete B_23mm_AP;
delete B_23mm_APHE;
delete B_25mm_HE;
delete B_25mm_HEI;
delete B_25mm_APDS;
delete B_30mm_AP;
delete B_30mmA10_AP;
delete B_30mm_HE;
delete B_30mm_AA;
/*
delete GrenadeBase;
delete G_30mm_HE;
delete G_40mm_HE;
delete F_40mm_White;
delete F_40mm_Green;
delete F_40mm_Red;
delete F_40mm_Yellow;
*/
delete ShellBase;
delete Sh_105_HE;
delete Sh_100_HE;
delete Sh_120_HE;
delete Sh_120_SABOT;
delete Sh_122_HE;
delete Sh_125_HE;
delete Sh_125_SABOT;
delete Sh_85_HE;
delete Sh_85_AP;
//delete RocketBase;
delete G_Camel_HE;
delete R_Hydra_HE;
delete R_57mm_HE;
delete R_80mm_HE;
delete R_S8T_AT;
//delete R_M136_AT;
delete R_RPG18_AT;
delete R_PG7V_AT;
delete R_PG7VL_AT;
delete R_PG7VR_AT;
delete R_OG7_AT;
delete R_PG9_AT;
delete R_OG9_HE;
delete R_SMAW_HEDP;
delete R_SMAW_HEAA;
delete R_GRAD;
delete R_MLRS;
delete MissileBase;
delete M_Javelin_AT;
delete M_Stinger_AA;
delete M_Sidewinder_AA;
delete M_Sidewinder_AA_F35;
delete M_Strela_AA;
delete M_Igla_AA;
delete M_AT5_AT;
delete M_AT13_AT;
delete M_TOW_AT;
delete M_TOW2_AT;
delete M_AT10_AT;
delete M_AT11_AT;
delete M_Hellfire_AT;
delete M_Vikhr_AT;
delete M_Maverick_AT;
delete M_R73_AA;
delete M_Ch29_AT;
delete M_AT2_AT;
delete M_AT6_AT;
delete M_AT9_AT;
delete M_9M311_AA;
delete Bo_GBU12_LGB;
delete Bo_GBU12_LGB_F35;
delete Bo_FAB_250;
delete Bo_Mk82;
/*
delete Grenade;
delete GrenadeHand;
delete GrenadeHandTimedWest;
delete GrenadeHandTimedEast;
delete GrenadeHand_stone;
delete SmokeShell;
delete G_40mm_Smoke;
delete G_40mm_SmokeRed;
delete G_40mm_SmokeGreen;
delete G_40mm_SmokeYellow;
delete SmokeShellRed;
delete SmokeShellGreen;
delete SmokeShellYellow;
delete SmokeShellPurple;
delete SmokeShellBlue;
delete SmokeShellOrange;
delete SmokeShellVehicle;
delete FlareCountermeasure;
delete TimeBomb;
delete PipeBomb;
delete Mine;
delete MineE;
delete FuelExplosion;
delete Laserbeam;
delete HelicopterExploSmall;
delete HelicopterExploBig;
delete SmallSecondary;
delete SmokeLauncherAmmo;
delete FlareLauncherAmmo;
delete ThrownObjects;
delete Melee;
delete Hatchet_Swing_Ammo;
delete Crowbar_Swing_Ammo;
delete SodaCan;
delete TinCan;
delete JackDaniels;
delete LitObject;
delete RoadFlare;
delete ChemLight;
delete ChemGreen;
delete ChemRed;
delete ChemBlue;
delete Bolt;
delete BoltSteel;
delete B_1866_Slug;
*/
delete B_30x113mm_M789_HEDP;
delete ARTY_Sh_Base;
delete ARTY_Flare_Small;
delete ARTY_Flare_Medium;
delete ARTY_Sh_Base_NET;
delete ARTY_Sh_105_NET;
delete ARTY_Sh_105_NET_NOFX;
delete ARTY_Sh_105_LASNET;
delete ARTY_Sh_122_NET;
delete ARTY_Sh_122_NET_NOFX;
delete ARTY_Sh_122_LASNET;
delete ARTY_Sh_81_NET;
delete ARTY_Sh_82_NET;
delete ARTY_Sh_120_NET;
delete ARTY_Sh_227_NET;
delete ARTY_Sh_105_HE;
delete ARTY_Sh_105_WP;
delete ARTY_Sh_105_SADARM;
delete ARTY_Sh_105_LASER;
delete ARTY_Sh_105_ILLUM;
delete ARTY_Sh_105_SMOKE;
delete ARTY_Sh_81_HE;
delete ARTY_Sh_81_WP;
delete ARTY_Sh_81_ILLUM;
delete ARTY_R_227mm_HE_Rocket;
delete ARTY_R_227mm_HE;
delete ARTY_Sh_122_HE;
delete ARTY_Sh_122_WP;
delete ARTY_Sh_122_SADARM;
delete ARTY_Sh_122_LASER;
delete ARTY_Sh_122_ILLUM;
delete ARTY_Sh_122_SMOKE;
delete ARTY_SADARM_PROJO;
delete ARTY_SADARM_NET;
delete ARTY_SADARM_BURST;
delete ARTY_SmokeShellWhite;
delete ARTY_Sh_82_HE;
delete ARTY_Sh_82_WP;
delete ARTY_Sh_82_ILLUM;
delete ARTY_R_120mm_HE_Rocket;
delete ARTY_R_120mm_HE;
delete Warfare82mmMortar;
delete B_86x70_Ball_noTracer;
delete B_127x99_Ball_noTracer_BAF;
delete M_NLAW_AT;
delete Sh_40_HE;
delete Sh_40_SABOT;
delete M_CRV7_AT;
delete M_CRV7_HEPD;
delete M_CRV7_FAT;
delete BAF_ied_v1;
delete BAF_ied_v2;
delete BAF_ied_v3;
delete BAF_ied_v4;
delete B_765x17_Ball;
delete B_762x51_SB_SCAR;
delete Sh_100_HEAT;
delete Sh_105_HESH;
delete Sh_105_APDS;
delete R_MEEWS_HEDP;
delete R_MEEWS_HEAT;
//delete IRStrobeBase;
//delete IRStrobe;
//delete IR_Strobe_Marker;
//delete B_45ACP_noCartridge_Ball;
delete CMflareAmmo;
delete CMflare_Chaff_Ammo;
delete ARTY_Sh_120_HE;
delete Sh_81_HE;
delete Sh_81_WP;
delete Sh_81_ILLUM;
delete Sh_82_HE;
delete Sh_82_WP;
delete Sh_82_ILLUM;
delete Sh_122_WP;
delete Sh_122_SADARM;
delete Sh_122_LASER;
delete Sh_122_ILLUM;
delete Sh_122_SMOKE;
delete Sh_105_WP;
delete Sh_105_SADARM;
delete Sh_105_LASER;
delete Sh_105_ILLUM;
delete Sh_105_SMOKE;
delete 120mmHE_M120;
//delete B_303_Ball;
delete M_47_AT_EP1;
delete PMC_ied_v1;
delete PMC_ied_v2;
delete PMC_ied_v3;
delete PMC_ied_v4;
//delete B_12Gauge_Pellets;
delete G_30mm_HE_heli;
delete B_19mm_HE;
delete B_556x45_Ball_airLock;
};

288
dayz_code/cfgLoot.hpp Normal file
View File

@@ -0,0 +1,288 @@
class CfgLoot {
trash[] = {
{
"TrashTinCan",
"TrashJackDaniels",
"ItemSodaEmpty"
},
{
1,
0.1,
0.5
}
};
civilian[] = {
{
"TrashTinCan",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"8Rnd_9x18_Makarov",
"7Rnd_45ACP_1911",
"2Rnd_shotgun_74Slug",
"2Rnd_shotgun_74Pellets",
"ItemBandage",
"ItemPainkiller",
"FoodBioMeat"
},
{
0.09,
0.09,
0.09,
0.12,
0.09,
0.05,
0.05,
0.05,
0.05,
0.07,
0.05,
0.05,
0.05,
0.06,
0.06,
0.01
}
};
food[] = {
{
"TrashTinCan",
"TrashJackDaniels",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"ItemBandage"
},
{
0.13,
0.13,
0.13,
0.09,
0.13,
0.09,
0.09,
0.09,
0.09,
0.04
}
};
generic[] = {
{
"TrashTinCan",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"TrashJackDaniels",
"FoodCanBakedBeans",
"FoodCanSardines",
"FoodCanFrankBeans",
"FoodCanPasta",
"ItemWaterbottleUnfilled",
"ItemWaterbottle",
"ItemBandage",
"7Rnd_45ACP_1911",
"5x_22_LR_17_HMR",
"10x_303",
"6Rnd_45ACP",
"2Rnd_shotgun_74Slug",
"2Rnd_shotgun_74Pellets",
"8Rnd_9x18_Makarov",
"15Rnd_W1866_Slug",
"BoltSteel",
"HandRoadFlare",
"ItemPainkiller",
"HandChemGreen",
"HandChemBlue",
"HandChemRed",
"ItemHeatPack"
},
{
0.06,
0.06,
0.06,
0.04,
0.04,
0.01,
0.01,
0.01,
0.01,
0.01,
0.01,
0.11,
0.03,
0.01,
0.04,
0.04,
0.05,
0.05,
0.09,
0.02,
0.04,
0.07,
0.02,
0.01,
0.03,
0.03,
0.04
}
};
medical[] = {
{
"ItemBandage",
"ItemPainkiller",
"ItemMorphine",
"ItemEpinephrine",
"ItemHeatPack"
},
{
1,
0.5,
0.5,
0.2,
0.1
}
};
hospital[] = {
{
"ItemBandage",
"ItemPainkiller",
"ItemMorphine",
"ItemEpinephrine",
"ItemBloodbag",
"ItemAntibiotic"
},
{
0.43,
0.17,
0.13,
0.09,
0.17,
0.02
}
};
military[] = {
{
"TrashTinCan",
"ItemSodaEmpty",
"ItemSodaCoke",
"ItemSodaPepsi",
"ItemBandage",
"ItemPainkiller",
"ItemMorphine",
"30Rnd_556x45_Stanag",
"20Rnd_762x51_DMR",
"17Rnd_9x19_glock17",
"15Rnd_9x19_M9SD",
"15Rnd_9x19_M9",
"30Rnd_762x39_AK47",
"30Rnd_545x39_AK",
"5Rnd_762x51_M24",
"10Rnd_127x99_m107",
"8Rnd_B_Beneli_74Slug",
"1Rnd_HE_M203",
"FlareWhite_M203",
"FlareGreen_M203",
"1Rnd_Smoke_M203",
"200Rnd_556x45_M249",
"HandGrenade_west",
"SmokeShell",
"SmokeShellRed",
"SmokeShellGreen",
"8Rnd_B_Beneli_Pellets",
"30Rnd_556x45_StanagSD",
"30Rnd_9x19_MP5",
"30Rnd_9x19_MP5SD",
"100Rnd_762x51_M240",
"HandChemGreen",
"HandChemBlue",
"HandChemRed",
"ItemHeatPack"
},
{
0.18,
0.09,
0.01,
0.01,
0.04,
0.04,
0.01,
0.04,
0.04,
0.05,
0.01,
0.02,
0.04,
0.04,
0.01,
0.01,
0.04,
0.01,
0.01,
0.01,
0.01,
0.01,
0.01,
0.04,
0.02,
0.02,
0.04,
0.01,
0.02,
0.01,
0.01,
0.02,
0.02,
0.02,
0.04
};
};
policeman[] = {
{
"ItemBandage",
"7Rnd_45ACP_1911",
"6Rnd_45ACP",
"15Rnd_W1866_Slug",
"8Rnd_B_Beneli_74Slug",
"HandRoadFlare"
},
{
1,
0.8,
0.3,
0.3,
0.5,
0.3
}
};
hunter[] = {
{
"ItemBandage",
"5x_22_LR_17_HMR",
"7Rnd_45ACP_1911",
"10x_303",
"ItemWaterbottleUnfilled",
"BoltSteel",
"ItemHeatPack",
"TrapBear"
},
{
1,
0.5,
0.2,
0.5,
0.2,
1,
0.2,
0.01
}
};
};

641
dayz_code/cfgMoves.hpp Normal file
View File

@@ -0,0 +1,641 @@
class CfgMovesAnimalsBase {
class ManActions;
class StandBase;
class DefaultDie;
class BlendAnims;
};
class CfgMovesDogBase
{
class Default
{
actions = "";
access = 3;
file = "";
looped = 1;
speed = 0.5;
disableWeapons = 1;
enableOptics = 0;
disableWeaponsLong = 1;
showWeaponAim = 0;
enableMissile = 0;
enableBinocular = 0;
showItemInHand = 0;
showItemInRightHand = 0;
showHandGun = 0;
onLandBeg = 0;
onLandEnd = 0;
onLadder = 0;
canPullTrigger = 1;
duty = -0.51;
predictSpeedCoef = 1;
visibleSize = 1;
aimPrecision = 1;
relSpeedMin = 1;
relSpeedMax = 1;
soundEnabled = 0;
controlHead = 0;
headBobMode = 0;
headBobStrength = 0;
soundOverride = "";
soundEdge[] = {0.5,1};
terminal = 0;
limitGunMovement = 1;
variantsPlayer[] = {};
variantsAI[] = {""};
equivalentTo = "";
connectAs = "";
variantAfter[] = {5,10,20};
connectFrom[] = {};
connectTo[] = {};
interpolateWith[] = {};
interpolateTo[] = {};
interpolateFrom[] = {};
aiming = "aimingNo";
leaning = "aimingNo";
untiltWeapon = "aimingNo";
aimingBody = "aimingUpDefault";
legs = "legsNo";
head = "headDefault";
leaningFactorBeg = 0;
leaningFactorEnd = 0;
leaningFactorZeroPoint = -1;
leaningCorrectionAngleBeg = 0;
leaningCorrectionAngleEnd = 0;
interpolationSpeed = 6;
interpolationRestart = 0;
collisionShape = "ca\animals2\data\geom\basicColide.p3d";
hasCollShapeSafe = 0;
collisionShapeSafe = "";
boundingSphere = 1;
enableDirectControl = 1;
enableAutoActions = 0;
leftHandIKBeg = 0;
leftHandIKEnd = 0;
rightHandIKBeg = 0;
rightHandIKEnd = 0;
weaponIK = 0;
preload = 0;
walkcycles = 1;
forceAim = 0;
rightHandIKCurve[] = {};
leftHandIKCurve[] = {};
};
class StandBase: Default
{
aiming = "aimingDefault";
disableWeapons = 1;
leaningFactorBeg = 1;
leaningFactorEnd = 1;
};
class DefaultDie: Default
{
aiming = "aimingNo";
legs = "legsNo";
head = "headNo";
disableWeapons = 1;
interpolationRestart = 1;
soundOverride = "fallbody";
soundEdge[] = {0.45};
soundEnabled = 0;
};
class ManActions
{
Stop = "";
StopRelaxed = "";
TurnL = "";
TurnR = "";
TurnLRelaxed = "";
TurnRRelaxed = "";
Default = "";
JumpOff = "";
ReloadMagazine = "";
ReloadMGun = "";
ReloadAT = "";
ReloadMortar = "";
ThrowGrenade = "";
WalkF = "";
WalkLF = "";
WalkRF = "";
WalkL = "";
WalkR = "";
WalkLB = "";
WalkRB = "";
WalkB = "";
SlowF = "";
SlowLF = "";
SlowRF = "";
SlowL = "";
SlowR = "";
SlowLB = "";
SlowRB = "";
SlowB = "";
FastF = "";
FastLF = "";
FastRF = "";
FastL = "";
FastR = "";
FastLB = "";
FastRB = "";
FastB = "";
EvasiveForward = "";
EvasiveLeft = "";
EvasiveRight = "";
EvasiveBack = "";
StartSwim = "";
StopSwim = "";
Down = "";
Up = "";
PlayerStand = "";
PlayerCrouch = "";
PlayerProne = "";
Lying = "";
Stand = "";
Combat = "";
Crouch = "";
CanNotMove = "";
Civil = "";
CivilLying = "";
FireNotPossible = "";
Die = "";
WeaponOn = "";
WeaponOff = "";
StrokeFist = "";
StrokeGun = "";
SitDown = "";
Salute = "";
BinocOn = "";
BinocOff = "";
PutDown = "";
PutDownEnd = "";
Medic = "";
Treated = "";
LadderOnDown = "";
LadderOnUp = "";
LadderOff = "";
LadderOffTop = "";
LadderOffBottom = "";
GetInLow = "";
GetInMedium = "";
GetInHigh = "";
GetOutLow = "";
GetOutMedium = "";
GetOutHigh = "";
TakeFlag = "";
HandGunOn = "";
LookAround = "";
Eat = "";
StopEat = "";
Rest = "";
StopRest = "";
GestureBark = " ";
GestureIdle1 = " ";
GestureIdle2 = " ";
GestureSniff = " ";
GestureHeadL = " ";
GestureHeadR = " ";
};
class BlendAnims
{
aimingDefault[] = {};
untiltWeaponDefault[] = {};
legsDefault[] = {};
headDefault[] = {};
aimingNo[] = {};
legsNo[] = {};
headNo[] = {};
aimingUpDefault[] = {};
};
collisionVertexPattern[] = {"1a","2a","3a","4a","5a","6a","7a","8a","9a","10a","11a","12a","13a","14a","15a","16a","17a","18a","19a","20a","21a","22a","23a","24a","25a","26a","27a","28a","29a","30a","31a","32a","33a","34a"};
collisionGeomCompPattern[] = {1};
};
class CfgMovesDogDZ: CfgMovesDogBase
{
primaryActionMaps[] = {"DogActions","NoActions"};
skeletonName = "DogSkeleton";
gestures = "CfgGesturesDogDZ";
class States
{
class Dog_Stop: StandBase
{
actions = "DogActions";
duty = -1;
file = "\CA\animals2\dogs\data\Anim\dogStop";
//variantsAI[] = {"Dog_Stop",1};
//variantAfter[] = {0,2,3};
speed = 1e+010;
relSpeedMin = 0.7;
relSpeedMax = 1.1;
looped = 1;
//collisionShape = "Ca\animals2\Dogs\Dog_CollShape.p3d";
ConnectTo[] = {"Dog_TurnR",0.1,"Dog_StopV2",0.1,"Dog_StopV1",0.1,"Dog_TurnL",0.1,"Dog_Sprint",0.02,"Dog_Run",0.02,"Dog_Walk",0.2};
InterpolateTo[] = {"Dog_TurnR",0.1,"Dog_Die",0.02,"Dog_TurnL",0.1,"Dog_Sprint",0.02,"Dog_Run",0.02,"Dog_Walk",0.2};
};
class Dog_TurnL: Dog_Stop
{
file = "\CA\animals2\Dogs\data\anim\dog_rotateL.rtm";
speed = 1;
ConnectTo[] = {"Dog_Stop",0.1};
InterpolateTo[] = {"Dog_Stop",0.1};
};
class Dog_TurnR: Dog_TurnL
{
file = "\CA\animals2\Dogs\data\anim\dog_rotateR.rtm";
ConnectTo[] = {"Dog_Stop",0.1};
InterpolateTo[] = {"Dog_Stop",0.1};
};
class Dog_StopV1: Dog_Stop
{
file = "\CA\animals2\dogs\data\Anim\dogIDLE";
speed = 2.14;
variantAfter[] = {5,7,10};
looped = 0;
ConnectTo[] = {"Dog_Stop",0.1};
InterpolateTo[] = {"Dog_Die",0.02};
};
class Dog_StopV2: Dog_Stop
{
file = "\CA\animals2\dogs\data\Anim\dogBark";
speed = 1;
variantAfter[] = {1,1,1};
looped = 0;
ConnectTo[] = {"Dog_Stop",0.1};
InterpolateTo[] = {"Dog_Die",0.02};
};
class Dog_Attack: Dog_Stop
{
file = "\CA\animals2\dogs\data\Anim\dogAttack";
speed = 1;
variantAfter[] = {1,1,1};
looped = 0;
ConnectTo[] = {"Dog_Stop",0.1};
InterpolateTo[] = {"Dog_Die",0.02};
};
class Dog_Sniff: Dog_Stop
{
file = "\dayz_anim\dog\dogGestureSniff";
speed = 0.3;
mask = "frontBody";
variantAfter[] = {1,1,1};
looped = 0;
ConnectTo[] = {"Dog_Stop",0.1};
InterpolateTo[] = {"Dog_Die",0.02};
};
class Dog_SitDown: Dog_Stop
{
actions = "DogSit";
file = "\CA\animals2\dogs\data\Anim\dogSit1In";
speed = 1.43;
variantAfter[] = {1,1,1};
looped = 0;
relSpeedMin = 0.996672;
relSpeedMax = 0.996672;
ConnectTo[] = {};
InterpolateTo[] = {"Dog_Die",0.02};
};
class Dog_LieDown: Dog_Stop
{
actions = "DogSit";
file = "\dayz_anim\dog\dogStandDown";
speed = 1.428571;
variantAfter[] = {1,1,1};
looped = 0;
relSpeedMin = 0.996672;
relSpeedMax = 0.996672;
ConnectTo[] = {};
InterpolateTo[] = {"Dog_Die",0.02};
};
class Dog_GetUp: Dog_Stop
{
actions = "DogSit";
file = "\dayz_anim\dog\dogDownStand";
speed = 1.428571;
variantAfter[] = {1,1,1};
looped = 0;
relSpeedMin = 0.996672;
relSpeedMax = 0.996672;
ConnectTo[] = {"Dog_Stop",0.1,"Dog_Run",0.1,"Dog_Walk",0.1,"Dog_Sprint",0.1};
InterpolateTo[] = {"Dog_Die",0.02,"Dog_Run",0.1,"Dog_Walk",0.1,"Dog_Sprint",0.1};
};
class Dog_Siting: Dog_Stop
{
actions = "DogSit";
file = "\CA\animals2\dogs\data\Anim\dogSit2Idle";
speed = 1.58;
variantAfter[] = {1,1,1};
looped = 1;
ConnectTo[] = {};
InterpolateTo[] = {"Dog_Die",0.02};
};
class Dog_SitUp: Dog_Stop
{
actions = "DogSit";
file = "\CA\animals2\dogs\data\Anim\dogSit3Out";
speed = 1.08;
variantAfter[] = {1,1,1};
looped = 0;
relSpeedMin = 0.996672;
relSpeedMax = 0.996672;
ConnectTo[] = {"Dog_Stop",0.1,"Dog_Run",0.1,"Dog_Walk",0.1,"Dog_Sprint",0.1};
InterpolateTo[] = {"Dog_Die",0.02,"Dog_Run",0.1,"Dog_Walk",0.1,"Dog_Sprint",0.1};
};
class Dog_Sprint: Dog_Stop
{
actions = "DogSprint";
file = "\CA\animals2\dogs\data\Anim\dogSprint";
duty = 0.5;
speed = 4.5;
ConnectTo[] = {"Dog_Stop",0.02,"Dog_Run",0.02,"Dog_Walk",0.02};
InterpolateTo[] = {"Dog_Die",0.02,"Dog_Stop",0.02,"Dog_Run",0.02,"Dog_Walk",0.02};
};
class Dog_Run: Dog_Stop
{
file = "\CA\animals2\dogs\data\Anim\dogRun";
duty = -0.5;
speed = 1.8;
ConnectTo[] = {"Dog_Stop",0.02,"Dog_Sprint",0.02,"Dog_Walk",0.02};
InterpolateTo[] = {"Dog_Die",0.02,"Dog_Stop",0.02,"Dog_Sprint",0.02,"Dog_Walk",0.02};
};
class Dog_Walk: Dog_Stop
{
duty = -0.7;
file = "\CA\animals2\dogs\data\Anim\dogWalk";
speed = 1.3;
variantAfter[] = {3,10,20};
ConnectTo[] = {"Dog_Stop",0.2,"Dog_Sprint",0.2,"Dog_Run",0.2};
InterpolateTo[] = {"Dog_Die",0.02,"Dog_Stop",0.2,"Dog_Sprint",0.2,"Dog_Run",0.2};
};
class Dog_Die: DefaultDie
{
enableDirectControl = 0;
actions = "NoActions";
file = "\CA\animals2\dogs\data\Anim\dogDeath";
speed = 1.2;
looped = 0;
variantsPlayer[] = {};
variantsAI[] = {""};
variantAfter[] = {0,0,0};
terminal = 1;
soundEnabled = 0;
//collisionShape = "";
ConnectTo[] = {};
InterpolateTo[] = {};
};
};
class Actions
{
class NoActions: ManActions
{
turnSpeed = 8;
limitFast = 5.5;
useFastMove = 0;
upDegree = 0;
GestureBark[] = {
"GestureBark", "Gesture"
};
GestureIdle1[] = {
"GestureIdle1", "Gesture"
};
GestureIdle2[] = {
"GestureIdle2", "Gesture"
};
GestureSniff[] = {
"GestureSniff", "Gesture"
};
GestureHeadL[] = {
"GestureHeadL", "Gesture"
};
GestureHeadR[] = {
"GestureHeadR", "Gesture"
};
};
class DogActions: NoActions
{
Stop = "Dog_Stop";
StopRelaxed = "Dog_Stop";
TurnL = "Dog_TurnL";
TurnR = "Dog_TurnR";
TurnLRelaxed = "Dog_TurnL";
TurnRRelaxed = "Dog_TurnR";
Default = "Dog_Stop";
JumpOff = "Dog_Stop";
WalkF = "Dog_Walk";
//WalkF = "Dog_Run";
SlowF = "Dog_Run";
FastF = "Dog_Sprint";
EvasiveForward = "Dog_Sprint";
Down = "Dog_Stop";
Up = "Dog_Stop";
PlayerStand = "Dog_Stop";
PlayerProne = "Dog_Stop";
PlayerCrouch = "";
Crouch = "";
Lying = "Dog_Stop";
Stand = "Dog_Stop";
Combat = "Dog_Stop";
CanNotMove = "Dog_Stop";
Civil = "Dog_Stop";
CivilLying = "Dog_Stop";
FireNotPossible = "Dog_StopV1";
Die = "Dog_Die";
turnSpeed = 8;
limitFast = 5.5;
useFastMove = 0;
upDegree = "ManPosNoWeapon";
StartSwim = "Dog_Die";
};
class DogSprint: DogActions
{
Die = "Dog_Die";
turnSpeed = 4;
limitFast = 5.5;
useFastMove = 1;
};
class DogSit: NoActions
{
Up = "Dog_Stop";
PlayerStand = "Dog_Stop";
Stand = "Dog_Stop";
WalkF = "Dog_Walk";
//WalkF = "Dog_Run";
SlowF = "Dog_Run";
FastF = "Dog_Sprint";
EvasiveForward = "Dog_Sprint";
PlayerCrouch = "Dog_Stop";
Crouch = "Dog_Stop";
Die = "Dog_Die";
upDegree = "ManPosNoWeapon";
StartSwim = "Dog_Die";
};
};
class Interpolations
{
};
transitionsInterpolated[] = {};
transitionsSimple[] = {};
transitionsDisabled[] = {};
class BlendAnims: BlendAnims
{
aimingDefault[] = {"head",1,"Jaw",1,"Neck1",0.5,"Tongue1",1,"Tongue2",1};
untiltWeaponDefault[] = {};
legsDefault[] = {};
headDefault[] = {"head",1,"Jaw",1,"Neck1",0.5,"Tongue1",1,"Tongue2",1};
aimingNo[] = {};
legsNo[] = {};
headNo[] = {};
aimingUpDefault[] = {};
frontBody[] = {
/*
"spine",0.1,
"spine1",0.3,
"spine2",0.6,
*/
"neck",1,
"neck1",1,
"head",1,
"Jaw",1,
"Tongue1",1,
"Tongue2",1,
"leftArm",0.5,
"rightArm",0.5,
"leftEar",1,
"rightEar",1
};
};
};
class CfgGesturesDogDZ
{
skeletonName = "DogSkeleton";
class ManActions
{
};
class Actions
{
class NoActions: ManActions
{
turnSpeed = 0;
upDegree = 0;
limitFast = 1;
useFastMove = 0;
};
};
class Default
{
actions = "NoActions";
file = "";
looped = 1;
speed = 0.5;
relSpeedMin = 1;
relSpeedMax = 1;
soundEnabled = 0;
soundOverride = "";
soundEdge[] = {0.5,1};
terminal = 0;
equivalentTo = "";
connectAs = "";
connectFrom[] = {};
connectTo[] = {};
interpolateWith[] = {};
interpolateTo[] = {};
interpolateFrom[] = {};
mask = "empty";
interpolationSpeed = 6;
interpolationRestart = 0;
preload = 0;
disableWeapons = 1;
enableOptics = 1;
showWeaponAim = 1;
enableMissile = 1;
enableBinocular = 1;
showItemInHand = 0;
showItemInRightHand = 0;
showHandGun = 0;
canPullTrigger = 1;
walkcycles = 1;
headBobMode = 0;
headBobStrength = 0;
leftHandIKBeg = 0;
leftHandIKEnd = 0;
rightHandIKBeg = 0;
rightHandIKEnd = 0;
leftHandIKCurve[] = {1};
rightHandIKCurve[] = {1};
forceAim = 0;
};
class States
{
class GestureBark: Default
{
file = "\dayz_anim\dog\dogBarkOnce";
looped = 0;
speed = 3;
mask = "barking";
};
class GestureIdle1: Default
{
file = "\dayz_anim\dog\dogGestureIdle1";
looped = 0;
speed = 0.3;
mask = "idle";
};
class GestureIdle2: Default
{
file = "\dayz_anim\dog\dogGestureIdle2";
looped = 0;
speed = 0.3;
mask = "idle";
};
class GestureHeadL: Default
{
file = "\dayz_anim\dog\dogGestureHeadL";
looped = 0;
speed = 0.3;
mask = "idle";
};
class GestureHeadR: Default
{
file = "\dayz_anim\dog\dogGestureHeadR";
looped = 0;
speed = 0.3;
mask = "idle";
};
class GestureSniff: Default
{
file = "\dayz_anim\dog\dogGestureSniff";
looped = 0;
speed = 0.3;
mask = "frontBody";
};
};
class BlendAnims
{
barking[] = {"head",1,"Jaw",1,"Neck1",0.5,"Tongue1",1,"Tongue2",1,"Tail1",0.3,"Tail2",0.6,"Tail3",1};
idle[] = {"head",1,"Jaw",1,"Neck1",0.6,"Tongue1",1,"Tongue2",1,"Tail1",0.3,"Tail2",0.6,"Tail3",1,"Spine",0.1,"Spine1",0.2,"Spine2",0.4};
frontBody[] = {
"spine",0.1,
"spine1",0.3,
"spine2",0.6,
"neck",1,
"neck1",1,
"head",1,
"Jaw",1,
"Tongue1",1,
"Tongue2",1,
"leftArm",0.5,
"rightArm",0.5,
"leftEar",1,
"rightEar",1
};
};
class Interpolations
{
};
transitionsInterpolated[] = {};
transitionsSimple[] = {};
transitionsDisabled[] = {};
};

1193
dayz_code/cfgVehicles.hpp Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,49 @@
private["_serial","_positions","_lootGroup","_iArray","_iItem","_iClass","_iPos","_item","_mags","_qty","_max","_tQty","_canType","_obj","_type","_nearBy","_allItems","_items","_itemType","_itemChance","_lootChance","_weights","_index"];
_obj = _this select 0;
_fastRun = _this select 1;
_type = typeOf _obj;
_config = configFile >> "CfgBuildingLoot" >> _type;
_positions = [] + getArray (_config >> "lootPos");
//diag_log ("LOOTSPAWN: READ:" + str(_type));
_lootChance = getNumber (_config >> "lootChance");
_itemType = [] + getArray (_config >> "itemType");
//diag_log ("LOOTSPAWN: READ:" + str(_itemType));
_itemChance = [] + getArray (_config >> "itemChance");
//diag_log ("LOOTSPAWN: Type " + str(count _itemType) + " / Chance " + str(count _itemChance));
//diag_log ("I want to spawn loot...");
{
private["_iPos2"];
_iPos2 = _obj modelToWorld _x;
_rnd = random 1;
//Place something at each position
if (player distance _iPos2 > 5) then {
if (_rnd < _lootChance) then {
//if (true) then {
_nearBy = nearestObjects [_iPos2, ["WeaponHolder","WeaponHolderBase"],1];
if (count _nearBy == 0) then {
private["_index","_iArray"];
_weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
_index = _weights call BIS_fnc_selectRandom;
//diag_log ("LOOTSPAWN: _itemType:" + str(_itemType));
//diag_log ("LOOTSPAWN: _index:" + str(_index));
if (_index >= 0) then {
_iArray = +(_itemType select _index);
// diag_log ("LOOTSPAWN: _iArray" + str(_iArray));
_iArray set [2,_iPos2];
_iArray set [3,0];
_iArray call spawn_loot;
_iArray = [];
};
_item setVariable ["created",(DateToNumber date),true];
};
if (!_fastRun) then {
sleep 0.1;
};
};
};
} forEach _positions;

View File

@@ -0,0 +1,48 @@
private["_serial","_positions","_min","_lootGroup","_iArray","_iItem","_iClass","_iPos","_item","_mags","_qty","_max","_tQty","_canType","_obj","_type","_nearBy","_clean","_unitTypes","_max","_isNoone","_config","_num","_originalPos","_zombieChance","_rnd","_fastRun"];
_obj = _this select 0;
_type = typeOf _obj;
_config = configFile >> "CfgBuildingLoot" >> _type;
_canLoot = isClass (_config);
_fastRun = _this select 1;
_originalPos = getPosATL _obj;
if (_canLoot) then {
//Get zombie class
_unitTypes = getArray (_config >> "zombieClass");
_min = getNumber (_config >> "maxRoaming");
_max = getNumber (_config >> "minRoaming");
//Walking Zombies
_num = round(random _max) max _min; // + round(_max / 3);
//diag_log ("Class: " + _type + " / Zombies: " + str(_unitTypes) + " / Walking: " + str(_num));
for "_i" from 1 to _num do
{
[_originalPos,true,_unitTypes] call zombie_generate;
if (!_fastRun) then {
sleep 0.1;
};
};
//Add Internal Zombies
_clean = {alive _x} count ((getPosATL _obj) nearEntities ["zZombie_Base",(sizeOf _type)]) == 0;
if (_clean) then {
_positions = getArray (_config >> "lootPos");
_zombieChance = getNumber (_config >> "zombieChance");
//diag_log format["Building: %1 / Positions: %2 / Chance: %3",_type,_positions,_zombieChance];
{
_rnd = random 1;
if (_rnd < _zombieChance) then {
_iPos = _obj modelToWorld _x;
_nearBy = {alive _x} count nearestObjects [_iPos, ["zZombie_Base"],1] > 0;
_nearByPlayer = ({isPlayer _x} count (_iPos nearEntities ["CAManBase",30])) > 0;
diag_log ("BUILDING: " + _type + " / " + str(_nearBy) + " / " + str(_nearByPlayer));
if (!_nearByPlayer and !_nearBy) then {
[_iPos,false,_unitTypes] call zombie_generate;
};
};
if (!_fastRun) then {
sleep 0.1;
};
} forEach _positions;
};
dayz_buildingMonitor set [count dayz_buildingMonitor,_obj];
};

View File

@@ -0,0 +1,56 @@
private["_position","_unitTypes","_group","_unit","_target","_bodies","_targetPos","_codeSpawns","_unitSpawn","_lead","_isAlive","_units"];
//Definitions
_agent = _this select 0;
//Add handlers
//_id = _agent addeventhandler ["HandleDamage",{_this call local_zombieDamage}];
//Loop behaviour
_list = (getposATL _agent) nearEntities ["Man",200];
_isSomeone = ({isPlayer _x} count _list) > 0;
while {_isAlive and _isSomeone} do {
//NO TARGET
_agent disableAI "FSM";
_target = objNull;
_targetPos = [];
//Spawn roaming script (individual to unit)
_myDest = getPosATL _agent;
//Loop looking for targets
while {isNull _target and _isAlive and _isSomeone} do {
_isAlive = alive _agent;
_list = (getposATL _agent) nearEntities ["Man",200];
_isSomeone = ({isPlayer _x} count _list) > 0;
_target = _agent call zombie_findTargetAgent;
if (_isAlive and (_agent distance _myDest < 5)) then {
[_agent,_position] call zombie_loiter;
};
_agent forceSpeed 2;
sleep 1;
};
//CHASE TARGET
//Leader cries out
[_agent,"attack",0,false] call dayz_zombieSpeak;
//Start Movement loop
while {!isNull _target and _isAlive and _isSomeone} do {
_target = _agent call zombie_findTargetAgent;
_isAlive = alive _agent;
_targetPos = getPosATL _target;
//Move to target
_agent moveTo _targetPos;
_agent forceSpeed 6;
sleep 1;
};
//LOOP
_agent setVariable ["targets",[],true];
_isAlive = alive _agent;
sleep 1;
};
//Wait for a while then cleanup
sleep 5;
deleteVehicle _agent;

View File

@@ -0,0 +1,55 @@
scriptName "Functions\arrays\fn_selectRandomWeighted.sqf";
/*
File: fn_selectRandomWeighted.sqf
Author: Joris-Jan van 't Land
Description:
Function to select a random item from an array, taking into account item weights.
The weights should be Numbers between 0 and 1, with a maximum precision of hundreds.
Parameter(s):
_this select 0: source Array (Array of Any Value)
_this select 1: weights (Array of Number)
Returns:
Any Value selected item
TODO:
[*] Algorithm is inefficient?
*/
private ["_array", "_weights"];
_array = _this select 0;
_weights = _this select 1;
/*
//Parameter validation.
if ((typeName _array) != (typeName [])) exitWith {debugLog "Log: [selectRandomWeighted] Array (0) must be an Array!"; nil};
if ((typeName _weights) != (typeName [])) exitWith {debugLog "Log: [selectRandomWeighted] Weights (1) must be an Array!"; nil};
if ((count _array) > (count _weights)) exitWith {debugLog "Log: [selectRandomWeighted] There must be at least as many elements in Weights (1) as there are in Array (0)!"; nil};
*/
//Created weighted array of indices.
_weighted = [];
for "_i" from 0 to ((count _weights) - 1) do
{
private ["_weight"];
_weight = _weights select _i;
//Ensure the weight is a Number.
//If it's not, set weight to 0 to exclude it.
if ((typeName _weight) != (typeName 0)) then {diag_log "Log: [selectRandomWeighted] Weights should be Numbers; weight set to 0!"; _weight = 0};
//The weight should be a Number between 0 and 1.
if (_weight < 0) then {diag_log "Log: [selectRandomWeighted] Weights should be more than or equal to 0; weight set to 0!"; _weight = 0};
//if (_weight > 1) then {debugLog "Log: [selectRandomWeighted] Weights should be less than or equal to 1; weight set to 1!"; _weight = 1};
//Normalize the weight for a precision of hundreds.
_weight = round(_weight * 100);
for "_k" from 0 to (_weight - 1) do
{
_weighted = _weighted + [_i];
};
};
_weighted

View File

@@ -0,0 +1,12 @@
_curDate = date;
_hr = _curDate select 3;
_min = _curDate select 4;
_hrStr = "";
_minStr = "";
if (_hr < 10) then {_hrStr = format["0%1",_hr]} else {_hrStr = format["%1",_hr]};
if (_hr == 0) then {_hrStr = "00"};
if (_min < 10) then {_minStr = format["0%1",_min]} else {_minStr = format["%1",_min]};
if (_min == 0) then {_minStr = "00"};
_strTime = format["%1%2 hrs",_hrStr,_minStr];
_strTime;

View File

@@ -0,0 +1,211 @@
scriptName "Functions\misc\fn_damageActions.sqf";
/***********************************************************
ADD ACTIONS FOR A CASUALTY
- Function
- [] call fnc_usec_damageActions;
************************************************************/
private["_menClose","_unit","_unconscious","_lowBlood","_injured","_inPain","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_action1","_action2","_action","_vehClose","_hasVehicle","_vehicle","_inVehicle","_crew","_unconscious_crew","_patients"];
_menClose = cursorTarget;
_hasPatient = alive _menClose;
_vehicle = vehicle player;
_inVehicle = (_vehicle != player);
_isClose = ((player distance _menClose) < ((sizeOf typeOf _menClose) / 2));
_bag = unitBackpack player;
_classbag = typeOf _bag;
if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unconscious and _isClose) then {
_unit = cursorTarget;
player reveal _unit;
_vehClose = (getPosATL player) nearEntities [["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"],5]; //nearestObjects [player, ["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"], 5];
_hasVehicle = ({alive _x} count _vehClose > 0);
_unconscious = _unit getVariable ["NORRN_unconscious", false];
_lowBlood = _unit getVariable ["USEC_lowBlood", false];
_injured = _unit getVariable ["USEC_injured", false];
_inPain = _unit getVariable ["USEC_inPain", false];
_legsBroke = _unit getVariable ["hit_legs", 0] >= 1;
_armsBroke = _unit getVariable ["hit_hands", 0] >= 1;
_hasBandage = "ItemBandage" in magazines player;
_hasEpi = "ItemEpinephrine" in magazines player;
_hasMorphine = "ItemMorphine" in magazines player;
_hasBlood = "ItemBloodbag" in magazines player;
_hasToolbox = "ItemToolbox" in items player;
_hasJerry = "ItemJerrycan" in magazines player;
_hasEtool = "ItemEtool" in weapons player;
_hasWire = "ItemWire" in magazines player;
_hasPainkillers = "ItemPainkiller" in magazines player;
//Allow player to drag
if(_unconscious) then {
r_action = true;
_action1 = _unit addAction [localize "str_actions_medical_01", "\z\addons\dayz_code\medical\drag.sqf",_unit, 0, true, true];
_action2 = _unit addAction [localize "str_actions_medical_02", "\z\addons\dayz_code\medical\pulse.sqf",_unit, 0, true, true];
r_player_actions = r_player_actions + [_action1,_action2];
};
//Load Vehicle
if (_hasVehicle and _unconscious) then {
_x = 0;
r_action = true;
_unit = _unit;
_vehicle = (_vehClose select _x);
while{((!alive _vehicle) and (_x < (count _vehClose)))} do {
_x = _x + 1;
_vehicle = (_vehClose select _x);
};
_vehType = typeOf _vehicle;
_action = _unit addAction [format[localize "str_actions_medical_03",_vehType], "\z\addons\dayz_code\medical\load\load_act.sqf",[player,_vehicle,_unit], 0, true, true];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to bandage
if(_injured and _hasBandage) then {
r_action = true;
//_unit setdamage 0.8;
_action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit], 0, true, true, "", "'ItemBandage' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to give Epinephrine
if(_unconscious and _hasEpi) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_05", "\z\addons\dayz_code\medical\epinephrine.sqf",[_unit], 0, true, true];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to give Morphine
if((_legsBroke or _armsBroke) and _hasMorphine) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_06", "\z\addons\dayz_code\medical\morphine.sqf",[_unit], 0, true, true, "", "'ItemMorphine' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to give Painkillers
if(_inPain and _hasPainkillers) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_07", "\z\addons\dayz_code\medical\painkiller.sqf",[_unit], 0, true, true, "", "'ItemPainkiller' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to transfuse blood
if(_lowBlood and _hasBlood) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_08", "\z\addons\dayz_code\medical\transfusion.sqf",[_unit], 0, true, true, "", "'ItemBloodbag' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//Repairs
if ((_unit isKindOf "AllVehicles") and !(_unit isKindOf "Man")) then {
_type = TypeOf(_unit);
_typeVeh = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
//CAN WE REFUEL THE OBJECT?
if ((fuel _unit < 1) and _hasJerry) then {
r_action = true;
_action = _unit addAction [format[localize "str_actions_medical_10",_typeVeh], "\z\addons\dayz_code\actions\refuel.sqf",[_unit], 0, true, true, "", "'ItemJerrycan' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//CAN WE ISSUE ANOTHER KIND OF AMMUNITION?
if (count weapons _unit > 0) then {
//Get mag array
_weapon = weapons _unit select 0;
_magTypes = getArray(configFile >> "cfgWeapons" >> _weapon >> "magazines");
{
_ammoSerial = (USEC_LogisticsItems find _x);
if (_ammoSerial > -1) then {
//Have the item type
_ammoQty = ((USEC_LogisticsDetail select _ammoSerial) select 1);
if (_ammoQty > 0) then {
//Have at least one
r_action = true;
_displayName = getText(configFile >> "cfgMagazines" >> _x >> "displayName");
_action = _unit addAction [format[localize "str_actions_medical_11",_displayName], "\z\addons\dayz_code\actions\logistics_loadmag.sqf",[_unit,_x], 0, false, true];
r_player_actions set [count r_player_actions,_action];
};
};
} forEach _magTypes;
};
//CAN CARRY BACKPACK
if ((_type in USEC_PackableObjects) and (_classbag == "")) then {
r_action = true;
_action = _unit addAction [format[localize "str_actions_medical_12",_typeVeh], "\z\addons\dayz_code\actions\pack.sqf",[_unit], 0, true, true];
r_player_actions set [count r_player_actions,_action];
};
};
if ((_unit isKindOf "Building")) then {
_type = TypeOf(_unit);
_typeVeh = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
_isEngineer = _hasToolbox;//(_classbag isKindOf "BAF_AssaultPack_Engineer");
//CAN DISASSEMBLE
if (_isEngineer and (_type in USEC_CanDisassemble)) then {
r_action = true;
_index = USEC_CanDisassemble find _type;
_inventory = USEC_DisassembleKits select _index;
_action = _unit addAction [format[localize "str_actions_medical_12",_typeVeh], "\z\addons\dayz_code\actions\disassemble.sqf",[_unit,_inventory], 0, true, true];
r_player_actions set [count r_player_actions,_action];
};
//Upgrade Wire
if (_isEngineer and (_type == "usec_wire_cat1") and _hasWire) then {
r_action = true;
_unitTo = "usec_wire_cat2";
_action = _unit addAction [format[localize "str_actions_medical_13",_typeVeh], "\z\addons\dayz_code\actions\engineer_upgrade.sqf",[_unit,"ItemWire",_unitTo], 0, false, true];
r_player_actions set [count r_player_actions,_action];
};
if (_isEngineer and (_type == "usec_wire_cat2") and _hasWire) then {
r_action = true;
_unitTo = "Fort_RazorWire";
_action = _unit addAction [format[localize "str_actions_medical_13",_typeVeh], "\z\addons\dayz_code\actions\engineer_upgrade.sqf",[_unit,"ItemWire",_unitTo], 0, false, true];
r_player_actions set [count r_player_actions,_action];
};
};
if (r_action) then {
r_action_targets = r_action_targets + [_unit];
};
};
/*
if ((r_player_vehicle != _vehicle) and r_action) then {
//Player is in a new vehicle
r_action = false;
call fnc_usec_medic_removeActions;
};
*/
if (_inVehicle) then {
//Check if patients
_crew = crew _vehicle;
if (count _crew > 0) then {
_unconscious_crew = [];
{
if (_x getVariable "NORRN_unconscious") then {
_unconscious_crew = _unconscious_crew + [_x]
};
} forEach _crew;
_patients = (count _unconscious_crew);
if (_patients > 0) then {
if (!r_action_unload) then {
r_action_unload = true;
_vehType = typeOf _vehicle;
_action = _vehicle addAction [format[localize "str_actions_medical_14",_vehType], "\z\addons\dayz_code\medical\load\unLoad_act.sqf",[player,_vehicle], 0, false, true];
r_player_actions set [count r_player_actions,_action];
};
} else {
if (r_action_unload) then {
call fnc_usec_medic_removeActions;
r_action_unload = false;
};
};
};
//hintSilent format["Crew: %1\nPatients: %2\nAction: %3",(count _crew),_patients,r_action_unload];
} else {
if (r_action_unload) then {
r_action_unload = false;
call fnc_usec_medic_removeActions;
};
};
//Remove Actions
if ((!_isClose or !_hasPatient) and r_action) then {
call fnc_usec_medic_removeActions;
r_action = false;
};
//Pain Effects
if (r_player_inpain and !r_player_unconscious) then {
playSound "breath_1";
addCamShake [2, 1, 25];
};

View File

@@ -0,0 +1,233 @@
scriptName "Functions\misc\fn_damageHandler.sqf";
/***********************************************************
PROCESS DAMAGE TO A UNIT
- Function
- [unit, selectionName, damage, source, projectile] call fnc_usec_damageHandler;
************************************************************/
private["_unit","_humanityHit","_myKills","_isBandit","_hit","_damage","_isPlayer","_unconscious","_wound","_isHit","_isInjured","_type","_hitPain","_inPain","_isDead","_isCardiac","_killerID","_evType","_recordable","_inVehicle","_isHeadHit","_isMinor","_scale","_canHitFree"];
_unit = _this select 0;
_hit = _this select 1;
_damage = _this select 2;
_unconscious = _unit getVariable ["NORRN_unconscious", false];
_source = _this select 3;
_ammo = _this select 4;
_type = [_damage,_ammo] call fnc_usec_damageType;
_isMinor = (_hit in USEC_MinorWounds);
_isHeadHit = (_hit == "head_hit");
_inVehicle = (vehicle _unit != _unit);
_evType = "";
_recordable = false;
_isPlayer = (isPlayer _source);
_humanityHit = 0;
_myKills = 0;
_sourceZombie = _source isKindOf "zZombie_base";
//Publish Damage
//player sidechat format["Processed damage for %1",_unit];
//USEC_SystemMessage = format["CLIENT: %1 damaged for %2 (in vehicle: %5)",_unit,_damage,_isMinor,_isHeadHit,_inVehicle];
//PublicVariable "USEC_SystemMessage";
/*
if (_isPlayer) then {
if (_damage > 0.1) then {
dayz_canDisconnect = false;
dayzDiscoAdd = getPlayerUID player;
publicVariable "dayzDiscoAdd";
dayz_damageCounter = time;
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1204;
_control ctrlShow true;
};
};
*/
if (_unit == player) then {
if (_hit == "") then {
if ((_source != player) and _isPlayer) then {
_canHitFree = player getVariable ["freeTarget",false];
_isBandit = (typeOf player) == "Bandit1_DZ";
if (!_canHitFree and !_isBandit) then {
_myKills = 200 - (((player getVariable ["humanKills",0]) / 30) * 100);
//Process Morality Hit
_humanityHit = -(_myKills * _damage);
_id = [_source,_humanityHit] spawn {
dayzHumanity = [_this select 0,_this select 1,30];
publicVariable "dayzHumanity";
};
};
};
};
};
//PVP Damage
_scale = 200;
if (_damage > 0.4) then {
if (_ammo != "zombie") then {
_scale = _scale + 50;
};
if (_isHeadHit) then {
_scale = _scale + 500;
};
if ((isPlayer _source) and !(player == _source)) then {
_scale = _scale + 800;
if (_isHeadHit) then {
_scale = _scale + 500;
};
};
switch (_type) do {
case 1: {_scale = _scale + 200};
case 2: {_scale = _scale + 200};
};
if (_unit == player) then {
//Cause blood loss
//Log Damage
//diag_log ("DAMAGE: player hit by " + typeOf _source + " in " + _hit + " with " + _ammo + " for " + str(_damage) + " scaled " + str(_damage * _scale));
r_player_blood = r_player_blood - (_damage * _scale);
};
};
//Record Damage to Minor parts (legs, arms)
if (_hit in USEC_MinorWounds) then {
if (_ammo == "zombie") then {
if (_hit == "legs") then {
[_unit,_hit,(_damage / 6)] call object_processHit;
} else {
[_unit,_hit,(_damage / 4)] call object_processHit;
};
} else {;
[_unit,_hit,(_damage / 2)] call object_processHit;
};
if (_ammo == "") then {
[_unit,_hit,_damage] call object_processHit;
};
};
/*
if (_unit == player) then {
player sideChat str(_damage);
};
*/
if (_damage > 0.1) then {
if (_unit == player) then {
//shake the cam, frighten them!
//player sidechat format["Processed bullet hit for %1 (should only be for me!)",_unit];
1 call fnc_usec_bulletHit;
};
if (local _unit) then {
_unit setVariable["medForceUpdate",true,true];
};
};
if (_damage > 0.4) then { //0.25
/*
BLEEDING
*/
_wound = _hit call fnc_usec_damageGetWound;
_isHit = _unit getVariable[_wound,false];
if (_unit == player) then {
_rndPain = (random 10);
_rndInfection = (random 1000);
_hitPain = (_rndPain < _damage);
if ((_isHeadHit) or (_damage > 1.2 and _hitPain)) then {
_hitPain = true;
};
_hitInfection = (_rndInfection < 1);
//player sidechat format["HitPain: %1, HitInfection %2 (Damage: %3)",_rndPain,_rndInfection,_damage]; //r_player_infected
if (_isHit) then {
//Make hit worse
if (_unit == player) then {
r_player_blood = r_player_blood - 50;
};
};
if (_hitInfection) then {
//Set Infection if not already
if (_unit == player) then {
r_player_infected = true;
player setVariable["USEC_infected",true,true];
};
};
if (_hitPain) then {
//Set Pain if not already
if (_unit == player) then {
r_player_inpain = true;
player setVariable["USEC_inPain",true,true];
};
};
if ((_damage > 1.5) and _isHeadHit) then {
_id = [_source,"shothead"] spawn player_death;
};
};
if(!_isHit) then {
//Create Wound
_unit setVariable[_wound,true,true];
[_unit,_wound,_hit] spawn fnc_usec_damageBleed;
usecBleed = [_unit,_wound,_hit];
publicVariable "usecBleed";
//Set Injured if not already
_isInjured = _unit getVariable["USEC_injured",false];
if (!_isInjured) then {
_unit setVariable["USEC_injured",true,true];
if ((_unit == player) and (_ammo != "zombie")) then {
dayz_sourceBleeding = _source;
};
};
//Set ability to give blood
_lowBlood = _unit getVariable["USEC_lowBlood",false];
if (!_lowBlood) then {
_unit setVariable["USEC_lowBlood",true,true];
};
if (_unit == player) then {
r_player_injured = true;
};
};
};
if (_type == 1) then {
/*
BALISTIC DAMAGE
*/
if ((_damage > 0.01) and (_unit == player)) then {
//affect the player
[20,45] call fnc_usec_pitchWhine; //Visual , Sound
};
if (_damage > 4) then {
//serious ballistic damage
if (_unit == player) then {
_id = [_source,"explosion"] spawn player_death;
};
} else {
if (_damage > 2) then {
_isCardiac = _unit getVariable["USEC_isCardiac",false];
if (!_isCardiac) then {
_unit setVariable["USEC_isCardiac",true,true];
r_player_cardiac = true;
};
};
};
};
if (_type == 2) then {
/*
HIGH CALIBRE
*/
if (_damage > 4) then {
//serious ballistic damage
if (_unit == player) then {
_id = [_source,"shotheavy"] spawn player_death;
};
} else {
if (_damage > 2) then {
_isCardiac = _unit getVariable["USEC_isCardiac",false];
if (!_isCardiac) then {
_unit setVariable["USEC_isCardiac",true,true];
r_player_cardiac = true;
};
};
};
};
if (!_unconscious and !_isMinor and ((_damage > 2) or ((_damage > 0.5) and _isHeadHit))) then {
//set unconsious
[_unit,_damage] call fnc_usec_damageUnconscious;
};

View File

@@ -0,0 +1,25 @@
scriptName "Functions\misc\fn_damageHandler.sqf";
/***********************************************************
PROCESS DAMAGE TO A UNIT
- Function
- [unit, selectionName, damage, source, projectile] call fnc_usec_damageHandler;
************************************************************/
private["_unit","_hit","_damage","_unconscious","_wound","_isHit","_isInjured","_type","_hitPain","_inPain","_isDead","_isCardiac","_killerID","_evType","_recordable","_inVehicle","_isHeadHit","_isMinor","_total"];
_unit = _this select 0;
_hit = _this select 1;
_damage = _this select 2;
_source = _this select 3;
_ammo = _this select 4;
_total = _damage;
//diag_log ("DAMAGE VEH: " + typeof(_unit) + " / " + str(_hit) + " / " + str(_damage) + " / " + str(getDammage _unit));
if (local _unit) then {
if (_ammo == "zombie") then {
//_unit setDamage (_damage / 2);
_total = [_unit,_hit,_damage] call object_setFixServer;
} else {
_total = [_unit,_hit,_damage] call object_setHitServer;
};
};
_total

View File

@@ -0,0 +1,33 @@
//[unit, selectionName, damage, source, projectile]
//will only run when local to the created object
//record any key hits to the required selection
private["_zed","_selection","_damage","_hitter","_projectile","_headShots","_damageOrg"];
_zed = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
_hitter = _this select 3;
_projectile = _this select 4;
if (local _zed) then {
if (_damage > 1 and _projectile != "") then {
//Record deliberate critical damages
switch (_selection) do {
case "head_hit": {
if (!(_zed getVariable["hitRegistered",false])) then {
_headShots = _hitter getVariable["headShots",0];
_hitter setVariable["headShots",(_headShots + 1),true];
_zed setVariable["hitRegistered",true];
};
};
};
if (_projectile isKindOf "Bolt") then {
_damageOrg = _hitter getVariable["firedDamage",0]; //_unit getVariable["firedSelection",_selection];
if (_damageOrg < _damage) then {
_hitter setVariable["firedHit",[_zed,_selection],true];
_hitter setVariable["firedDamage",_damage,true];
};
};
};
};
_damage

View File

@@ -0,0 +1,39 @@
//------------------
// Authors: Peter Morrison (snYpir) & Philipp Pilhofer (raedor)
// Purpose: Checks if a position lies within an angle sector
// Arguments: [<center position>,<center angle of sector>,<sector width>,<position>]
// Return: boolean
//
/*
Returns true if <position> lies within the sector defined by <center position>,
<center angle of sector> and <sector width>. Use this function to determine if
a position lies within a certain angle from another position (ie the <center position>).
Example:
[position player,getdir player,30,position enemy_tank] call BIS_fnc_inAngleSector
will return true if the vehicle named enemy_tank is within 30 degrees of where the player is pointing.
*/
// Revision History:
// 09/01/08 0.1 - First cut VBS2
//------------------
private["_dir1","_dir2","_dir3","_small","_large","_x","_y","_r"];
_r = false;
_small = (_this select 1) - ((_this select 2) / 2);
_large = (_this select 1) + ((_this select 2) / 2);
_x = ((_this select 3) select 0) - ((_this select 0) select 0);
_y = ((_this select 3) select 1) - ((_this select 0) select 1);
_dir1 = _x atan2 _y;
if (_dir1 < 0) then {_dir1 = _dir1 + 360};
_dir2 = _dir1 - 360;
_dir3 = _dir1 + 360;
if ((_dir1 >= _small && _dir1 <= _large) || (_dir2 >= _small && _dir2 <= _large) || (_dir3 >= _small && _dir3 <= _large)) then {_r = true};
_r

View File

@@ -0,0 +1,59 @@
/*
File: inString.sqf
Author: Mika Hannola
Description:
Find a string within a string.
Parameter(s):
_this select 0: BOOL - when true, displays all units, otherwise just player positions
_this select 0: <string> string to be found
_this select 1: <string> string to search from
_this select 2 (Optional): search is case sensitive (default: false)
Returns:
Boolean (true when string is found).
How to use:
BIS_fnc_inString = compile preprocessFile "inString.sqf"; //Compile the function
_found = ["string","String",true] call BIS_fnc_inString; //Find a string within a string
*/
private ["_casesensitive","_find","_string","_findarray","_stringarray","_findcount","_stringcount","_found","_match","_y","_i","_x"];
_find = _this select 0;
_string = _this select 1;
//modification : default _casesensitive is false
_casesensitive = false;
if(count(_this) > 2) then {_casesensitive = _this select 2;};
_findarray = toArray _find;
_stringarray = toArray _string;
_findcount = count _findarray;
_stringcount = count _stringarray;
_found = false;
scopeName "main";
if (_findcount <= _stringcount and !_found) then
{
for "_y" from 0 to (_stringcount - _findcount) do
{
_match = [];
for "_i" from 0 to (_findcount - 1) do
{
_match set [count _match,_stringarray select (_y + _i)];
};
_found = true;
_i = 0;
{
if (_x != _match select _i) then
{
_found = false;
};
_i = _i + 1;
} forEach _findarray;
if (_found) then {breakTo "main";};
};
};
_found;

View File

@@ -0,0 +1,36 @@
private["_unit1","_building","_type","_relPos","_boundingBox","_min","_max","_myX","_myY","_myZ","_inside"];
_unit1 = _this select 0;
//_building = _this select 1;
_building = nearestObject [player, "HouseBase"];
_type = typeOf _building;
_relPos = _building worldToModel (getPosATL _unit1);
_boundingBox = boundingBox _building;
//diag_log ("DEBUG: Building: " + str(_building) );
//diag_log ("DEBUG: Building Type: " + str(_type) );
//diag_log ("DEBUG: BoundingBox: " + str(_boundingBox) );
_min = _boundingBox select 0;
_max = _boundingBox select 1;
//diag_log ("Min: " + str(_min) );
//diag_log ("Max: " + str(_max) );
_myX = _relPos select 0;
_myY = _relPos select 1;
_myZ = _relPos select 2;
//diag_log ("X: " + str(_myX) );
//diag_log ("Y: " + str(_myY) );
//diag_log ("Z: " + str(_myZ) );
if ((_myX > (_min select 0)) and (_myX < (_max select 0))) then {
if ((_myY > (_min select 1)) and (_myY < (_max select 1))) then {
if ((_myZ > (_min select 2)) and (_myZ < (_max select 2))) then {
_inside = true;
} else { _inside = false; };
} else { _inside = false; };
} else { _inside = false; };
//diag_log ("isinBuilding Check: " + str(_inside) );
_inside

View File

@@ -0,0 +1,51 @@
/***********************************************************
REQUEST FROM hive
- Function
- result = [_key] call fnc_usec_hive_request;
************************************************************/
private["_key","_pipe","_result","_resultArray","_buildings","_stream","_data","_attempt"];
_key = _this select 0;
_confirm = _this select 1;
_resultArray = [];
hiveContact = true;
_attempt = 0;
//startLoadingScreen ["Accessing hive"];
//diag_log format ["hive: Request: %1", _key];
while {true} do {
//Wait until not in use
scopeName "usePipe";
while {true} do {
scopeName "pipeWaiting5";
_pipe = [dayZ_hivePipe1] call jayarma2lib_fnc_openpipe;
if ((_pipe != "_JERR_PIPE_INVALID")) then {breakOut "pipeWaiting5";};
};
//Send Key
_ret = [_pipe, _key] call jayarma2lib_fnc_writepipe;
//Wait until hive replies
while {true} do {
scopeName "pipeWaiting6";
_data = [_pipe] call jayarma2lib_fnc_readpipe;
if (!(isNil "_data") and (_data != "_JERR_NULL")) then {breakOut "pipeWaiting6";};
};
//Release hive
[_pipe] call jayarma2lib_fnc_closepipe;
//Do we have an answer?
if(_data == "_JERR_FALSE" and _confirm) then {
if (_attempt > 10) then {
breakOut "usePipe";
} else {
//Retry the read
diag_log format ["hive: Failed with: %1, Retrying", _data];
};
} else {
breakOut "usePipe";
};
_attempt = _attempt + 1;
};
//diag_log format ["hive: Received: %1", _data];
//endLoadingScreen;
//Return information
_resultArray = call compile format ["%1",_data];
_resultArray;

View File

@@ -0,0 +1,70 @@
/***********************************************************
REQUEST FROM hive
- Function
- result = [_key] call fnc_usec_hive_request;
************************************************************/
private["_key","_pipe","_result","_resultArray","_buildings","_stream","_data","_attempt","_result1","_result2"];
_key = _this select 0;
_confirm = _this select 1;
_resultArray = [];
hiveContact = true;
_attempt = 0;
_result1 = "";
_result2 = "";
//startLoadingScreen ["Accessing hive"];
//diag_log format ["hive: Request: %1", _key];
while {true} do {
//Wait until not in use
scopeName "usePipe";
while {true} do {
scopeName "pipeWaiting5";
_pipe = [dayZ_hivePipe1] call jayarma2lib_fnc_openpipe;
if ((_pipe != "_JERR_PIPE_INVALID")) then {breakOut "pipeWaiting5";};
};
//Send Key
_ret = [_pipe, _key] call jayarma2lib_fnc_writepipe;
//Wait until hive replies
while {true} do {
scopeName "pipeWaiting6";
_data = [_pipe] call jayarma2lib_fnc_readpipe;
if (!(isNil "_data") and (_data != "_JERR_NULL")) then {breakOut "pipeWaiting6";};
};
_result1 = call compile format ["%1",_data];
_ret = [_pipe, "['OK']"] call jayarma2lib_fnc_writepipe;
_data = "";
//Send Key
_ret = [_pipe, _key] call jayarma2lib_fnc_writepipe;
//Wait until hive replies
while {true} do {
scopeName "pipeWaiting6";
_data = [_pipe] call jayarma2lib_fnc_readpipe;
if (!(isNil "_data") and (_data != "_JERR_NULL")) then {breakOut "pipeWaiting6";};
};
_result2 = call compile format ["%1",_data];
//Release hive
[_pipe] call jayarma2lib_fnc_closepipe;
//Do we have an answer?
if(_data == "_JERR_FALSE" and _confirm) then {
if (_attempt > 10) then {
breakOut "usePipe";
} else {
//Retry the read
diag_log format ["hive: Failed with: %1, Retrying", _data];
};
} else {
breakOut "usePipe";
};
_attempt = _attempt + 1;
};
//diag_log format ["hive: Received: %1", _data];
//endLoadingScreen;
//Return information
_resultArray = _result1;
_resultArray;

View File

@@ -0,0 +1,53 @@
/***********************************************************
REQUEST FROM hive
- Function
- result = [_key] call fnc_usec_hive_request;
************************************************************/
private["_key","_pipe","_result","_resultArray","_buildings","_stream","_data","_attempt"];
_key = _this select 0;
_confirm = _this select 1;
dayz_resultArray = [];
hiveContact = true;
_attempt = 0;
//startLoadingScreen ["Accessing hive"];
//diag_log format ["hive: Request: %1", _key];
while {true} do {
//Wait until not in use
scopeName "usePipe";
while {true} do {
scopeName "pipeWaiting5";
_pipe = [dayZ_hivePipe1] call jayarma2lib_fnc_openpipe;
if ((_pipe != "_JERR_PIPE_INVALID")) then {breakOut "pipeWaiting5";};
};
sleep 0.1;
//Send Key
_ret = [_pipe, _key] call jayarma2lib_fnc_writepipe;
//Wait until hive replies
while {true} do {
scopeName "pipeWaiting6";
_data = [_pipe] call jayarma2lib_fnc_readpipe;
if (!(isNil "_data") and (_data != "_JERR_NULL")) then {breakOut "pipeWaiting6";};
sleep 0.01;
};
sleep 0.1;
//Release hive
[_pipe] call jayarma2lib_fnc_closepipe;
//Do we have an answer?
if(_data == "_JERR_FALSE" and _confirm) then {
if (_attempt > 10) then {
breakOut "usePipe";
} else {
//Retry the read
diag_log format ["hive: Failed with: %1, Retrying", _data];
};
} else {
breakOut "usePipe";
};
_attempt = _attempt + 1;
};
//diag_log format ["hive: Received: %1", _data];
//endLoadingScreen;
//Return information
dayz_resultArray = call compile format ["%1",_data];

View File

@@ -0,0 +1,23 @@
scriptName "Functions\arrays\fn_selectRandom.sqf";
/************************************************************
Random Select
By Andrew Barron
Parameters: array
This returns a randomly selected element from the passed array.
Example: [1,2,3] call BIS_fnc_selectRandom
Returns: 1, 2, or 3
************************************************************/
private "_ret";
if(count _this > 0) then
{
_ret = (count _this) - 1; //number of elements in the array
//_ret = [0, _ret] call BIS_fnc_randomInt; //choose random index
_ret = random _ret;
_ret = _this select _ret; //get the element, return it
};
_ret

View File

@@ -0,0 +1,59 @@
scriptName "Functions\arrays\fn_selectRandomWeighted.sqf";
/*
File: fn_selectRandomWeighted.sqf
Author: Joris-Jan van 't Land
Description:
Function to select a random item from an array, taking into account item weights.
The weights should be Numbers between 0 and 1, with a maximum precision of hundreds.
Parameter(s):
_this select 0: source Array (Array of Any Value)
_this select 1: weights (Array of Number)
Returns:
Any Value selected item
TODO:
[*] Algorithm is inefficient?
*/
private ["_array", "_weights","_index","_weighted","_i"];
_array = _this select 0;
_weights = _this select 1;
//Parameter validation.
if ((typeName _array) != (typeName [])) exitWith {debugLog "Log: [selectRandomWeighted] Array (0) must be an Array!"; nil};
if ((typeName _weights) != (typeName [])) exitWith {debugLog "Log: [selectRandomWeighted] Weights (1) must be an Array!"; nil};
if ((count _array) > (count _weights)) exitWith {debugLog "Log: [selectRandomWeighted] There must be at least as many elements in Weights (1) as there are in Array (0)!"; nil};
//Created weighted array of indices.
private ["_weighted"];
_weighted = [];
for "_i" from 0 to ((count _weights) - 1) do
{
private ["_weight"];
_weight = _weights select _i;
//Ensure the weight is a Number.
//If it's not, set weight to 0 to exclude it.
if ((typeName _weight) != (typeName 0)) then {debugLog "Log: [selectRandomWeighted] Weights should be Numbers; weight set to 0!"; _weight = 0};
//The weight should be a Number between 0 and 1.
if (_weight < 0) then {debugLog "Log: [selectRandomWeighted] Weights should be more than or equal to 0; weight set to 0!"; _weight = 0};
//if (_weight > 1) then {debugLog "Log: [selectRandomWeighted] Weights should be less than or equal to 1; weight set to 1!"; _weight = 1};
//Normalize the weight for a precision of hundreds.
_weight = round(_weight * 100);
for "_k" from 0 to (_weight - 1) do
{
_weighted = _weighted + [_i];
};
};
//Randomly select an index from the weighted array and therefore an element.
private ["_index"];
_index = _weighted call BIS_fnc_selectRandom;
_array select _index

View File

@@ -0,0 +1,227 @@
scriptName "Functions\misc\fn_selfActions.sqf";
/***********************************************************
ADD ACTIONS FOR SELF
- Function
- [] call fnc_usec_selfActions;
************************************************************/
private["_menClose","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_vehicle","_inVehicle","_color","_part"];
_vehicle = vehicle player;
_inVehicle = (_vehicle != player);
_bag = unitBackpack player;
_classbag = typeOf _bag;
_isWater = (surfaceIsWater (position player)) or dayz_isSwimming;
_hasAntiB = "ItemAntibiotic" in magazines player;
_hasFuelE = "ItemJerrycanEmpty" in magazines player;
_hasRawMeat = "FoodSteakRaw" in magazines player;
_hasKnife = "ItemKnife" in items player;
_hasToolbox = "ItemToolbox" in items player;
//_hasTent = "ItemTent" in items player;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_nearLight = nearestObject [player,"LitObject"];
_canPickLight = false;
if (!isNull _nearLight) then {
if (_nearLight distance player < 4) then {
_canPickLight = isNull (_nearLight getVariable ["owner",objNull]);
};
};
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
//Grab Flare
if (_canPickLight and !dayz_hasLight) then {
if (s_player_grabflare < 0) then {
_text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName");
s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""];
s_player_removeflare = player addAction [format[localize "str_actions_medical_17",_text], "\z\addons\dayz_code\actions\flare_remove.sqf",_nearLight, 1, false, true, "", ""];
};
} else {
player removeAction s_player_grabflare;
player removeAction s_player_removeflare;
s_player_grabflare = -1;
s_player_removeflare = -1;
};
if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4)) then { //Has some kind of target
_isHarvested = cursorTarget getVariable["meatHarvested",false];
_isVehicle = cursorTarget isKindOf "AllVehicles";
_isMan = cursorTarget isKindOf "Man";
_ownerID = cursorTarget getVariable ["characterID","0"];
_isAnimal = cursorTarget isKindOf "Animal";
_isZombie = cursorTarget isKindOf "zZombie_base";
_isDestructable = cursorTarget isKindOf "BuiltItems";
_isTent = cursorTarget isKindOf "TentStorage";
_isFuel = false;
_isAlive = alive cursorTarget;
_text = getText (configFile >> "CfgVehicles" >> typeOf cursorTarget >> "displayName");
if (_hasFuelE) then {
_isFuel = (cursorTarget isKindOf "Land_Ind_TankSmall") or (cursorTarget isKindOf "Land_fuel_tank_big") or (cursorTarget isKindOf "Land_fuel_tank_stairs") or (cursorTarget isKindOf "Land_fuel_tank_stairs_ep1") or (cursorTarget isKindOf "Land_wagon_tanker") or (cursorTarget isKindOf "Land_fuelstation") or (cursorTarget isKindOf "Land_fuelstation_army");
};
//diag_log ("OWNERID = " + _ownerID + " CHARID = " + dayz_characterID + " " + str(_ownerID == dayz_characterID));
//Allow player to delete objects
if(_isDestructable and _hasToolbox and _canDo) then {
if (s_player_deleteBuild < 0) then {
s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",cursorTarget, 1, true, true, "", ""];
};
} else {
player removeAction s_player_deleteBuild;
s_player_deleteBuild = -1;
};
/*
//Allow player to force save
if((_isVehicle or _isTent) and _canDo and !_isMan) then {
if (s_player_forceSave < 0) then {
s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",cursorTarget, 1, true, true, "", ""];
};
} else {
player removeAction s_player_forceSave;
s_player_forceSave = -1;
};
*/
//Allow player to fill jerrycan
if(_hasFuelE and _isFuel and _canDo) then {
if (s_player_fillfuel < 0) then {
s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",[], 1, false, true, "", ""];
};
} else {
player removeAction s_player_fillfuel;
s_player_fillfuel = -1;
};
if (!alive cursorTarget and _isAnimal and _hasKnife and !_isHarvested and _canDo) then {
if (s_player_butcher < 0) then {
s_player_butcher = player addAction [localize "str_actions_self_04", "\z\addons\dayz_code\actions\gather_meat.sqf",cursorTarget, 3, true, true, "", ""];
};
} else {
player removeAction s_player_butcher;
s_player_butcher = -1;
};
//Fireplace Actions check
if(inflamed cursorTarget and _hasRawMeat and _canDo) then {
if (s_player_cook < 0) then {
s_player_cook = player addAction [localize "str_actions_self_05", "\z\addons\dayz_code\actions\cook.sqf",cursorTarget, 3, true, true, "", ""];
};
} else {
player removeAction s_player_cook;
s_player_cook = -1;
};
if(cursorTarget == dayz_hasFire and _canDo) then {
if ((s_player_fireout < 0) and !(inflamed cursorTarget) and (player distance cursorTarget < 3)) then {
s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_fireout;
s_player_fireout = -1;
};
//place tent
//if(_hasTent and _canDo) then {
// s_player_placetent = player addAction [localize "Place Tent", "\z\addons\dayz_code\actions\tent_pitch.sqf",cursorTarget, 0, false, true, "", ""];
//} else {
// player removeAction s_player_placetent;
// s_player_placetent = -1;
//};
//Packing my tent
if(cursorTarget isKindOf "TentStorage" and _canDo and _ownerID == dayz_characterID) then {
if ((s_player_packtent < 0) and (player distance cursorTarget < 3)) then {
s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_packtent;
s_player_packtent = -1;
};
//Repairing Vehicles
if ((dayz_myCursorTarget != cursorTarget) and !_isMan and _hasToolbox and (damage cursorTarget < 1)) then {
_vehicle = cursorTarget;
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
dayz_myCursorTarget = _vehicle;
_allFixed = true;
_hitpoints = _vehicle call vehicle_getHitpoints;
{
_damage = [_vehicle,_x] call object_getHit;
_part = "PartGeneric";
//change "HitPart" to " - Part" rather than complicated string replace
_cmpt = toArray (_x);
_cmpt set [0,20];
_cmpt set [1,toArray ("-") select 0];
_cmpt set [2,20];
_cmpt = toString _cmpt;
if(["Engine",_x,false] call fnc_inString) then {
_part = "PartEngine";
};
if(["HRotor",_x,false] call fnc_inString) then {
_part = "PartVRotor"; //yes you need PartVRotor to fix HRotor LOL
};
if(["Fuel",_x,false] call fnc_inString) then {
_part = "PartFueltank";
};
if(["Wheel",_x,false] call fnc_inString) then {
_part = "PartWheel";
};
if(["Glass",_x,false] call fnc_inString) then {
_part = "PartGlass";
};
// get every damaged part no matter how tiny damage is!
if (_damage > 0) then {
_allFixed = false;
_color = "color='#ffff00'"; //yellow
if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange
if (_damage >= 0.9) then {_color = "color='#ff0000'";}; //red
_string = format["<t %2>Repair%1</t>",_cmpt,_color]; //Repair - Part
_handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
s_player_repairActions set [count s_player_repairActions,_handle];
};
} forEach _hitpoints;
if (_allFixed) then {
_vehicle setDamage 0;
};
};
if (_isMan and !_isAlive and !_isZombie) then {
if (s_player_studybody < 0) then {
s_player_studybody = player addAction [localize "str_action_studybody", "\z\addons\dayz_code\actions\study_body.sqf",cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_studybody;
s_player_studybody = -1;
};
} else {
//Engineering
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
dayz_myCursorTarget = objNull;
//Others
player removeAction s_player_forceSave;
s_player_forceSave = -1;
player removeAction s_player_deleteBuild;
s_player_deleteBuild = -1;
player removeAction s_player_butcher;
s_player_butcher = -1;
player removeAction s_player_cook;
s_player_cook = -1;
player removeAction s_player_fireout;
s_player_fireout = -1;
player removeAction s_player_packtent;
s_player_packtent = -1;
player removeAction s_player_fillfuel;
s_player_fillfuel = -1;
player removeAction s_player_studybody;
s_player_studybody = -1;
};

View File

@@ -0,0 +1,124 @@
/************************************************************
Set Pitch and Bank
By General Barron ([EMAIL=aw_barron@hotmail.com]aw_barron@hotmail.com[/EMAIL]) and vektorboson
Parameters: [object, pitch, bank]
Returns: nothing
Rotates an object, giving it the specified pitch and bank,
in degrees.
Pitch is 0 when the object is level; 90 when pointing straight
up; and -90 when pointing straight down.
Bank is 0 when level; 90 when the object is rolled to the right,
-90 when rolled to the left, and 180 when rolled upside down.
Note that the object's yaw can be set with the setdir command,
which should be issued before using this function, if required.
The pitch/bank can be leveled out (set to 0) by using the
setdir command.
************************************************************/
//extract parameters
private ["_obj","_pitch","_bank","_yaw","_vdir","_vup","_sign","_rotate"];
_obj = _this select 0;
_pitch = _this select 1;
_bank = _this select 2;
//find the yaw (direction) of the object
//map compass directions go CW, while coordinate (vector) directions go CCW, so we need to flip this
//if we don't flip this, the object will face backwards
_yaw = 360-(getdir _obj);
//----------------------------
//function to rotate a 2d vector around the origin
//----------------------------
_rotate =
{
private ["_v","_d","_x","_y"];
//extract parameters
_v = +(_this select 0); //we don't want to modify the originally passed vector
_d = _this select 1;
//extract old x/y values
_x = _v select 0;
_y = _v select 1;
//if vector is 3d, we don't want to mess up the last element
_v set [0, (cos _d)*_x - (sin _d)*_y];
_v set [1, (sin _d)*_x + (cos _d)*_y];
//return new vector
_v
};
//----------------------------
//find vector dir (pitch)
//----------------------------
//find sign of pitch
_sign = [1,-1] select (_pitch < 0);
//cut off numbers above 180
while {abs _pitch > 180} do {_pitch = _sign*(abs _pitch - 180)};
//we can't use pitch that is exactly equal to 90, because then the engine doesn't know what 2d compass direction the object is facing
if(abs _pitch == 90) then {_pitch = _sign*(89.9)};
//we can't pitch beyond 90 degrees without changing the facing of our object
//(pitching beyond 90 degrees means that the object's eyes will point in the 2d compass direction that its back used to point)
if(abs _pitch > 90) then
{
//we are rolling upside down; flip our direction (yaw)
_obj setdir (getdir _obj)-180;
_yaw = 360-(getdir _obj);
//use bank to flip upside down
_bank = _bank + 180;
//and adjust our original pitch
_pitch = (180 - abs _pitch)*_sign;
};
//find appropriate vdir according to our pitch, as if we were facing north
_vdir = [0, cos _pitch, sin _pitch];
//then rotate X & Y around the origin according to object's yaw (direction)
_vdir = [_vdir, _yaw] call _rotate;
//----------------------------
//find vector up (bank)
//----------------------------
//find sign of bank
_sign = [1,-1] select (_bank < 0);
//cut off numbers above 360
while {abs _bank > 360} do {_bank = _sign*(abs _bank - 360)};
//reflect numbers above 180
if(abs _bank > 180) then {_sign = -1*_sign; _bank = (360-_bank)*_sign};
//find appropriate vup according to our bank, as if we were facing north
_vup = [sin _bank, 0, cos _bank];
//rotate Y & Z elements according to pitch
_vup = [_vup select 0] + ([[_vup select 1, _vup select 2], _pitch] call _rotate);
//rotate X & Y around origin according to yaw
_vup = [_vup, _yaw] call _rotate;
//----------------------------
//apply the vectors
//----------------------------
_obj setVectorDirAndUp [_vdir, _vup];

View File

@@ -0,0 +1,22 @@
/*
Author: CarlGustaffa (modified by gammadust)
Description:
Returns the sun's rise in hours for the current day of the year on any island (whos latitude may differ).
Parameters:
None needed.
Returns:
Sun's rise in hours, in the same format as engine's [daytime] command (16.5 == 16:30)
To obtain sun's set, just subtract the result from 24.
Reference:
http://forums.bistudio.com/showthread.php?107476-How-do-I-detect-sundown-sunrise
*/
private ["_lat", "_day", "_hour"];
_lat = -1 * getNumber(configFile >> "CfgWorlds" >> worldName >> "latitude");
_day = 360 * (dateToNumber date);
_hour = acos ((24 * sin(_lat) * cos(_day)) / ((12 * cos(_day) - 78) * cos(_lat)));
_daytime = _hour / 360 * 24;
_daytime

View File

@@ -0,0 +1,20 @@
//Assess Terrain
private["_unit","_pos","_type","_typeA","_soundType","_soundVal","_array","_test"];
_unit = _this;
_pos = getPosATL _unit;
_type = surfaceType _pos;
_typeA = toArray _type;
_typeA set [0,"DEL"];
_typeA = _typeA - ["DEL"];
_type = toString _typeA;
_test = 0;
//diag_log ("FINDME: " + _type);
_soundType = getText (configFile >> "CfgSurfaces" >> _type >> "soundEnviron");
_soundVal = parseNumber format["%1",((getArray (configFile >> "CfgVehicles" >> "CAManBase" >> "SoundEnvironExt" >> _soundType) select 0) select 3)];
if (_soundVal == 0) then {
_soundVal = 25;
};
_array = [_soundType,_soundVal];
_array

View File

@@ -0,0 +1,156 @@
/*
Author: TeeTime
Does: Manages the body temperatur of a Player
Possible Problems:
=> Balancing
Missing:
Save Functions
Should Effects Sum Up?
Math Functions for Water
Player Update GUI Colours need to be checked
Shivering Function need improments
*/
private ["_looptime","_sun_factor","_building_factor","_vehicle_factor","_fire_factor","_water_factor","_rain_factor","_night_factor","_wind_factor","_difference","_hasfireffect","_isinbuilding","_isinvehicle","_raining","_sunrise","_building"];
_looptime = _this;
//Factors are equal to win/loss of factor*basic value
//All Values can be seen as x of 100: 100 / x = minutes from min temperetaure to max temperature (without other effects)
_vehicle_factor = 4;
_moving_factor = 7;
_fire_factor = 15; //Should be always: _rain_factor + _night_factor + _wind_factor OR higher !
_building_factor = 7;
_sun_factor = 4; //max sunfactor linear over the day. highest value in the middle of the day
_water_factor = -8;
_rain_factor = -3;
_night_factor = -1.5;
_wind_factor = -1;
_difference = 0;
_hasfireffect = false;
_isinbuilding = false;
_isinvehicle = false;
_raining = if(rain > 0) then {true} else {false};
_sunrise = call world_sunRise;
//POSITIV EFFECTS
//vehicle
if((vehicle player) != player) then {
_difference = _difference + _vehicle_factor;
_isinvehicle = true;
} else {
//speed factor
private["_vel","_speed"];
_vel = velocity player;
_speed = round((_vel distance [0,0,0]) * 3.5);
_difference = (_moving_factor * (_speed / 20)) min 1;
};
//fire
private ["_fireplaces"];
_fireplaces = nearestObjects [player, ["Land_Fire","Land_Campfire"], 8];
if(({inflamed _x} count _fireplaces) > 0 && !_isinvehicle ) then {
//Math: factor * 1 / (0.5*(distance max 1)^2) 0.5 = 12.5% of the factor effect in a distance o 4 meters
_difference = _difference + (_fire_factor /(0.5*((player distance (_fireplaces select 0)) max 1)^2));
_hasfireffect = true;
};
//building
_building = nearestObject [player, "HouseBase"];
if(!isNull _building) then {
if([player,_building] call fnc_isInsideBuilding) then {
//Make sure thate Fire and Building Effect can only appear single Not used at the moment
//if(!_hasfireffect && _fire_factor > _building_factor) then {
_difference = _difference + _building_factor;
//};
_isinbuilding = true;
dayz_inside = true;
} else {
dayz_inside = false;
};
} else {
dayz_inside = false;
};
//sun
if(daytime > _sunrise && daytime < (24 - _sunrise) && !_raining && overcast <= 0.6 && !_isinbuilding) then {
/*Mathematic Basic
t = temperature effect
a = calcfactor
f = sunfactor
s = sunrise
d = daytime
I: a = f / (12 - s)<29>
II: t = -a * (d - 12)<29> + f
I + II =>
t = -(f / (12 - s)<29>) * (d - 12)<29> + f
Parabel with highest Point( greatest Effect == _sun_factor) always at 12.00
Zero Points are always at sunrise and sunset -> Only Positiv Values Possible
*/
_difference = _difference + (-((_sun_factor / (12 - _sunrise)^2)) * ((daytime - 12)^2) + _sun_factor);
};
//NEGATIVE EFFECTS
//water
if(surfaceIsWater getPosATL player || dayz_isSwimming) then {
_difference = _difference + _water_factor;
};
//rain
if(_raining && !_isinvehicle && !_isinbuilding) then {
_difference = _difference + _rain_factor;
};
//night
private ["_daytime"];
if((daytime < _sunrise || daytime < (24 - _sunrise)) && !_isinvehicle && !_isinbuilding) then {
_daytime = if(daytime < 12) then {daytime + 24} else {daytime};
_difference = _difference + (((_night_factor * -1) / (_sunrise^2)) * ((_daytime - 24)^2) + _night_factor);
};
//wind
if(((wind select 0) > 4 || (wind select 1) > 4) && !_isinvehicle && !_isinbuilding ) then {
_difference = _difference + _wind_factor;
};
//Calculate Change Value Basic Factor Looptime Correction Adjust Value to current used temperatur scala
_difference = _difference * SleepTemperatur / (60 / _looptime) * ((dayz_temperaturmax - dayz_temperaturmin) / 100);
//Change Temperatur Should be moved in a own Function to allow adding of Items which increase the Temp like "hot tea"
dayz_temperatur = (((dayz_temperatur + _difference) max dayz_temperaturmin) min dayz_temperaturmax);
//Add Shivering
// Percent when the Shivering will start
if(dayz_temperatur <= (0.125 * (dayz_temperaturmax - dayz_temperaturmin) + dayz_temperaturmin)) then {
//CamShake as linear Function Maximum reached when Temp is at temp minimum. First Entry = Max Value
_temp = 0.6 * (dayz_temperaturmin / dayz_temperatur );
addCamShake [_temp,(_looptime + 1),30]; //[0.5,looptime,6] -> Maximum is 25% of the Pain Effect
} else {
addCamShake [0,0,0]; //Not needed at the Moment, but will be necesarry for possible Items
};

View File

@@ -0,0 +1,99 @@
disableSerialization;
if ((!r_player_handler1) and (r_handlerCount == 0)) then {
//Unconscious Meter
_totalTimeout = r_player_timeout;
4 cutRsc ["playerStatusWaiting", "PLAIN",0];
_display = uiNamespace getVariable 'DAYZ_GUI_waiting';
_ctrl1 = _display displayCtrl 1400;
_ctrl1Pos = ctrlPosition _ctrl1;
_timeout = 0;
r_handlerCount = r_handlerCount + 1;
r_player_handler1 = true;
player playAction "CanNotMove";
"dynamicBlur" ppEffectEnable true;"dynamicBlur" ppEffectAdjust [2]; "dynamicBlur" ppEffectCommit 0;
"colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectEnable true;"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.1], [1, 1, 1, 0.0]];"colorCorrections" ppEffectCommit 0;
0 fadeSound 0.05;
disableUserInput true;
//waitUntil{USEC_MotherInbox == ""};
//["MED001",0,"Unconscious"] call fnc_usec_recordEventClient;
localize "CLIENT: Unconscious...";
while {(r_player_unconscious)} do {
_ctrl1 ctrlSetPosition [(_ctrl1Pos select 0),(_ctrl1Pos select 1),(_ctrl1Pos select 2),((0.136829 * safezoneH) * (1 -(r_player_timeout / _totalTimeout)))];
_ctrl1 ctrlCommit 1;
playSound "heartbeat_1";
sleep 1;
_isOnDeck = false; //getPos player in LHA_Deck;
_isInLocation = false; //getPos player in LHA_Location;
_inVehicle = (vehicle _unit != _unit);
_bloodLow = ((r_player_blood/r_player_bloodTotal) < 0.5);
if ((surfaceIsWater (getPosASL player)) and !_isOnDeck and !_inVehicle) then {
player setpos [(getPosASL player select 0),(getPosASL player select 1),0.3];
};
if(_timeout == 0) then {
if (!r_player_dead and !_bloodLow and r_player_injured) then {
_timeout = 10;
//_animType = (USEC_WoundAnim select (floor(random (count USEC_WoundAnim))));
//player playActionNow _anim;
};
} else {
_timeout = _timeout - 1;
};
if (r_player_timeout > 0) then {
r_player_timeout = r_player_timeout - 1;
} else {
if ((!r_player_dead) and (!r_player_cardiac)) then {
nul = [] spawn fnc_usec_recoverUncons;
};
};
//Check if near field hospital
_isHospital = false; //(count( nearestObjects [player, ["USMC_WarfareBFieldhHospital"], 8]) > 0);
if (_isHospital or _isOnDeck or _isInLocation) then {
waitUntil {!(player getVariable ["NORRN_unit_dragged", false])};
cutText[localize "str_medical_healing", "PLAIN", 2];
sleep 5;
r_player_inpain = false;
r_player_dead = false;
r_player_injured = false;
r_player_cardiac = false;
//Give Blood
r_player_blood = r_player_bloodTotal;
player setVariable["USEC_lowBlood",false,true];
usecMorphine = [player,player];
publicVariable "usecMorphine";
player setVariable ["USEC_inPain", false, true];
usecBandage = [player,player];
publicVariable "usecBandage";
player setdamage 0;
{player setVariable[_x,false,true];} forEach USEC_woundHit;
player setVariable ["USEC_injured",false,true];
sleep 1;
r_player_handler = false;
nul = [] spawn fnc_usec_recoverUncons;
};
if (!(player getVariable ["NORRN_unconscious", true])) then {
nul = [] spawn fnc_usec_recoverUncons;
};
if(animationState player == "AmovPpneMstpSnonWnonDnon_healed") then {
nul = [] spawn fnc_usec_recoverUncons;
};
};
4 cutRsc ["default", "PLAIN",1];
localize "CLIENT: Conscious...";
disableUserInput false;
//waitUntil{USEC_MotherInbox == ""};
//["MED001",0,"Conscious"] call fnc_usec_recordEventClient;
if (!r_player_injured and ((r_player_blood/r_player_bloodTotal) >= 0.5)) then {
10 fadeSound 1;
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5;
};
r_handlerCount = r_handlerCount - 1;
};

View File

@@ -0,0 +1,66 @@
private["_type","_location","_dir","_character","_tent","_class","_id"];
//[dayz_characterID,_tent,[_dir,_location],"TentStorage"]
_class = _this select 3;
_location = getPosATL player;
_dir = getDir player;
player allowdamage false;
diag_log ("PUBLISH: Attempt " + _class);
_worldspace = [_dir,_location];
_object = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"];
_object setdir _dir;
_object setpos _location;
_object setVariable ["CharacterID", "0", true];
sleep 1;
_dam = 1;
_hitpoints = _object call vehicle_getHitpoints;
_object setFuel 0;
{
_selection = getText(configFile >> "cfgVehicles" >> _class >> "HitPoints" >> _x >> "name");
if (_x != "HitEngine" and _x != "HitFuel") then {
_dam = 1;
} else {
_dam = 0.85;
};
[_object,_selection,_dam] call object_setFixServer;
//_object setHit[_selection,1];
} forEach _hitpoints;
_object setvelocity [1,0,0];
player reveal _object;
//Send request
_array = [];
_dam = 1;
{
_hit = [_object,_x] call object_getHit;
_selection = getText (configFile >> "CfgVehicles" >> _class >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
} forEach _hitpoints;
//add to database
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
//Send request
//61 to 120
//207 to 208
for "_x" from 61 to 120 do {
_key = format["CHILD:301:%1:%2:%3:%4:%5:%6:%7:%8:",_x, _class, 0 , 0, _worldspace, [], _array, 0];
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
//sleep 0.5;
/*
waitUntil{!hiveInUse};
hiveInUse = true;
//Send request
_primary = [_key,false,dayZ_hivePipeAuth] call server_hiveReadWrite;
hiveInUse = false;
*/
};
diag_log ("PUBLISH: Result " + str(_result));
if (count _result > 1) then {
_id = _result select 1;
_object setVariable ["ObjectID", _id, true];
diag_log ("PUBLISH: Created " + (_class) + " with ID " + str(_id));
};

View File

@@ -0,0 +1,22 @@
/*
[_objectID,_objectUID] call local_deleteObj;
*/
private["_id","_uid","_key"];
_id = _this select 0;
_uid = _this select 1;
if (isServer) then {
//remove from database
if (parseNumber _id > 0) then {
//Send request
_key = format["CHILD:304:%1:",_id];
_key call server_hiveWrite;
diag_log format["DELETE: Deleted by ID: %1",_id];
};
if (parseNumber _uid > 0) then {
//Send request
_key = format["CHILD:310:%1:",_uid];
_key call server_hiveWrite;
diag_log format["DELETE: Deleted by UID: %1",_uid];
};
};

View File

@@ -0,0 +1,14 @@
//[unit, selectionName, damage, source, projectile]
//will only run when local to the created object
//record any key hits to the required selection
private["_zed","_killer","_kills","_array","_type"];
_array = _this select 0;
_zed = _array select 0;
_killer = _array select 1;
_type = _this select 1;
if (local _zed) then {
_kills = _killer getVariable[_type,0];
_killer setVariable[_type,(_kills + 1),true];
};

View File

@@ -0,0 +1,23 @@
private["_qty","_item","_meat"];
_item = _this select 0;
_qty = _this select 1;
_meat = 0;
_loop = true;
if (local _item) then {
for "_x" from 1 to _qty do {
_item addMagazine "FoodSteakRaw";
};
sleep 2;
_timer = time;
while {_loop} do {
_meat = count magazines _item;
if (_meat == 0) then {_loop = false};
if ((time - _timer) > 300) then {_loop = false};
sleep 1;
};
dayzHideBody = _item;
publicVariable "dayzHideBody";
hideBody _item;
sleep 10;
deleteVehicle _item;
};

View File

@@ -0,0 +1,31 @@
private["_type","_location","_dir","_character","_tent","_class","_id"];
//[dayz_characterID,_tent,[_dir,_location],"TentStorage"]
_charID = _this select 0;
_object = _this select 1;
_worldspace = _this select 2;
_class = _this select 3;
_id = 0;
diag_log ("PUBLISH: Attempt " + str(_object));
_dir = _worldspace select 0;
_location = _worldspace select 1;
_object = createVehicle [_class, _location, [], 0, "CAN_COLLIDE"];
_object setdir _dir;
_object setpos _location;
_object setVariable ["OwnerID", _charID, true];
//add to database
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
//get UID
_uid = _object call dayz_objectUID;
//Send request
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _charID, _worldspace, [], [], 0,_uid];
diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
_object setVariable ["ObjectUID", _uid, true];
diag_log ("PUBLISH: Created " + (_class) + " with ID " + _uid);

View File

@@ -0,0 +1,5 @@
private["_qty","_vehicle"];
_vehicle = _this select 0;
_qty = _this select 1;
_vehicle setFuel _qty;

View File

@@ -0,0 +1,57 @@
private["_currentObjects","_currentTypes","_currentQty","_previousTypes","_previousQty","_serial","_itemVal","_itemQty","_oldSerial","_oldQty"];
//_newObjects = [_previous,weapons player] call player_weaponCheck;
_currentObjects = _this select 0;
_checkObjects = _this select 1;
_change = false;
if (count _currentObjects > 1) then {
_currentTypes = _currentObjects select 0;
_currentQty = _currentObjects select 1;
} else {
_currentTypes = [];
_currentQty = [];
};
if (count _checkObjects > 1) then {
_previousTypes = _checkObjects select 0;
_previousQty = _checkObjects select 1;
} else {
_previousTypes = [];
_previousQty = [];
};
//Check if some of old loadout not there
//Review current loadout
_serial = 0;
{
_itemVal = _x;
_itemQty = _currentQty select _serial;
_oldSerial = _previousTypes find _itemVal;
_oldQty = 0;
if (_oldSerial >= 0) then {
_oldQty = _previousQty select _oldSerial;
};
if (_itemQty != _oldQty) then {_change = true};
_serial = _serial + 1;
} forEach _currentTypes;
//Review old loadout
_serial = 0;
{
_itemVal = _x;
_itemQty = _previousQty select _serial;
_oldSerial = _currentTypes find _itemVal;
_oldQty = 0;
if (_oldSerial >= 0) then {
_oldQty = _currentQty select _oldSerial;
};
if (_itemQty != _oldQty) then {_change = true};
_serial = _serial + 1;
} forEach _previousTypes;
_change

View File

@@ -0,0 +1,9 @@
private["_type","_tent","_pos"];
_type = _this select 0;
_pos = _this select 1;
_tent = nearestObject [_type,_pos];
if (!isNull _tent) then {
if (local _tent) then {deleteVehicle _tent};
};

View File

@@ -0,0 +1,7 @@
private["_unit","_hp","_selection","_strH","_dam"];
_unit = _this select 0;
_hp = _this select 1;
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _unit) >> "HitPoints" >> _hp >> "name");
_strH = "hit_" + (_selection);
_dam = _unit getVariable [_strH,0];
_dam

View File

@@ -0,0 +1,38 @@
private["_unit","_hp","_selection","_strH","_dam","_display"];
disableSerialization;
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
_strH = "hit_" + (_selection);
if (local _unit) then {
_dam = _unit getVariable [_strH,0];
_total = (_dam + _damage);
_unit setVariable [_strH,_total,true];
_break = false;
if (_selection in USEC_MinorWounds and _total >= 1 and _unit == player) then {
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_ctrlFracture = _display displayCtrl 1203;
if ((_selection == "legs") and !r_fracture_legs) then {
r_fracture_legs = true;
_ctrlFracture ctrlShow true;
_id = [] spawn {
player setHit["legs",1];
};
_break = true;
};
if ((_selection == "arms") and !r_fracture_arms) then {
r_fracture_arms = true;
_ctrlFracture ctrlShow true;
_id = [] spawn {
player setHit["hands",1];
};
_break = true;
};
};
if (_break) then {
[player,"fracture",0,false] call dayz_zombieSpeak;
};
};

View File

@@ -0,0 +1,43 @@
private["_flare","_sfx","_isLocal","_lightArea","_lightSpark","_type","_color"];
_flare = _this select 0;
_type = _this select 1;
_sfx = objNull;
if (!isNull _flare) then {
switch (_type) do {
case 0: {
_isLocal = local _flare;
//Area Light
_lightArea = "#lightpoint" createVehicleLocal (getPosATL _flare);
_lightArea setLightColor [0.5,0,0]; //[0.1,0.005,0.005];
_lightArea setLightAmbient [0.2,0.01,0.01];
_lightArea setLightBrightness 0.2;
_lightArea lightAttachObject [_flare, [0,0,0]];
//Spark Light
_lightSpark = "#lightpoint" createVehicleLocal (getPosATL _flare);
_lightSpark setLightColor [0.1,0.1,0.1];
_lightSpark setLightAmbient [0.05,0.05,0.05];
_lightSpark setLightBrightness 0.05;
_lightSpark lightAttachObject [_flare, [0,0,0]];
while {alive _flare} do {
_lightArea setLightAmbient [((random 0.2) + 0.2),0.01,0.01];
//_lightArea setLightColor [((random 0.1) + 0.1),0.005,0.005];
sleep (random 0.1);
};
deleteVehicle _lightArea;
deleteVehicle _lightSpark;
};
case 1: {
//Spark Light
_color = getArray(configFile >> "cfgAmmo" >> (typeOf _flare) >> "lightColor");
_lightSpark = "#lightpoint" createVehicleLocal (getPosATL _flare);
_lightSpark setLightColor _color;
_lightSpark setLightAmbient _color;
_lightSpark setLightBrightness 0.01;
_lightSpark lightAttachObject [_flare, [0,0,0]];
waitUntil{!(alive _flare)};
deleteVehicle _lightSpark;
};
};
};

View File

@@ -0,0 +1,23 @@
private["_unit","_selection","_strH","_dam","_total"];
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
if (_selection != "" and local _unit) then {
_strH = "hit_" + (_selection);
_unit setHit[_selection,_damage];
//player sidechat str _damage;
_unit setVariable [_strH,_damage,true];
if (_damage == 0) then {
dayzUpdateVehicle = [_unit,"repair"];
} else {
dayzUpdateVehicle = [_unit,"damage"];
};
if (isServer) then {
if (allowConnection) then {
dayzUpdateVehicle call server_updateObject;
};
} else {
publicVariable "dayzUpdateVehicle";
};
};

View File

@@ -0,0 +1,13 @@
private["_unit","_selection","_strH","_dam"];
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
if (_selection != "") then {
_strH = "hit_" + (_selection);
_dam = _unit getVariable [_strH,0];
_unit setVariable [_strH,(_dam + _damage)];
if (_selection in USEC_MinorWounds) then {
_unit setHit[_selection,(_dam + _damage)];
};
};
_damage

View File

@@ -0,0 +1,16 @@
private["_unit","_selection","_strH","_dam","_total"];
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
if ((_selection != "")) then {
_strH = "hit_" + (_selection);
_dam = _unit getVariable [_strH,0];
_total = (_dam + _damage);
if (_total > 1) then {
_total = 1;
};
_unit setVariable [_strH,_total];
} else {
_damage = 0;
};
_damage

View File

@@ -0,0 +1,28 @@
private["_unit","_selection","_strH","_dam","_total"];
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
if ((_selection != "") and local _unit) then {
_strH = "hit_" + (_selection);
_dam = _unit getVariable [_strH,0];
_total = (_dam + _damage);
if (_total > 1) then {
_total = 1;
};
_unit setVariable [_strH,_total,true];
if (_damage >= 1) then {
dayzUpdateVehicle = [_unit,"damage"];
if (isServer) then {
if (allowConnection) then {
dayzUpdateVehicle call server_updateObject;
};
} else {
publicVariable "dayzUpdateVehicle";
};
};
} else {
_damage = 0;
};
_damage

View File

@@ -0,0 +1,45 @@
private["_car","_hitpoints","_dam","_selection","_type","_pos","_dir"];
_type = _this select 0;
_pos = _this select 1;
_dir = _this select 2;
_car = _type createVehicle _pos;
_car setpos _pos;
_car setdir _dir;
_hitpoints = _car call vehicle_getHitpoints;
_dam = 1;
_car setFuel 0;
{
_selection = getText(configFile >> "cfgVehicles" >> typeOf _car >> "HitPoints" >> _x >> "name");
if (_x != "HitEngine" and _x != "HitFuel") then {
_dam = 1;
} else {
_dam = 0.85;
};
[_car,_selection,_dam] call object_setFixServer;
} forEach _hitpoints;
_car setvelocity [1,0,0];
player reveal _car;
dayzVehicleInit = _car;
publicVariable "dayzVehicleInit";
if (isServer) then {
_car call fnc_vehicleEventHandler;
[0,_car,[_dir,_pos],_type] call local_publishObj;
};
//Wait for HIVE to be free
waitUntil{!hiveInUse};
hiveInUse = true;
//Send request
_hitpoints = _car call vehicle_getHitpoints;
_array = [];
_dam = 1;
{
_hit = [_car,_x] call object_getHit;
_selection = getText (configFile >> "CfgVehicles" >> (typeOf _car) >> "HitPoints" >> _x >> "name");
if (_hit > 0) then {_array set [count _array,[_selection,_hit]]};
} forEach _hitpoints;
copyToClipboard str(_array);
_car

View File

@@ -0,0 +1,44 @@
private["_unit","_type","_chance","_rnd","_sound","_local","_dis"];
_unit = _this select 0;
_type = _this select 1;
_chance = _this select 2;
_local = _this select 3;
_dis = 40;
_num = switch (_type) do {
default {0};
case "cough": {2};
case "chase": {14};
case "spotted": {13};
case "hit": {6};
case "attack": {13};
case "idle": {35};
case "scream": {4};
case "fracture": {1};
case "eat": {3};
case "cook": {2};
case "panic": {1};
case "dog_bark": {4};
case "dog_growl": {3};
case "dog_qq": {2};
};
if (_type in ["shout","hit","attack","scream","breath"]) then {
_dis = 100;
};
_isWoman = getText(configFile >> "cfgVehicles" >> (typeOf _unit) >> "TextPlural") == "Women";
if (_isWoman and (_type in ["scream","panic"])) then {
_type = _type + "_w";
};
if ((round(random _chance) == _chance) or (_chance == 0)) then {
_rnd =(round(random _num));
_sound = "z_" + _type + "_" + str(_rnd);
if (_local) then {
_unit say [_sound, _dis];
} else {
[nil,_unit,rSAY,[_sound, _dis]] call RE;
};
};

View File

@@ -0,0 +1,10 @@
private["_object","_updateObj"];
//check if can pitch here
_object = _this;
if (_object getVariable ["ObjectID",0] > 0) then {
_updateObj = _object getVariable["update",[false,false,false]];
_updateObj set [1,true];
_object setVariable ["update",_updateObj,true];
_object setVariable ["position",(getPosATL _object),true];
};

View File

@@ -0,0 +1,10 @@
private["_unit","_selection","_strH","_dam","_total"];
_unit = _this select 0;
_killer = _this select 1;
_type = typeOf _unit;
_pos = getposATL _unit;
_dir = direction _unit;
if (local _unit) then {
deleteVehicle _unit;
// [_type,_pos,_dir] spawn object_spawnDamVehicle;
};

View File

@@ -0,0 +1,22 @@
private["_unit","_distance","_i","_listTalk","_zombie","_targets","_pos"];
//Alert Zed's to noise of shot
_pos = _this select 0;
_distance = _this select 1;
_doRun = _this select 2;
_pos = _this select 3;
_listTalk = _pos nearEntities ["zZombie_Base",_distance];
//hint str(_listTalk);
{
_zombie = _x;
if (_doRun) then {
_targets = _zombie getVariable ["targets",[]];
if (!(_unit in _targets)) then {
_targets set [count _targets,_unit];
_zombie setVariable ["targets",_targets,true];
};
} else {
_zombie setVariable ["myDest",_pos,true];
};
} forEach _listTalk;

View File

@@ -0,0 +1,37 @@
private["_list","_Pos","_randrefpoint","_PosList","_PosSelect","_Pos","_list","_animalssupported","_type","_root","_favouritezones"];
_list = getposATL player nearEntities [["CAAnimalBase"],dayz_animalDistance];
if (count _list < dayz_maxAnimals) then {
//Find where animal likes
_animalssupported = ["hen","Cow","Sheep","WildBoar","WildBoar","WildBoar","Goat","Rabbit","Rabbit"];
_type = (_animalssupported select floor(random(count _animalssupported)));
if (_type == "Cow") then {
_animalssupported = ["Cow01","Cow02","Cow03","Cow04"];
_type = (_animalssupported select floor(random(count _animalssupported)));
};
_root = configFile >> "CfgVehicles" >> _type;
_favouritezones = getText ( _root >> "favouritezones");
//_randrefpoint = [position player, 10, dayz_animalDistance, 1, 0, 50, 0] call BIS_fnc_findSafePos;
_randrefpoint = getposATL player;
_PosList = selectbestplaces [_randrefpoint,dayz_animalDistance,_favouritezones,10,5];
_PosSelect = _PosList select (floor random (count _PosList));
_Pos = _PosSelect select 0;
_list = _Pos nearEntities [["CAAnimalBase","Man"],50];
if (player distance _Pos < dayz_animalDistance and NOT surfaceIsWater _Pos and (count _list == 0)) then {
//Create Marker
/*
DAYZ_agentnumber = DAYZ_agentnumber + 1;
_GroupMarker = "animal_" + (str DAYZ_agentnumber) + "_" + str(dayz_characterID);
createMarker [_GroupMarker, _Pos ];
_GroupMarker setMarkerType "Dot";
_GroupMarker setMarkerColor "ColorRed";
_GroupMarker setMarkerText _type;
*/
_agent = createAgent [_type, _Pos, [], 0, "FORM"];
_agent setpos _Pos;
_id = [_pos,_agent] execFSM "\z\addons\dayz_code\system\animal_agent.fsm";
};
sleep 1;
};z

View File

@@ -0,0 +1,120 @@
private["_vel","_speed","_scalePose","_scaleMvmt","_scaleLight","_scaleAlert","_anim","_anim4","_initial","_isDay","_nearFlare","_scaler","_pos"];
_vel = velocity (vehicle player);
_speed = (_vel distance [0,0,0]);
_pos = getPosATL player;
_scalePose = 0.9;
_scaleMvmt = 0.2; //0.4;
_scaleLight = 0.5;
_scaleAlert = 1;
//Assess Players Position
_anim = animationState player;
_anim4 = toArray _anim;
_anim4 resize 4;
_anim4 = toString _anim4;
if (["pknl",_anim] call fnc_inString) then {
_scaleMvmt = 0.2; //0.1;
_scalePose = 0.6; //0.4
} else {;
if (["ppne",_anim] call fnc_inString) then {
_scaleMvmt = 0.3;
_scalePose = 0.14;
};
};
if (_anim4 == "aswm") then {
_scaleMvmt = 0.3;
dayz_isSwimming = true;
} else {
dayz_isSwimming = false;
};
_initial = 20 + (sunOrMoon * 20);
_scaleLight = (
(sunOrMoon * 2) //add sunlight
+ moonIntensity //add moonlight
- (overcast * 0.2) //remove for cloud state
- (rain * 0.2) //remove for rain state
- (fog * 0.5)); //remove for fog state
dayz_scaleLight = _scaleLight;
_scaleSound = (1
- (rain * 0.3) //remove for rain state
//+ (fog * 0.3) //add for fog state
)
max 0;
if (_scaleLight < 0.9) then {
//Assess if near lightsource
_nearFlare = nearestObject [(vehicle player),"RoadFlare"];
if (!isNull _nearFlare) then {
_scaler = (_nearFlare distance (vehicle player));
if (_scaler <= 30) then {
_scaler = 30 - _scaler;
_scaleLight = ((_scaler / 30) * 2) + _scaleLight;
};
};
_nearFire = nearestObject [(vehicle player),"Land_Fire"];
if (!isNull _nearFire) then {
_scaler = 50 - (_nearFire distance (vehicle player));
_scaleLight = ((_scaler / 50) * 2) + _scaleLight;
};
};
//Ensure zero or above
_scaleLight = _scaleLight max 0;
//Terrain Visibility
if (["grass",dayz_surfaceType] call fnc_inString) then {
_initial = _initial * 0.75;
_scaleMvmt = _scaleMvmt - 0.05;
} else {
if (["forest",dayz_surfaceType] call fnc_inString) then {
_initial = _initial * 0.5;
_scaleMvmt = _scaleMvmt - 0.1;
} else {
if (["concrete",dayz_surfaceType] call fnc_inString) then {
_initial = _initial * 1.2;
_scaleMvmt = _scaleMvmt + 0.1;
} else {
if (["rock",dayz_surfaceType] call fnc_inString) then {
_initial = _initial * 1.1;
_scaleMvmt = _scaleMvmt + 0.05;
};
};
};
};
if (isOnRoad _pos) then {
_initial = _initial * 1.3;
_scaleMvmt = _scaleMvmt + 0.2;
//dayz_surfaceNoise = dayz_surfaceNoise + 10;
};
/*
if (_speed > 5) then {
_speed = _speed * 1;
} else {
if (_speed > 3) then {
_speed = _speed * 0.7;
} else {
_speed = _speed * 0.3;
};
};
*/
//Are they inside a building
_building = nearestObject [(vehicle player), "Building"];
_isPlayerInside = [(vehicle player),_building] call fnc_isInsideBuilding;
if (_isPlayerInside) then {
_initial = 5;
};
//Work out result
_audial = round(_speed * dayz_surfaceNoise * _scaleMvmt * _scaleSound);
if ((_audial > DAYZ_disAudial) or ((time - dayz_firedCooldown) > 0.3)) then {
DAYZ_disAudial = _audial;
};
DAYZ_disVisual = (round((_initial + (_speed * 3)) * _scalePose * _scaleLight)) * 1.5;

View File

@@ -0,0 +1,10 @@
private["_playerName","_center","_group"];
_playerName = _this;
cutText [format["%1 has combat logged!",_playerName], "PLAIN DOWN"];
_center = createCenter sideLogic;
_group = createGroup _center;
cl_gamelogic = _group createUnit ["LOGIC", [0, 0, 0], [], 0, "NONE"];
cl_gamelogic sideChat format["(COMBAT LOG) %1",_playerName];
deleteVehicle cl_gamelogic;

View File

@@ -0,0 +1,53 @@
private["_unit","_ammo","_audible","_distance","_listTalk","_weapon","_projectile","_vUp","_endPos","_dir","_height","_bolt","_hitArray","_hitObject","_hitSelection","_config","_hitMemoryPt","_variation","_val","_doLoop","_countr"];
_unit = _this select 0;
_weapon = _this select 1;
_ammo = _this select 4;
_projectile = _this select 6;
_projectile = nearestObject [_unit, _ammo];
_vUp = vectorUp _projectile;
_endPos = getPosATL _projectile;
_dir = 0;
while {alive _projectile} do {
_endPos = getPosATL _projectile;
_vUp = vectorUp _projectile;
sleep 0.01;
};
_distance = _unit distance _endPos;
_height = _endPos select 2;
_doLoop = true;
_countr = 0;
if (_height < 100) then {
_bolt = createVehicle ["BoltSteelF", _endPos, [], 0, "CAN_COLLIDE"];
_bolt setPosATL _endPos;
_bolt setDir (getDir _unit);
_bolt setVectorUp _vUp;
_hitArray = _unit getVariable["firedHit",[]];
while {_doLoop} do {
_hitArray = _unit getVariable["firedHit",[]];
if (count _hitArray > 0) then {_doLoop = false};
if (_countr > 50) then {_doLoop = false};
_countr = _countr + 1;
sleep 0.1;
};
if (count _hitArray > 0) then {
_hitObject = _hitArray select 0;
_hitSelection = _hitArray select 1;
_config = configFile >> "cfgBody" >> _hitSelection;
_hitMemoryPt = getText(_config >> "memoryPoint");
_variation = getNumber(_config >> "variation");
_val = [((random (_variation * 2)) - _variation),((random (_variation * 2)) - _variation),((random (_variation * 2)) - _variation)];
_bolt attachTo [_hitObject,_val,_hitMemoryPt];
_dir = ([_hitObject,_unit] call BIS_fnc_relativeDirTo) + 180;
_bolt setDir (_dir);
_bolt setPos (getPos _bolt);
_unit setVariable["firedHit",[]];
_unit setVariable["firedDamage",0,true];
};
};

View File

@@ -0,0 +1,127 @@
private["_array","_source","_kills","_killsV","_humanity","_wait","_myKills"];
if (deathHandled) exitWith {};
deathHandled = true;
//Death
_body = player;
_playerID = getPlayerUID player;
//Send Death Notice
dayzDeath = [dayz_characterID,0,_body,_playerID,dayz_playerName];
publicVariableServer "dayzDeath";
if (isServer) then {
_id = dayzDeath spawn server_playerDied;
};
_id = [player,50,true,getPosATL player] spawn player_alertZombies;
sleep 0.5;
player setDamage 1;
0.1 fadeSound 0;
player setVariable ["NORRN_unconscious", false, true];
player setVariable ["unconsciousTime", 0, true];
player setVariable ["USEC_isCardiac",false,true];
player setVariable ["medForceUpdate",true,true];
r_player_unconscious = false;
r_player_cardiac = false;
_id = player spawn spawn_flies;
_humanity = 0;
_wait = 0;
_array = _this;
if (count _array > 0) then {
_source = _array select 0;
_method = _array select 1;
if (!isNull _source) then {
if (_source != player) then {
_canHitFree = player getVariable ["freeTarget",false];
_isBandit = (["Bandit",typeOf player,false] call fnc_inString);
_myKills = ((player getVariable ["humanKills",0]) / 30) * 1000;
if (!_canHitFree and !_isBandit) then {
//Process Morality Hit
_humanity = -(2000 - _myKills);
_kills = _source getVariable ["humanKills",0];
_source setVariable ["humanKills",(_kills + 1),true];
_wait = 300;
} else {
//Process Morality Hit
//_humanity = _myKills * 100;
_killsV = _source getVariable ["banditKills",0];
_source setVariable ["banditKills",(_killsV + 1),true];
_wait = 0;
};
if (_humanity < 0) then {
_wait = 0;
};
if (!_canHitFree and !_isBandit) then {
dayzHumanity = [_source,_humanity,_wait];
publicVariable "dayzHumanity";
};
};
};
_body setVariable ["deathType",_method,true];
};
terminate dayz_musicH;
terminate dayz_lootCheck;
terminate dayz_slowCheck;
terminate dayz_animalCheck;
terminate dayz_monitor1;
terminate dayz_medicalH;
terminate dayz_gui;
//Reset (just in case)
//deleteVehicle dayz_playerTrigger;
disableUserInput false;
r_player_dead = true;
"dynamicBlur" ppEffectEnable true;"dynamicBlur" ppEffectAdjust [4]; "dynamicBlur" ppEffectCommit 0.2;
"colorCorrections" ppEffectEnable true;
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.01], [1, 1, 1, 0.0]];
"colorCorrections" ppEffectCommit 1;
//Player is Dead!
3 fadeSound 0;
0 cutText ["", "BLACK",10];
dayz_DeathActioned = true;
sleep 1;
TitleText[localize "str_player_12","PLAIN DOWN",5];
dayz_originalPlayer enableSimulation true;
addSwitchableUnit dayz_originalPlayer;
setPlayable dayz_originalPlayer;
selectPlayer dayz_originalPlayer;
_myGroup = group _body;
[_body] joinSilent dayz_firstGroup;
deleteGroup _myGroup;
3 cutRsc ["default", "PLAIN",3];
4 cutRsc ["default", "PLAIN",3];
if (count _array > 0) then {
_body setVariable ["deathType",_method,true];
};
_body setVariable["combattimeout", 0, true];
/*
dayzFlies = player;
publicVariable "dayzFlies";
*/
sleep 2;
1 cutRsc ["DeathScreen","BLACK OUT",3];
playMusic "dayz_track_death_1";
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5;

View File

@@ -0,0 +1,70 @@
private["_unit","_ammo","_audible","_distance","_listTalk","_weapon"];
//[unit, weapon, muzzle, mode, ammo, magazine, projectile]
_unit = _this select 0;
_weapon = _this select 1;
_ammo = _this select 4;
_projectile = _this select 6;
//Alert Nearby
_audible = getNumber (configFile >> "CfgAmmo" >> _ammo >> "audibleFire");
_caliber = getNumber (configFile >> "CfgAmmo" >> _ammo >> "caliber");
_distance = round(_audible * 10 * _caliber);
dayz_disAudial = _distance;
dayz_firedCooldown = time;
// Put everyone in range of the bullet into combat
//_id = _this spawn player_projectileNear;
// Color in the combat icon
dayz_combat = 1;
if (_ammo isKindOf "Melee") exitWith {
_unit playActionNow "GestureSwing";
};
//Smoke Grenade
if (_ammo isKindOf "SmokeShell") then {
//Alert Zed's to smoke
_i = 0;
_projectile = nearestObject [_unit, _ammo];
_listTalk = (getPosATL _projectile) nearEntities ["zZombie_Base",50];
{
_group = group _x;
if (isNull group _x) then {
_group = _x;
};
_x reveal [_projectile,4];
_targets = _group getVariable ["targets",[]];
if (!(_projectile in _targets)) then {
_targets set [count _targets,_projectile];
_group setVariable ["targets",_targets,true];
};
_i = _i + 1;
} forEach _listTalk;
} else {
_id = [_unit,_distance,true,(getPosATL player)] spawn player_alertZombies;
//Check if need to place arrow
if (_ammo isKindOf "Bolt") then {
_id = _this spawn player_crossbowBolt;
};
if (_ammo isKindOf "GrenadeHand") then {
if (_ammo isKindOf "ThrownObjects") then {
_id = _this spawn player_throwObject;
};
if (_ammo isKindOf "RoadFlare") then {
//hint str(_ammo);
_projectile = nearestObject [_unit, "RoadFlare"];
_id = [_projectile,0] spawn object_roadFlare;
dayzRoadFlare = [_projectile,0];
publicVariable "dayzRoadFlare";
_id = _this spawn player_throwObject;
};
if (_ammo isKindOf "ChemLight") then {
_projectile = nearestObject [_unit, "ChemLight"];
_id = [_projectile,1] spawn object_roadFlare;
dayzRoadFlare = [_projectile,1];
publicVariable "dayzRoadFlare";
_id = _this spawn player_throwObject;
};
};
};

View File

@@ -0,0 +1,39 @@
private["_inventory","_wpns","_mags","_idc","_isOK","_val","_item","_x"];
_inventory = _this;
if (count _inventory > 0) then {
_wpns = _inventory select 0;
_mags = _inventory select 1;
//Add inventory
{
private["_item","_val"];
//is it an array?
_idc = 109;
if (typeName _x == "ARRAY") then {
_item = _x select 0;
_val = _x select 1;
} else {
_item = _x;
_val = -1;
};
//Is item legal?
_isOK = isClass(configFile >> "CfgMagazines" >> _item);
if (_isOK) then {
if (_val != -1) then {
player addMagazine [_item,_val];
} else {
player addMagazine _item;
};
};
_idc = _idc + 1;
} forEach _mags;
//Add weapons
{
//Is item legal?
_isOK = isClass(configFile >> "CfgWeapons" >> _x);
if (_isOK) then {
player addWeapon _x;
};
} forEach _wpns;
};

View File

@@ -0,0 +1,83 @@
private ["_objects"];
_objects = nearestObjects [getPosATL player, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage"], 10];
{
dayzUpdateVehicle = [_x,"all"];
publicVariable "dayzUpdateVehicle";
} foreach _objects;
private ["_backpackWpnQtys","_backpackWpnTypes","_backpackWpn","_backpackMag","_countr"];
dayz_myBackpack = unitBackpack player;
_backpackWpn = getWeaponCargo unitBackpack player;
_backpackMag = getMagazineCargo unitBackpack player;
clearWeaponCargoGlobal unitBackpack player;
clearMagazineCargoGlobal unitBackpack player;
//Fill backpack contents
//Weapons
_backpackWpnTypes = [];
_backpackWpnQtys = [];
if (count _backpackWpn > 0) then {
_backpackWpnTypes = _backpackWpn select 0;
_backpackWpnQtys = _backpackWpn select 1;
};
_countr = 0;
{
dayz_myBackpack addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];
_countr = _countr + 1;
} forEach _backpackWpnTypes;
//magazines
_backpackmagTypes = [];
_backpackmagQtys = [];
if (count _backpackmag > 0) then {
_backpackmagTypes = _backpackMag select 0;
_backpackmagQtys = _backpackMag select 1;
};
_countr = 0;
{
dayz_myBackpack addmagazineCargoGlobal [_x,(_backpackmagQtys select _countr)];
_countr = _countr + 1;
} forEach _backpackmagTypes;
private["_dialog","_magazineArray","_control","_item","_val","_max"];
diag_log ("REQUESTING GEAR SYNC");
disableSerialization;
//if (!dayzGearSave) exitWith {};
diag_log ("CONDUCTING GEAR SYNC");
_dialog = _this select 0;
_magazineArray = [];
//Primary Mags
for "_i" from 109 to 120 do
{
_control = _dialog displayCtrl _i;
_item = gearSlotData _control;
_val = gearSlotAmmoCount _control;
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
if (_item != "") then {
if (_val != _max) then {
_magazineArray set [count _magazineArray,[_item,_val]];
} else {
_magazineArray set [count _magazineArray,_item];
};
};
};
//Secondary Mags
for "_i" from 122 to 129 do
{
_control = _dialog displayCtrl _i;
_item = gearSlotData _control;
_val = gearSlotAmmoCount _control;
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
if (_item != "") then {
if (_val != _max) then {
_magazineArray set [count _magazineArray,[_item,_val]];
} else {
_magazineArray set [count _magazineArray,_item];
};
};
};
dayz_unsaved = true;
dayz_Magazines = _magazineArray;

Some files were not shown because too many files have changed in this diff Show More