juandayz Posted August 29, 2016 Report Share Posted August 29, 2016 #This add a new kind of trader not based in humanity variable as: Neutral,Bandit,Hero. #This new kind is based on friendship with player. #I take friendship as survived days. So if u survived days > 1 then AI trader is your friend and he wanna trade with you. #You can locate this traders in Bash,Stary && Klen. #Also i made a new category where you are free to play with rare items and lower prices (its the main idea). #This is only for coins and advanced trade but if someone want it for gold or without adv just say in this post. INSTALL: Spoiler 1-ADD THE AI: Unpack your dayz_server.pbo Go to ....\@DayZ_Epoch_Server\addons\dayz_server\missions\DayZ_Epoch_11.Chernarus\ and open mission.sqf Spoiler FIND: _unit_132 = objNull; if (true) then { _this = createAgent ["GUE_Woodlander2", [6321.0439, 7781.0288], [], 0, "CAN_COLLIDE"]; _unit_132 = _this; _this setDir 9.6638927; _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;}; PASTE BELLOW: ////////////////////////////FRIENDSHIP TRADERS _unit_1000 = objNull; if (true) then { _this = createAgent ["ValentinaFit", [6347.0796, 7765.0483, 0.88207597], [], 0, "CAN_COLLIDE"]; _unit_1 = _this; _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;"; _this addEventHandler ["handleDamage", {false}]; _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;}; _unit_1002 = objNull; if (true) then { _this = createAgent ["ValentinaFit", [11455.211, 11346.01, 0.85507959], [], 0, "CAN_COLLIDE"]; _unit_2 = _this; _this setDir -10.121396; _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;"; _this addEventHandler ["handleDamage", {false}]; _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;}; _unit_1003 = objNull; if (true) then { _this = createAgent ["ValentinaFit", [4077.468, 11671.014, 0.85201353], [], 0, "CAN_COLLIDE"]; _unit_3 = _this; _this setDir -83.496246; _this setVehicleInit "this allowDammage false; this disableAI 'FSM'; this disableAI 'MOVE'; this disableAI 'AUTOTARGET'; this disableAI 'TARGET'; this setBehaviour 'CARELESS'; this forceSpeed 0;"; _this addEventHandler ["handleDamage", {false}]; _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;}; //////////////////////////////END FRIENDSHIPTRADERS Save and repack your pbo. 2-CREATE THE NEW CATEGORY: A-make a new file called FriendshipCategory.hpp and drop it into this path: ...\MPMissions\DayZ_Epoch_11.Chernarus\ZSC\config\Category\ FriendshipCategory.hpp Spoiler ///////////////////////////This is only an example i made subcategories if you want add more items and change prices/////////////////// class Category_5000 { /////////////////////////AMMO SECTION class 20Rnd_762x51_DMR { type = "trade_items"; buy[] ={200,"Coins"}; sell[] ={100,"Coins"}; }; class 10Rnd_762x54_SVD { type = "trade_items"; buy[] ={200,"Coins"}; sell[] ={100,"Coins"}; }; class 5Rnd_762x51_M24 { type = "trade_items"; buy[] ={100,"Coins"}; sell[] ={50,"Coins"}; }; class 5x_22_LR_17_HMR { type = "trade_items"; buy[] ={200,"Coins"}; sell[] ={100,"Coins"}; }; ////////////////////////END AMMO//////// //////////TOOLS SECTION/////////////// class ItemCompass { type = "trade_weapons"; buy[] ={100,"Coins"}; sell[] ={100,"Coins"}; }; class Binocular { type = "trade_weapons"; buy[] ={60,"Coins"}; sell[] ={30,"Coins"}; }; class Binocular_Vector { type = "trade_weapons"; buy[] ={700,"Coins"}; sell[] ={700,"Coins"}; }; class ItemEtool { type = "trade_weapons"; buy[] = {300,"Coins"}; sell[] ={300,"Coins"}; }; class ItemFlashlight { type = "trade_weapons"; buy[] ={60,"Coins"}; sell[] ={1,"Coins"}; }; class ItemFlashlightRed { type = "trade_weapons"; buy[] ={100,"Coins"}; sell[] ={100,"Coins"}; }; class ItemGPS { type = "trade_weapons"; buy[] ={200,"Coins"}; sell[] ={100,"Coins"}; }; class ItemHatchet_DZE { type = "trade_weapons"; buy[] ={40,"Coins"}; sell[] ={30,"Coins"}; }; class ItemKnife { type = "trade_weapons"; buy[] ={40,"Coins"}; sell[] ={30,"Coins"}; }; class ItemMap { type = "trade_weapons"; buy[] ={80,"Coins"}; sell[] ={1,"Coins"}; }; class ItemMatchbox_DZE { type = "trade_weapons"; buy[] ={20,"Coins"}; sell[] ={20,"Coins"}; }; class ItemToolbox { type = "trade_weapons"; buy[] ={30,"Coins"}; sell[] ={30,"Coins"}; }; class ItemWatch { type = "trade_weapons"; buy[] ={30,"Coins"}; sell[] ={30,"Coins"}; }; class NVGoggles { type = "trade_weapons"; buy[] ={260,"Coins"}; sell[] ={160,"Coins"}; }; class ItemCrowbar { type = "trade_weapons"; buy[] ={60,"Coins"}; sell[] ={30,"Coins"}; }; class ItemMachete { type = "trade_weapons"; buy[] ={60,"Coins"}; sell[] ={30,"Coins"}; }; class ItemFishingPole { type = "trade_weapons"; buy[] ={60,"Coins"}; sell[] ={30,"Coins"}; }; class ItemShovel { type = "trade_weapons"; buy[] ={1200,"Coins"}; sell[] ={1000,"Coins"}; }; class ItemSledge { type = "trade_weapons"; buy[] ={1200,"Coins"}; sell[] ={1000,"Coins"}; }; ////////////////////////////////END TOOLS//////// /////////WEAPONS SECTION///// class m107 { type = "trade_weapons"; buy[] ={100000,"Coins"}; sell[] ={50000,"Coins"}; }; class FN_FAL_ANPVS4 { type = "trade_weapons"; buy[] ={80000,"Coins"}; sell[] ={40000,"Coins"}; }; class BAF_L85A2_RIS_CWS { type = "trade_weapons"; buy[] ={100000,"Coins"}; sell[] ={50000,"Coins"}; }; class BAF_AS50_scoped { type = "trade_weapons"; buy[] ={150000,"Coins"}; sell[] ={50000,"Coins"}; }; class BAF_LRR_scoped { type = "trade_weapons"; buy[] ={150000,"Coins"}; sell[] ={50000,"Coins"}; }; class KSVK { type = "trade_weapons"; buy[] ={120000,"Coins"}; sell[] ={50000,"Coins"}; }; //////////////////////////////END WEAPONS /////////CLOTHES SECTION class Skin_CZ_Special_Forces_GL_DES_EP1_DZ { type = "trade_items"; buy[] ={2000,"Coins"}; sell[] ={1000,"Coins"}; }; class Skin_Drake_Light_DZ { type = "trade_items"; buy[] ={2000,"Coins"}; sell[] ={1000,"Coins"}; }; class Skin_Soldier_Sniper_PMC_DZ { type = "trade_items"; buy[] ={2000,"Coins"}; sell[] ={1000,"Coins"}; }; class Skin_FR_OHara_DZ { type = "trade_items"; buy[] ={2000,"Coins"}; sell[] ={1000,"Coins"}; }; class Skin_FR_Rodriguez_DZ { type = "trade_items"; buy[] ={2000,"Coins"}; sell[] ={1000,"Coins"}; }; class Skin_CZ_Soldier_Sniper_EP1_DZ { type = "trade_items"; buy[] ={2000,"Coins"}; sell[] ={1000,"Coins"}; }; class Skin_Graves_Light_DZ { type = "trade_items"; buy[] ={2000,"Coins"}; sell[] ={1000,"Coins"}; }; ////////////////////////////////END CLOTHES///////////// ///////BACKPACK SECTION/////////////// class DZ_TerminalPack_EP1 { type = "trade_backpacks"; buy[] ={600,"Coins"}; sell[] ={300,"Coins"}; }; class DZ_GunBag_EP1 { type = "trade_backpacks"; buy[] ={1000,"Coins"}; sell[] ={1000,"Coins"}; }; ////////////////////////////////////END BACKPACK //////////DRINK AND FOOD SECTION class ItemSodaMdew { type = "trade_items"; buy[] ={1000,"Coins"}; sell[] ={1000,"Coins"}; }; class ItemSodaOrangeSherbet { type = "trade_items"; buy[] ={1000,"Coins"}; sell[] ={1000,"Coins"}; }; class ItemSodaPepsi { type = "trade_items"; buy[] ={60,"Coins"}; sell[] ={30,"Coins"}; }; class ItemSodaRbull { type = "trade_items"; buy[] ={1000,"Coins"}; sell[] ={1000,"Coins"}; }; class FoodMRE { type = "trade_items"; buy[] ={100,"Coins"}; sell[] ={100,"Coins"}; }; class FoodPistachio { type = "trade_items"; buy[] ={60,"Coins"}; sell[] ={30,"Coins"}; }; ///////////////////////////////END DRINKS FOOD//////// ///////////MEDICAL class ItemAntibiotic { type = "trade_items"; buy[] ={1000,"Coins"}; sell[] ={1000,"Coins"}; }; class ItemBandage { type = "trade_items"; buy[] ={30,"Coins"}; sell[] ={30,"Coins"}; }; class ItemBloodbag { type = "trade_items"; buy[] ={100,"Coins"}; sell[] ={100,"Coins"}; }; class ItemEpinephrine { type = "trade_items"; buy[] ={100,"Coins"}; sell[] ={100,"Coins"}; }; class ItemHeatPack { type = "trade_items"; buy[] ={20,"Coins"}; sell[] ={10,"Coins"}; }; class ItemMorphine { type = "trade_items"; buy[] ={100,"Coins"}; sell[] ={100,"Coins"}; }; class ItemPainkiller { type = "trade_items"; buy[] ={50,"Coins"}; sell[] ={50,"Coins"}; }; /////////////////////////////////END MEDICAL //////////WHOLESALER class bulk_15Rnd_9x19_M9SD { type = "trade_items"; buy[] ={2000,"Coins"}; sell[] ={2000,"Coins"}; }; class bulk_17Rnd_9x19_glock17 { type = "trade_items"; buy[] ={2000,"Coins"}; sell[] ={2000,"Coins"}; }; class bulk_30Rnd_556x45_StanagSD { type = "trade_items"; buy[] ={2000,"Coins"}; sell[] ={2000,"Coins"}; }; class bulk_30Rnd_9x19_MP5SD { type = "trade_items"; buy[] ={2000,"Coins"}; sell[] ={2000,"Coins"}; }; class bulk_ItemSandbag { type = "trade_items"; buy[] ={2000,"Coins"}; sell[] ={1000,"Coins"}; }; class bulk_ItemTankTrap { type = "trade_items"; buy[] ={2000,"Coins"}; sell[] ={500,"Coins"}; }; class bulk_ItemWire { type = "trade_items"; buy[] ={1000,"Coins"}; sell[] ={1000,"Coins"}; }; class bulk_PartGeneric { type = "trade_items"; buy[] ={2000,"Coins"}; sell[] ={500,"Coins"}; }; class CinderBlocks { type = "trade_items"; buy[] ={80000,"Coins"}; sell[] ={5000,"Coins"}; }; class PartPlywoodPack { type = "trade_items"; buy[] ={600,"Coins"}; sell[] ={300,"Coins"}; }; class MortarBucket { type = "trade_items"; buy[] ={80000,"Coins"}; sell[] ={5000,"Coins"}; }; class PartPlankPack { type = "trade_items"; buy[] ={300,"Coins"}; sell[] ={150,"Coins"}; }; class ItemFuelBarrelEmpty { type = "trade_items"; buy[] ={2000,"Coins"}; sell[] ={1500,"Coins"}; }; ////////////////////////////////END WHOLESALER ///////////MONEY class ItemBriefcase100oz { type = "trade_items"; buy[] ={100000,"Coins"}; sell[] ={100000,"Coins"}; }; class ItemGoldBar { type = "trade_items"; buy[] ={1000,"Coins"}; sell[] ={1000,"Coins"}; }; class ItemGoldBar10oz { type = "trade_items"; buy[] ={10000,"Coins"}; sell[] ={10000,"Coins"}; }; class ItemSilverBar { type = "trade_items"; buy[] ={10,"Coins"}; sell[] ={10,"Coins"}; }; class ItemSilverBar10oz { type = "trade_items"; buy[] ={100,"Coins"}; sell[] ={100,"Coins"}; }; class ItemCopperBar10oz { type = "trade_items"; buy[] ={1,"Coins"}; sell[] ={1,"Coins"}; }; class ItemTinBar { type = "trade_items"; buy[] ={2,"Coins"}; sell[] ={2,"Coins"}; }; class ItemAluminumBar { type = "trade_items"; buy[] ={2,"Coins"}; sell[] ={2,"Coins"}; }; class ItemObsidian{ type = "trade_items"; buy[] ={100000,"Coins"}; sell[] ={100000,"Coins"}; }; class PartOre { type = "trade_items"; buy[] ={20,"Coins"}; sell[] ={20,"Coins"}; }; class PartOreSilver { type = "trade_items"; buy[] ={30,"Coins"}; sell[] ={30,"Coins"}; }; class PartOreGold { type = "trade_items"; buy[] ={1000,"Coins"}; sell[] ={1000,"Coins"}; }; //////////////////////////////////END MONEY /////////////////BUILDING SUPPLY class 30m_plot_kit { type = "trade_items"; buy[] ={50000,"Coins"}; sell[] ={40000,"Coins"}; }; class ItemVault { type = "trade_items"; buy[] ={40000,"Coins"}; sell[] ={40000,"Coins"}; }; /////////////////BUILDING SUPPLY END }; 2-B Now you need call this category in: class CfgTraderCategory so go to this path: ...\MPMissions\DayZ_Epoch_11.Chernarus\ZSC\config\ and open cfgServerTrader.hpp At bottom of this file but above of the bracket ( }; ) add this: Spoiler #include "Category\FriendshipCategory.hpp" *New category is ready now. 3-RECOGNIZE NEW TRADERS AND GIVE A MENU: open your server_traders_cherno_11.sqf 3-A-Recognize the trader ID Spoiler Find: serverTraders = ["RU_Functionary1",....the others traders]; Add lines in blue: serverTraders = ["ValentinaFit","RU_Functionary1",,....the others traders]; 3-B-Give a menu and category: At very bottom of this server_traders_cherno_11.sqf paste: Spoiler //Friendship Trader menu_ValentinaFit = [ [["Category",5000]], [], "friendship" ]; **Now ValentinaFit is all a merchant. ;) 4-DEFINE WTF IS FRIENDSHIP. Open your CUSTOM! CUSTOM!! CUSTOM!!! fn_selfactions.sqf. Find this part and add all lines in blue or in some case replace for lines in blue: Spoiler if (s_player_parts_crtl < 0) then { _humanity = player getVariable ["humanity",0]; _traderMenu = call compile format["menu_%1;",_traderType]; _low_high = "low"; _required=""; _humanity_logic = false; _friendship_logic = false; _Playersurviveddays = dayz_Survived; if((_traderMenu select 2) == "friendship") then { _friendship_logic = (_Playersurviveddays < 1); _required="Survive almost 1 day"; }; if((_traderMenu select 2) == "friendly") then { _humanity_logic = (_humanity < -5000); _required="more than -5000 H"; }; if((_traderMenu select 2) == "hostile") then { _low_high = "high"; _humanity_logic = (_humanity > -5000); _required="humanity to high"; }; if((_traderMenu select 2) == "hero") then { _humanity_logic = (_humanity < 5000); _required="humanity to low"; }; if(_humanity_logic || _friendship_logic) then { _cancel = player addAction [format["You cannot access to this trader: %1 !",_required], "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""]; s_player_parts set [count s_player_parts,_cancel]; } else { DONE! ***if u need test and your survived days cannot let you then go to selfActions and...*** Spoiler find: _friendship_logic = (_Playersurviveddays < 1); and change: <1 by >1 Shak and chi 2 Link to comment Share on other sites More sharing options...
chi Posted August 29, 2016 Report Share Posted August 29, 2016 Amazing idea! juandayz 1 Link to comment Share on other sites More sharing options...
juandayz Posted August 29, 2016 Author Report Share Posted August 29, 2016 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now