Jump to content

Custom Gem Trader


Recommended Posts

  • 1 month later...

Greetings,

 

I'm using the Custom Gem Trader now on my A2 Epoch Napf server and we are enjoying being able to utilize mining. Also, there is a chance to recover gems from the roaming AI when they are killed and looted. A quick question. How did you get the 1337 number for the RU_Villager1 trader? Is it derived by the editor? Because whenever I place a man (NPC) in the editor, that number is always 0 (zero). Here is a snippet from your Gem_Trader.sqf code. Thanks for the mod. :)

 

_unit_1337 = objNull;


if (true) then
{
_this = createAgent ["RU_Villager1", [6054.33,7704.25,0.1], [], 0, "CAN_COLLIDE"];
_unit_1337 = _this;
_this setDir 29;
_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;
};

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 months later...

This is the way you want to add the items to the database. it will allow for an auto id. If you have any custom items already. The previously posted ways will not work.

 

Make sure to change the tid number to match yours. 695 is mine.


INSERT INTO `traders_data` (`item`,`qty`,`buy`,`sell`,`order`,`tid`,`afile`) VALUES ('["ItemAmethyst",1]',10,'[8,"ItemGoldBar10oz",1]','[4,"ItemGoldBar10oz",1]',0,695,'trade_items');
INSERT INTO `traders_data` (`item`,`qty`,`buy`,`sell`,`order`,`tid`,`afile`) VALUES ('["ItemCitrine",1]',10,'[8,"ItemGoldBar10oz",1]','[4,"ItemGoldBar10oz",1]',0,695,'trade_items');
INSERT INTO `traders_data` (`item`,`qty`,`buy`,`sell`,`order`,`tid`,`afile`) VALUES ('["ItemEmerald",1]',10,'[12,"ItemBriefcase100oz",1]','[6,"ItemGoldBar10oz",1]',0,695,'trade_items');
INSERT INTO `traders_data` (`item`,`qty`,`buy`,`sell`,`order`,`tid`,`afile`) VALUES ('["ItemObsidian",1]',10,'[8,"ItemGoldBar10oz",1]','[4,"ItemGoldBar10oz",1]',0,695,'trade_items');
INSERT INTO `traders_data` (`item`,`qty`,`buy`,`sell`,`order`,`tid`,`afile`) VALUES ('["ItemRuby",1]',10,'[4,"ItemBriefcase100oz",1]','[2,"ItemGoldBar10oz",1]',0,695,'trade_items');
INSERT INTO `traders_data` (`item`,`qty`,`buy`,`sell`,`order`,`tid`,`afile`) VALUES ('["ItemSapphire",1]',10,'[8,"ItemGoldBar10oz",1]','[4,"ItemGoldBar10oz",1]',0,695,'trade_items');
INSERT INTO `traders_data` (`item`,`qty`,`buy`,`sell`,`order`,`tid`,`afile`) VALUES ('["ItemTopaz",1]',10,'[8,"ItemGoldBar10oz",1]','[4,"ItemGoldBar10oz",1]',0,695,'trade_items');
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Discord

×
×
  • Create New...