Jump to content

SmithyJenkins

Member
  • Posts

    4
  • Joined

  • Last visited

Posts posted by SmithyJenkins

  1. If anyone is looking for a version like Schwedes that had separate chances for hotwiring lockboxes and safes, I made a version that had that functionality:

    Spoiler
    
    /** ORIGINAL Author: SchwEde aka shinySonic **/
    /** REWRITED BY juandayz and dedicated for Pillbox :D **/
    //Fixes by "a man" and "shawn" tnks guys for the help
    //Separate lockbox/safe functionality added by Smithy Jenkins
    
    private ["_vault","_isunlockable", "_isSafe", "_isLockbox", "_openChance", "_safeFailChance", "_lockboxFailChance"];
    
    _vault = _this select 3;
    
    _isunlockable = (((typeOf _vault) == "VaultStorageLocked") || ((typeOf _vault) == "LockboxStorageLocked"));
    
    _isSafe = (typeOf _vault) == "VaultStorageLocked";
    _isLockbox = (typeOf _vault) == "LockboxStorageLocked";
    
    _openChance= round(random 100);		//Random rounded number out of 100
    
    _safeFailChance = 0;
    _lockboxFailChance = 0;
    
    player removeAction s_player_hotwirevault;
    s_player_hotwirevault = -1;
    
    if !("ItemHotwireKit" in magazines player) exitwith {    
    	_msg = "No Hotwire Kit found in inventory!"; 
    	systemChat ("Server: "+str _msg);
    };
    
    dayz_actionInProgress = true;
    player removeMagazine "ItemHotwireKit";
    
    if (_isunlockable) then {
    	if (_isSafe) then {
    		if (_openChance < _safeFailChance)  exitWith {
    			dayz_actionInProgress = false;
    			_msg = "The Hotwire Kit breaks and the vault remains locked."; 
    			systemChat ("Server: "+str _msg);
    		};
    		
    		_msg = "The Hotwire Kit disintegrates as the vault unlocks."; 
    		systemChat ("Server: "+str _msg);
    		dayz_combination = _vault getVariable["CharacterID","0"];
    		_vault spawn player_unlockVault;
    		dayz_actionInProgress = false;
    	} else {
    		if (_isLockbox) then {
    			if (_openChance < _lockboxFailChance)  exitWith {
    				dayz_actionInProgress = false;
    				_msg = "The Hotwire Kit breaks and the vault remains locked."; 
    				systemChat ("Server: "+str _msg);
    			};
    			
    			_msg = "The Hotwire Kit disintegrates as the vault unlocks.";
    			systemChat ("Server: "+str _msg);
    			dayz_combination = _vault getVariable["CharacterID","0"];
    			_vault spawn player_unlockVault;
    			dayz_actionInProgress = false;
    		};
    	};
    };
    

     

    Code may be a little unoptimized but hey, it works :)

  2. On 8/27/2016 at 7:20 AM, Jestertriks said:

    Where do all the mission crates and ai items pull from? Weapons spawn in the boxes after missions complete but i dont see where to edit those boxes so i can add/remove weapons. Also i want to edit the ai, for example, when i switch the president mission to extreme, i am assuming it also changes the ai loadout cause players are looting laser designator from ai and getting kicked for it but everything seems fine when it is on hard.

     

    [_crate,5,5,[5,crate_items_gem_tower],2] call dynamic_crate;

    where is the first _crate,5,5 pulling from? what do the numbers mean?

    - Mission crates and AI load outs can be found in the config.sqf file in the WAI folder. You can either edit the existing ones or make new ones and then put them in the separate mission files.

    - Editing the AI can also be found in the config.sqf. Editing the AI extremity should not have any effect on the AI load out.

    - Most of the WAI mission documentation can be found in MISSION_EXAMPLE.sqf in the /missions/ directory.

    - Here is the sepecifc documentation for the dynamic_crate call.

        //Setup the crate
        _crate_type     = crates_large call BIS_fnc_selectrandom; // Choose between crates_large, crates_medium and crates_small
        _crate             = createVehicle [_crate_type,[(_position select 0),(_position select 1),0],[],0,"CAN_COLLIDE"];
    
        // Crate Spawn Example
        // Parameters:    0: _crate
        //                1: Max number of guns OR [MAX number of guns,gun_array]
        //                2: Max number of tools OR [MAX number of tools,tool_array]
        //                3: Max number of items OR [MAX number of items,item_array]
        //                4: Max number of backpacks OR [MAX number of backpacks,backpack_array]
        [_crate,16,[8,crate_tools_sniper],[3,crate_items_high_value],[4,crate_backpacks_large]] call dynamic_crate;

    - Param 0 - _crate is creating the vehicle, as you can see in the _crate line above.

    - Param 1 - The first number is the max number of guns, and an optional gun_array, which would be what you find in the config.sqf

    - Param 2 - Tools

    - Param 3 - Items

    - Param 4 - Backpacks.

×
×
  • Create New...