Drugs and effects

hmmm not that quick, i think is not working now. -.-

and the script don't do anything... :/ show 2 hints, and thats everything, but you lost all tree items.
 

SmokeyMeadow

Well-Known Member
I have a new concoction here, but I'm having some problems clearing the effects in the end. I want to have b&w vision during the effect, but not after it wears off. So far the vision just stays b&w until you log out. So it's a work in progress.
fn_selfactions:
Code:
//CURE START
if((speed player <= 1) && ("ItemBandage" in magazines player) && ("ItemWaterbottleBoiled" in magazines player)  && ("ItemHeatPack" in magazines player)  && ("ItemAntibiotic" in magazines player)) then {
    hasCur = true;
} else {
    hasCur  = false;
};
if (hasCur) then {
    if (s_player_cur < 0) then {
    s_player_cur = player addAction [("<t color=""#0096ff"">" + ("Zombie Virus Home Remedy") +"</t>"),"scripts\mofzvc.sqf","",5,false,true,"",""];
    };
} else {
  player removeAction s_player_cur;
    s_player_cur = -1;
};
//CURE END
And this is called mofzvc.sqf:
Code:
private ["_chance", "_drugTrip", "_trip"];
 
 
_chance = floor(random 100);
_trip = _this select 2;
_drugTrip = time + 60 + (_trip * 10);
 
player playActionNow "Medic";
sleep 1;
titleText ["You whip up a batch of Mom's Ol Fashioned Zombie Virus Cure.","PLAIN DOWN"]; titleFadeOut 5;
sleep 5;
dayzHumanity = [player,+100];
_id = dayzHumanity spawn player_humanityChange;
player removeMagazine "ItemBandage";
player removeMagazine "ItemAntibiotic";
player removeMagazine "ItemHeatPack";
player removeMagazine "ItemWaterbottleBoiled";
player addMagazine "ItemWaterbottleUnfilled";
 
if (_chance > 10) then
    {
 
    titleText ["You feel better already.","PLAIN DOWN"]; titleFadeOut 5;
    while {time < _drugTrip} do {
 
 
 
_ppColor = ppEffectCreate ["ColorCorrections", 1999];
_ppColor ppEffectEnable true;
_ppColor ppEffectAdjust [0.5, 1, 0, [1, 1, 1, 0], [1, 1, 1, 0.0], [1, 1, 1, 1.0]];
_ppColor ppEffectCommit 0;
_ppGrain = ppEffectCreate ["filmGrain", 2005];
_ppGrain ppEffectEnable true;
_ppGrain ppEffectAdjust [0.02, 1, 1, 0, 1];
_ppGrain ppEffectCommit 0;
        r_player_blood = r_player_blood + 12000;
        [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
        r_player_injured = false;
        player setVariable ["USEC_injured",false,false];
        player setVariable ["NORRN_unconscious", false, false];
        player setVariable ["unconsciousTime", 0, false];
        player setVariable ["medForceUpdate",true,true];
        r_player_infected = false;
        player setVariable["USEC_infected",false,true];
        _unit setVariable["USEC_isCardiac",false,true];
        r_player_cardiac = false;
        sleep 0.6;
 
        };
 
    }
else
    {
 
 
    titleText ["You had an adverse reaction.","PLAIN DOWN"]; titleFadeOut 5;
    while {time < _drugTrip} do {
 
 
    _unit setVariable["USEC_isCardiac",true,true];
    r_player_cardiac = true;
    sleep 0.6;
     r_player_inpain = true;
    player setVariable["USEC_inPain",true,true];
    r_player_blood = r_player_blood - 8000;
 
        };
    };
 
titleText ["Just like Mom used to make.","PLAIN DOWN"]; titleFadeOut 5;
 
_ppColor ppEffectEnable false;
_ppColor ppEffectCommit 180;
_ppGrain ppEffectEnable false;
_ppGrain ppEffectCommit 180;
        call fnc_usec_resetWoundPoints;
        r_player_injured = false;
        player setVariable ["USEC_injured",false,false];
        player setVariable ["NORRN_unconscious", false, false];
        player setVariable ["unconsciousTime", 0, false];
        player setVariable ["medForceUpdate",true,true];
        r_player_infected = false;
        player setVariable["USEC_infected",false,true];
        _unit setVariable["USEC_isCardiac",false,true];
        r_player_cardiac = false;
        sleep 0.6;
I would love to know how to drop those effects, if anyone has any ideas.
 

SmokeyMeadow

Well-Known Member
Hi SmokeyMeadow! i interest you job, i will implementing in my comunity, its a great job! its complete?

thanks and sorry for my english
No problem, I'm glad you like it. It's almost ready for release, if I can just figure out how to clear the visual effects of the virus cure. Also sometimes the visual effects for the other drugs will stay for a really long time. I think this is just because the length is random, and sometimes the script just chooses a really long time to trip. I sat and watched it, and eventually the effects for the other drugs do clear, eventually.
 
The option for failure is already in place, it just causes you to trip hard and not have any of the combat bonuses. So maybe the inpain variable or unconscious variables could be added to that. It would be simple enough to do. I'm also in favor of adding a humanity penalty, I will work on that next. Meanwhile, here is a script that uses the hookah (Land_Water_pipe_EP1), instead of the items required by the other version. Put this in fn_selfactions:

Code:
//HITS FROM THE BONG START
if(cursorTarget isKindOf "Land_Water_pipe_EP1" and _canDo and (player distance cursorTarget < 4)) then {
    if (s_player_hippy < 0) then {
    s_player_hippy = player addAction ["Hit the Bong","scripts\pot.sqf",cursorTarget, 0, false, true, "",""];
    };
    } else {
    player removeAction s_player_hippy;
    s_player_hippy = -1;
    };
//HITS FROM THE BONG END
Then this goes in the scripts folder as pot.sqf:

Code:
private ["_chance", "_drugTrip", "_trip"];


_chance = floor(random 100);
_trip = _this select 2;
_drugTrip = time + 60 + (_trip * 10);

player playActionNow "Medic";
sleep 1;
_nul = [objNull, player, rSAY, "bong"] call RE;
sleep 3;
titleText ["You inhale deeply from the hookah.","PLAIN DOWN"]; titleFadeOut 5;
sleep 5;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
dayzHumanity = [player,-100];
_id = dayzHumanity spawn player_humanityChange;


liafu = true;
Flare = "SmokeShell" createVehicle position player;
if (vehicle player != player) then { Flare attachTo [vehicle player,[0,0,0.]];}
        else {Flare attachTo [player,[0,0,0.]];};
_nul = [objNull, player, rSAY, "cough"] call RE;
sleep 1;
      
if (_chance > 10) then
    {

    titleText ["You are stoned as a motherfucker.","PLAIN DOWN"]; titleFadeOut 5;
    while {time < _drugTrip} do {

        _force = random 10;
        "chromAberration" ppEffectEnable true;
        "chromAberration" ppEffectAdjust [_force / 24, _force / 24, false];
        "chromAberration" ppEffectCommit (0.3 + random 0.1);
        waituntil {ppEffectCommitted "chromAberration"};
        r_player_inpain = false;
        player setVariable["USEC_inPain",false,false];
        r_player_injured = false;
        player setVariable ["USEC_injured",false,false];
        player setVariable ["NORRN_unconscious", false, false];
        player setVariable ["unconsciousTime", 0, false];
        r_fracture_legs = false;
        player setVariable ["medForceUpdate",true,true];
        r_fracture_arms = false;
        player setHit["legs",0];
        player setHit["hands",0];  
      
        sleep 0.6;

        };
  
    }
else
    {

    titleText ["That shit must have been laced.","PLAIN DOWN"]; titleFadeOut 5;
    while {time < _drugTrip} do {


        _force = random 10;
        "chromAberration" ppEffectEnable true;
        "chromAberration" ppEffectAdjust [_force / 24, _force / 24, false];
        "chromAberration" ppEffectCommit (0.3 + random 0.1);
        "colorInversion" ppEffectEnable true;
        "wetDistortion" ppEffectEnable true;
        waituntil {ppEffectCommitted "chromAberration"};
        sleep 0.6;


        };
    };

  
"colorInversion" ppEffectEnable false;
"wetDistortion" ppEffectEnable false;
"colorCorrections" ppEffectAdjust [1, 1, 0, [0.5,0.5,0.5,0], [0.5,0.5,0.5,0], [0.5,0.5,0.5,0]];
"colorCorrections" ppEffectCommit 10;
waitUntil {ppEffectCommitted "colorCorrections"};
"colorCorrections" ppEffectEnable false;
"chromAberration" ppEffectEnable false;
titleText ["Your brain is finally starting to feel normal again.","PLAIN DOWN"]; titleFadeOut 5;
r_player_inpain = false;
player setVariable["USEC_inPain",false,false];
r_player_injured = false;
player setVariable ["USEC_injured",false,false];
r_fracture_legs = false;
player setVariable ["medForceUpdate",true,true];
r_fracture_arms = false;
player setHit["legs",0];
player setHit["hands",0];  

//Bong Hits by Smokey Meadow
Then, download this archive and extract to a folder in the mission.pbo called Sound. Alter description.ext and add this under class cfgsounds:

Code:
class cough
{
name="cough";
sound[]={sound\cough.ogg,0.9,1};
titles[] = {};
};
class bong
{
name="bong";
sound[]={sound\hookah.ogg,0.9,1};
titles[] = {};
};
You will notice I used one of the existing game sounds, the infection cough, but couldn't figure out how to call it. So I just extracted and moved it to the mission.pbo. If anyone knows how to call that sound without it being downloaded client side, please let me know, that would shave 16kb off the file size.
*Update: Humanity penalty added
This doesn't work, i get to "this shit is laced" and nothing happens. is there an update for this?
 

SmokeyMeadow

Well-Known Member
This doesn't work, i get to "this shit is laced" and nothing happens. is there an update for this?
Which version of Day Z are you running?

There's not really an update, I kind of lost track of this script and never finished it. I was having problems getting it to go back to normal after the effects ended.

When it says it's laced, does your vision not change? It's supposed to go blurry.
Also, it says it's laced every time? That's supposed to be a 1/10 chance of happening, or something like that. Not sure what's going on there.
 

HisShadowONE

Well-Known Member
boya i like this i havent tried the script but was about to post a similar idea glad i found this first!

so here goes can you make a alcohol variation for this , maybe mix a drink with a drug for now to get booze or whatever makes sense , effects could be like when severly injured with a screen blur/blink just an idea , enjoy!
 
Top