[Release][Epoch] Breakable Melee-Weapons on Buildables

Grafzahl

Valued Member!
Breakable Melee-Weapons on Buildables
What it does:
I know you hate indestructable bases, because this takes the salt from the whole epoch-gameplay, but i also know that you had to use indestructable bases because it was to easy to destroy a whole base while only having a hatchet... a wooden wall can only handle like 600 hatchet-slays, and this just makes all melee-weapons op against any buildables!

So what this tiny script does, is to make all melee weapons randomly break while using it near any modular buildables. Hatchets will have a 1% chance of breaking with each hit, while sledgehammer have a chance of 0.1% (configureable). It also gives a warning that you weapon can be destroyed when you use your melee weapon near any buildables.

This doesnt effect chopping wood or slaying zeds with melee weapons, it only activates when there is a modular basebuilding-item next to you (6m distance).

Its a very simple but effective script for taking out those hatchet swinging basedestructing a**holes...

Requirements:
Notepad++ and PBO manager.

Easy = <10 minutes

Installation:

Step 1:
You need your init/compiles.sqf and compile/player_harvest.sqf from the dayz_code.pbo folder and put them in your mission.pbo

Step 2:
After you have done that, add this code to the bottom of your copied player_harvest.sqf.
Code:
Code:
private ["_item","_iPos","_weapon","_primaryWeapon","_iItem","_removed","_radius","_dropPrimary","_buildableNearby","_breakChance"];
_buildableNearby = false;
_breakChance = 1;
if (_ammo isKindOf "Sledge_Swing_Ammo") then {
    _breakChance = 0.1;
};
if (_ammo isKindOf "Crowbar_Swing_Ammo") then {
    _breakChance = 0.5;
};
if (_ammo isKindOf "Hatchet_Swing_Ammo" or _ammo isKindOf "Machete_Swing_Ammo" or _ammo isKindOf "Sledge_Swing_Ammo" or _ammo isKindOf "Crowbar_Swing_Ammo" or _ammo isKindOf "Fishing_Swing_Ammo") then {
    {
        if ((_x isKindOf "ModularItems") or (_x isKindOf "Land_DZE_WoodDoor_Base") or (_x isKindOf "CinderWallDoor_DZ_Base")) then {
            if (alive _x) then {
                _buildableNearby = true;
            };
        };
    } foreach nearestObjects [getPosATL player, [], 6];
    if(_buildableNearby) then {
        if(random 100 <= _breakChance) then {
            _primaryWeapon = primaryWeapon player;
            cutText ["\n\nYour Melee-Weapon broke while you was trying to destroy this buildable!", "PLAIN DOWN"];
            player removeWeapon _primaryWeapon;
        } else {
            cutText [format["\n\nYour Melee-Weapon has a %1%2 chance to break while using it near buildables!",_breakChance,"%"], "PLAIN DOWN"];
        };
    };
};
Step 3:
After this open your copied compiles.sqf and search for this line:
Code:
    player_harvest =            compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_harvest.sqf";
and edit it to the new location of your copied player_harvest.sqf, something like
Code:
    player_harvest =            compile preprocessFileLineNumbers "fixes\player_harvest.sqf";

That's it. Pack your Pbo's and restart your server.

Last Words:I know players love indestructable bases, but please do me the favour: set tempbans for ammo-refuel-relogging-faggots, try this script, and maybe make cinder indestructable, but dont just make everything indestructable! there should always be a way to get into enemy bases without cracking codes for hours... its much more fun for every this way :)
 
Last edited:
Back
Top