Jump to content

[Release] Pay for Heal -Default Currency-


oSoDirty

Recommended Posts

Pay for healing -Default Currency- 

 

Updateded! I forgot to add the fix broken legs bit. As well as some others For those who have already installed this. Just replace the playerHeal.sqf with the new one in the link.

I have updated the link a couple of times now lol. This will now heal/reset and save blood amount, wounds, broken limbs, pain level, and sickness. 

 

 

Future: Food and hydration also set to full.

 

 

Credits to   GaspArt  for the original idea! For his coin currency version go

Credits & thanks to Krixes @ http://opendayz.net for his self bloodbag script and letting me use his healing method.

 

 

 

What it does:

Places an AI at a specific location that will heal you for one gold if not in combat.

This script does give change although if you use silver it has to be a full brief.

To many combos of silver to write.

 

 

You will need

playerHeal.sqf get it HERE

A tool for unpacking pbos. (I recommend pbo manager from armaholic)

A custom fn_selfActions.sqf

A custom variables.sqf

 

 

NOTE!: Im not 100% sure which addon this Ai skin is from, due to my trader addons it just happens to be the last available medic.

To change which AI is used just change the classname from "GER_Soldier_Medic_EP1" to any available AI skin you have. Note that if you intend to add this to a pre existing AI you'll skip the mission.sqf step and just find the classname of the ai you intend to use and replace it in the fn_selfActions part.

 

Let's do this shall we?

 

 

1st off, Place the playerHeal.sqf you downloaded in a folder a called "custom" -no quotes- in the root of your mission pbo/folder. (I you have one already then use the pre-existing)

 

 

 

Open up your custom variables.sqf look for 

//Player self-action handles
dayz_resetSelfActions = {
      s_player_fire =			-1;
      s_player_cook =			-1;
      s_player_boil =			-1;
      s_player_fireout =		-1;
      s_player_butcher =		-1;
      s_player_packtent = 	        -1;
      ................
      ..........
}; 

and at the bottom of that array you need to put:

s_playerHeal = -1;

We're done with variables.

 

 

Now we need to open up fn_selfActions.sqf and find this block of variables:

	_isVehicle = _cursorTarget isKindOf "AllVehicles";
	_isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"];
	_isnewstorage = _typeOfCursorTarget in DZE_isNewStorage;

A space below them place:

// AI heal start
if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "GER_Soldier_Medic_EP1")) then {
	if (s_playerHeal < 0) then {
            s_playerHeal = player addaction["Heal for 1 gold","custom\getHealed.sqf","",15,false,true,"", ""];
			waitUntil { speed player > 0 };
			player removeAction s_playerHeal;  // Stops player from being able to target AI healer and heal elsewhere later on
			s_playerHeal = -1;
        };
    } else {
        player removeAction s_playerHeal;
        s_playerHeal = -1;
    };	
// AI heal end

You should have something like this:

	_isVehicle = _cursorTarget isKindOf "AllVehicles";
	_isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"];
	_isnewstorage = _typeOfCursorTarget in DZE_isNewStorage;
	
// AI heal start
if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "GER_Soldier_Medic_EP1")) then {
	if (s_playerHeal < 0) then {
            s_playerHeal = player addaction["Heal for 1 gold","custom\getHealed.sqf","",15,false,true,"", ""];
			waitUntil { speed player > 0 };
			player removeAction s_playerHeal;  // Stops player from being able to target AI healer and heal elsewhere later on
			s_playerHeal = -1;
        };
    } else {
        player removeAction s_playerHeal;
        s_playerHeal = -1;
    };	
// AI heal end
	
	// get items && magazines only once
	_magazinesPlayer = magazines player;

	//boiled Water
	_hasbottleitem = "ItemWaterbottle" in _magazinesPlayer;
	_hastinitem = false;
	{

 

 

That's all for fn_selfActions

 

 

Now for the last part. Unpack your dayz_server.pbo and in missions\YourMission\ open up mission.sqf  & place:

     _unit_1525 = objNull;
if (true) then
{
  _this = createAgent ["GER_Soldier_Medic_EP1", [15529.1,8508.58,0.018], [], 0, "CAN_COLLIDE"];
  _unit_1525 = _this;
  _this setDir 1.60;
  _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;";
  _this setUnitAbility 0.60000002;
  _this allowDammage false; _this disableAI 'FSM'; _this disableAI 'MOVE'; _this disableAI 'AUTOTARGET'; _this disableAI 'TARGET'; _this setBehaviour 'CARELESS'; _this forceSpeed 0;_this enableSimulation false;};

at the bottom a space above   processInitCommands;   and at least a space below the last    }; If you already have trader additions then just place it with your other additions making sure the unit # is unique.

Note that these coords are in a random tent in Taviana (origins version). Change them to suit your needs. You can add as many as you like just make sure they dont have the same unit number. I just did one for reference.

 

That should be it!!

 

Repack, upload, get gold, get hurt, & get HEALED!

 

#2 from oSoDirty, Hope y'all enjoy!

Link to comment
Share on other sites

Nice script. How do this effect server load and AH?

The client side part of the script its self is quite small, so server load would depend on how many AI you spawn in, and i would imagine it would take quite a few to put a toll on performance.

And the AH i dont think is a bother since it only does things you do in game anyway like self bloodbag, pain killers, antibiotics, and bandage.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...