William Rogers

Adding consume option to new item and special effect

4 posts in this topic

Hello, I have created some custom items for drugs but I cannot seem to get it so that I can consume them, also how would I add some sort of drug effect?

Share this post


Link to post
Share on other sites

This should lead you in the right direction

Spoiler

/**
 * ExileClient_object_player_thread_delirium
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_bloodAlcohol","_moveChance","_possibleMoves","_moveIndex"];
_bloodAlcohol = (ExileClientPlayerAttributes select 4);
if !(ExileClientDeliriumThread isEqualTo -1) then
{
	ExileClientPostProcessingDelirium ppEffectEnable true;
	_bloodAlcohol = (_bloodAlcohol - 0.1) max 0; 
	ExileClientPlayerAttributes set [4, _bloodAlcohol];
};
if (_bloodAlcohol isEqualTo 0) then
{
	ExileClientPostProcessingDelirium ppEffectEnable false;
	ExileClientPostProcessingDelirium ppEffectCommit 0; 
	[ExileClientDeliriumThread] call ExileClient_system_thread_removeTask;
	ExileClientDeliriumThread = -1;
	systemChat "You are now sober again.";
}
else 
{
	ExileClientPostProcessingDelirium ppEffectAdjust 
	[
		linearConversion [0, 3, _bloodAlcohol, 2, 		5, 		true],	
		linearConversion [0, 3, _bloodAlcohol, 0.1, 	0.2, 	true],	
		linearConversion [0, 3, _bloodAlcohol, 0.1, 	0.2, 	true],	
		linearConversion [0, 3, _bloodAlcohol, 0.2, 	1.5, 	true],	
		linearConversion [0, 3, _bloodAlcohol, 0.2, 	2, 		true],	
		linearConversion [0, 3, _bloodAlcohol, 2, 		4, 		true],	
		linearConversion [0, 3, _bloodAlcohol, 2, 		3, 		true],	
		linearConversion [0, 3, _bloodAlcohol, 0.01, 	0.02, 	true],	
		linearConversion [0, 3, _bloodAlcohol, 0.01, 	0.02, 	true],	
		linearConversion [0, 3, _bloodAlcohol, 0.01, 	0.01, 	true],	
		linearConversion [0, 3, _bloodAlcohol, 0.01, 	0.02, 	true],	
		linearConversion [0, 3, _bloodAlcohol, 0.01, 	0.05, 	true],	
		linearConversion [0, 3, _bloodAlcohol, 0.1,		0.25, 	true],	
		linearConversion [0, 3, _bloodAlcohol, 2, 		10, 	true],
		linearConversion [0, 3, _bloodAlcohol, 2, 		5, 		true]
	];
	ExileClientPostProcessingDelirium ppEffectCommit 0; 
	addCamShake 
	[
		linearConversion [0, 3, _bloodAlcohol, 0, 30, true], 
		15.9, 
		linearConversion [0, 3, _bloodAlcohol, 0.1, 0.3, true] 
	];
	if (_bloodAlcohol > 2) then
	{
		_moveChance = floor (random 100); 
		if (_moveChance <= 10) then
		{
			_possibleMoves = ["PlayerWalkB", "PlayerWalkF", "PlayerWalkL", "PlayerWalkLB", "PlayerWalkLF", "PlayerWalkR", "PlayerWalkRB", "PlayerWalkRF"];
			_moveIndex = floor (random (count _possibleMoves));
			player playActionNow (_possibleMoves select _moveIndex);
		};
	};
};

 

Share this post


Link to post
Share on other sites
Advertisement

you would have to script it all manually as unless you make it a mod, you need to add it to the actual items cfgmagazines config class :) just look inside exile configs and you will find all you need! :)

1 person likes this

Share this post


Link to post
Share on other sites

Posted (edited)

I've been trying to find ExileClient_object_player_thread_delirium . What PBO is it in?

 

nvm... I found it!

Edited by Bob_the_K

Share this post


Link to post
Share on other sites
Advertisement

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

  • Recently Browsing   0 members

    No registered users viewing this page.