Jump to content

+[Release]+[Alchemy Lab]


juandayz

Recommended Posts

***ALLOW PLAYERS TO TRY TO CRAFT EMERALDS USING AN ALCHEMY LAB WITH A SPECIFIC TRADER***
                   ...Players will need have a ItemSledge && Goldbar && SilverBar in inventory...
 

1-Create this sqf:

alchemylab.sqf  ( put into MPMISSIONS/YOURINSTANCE/CUSTOM/ ).

 

Spoiler

private ["_hasitem","_inventory","_hasSledge","_rand","_removed"];


_hasitem = ["ItemGoldBar","ItemSilverBar"] call player_checkItems;
_inventory = items player;
_hasSledge = "ItemSledge" in _inventory;
 

if (!_hasitem) exitWith {cutText [format["Needs 1xItemGoldBar and 1xItemSilverBar"], "PLAIN DOWN"];};
if (!_hasSledge) exitWith {cutText [format["1xSledge in inventory"], "PLAIN DOWN"];};

 


if (_hasitem && _hasSledge) then {

    _removed = ["ItemGoldBar","ItemSilverBar"] call player_removeItems;
    player playActionNow "Medic";
    sleep 1;

    _rand = floor(random 500);
            
            if (_rand <= 100) then {
                
                titleText ["Something  went wrong", "PLAIN DOWN"];titleFadeOut 5;             
            };
            if (_rand <= 120 && _rand > 101) then {
                player addMagazine "ItemEmerald";
                [format["<t size='1.2' color='#D01000'>WOW!!!!%1</t><br/><t size='0.9'>CRAFT AN EMERALD!!!!.</t>",(name player)],0,0,2,2] spawn BIS_fnc_dynamicText;  
            };
            if (_rand <= 200 && _rand > 121) then {
                
                titleText ["Mmm Items go back to the original state", "PLAIN DOWN"];titleFadeOut 5;
                player addMagazine "ItemGoldBar";
                player addMagazine "ItemSilverBar";
            };
            if (_rand <= 500 && _rand > 201) then {
                titleText ["FAIL But Do not Worry your near of the goal", "PLAIN DOWN"];titleFadeOut 5;
            };
    };

 

NOTE: if u wanna change the items to allow the script (change _hasitem and _remove variables and  in if (_rand <= 200 && _rand > 121) then { you also will need change the two player addMagazine )

Also you will need a sledge but you can change it by another tool in _hasSledge variable.

 

 

2-Now open your server_traders_cherno_11.sqf ( for coins users )  or server_traders.sqf ( for goldbars users)  and choose one of the traders IDs.

The trader you pick will have the option to execute the alchemy lab

in this example i will choose RU_Functionary1

3-In your CUSTOM fn_selfactions.sqf:

find:

if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "Plastic_Pole_EP1_DZ")) then {

above paste:

if (_canDo && (speed player <= 1) && (_cursorTarget isKindOf "RU_Functionary1")) then {
	if (s_player_alchemylab < 0) then {
	s_player_alchemylab = player addAction ["<t color='#ff5200'>AlchemyLab</t>", "custom\alchemylab.sqf", [], 5, false];
	};
	} else {
	player removeAction s_player_alchemylab;
    s_player_alchemylab = -1;
	};

4-Near of the end of fn_selfactions:

Find lines in grey and add only lines in blue.

Spoiler

} else {
            player removeAction s_player_feeddog;
            s_player_feeddog = -1;
            player removeAction s_player_waterdog;
            s_player_waterdog = -1;
            player removeAction s_player_staydog;
            s_player_staydog = -1;
            player removeAction s_player_trackdog;
            s_player_trackdog = -1;
            player removeAction s_player_barkdog;
            s_player_barkdog = -1;
            player removeAction s_player_warndog;
            s_player_warndog = -1;
            player removeAction s_player_followdog;
            s_player_followdog = -1;
        };
    };

} else {
//Engineering

player removeAction s_player_alchemylab;
s_player_alchemylab = -1;


    
    {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
    s_player_repair_crtl = -1;
    {player removeAction _x} count s_player_combi;s_player_combi = [];
    dayz_myCursorTarget = objNull;
    s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull];
    {player removeAction _x} count s_player_parts;s_player_parts = [];
    s_player_parts_crtl = -1;
    {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
    s_player_lockUnlock_crtl = -1;
    player removeAction s_player_checkGear;
    s_player_checkGear = -1;
    player removeAction s_player_SurrenderedGear;
    s_player_SurrenderedGear = -1;

 

Link to comment
Share on other sites

@oldmatechoc  haha see here you have the code for heal players
 with a cost in coins...

Spoiler

private ["_LastUsedTime","_Time","_costs"];

_LastUsedTime = 900;
_Time = time - lastuse;    
_costs = 2000;

if(_Time < _LastUsedTime) exitWith {
    cutText [format["wait %1 seconds",(round(_Time - _LastUsedTime))], "PLAIN DOWN"];
};

 

if !([ player,_costs] call SC_fnc_removeCoins) then {
        titleText [format["Needs %1 %2 .",_costs,CurrencyName] , "PLAIN DOWN", 1];
    } else {
    titleText [format["Pay %1 %2",_costs,CurrencyName] , "PLAIN DOWN", 1];


    disableSerialization;
                                dayz_sourceBleeding = objNull;
                                r_player_blood = r_player_bloodTotal;
                                r_player_inpain = false;
                                r_player_infected = false;
                                r_player_injured = false;
                                dayz_hunger = 0;
                                dayz_thirst = 0;
                                dayz_temperatur = 37;
                                r_fracture_legs = false;
                                r_fracture_arms = false;
                                r_player_dead = false;
                                r_player_unconscious = false;
                                r_player_loaded = false;
                                r_player_cardiac = false;
                                r_player_lowblood = false;
                                r_player_timeout = 0;
                                r_handlercount = 0;
                                r_interrupt = false;
                                r_doLoop = false;
                                r_drag_sqf = false;
                                r_self = false;
                                r_action = false;
                                r_action_unload = false;
                                r_player_handler = false;
                                r_player_handler1 = false;
                                disableUserInput false;
                                'dynamicBlur' ppEffectAdjust [0];
                                'dynamicBlur' ppEffectCommit 5;
                                _selection = 'legs';
                                _damage = 0;
                                player setHit[_selection,_damage];
                                player setVariable['messing',[dayz_hunger,dayz_thirst],true];
                                player setVariable['NORRN_unconscious',false,true];
                                player setVariable['USEC_infected',false,true];
                                player setVariable['USEC_injured',false,true];
                                player setVariable['USEC_inPain',false,true];
                                player setVariable['USEC_isCardiac',false,true];
                                player setVariable['USEC_lowBlood',false,true];
                                player setVariable['USEC_BloodQty',12000,true];
                                player setVariable['unconsciousTime',0,true];
                                player setVariable['hit_legs',0,true];
                                player setVariable['hit_hands',0,true];
                                player setVariable['medForceUpdate',true,true];
                                _display = uiNameSpace getVariable 'DAYZ_GUI_display';
                                _control = _display displayCtrl 1303;
                                _control ctrlShow false;
                                _display = uiNameSpace getVariable 'DAYZ_GUI_display';
                                _control = _display displayCtrl 1203;
                                _control ctrlShow false;
                                player setdamage 0;
                                0 fadeSound 1;
                                resetCamShake;
                                lastuse = time;
                                };

 

Link to comment
Share on other sites

@oldmatechoc

this is a lil and quick quest and answer ..with traders....  trader ask you something.. you choose your answer.. at least you can win or not a random reward.

questlist.sqf  (can use the same way to execute as in alchemylab)

Spoiler

private ["_standby","_randtext1","_randquest1","_randtext2","_randquest2","_randquestfinish","_randtextnice","_randtextbad","_rewards"];


_standby = 3;
_randtext1 = [
"Are you a bad guy or a nice child",
"You kill someone",
"You stole someother guy",
"Are you scared about zeds",
"You feel safe in your base"
] call BIS_fnc_selectRandom;

titleText [format["%1",_randtext1] , "PLAIN DOWN", 3];

sleep _standby;

_randquest1 = floor(random 100);

if (_randquest1 <= 30) then {
answer = 0;
list =
[
    ["",true],
    ["list", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Yes", [], "", -5, [["expression", "answer=1;"]], "1", "1"],
    ["No", [], "", -5, [["expression", "answer=0;"]], "1", "1"],
    ["Maybe", [], "", -5, [["expression", "answer=0;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:list";
WaitUntil{commandingMenu == ""};    
};

if (_randquest1 <= 65 && _randquest1 > 31) then {
answer = 0;
list =
[
    ["",true],
    ["list", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Yes", [], "", -5, [["expression", "answer=0;"]], "1", "1"],
    ["No", [], "", -5, [["expression", "answer=1;"]], "1", "1"],
    ["Maybe", [], "", -5, [["expression", "answer=0;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:list";
WaitUntil{commandingMenu == ""};    
};

if (_randquest1 <= 100 && _randquest1 > 66) then {
answer = 0;
list =
[
    ["",true],
    ["list", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Yes", [], "", -5, [["expression", "answer=0;"]], "1", "1"],
    ["No", [], "", -5, [["expression", "answer=0;"]], "1", "1"],
    ["Maybe", [], "", -5, [["expression", "answer=1;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:list";
WaitUntil{commandingMenu == ""};    
};

/////////////////////////////////////////PROCEED SECOND SECUENSE
if(answer != 0) then {

_randtext2 = [
"I lost my wife in berezino have you seen her",
"Have you seen the GREAT ZED",
"Military Comboy arrived at Chernogorsk have you seen it",
"I miss the Tv shows do you remember two and a half men",
"Something happend in Stary. People go crazy with the new girl.Have you seen her"
] call BIS_fnc_selectRandom;

titleText [format["%1",_randtext2] , "PLAIN DOWN", 3];

sleep _standby;

_randquest2 = floor(random 100);

if (_randquest2 <= 30) then {
answer2 = 0;
list2 =
[
    ["",true],
    ["list2", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Yes", [], "", -5, [["expression", "answer2=1;"]], "1", "1"],
    ["No", [], "", -5, [["expression", "answer2=0;"]], "1", "1"],
    ["Maybe", [], "", -5, [["expression", "answer2=0;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:list2";
WaitUntil{commandingMenu == ""};    
};

if (_randquest2 <= 65 && _randquest2 > 31) then {
answer2 = 0;
list2 =
[
    ["",true],
    ["list2", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Yes", [], "", -5, [["expression", "answer2=0;"]], "1", "1"],
    ["No", [], "", -5, [["expression", "answer2=1;"]], "1", "1"],
    ["Maybe", [], "", -5, [["expression", "answer2=0;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:list2";
WaitUntil{commandingMenu == ""};
};

if (_randquest2 <= 100 && _randquest2 > 66) then {
answer2 = 0;
list2 =
[
    ["",true],
    ["list2", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["", [-1], "", -5, [["expression", ""]], "1", "0"],
    ["Yes", [], "", -5, [["expression", "answer2=0;"]], "1", "1"],
    ["No", [], "", -5, [["expression", "answer2=0;"]], "1", "1"],
    ["Maybe", [], "", -5, [["expression", "answer2=1;"]], "1", "1"],    
    ["", [-1], "", -5, [["expression", ""]], "1", "0"]
];
showCommandingMenu "#USER:list2";
WaitUntil{commandingMenu == ""};    
};
}else{
cutText [format["Well im bussy now bye"], "PLAIN DOWN"];
};

/////////////////////////////////3rd SECUENSE
if(answer2 != 0) then {
_rewards = ["ItemSodaOrangeSherbet","HandGrenade_west","ItemSodaEmpty","ItemTrashRazor","ItemTrashToiletpaper","TrashJackDaniels","TrashTinCan","ItemOilBarrel","ItemFuelBarrel","ItemBriefcase50oz","ItemAluminumBar10oz","FoodSteakRaw","ItemWaterbottle","ItemAntibiotic","ItemBloodbag","ItemEpinephrine","ItemMorphine","ItemCanvas","MortarBucket","ItemLightBulb","PartWheel","ItemTent","ItemTentOld","Skin_FR_OHara_DZ","ItemGenerator","ItemComboLock","ItemMixOil","ItemKiloHemp","ItemSandbag","30Rnd_556x45_StanagSD","100Rnd_762x54_PK","20Rnd_762x51_DMR","PartGlass","ItemRuby"] call BIS_fnc_selectRandom;

_randquestfinish = floor(random 100);

_randtextnice = [
"Your a nice guy here you got some cash",
"Im glad to meet you here you got some cash"
] call BIS_fnc_selectRandom;

_randtextbad = [
"Your a lil brat get out of here or i gonna beat you with a baseball bat oh yeah ohh",
"You suck child get out of here now"
] call BIS_fnc_selectRandom;

if (_randquestfinish <= 50) then {
titleText [format["%1",_randtextnice] , "PLAIN DOWN", 3];
player addMagazine _rewards;
};

if (_randquestfinish <= 100 && _randquestfinish > 51) then {
titleText [format["%1",_randtextbad] , "PLAIN DOWN", 3];
};
}else{
cutText [format["Well im bussy now bye"], "PLAIN DOWN"];
};

 

 

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...