Drugs and effects

SmokeyMeadow

Well-Known Member
Okay, I've been working on something to allow players to combine the various meds for recreational use and even a bit of a power up. Got it working now to allow the player to combine morphine, epinephrin and painkillers to create a potent cocktail with effects similar to PCP. During the duration of the effects, players can still be killed, but cannot be injured or knocked unconscious. Damage taken during a drug trip will be applied after the effects of the drug wear off. Meanwhile, player vision becomes severely impaired, thanks to part of a Takistan Life script I found linked here. I'm posting this thread so people can suggest possible effects from the drugs. I don't want this to be like an invincibility powerup, but still make the player "feel" invulnerable.

Here is a pre-release version of the script for you all to try. It's still being tested, so keep that in mind. Not responsible for any weird effects or death if you try to jump off a building or something. Enjoy.

This goes in fn_selfactions:
Code:
//SPEEDBALL START
if((speed player <= 1) && ("ItemMorphine" in magazines player) && ("ItemPainkiller" in magazines player)  && ("ItemEpinephrine" in magazines player)) then {
    hasSpeed = true;
} else {
    hasSpeed  = false;
};
if (hasSpeed) then {
    if (takeSpeed < 0) then {
    takeSpeed = player addAction [("<t color=""#0096ff"">" + ("Mix Medications") +"</t>"),"scripts\speedball.sqf","",5,false,true,"",""];
    };
} else {
    player removeAction takeSpeed;
    takeSpeed = -1;
};
//SPEEDBALL END

Then create a scripts folder and a file called speedball.sqf, put this code in that 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 mix various medications into a potent cocktail.","PLAIN DOWN"]; titleFadeOut 5;
sleep 5;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
 dayzHumanity = [player,-100];
 _id = dayzHumanity spawn player_humanityChange;
player removeMagazine "ItemPainkiller"; 
player removeMagazine "ItemMorphine"; 
player removeMagazine "ItemEpinephrine"; 
 
if (_chance > 10) then
    {

    titleText ["You are ready to kick ass!","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 ["You are tripping balls.","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];    
 
 //Speedball by Smokey Meadow

This code will be updated over the weekend, so check back. Or chime in if you have any ideas.
*Update: Updated last lines of the speedball.sqf
**Update 2: Humanity penalty added. Thanks for the idea, reeper
 
great idea, think there should be a negative effect of taking the drug, maybe small humanity loss, also possibility of bad dose ie knocked out for short while, then maybe if take too often become addicted need help from another player to stop addiction......just throwing ideas out there....
 
Good idea how about something like a bad dose happens and you start violently shaking, being sick, bleeding, blurry vision etc. These could also be effects of taking the drug too or just taking to much of it...
 
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
 
would the last nine lines of code from 2nd script be missing from 1st script.....
as the 1st script seems to get stuck if you get a bad trip...
 
Hey Smokey!, nice i installed it correctly on origins 1.7.1, the only problem i get is restriction #44 or something like that with this number.
will be glad if you help me to whitelist the script, anyway it's awesome!!.
i was posting something similar with a thread called script ideas.
painkiller + antibiotics = blood :D but this is much more awesome ^^.
 
Hey Smokey!, nice i installed it correctly on origins 1.7.1, the only problem i get is restriction #44 or something like that with this number.
will be glad if you help me to whitelist the script, anyway it's awesome!!.
i was posting something similar with a thread called script ideas.
painkiller + antibiotics = blood :D but this is much more awesome ^^.
Aw crap, I knew this would happen eventually. I don't run BE on my server because I somehow got banned (never once hacked or even played on a public server, very odd). I will need to look into this. If someone who knows about fixing these restrictions is around, I would love to hear from you. Because without the ability to run BE, it's a lot harder to test it.
And thanks, I appreciate the kind words. This is one of my first projects.
 
Someone tells me that i have to modify this line. But also they tell me that i can coment it out with "//" and it will work, but i don't like that way (the easy way).
#47:
Code:
5 setHit !"\"setHit\"," !"object_setHitServer =        compile preprocessFileLineNumbers \"\z" !"object_setHit =        compile preprocessFileLineNumbers \"\z" !"player setHit[\"legs\",1];" !"player setHit[\"hands\",1];" !"_unit setHit[\"legs\",0];" !"_unit setHit[\"hands\",0];" !"_unit setHit[_selection,_damage];" !"_total = [_unit,_hit,_damage] call object_setHitServer;" !"_ent setHit [\"legs\",1];\n_ent setVariable [\"hit_legs\",2,true];" !"z\addons\dayz_code\compile\object_setHit.sqf" !"[player,\"legs\", (_fractures select 0)] call object_setHit;" !"[player,\"hands\", (_fractures select 1)] call object_setHit;" !"z\addons\dayz_code\compile\object_setHitServer.sqf" !"_unit setHit[_selection,(_dam + _damage)];" //!"call object_setHit"
 
Someone tells me that i have to modify this line. But also they tell me that i can coment it out with "//" and it will work, but i don't like that way (the easy way).
#47:
Code:
5 setHit !"\"setHit\"," !"object_setHitServer =        compile preprocessFileLineNumbers \"\z" !"object_setHit =        compile preprocessFileLineNumbers \"\z" !"player setHit[\"legs\",1];" !"player setHit[\"hands\",1];" !"_unit setHit[\"legs\",0];" !"_unit setHit[\"hands\",0];" !"_unit setHit[_selection,_damage];" !"_total = [_unit,_hit,_damage] call object_setHitServer;" !"_ent setHit [\"legs\",1];\n_ent setVariable [\"hit_legs\",2,true];" !"z\addons\dayz_code\compile\object_setHit.sqf" !"[player,\"legs\", (_fractures select 0)] call object_setHit;" !"[player,\"hands\", (_fractures select 1)] call object_setHit;" !"z\addons\dayz_code\compile\object_setHitServer.sqf" !"_unit setHit[_selection,(_dam + _damage)];" //!"call object_setHit"
Looks like it has to do with the part that prevents fractures during the trip. I wonder what would happen if the "sethit" section of the script was removed.
 
What about this?FuzeCraft,

If you set a rule to 1 only it just logs but does not kick so

1 addAmmo !"\"addAmmo\"," would log whenever a player did this but not kick

4 kicks the player if the line is detected so

4 addAmmo !"\"addAmmo\"," would just kick the player and not send any msg to the log

By adding the 1 + 4 you get 5 so the line

5 addAmmo !"\"addAmmo\","

Both kicks the user and logs the occurrence

If you want to turn a rule "off" you have two options you can change the 5 to a 1 which means people will never get kicked for it or you can put an exception for the specific command or script you intend to run, so if my Ammobuster.sqf script uses the addAmmo command inside it. And I want BE to ignore it

5 addAmmo !"\"addAmmo\"," !"Scripts\Ammobuster.sqf"

This tells BE to not include, which is what a ! means in code, the file "scripts\ammobuster.sqf" in detection, so I can run addAmmo in that script.
 
Doesn't work for me. It goes up to "You are ready to kick ass!" message and then nothing happens. Any ideas? I would think that something goes wrong here
Code:
    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
 
Yes, but I know that my antihack doesn't block these effects because something like this works fine for me
Code:
                nonapsi_ef = ppEffectCreate ["colorCorrections", 1555];
                nonapsi_ef ppEffectEnable true;
                nonapsi_ef ppEffectAdjust [1.0, 1.0, -0.03, [0.0, 0.0, 0.0, 0.0], [3.0, 5.0, 9.0, 5.0],[0.4,0.0,0.0, 0.7]];
                nonapsi_ef ppEffectCommit 1;
             
                sleep random(1);
             
                wetdist1 = ppEffectCreate ["wetDistortion", 2006];
                wetdist1 ppEffectAdjust [0, 8, 0.8,8,8, 0.2, 1, 0, 0, 0.08, 0.08, 0, 0, 0, 0.77];
                wetdist1 ppEffectEnable true;
                wetdist1 ppEffectCommit 0;
                ppe = ppEffectCreate ["colorCorrections", 1555];
                ppe ppEffectAdjust [1, 1, 0, [1.5,6,2.5,0.5], [5,3.5,5,-0.5], [-3,5,-5,-0.5]];
                ppe ppEffectCommit 1;
                ppe ppEffectEnable true;
                ppe2 = ppEffectCreate ["chromAberration", 1555];
                ppe2 ppEffectAdjust [0.01,0.01,true];
                ppe2 ppEffectCommit 1;
                ppe2 ppEffectEnable true;
                ppe3 = ppEffectCreate ["radialBlur", 1555];
                ppe3 ppEffectEnable true;
                ppe3 ppEffectAdjust [0.02,0.02,0.15,0.15];
                ppe3 ppEffectCommit 1;
 
                sleep random(1);
 
                wetdist1 = ppEffectCreate ["wetDistortion", 2006];
                wetdist1 ppEffectAdjust [1, 1.16, 0.32, 2.56, 0.8, 0.64, 2.64, 0, 0, 1.08, 0.08, 0, 0, 0, 1.77];
                wetdist1 ppEffectEnable true;
                wetdist1 ppEffectCommit 0;
 
                sleep random(1);
 
              nonapsi_ef = ppEffectCreate ["colorCorrections", 1555];
              nonapsi_ef ppEffectEnable true;
              nonapsi_ef ppEffectAdjust [1.0, 1.0, -0.02, [9.5, 1.5, 2.5, 0.2], [2.0, 7.0, 6.0, 2.0],[0.4,0.0,0.0, 0.7]];
              nonapsi_ef ppEffectCommit 1;
             
              sleep random(1);
            };
 
Do you know if you're still getting the combat bonuses or not? Also, does it give you the all clear message in the end, or does it just stop after the kick ass message?
 
something new about script restriction #44? ->#47? i solved it:
in line 47 paste: after all the stuff !"Scripts\Speedball.sqf"

->i think is working
 
something new about script restriction #44? ->#47? i solved it:
in line 47 paste: after all the stuff !"Scripts\Speedball.sqf"

->i think is working
That's good news. Thanks for reporting back, I'll make sure to credit you in the final release of the script.
 
Back
Top