| 
   | 
   | 
  
 
    | 
    | 
    | 
  
 
    | 
   | 
    | 
  
 
    | 
   | 
    | 
  
 
    | 
   | 
    | 
  
 
   | 
  
	
		
   
   
      | Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself. | 
    
    
   
   
   
   
   
   
   
   
		 
	 
 
	
	
		
	
	
	
		
		
		
			
			 
			
				03-06-2020, 02:27 AM
			
			
			
		  
	 | 
 
	
		
		
		
			
			| 
			
				
				
				 Sarnak 
				
				
				
			 | 
			  | 
			
				
				
					Join Date: Oct 2014 
					Location: Colorado 
					
					
						Posts: 74
					 
					
					
					
					     
				 
				
			 | 
		 
		 
		
	 | 
 
	
	
	
		
		
		
			
			
				 
				Assigning Perl Scripts to in game objects (Entity)
			 
			 
			
		
		
		
		I'm trying to figure out how everything works and absorbing as much as I can from  EQEmu Server but I'm missing some info. 
 
I want to make a Merchant that sells a Cloth Cap #1001 and can be Hailed with a response. 
 
I can make the merchant in game with #spawn, #npcspawn, #npcedit, #repop 
 
Can I add inventory with a perl script? If so, how do I link that script to the newly added Entity  
		
	
		
		
		
		
		
		
		
		
		
	
		
		
	
	
	 | 
 
 
	 
	
		 
	 
 
	
	
		
	
	
	
		
		
		
			
			 
			
				03-06-2020, 01:41 PM
			
			
			
		  
	 | 
 
	
		
		
		
			
			| 
			
				
				
				 Sarnak 
				
				
				
			 | 
			  | 
			
				
				
					Join Date: Oct 2014 
					Location: Colorado 
					
					
						Posts: 74
					 
					
					
					
					     
				 
				
			 | 
		 
		 
		
	 | 
 
	
	
	
		
		
		
			
			
			 
			
		
		
		
		Ok, it looks like the name of the NPC needs to be the same name as the pl file for it to trigger. 
		
	
		
		
		
		
		
		
		
		
		
	
		
		
	
	
	 | 
 
 
	 
	
		 
	 
 
	
	
		
	
	
	
		
		
		
			
			 
			
				03-06-2020, 02:02 PM
			
			
			
		  
	 | 
 
	
		
		
		
			  | 
			
			
				
				
				 Developer 
				
				
				
			 | 
			  | 
			
				
				
					Join Date: Mar 2003 
					
					
					
						Posts: 1,500
					 
					
					
					
					     
				 
				
			 | 
		 
		 
		
	 | 
 
	
	
	
		
		
		
			
			
			 
			
		
		
		
		Or NPC ID. It's all in the manual. 
		
	
		
		
		
		
		
		
		
		
		
	
		
		
	
	
	 | 
 
 
	 
	
		 
	 
 
	
	
		
	
	
	
		
		
		
			
			 
			
				03-06-2020, 02:45 PM
			
			
			
		  
	 | 
 
	
		
		
		
			  | 
			
			
				
				
				 Developer 
				
				
				
			 | 
			  | 
			
				
				
					Join Date: Apr 2012 
					Location: North Carolina 
					
					
						Posts: 2,815
					 
					
					
					
					     
				 
				
			 | 
		 
		 
		
	 | 
 
	
	
	
		
		
		
			
			
			 
			
		
		
		
		I don't know if you can add merchant inventory items through script..would need to dig in and see how that's handled. 
 
At the very least, it's probably not in the scripting apis. 
		
	
		
		
		
		
		
		
			
				__________________ 
				Uleat of Bertoxxulous 
 
Compilin' Dirty
			 
		
		
		
		
		
		
	
		
		
	
	
	 | 
 
 
	 
	
		 
	 
 
	
	
		
	
	
	
		
		
		
			
			 
			
				03-06-2020, 05:20 PM
			
			
			
		  
	 | 
 
	
		
		
		
			
			| 
			
				
				
				 Hill Giant 
				
				
				
			 | 
			  | 
			
				
				
					Join Date: Nov 2007 
					
					
					
						Posts: 198
					 
					
					
					
					     
				 
				
			 | 
		 
		 
		
	 | 
 
	
	
	
		
		
		
			
			
			 
			
		
		
		
		It looks like you can use quest::MerchantSetItem to add merchant inventory through a perl script.  I have never used this but maybe?  Replace npcid with the npc's ID, and howmanycaps with the total number you would like the npc to stock. 
	Code: 
	sub EVENT_SAY {
	if ($text=~/hail/i) 
	{
		quest::say("a response.");
	}
}
sub EVENT_SPAWN {
	#quest::MerchantSetItem(uint32 npc_id, uint32 item_id, [uint32 quantity])
	quest::MerchantSetItem(npcid, 1001, howmanycaps);
}
  
		
	
		
		
		
		
		
		
			
		
		
		
		
		
		
	
		
		
	
	
	 | 
 
 
	 
	
		 
	 
 
	
	
		
	
	
	
		
		
		
			
			 
			
				03-06-2020, 05:35 PM
			
			
			
		  
	 | 
 
	
		
		
		
			
			| 
			
				
				
				 Sarnak 
				
				
				
			 | 
			  | 
			
				
				
					Join Date: Oct 2014 
					Location: Colorado 
					
					
						Posts: 74
					 
					
					
					
					     
				 
				
			 | 
		 
		 
		
	 | 
 
	
	
	
		
		
		
			
			
			 
			
		
		
		
		
	Quote: 
	
	
		
			
				
					Originally Posted by  joligario
					 
				 
				Or NPC ID. It's all in the manual. 
			
		 | 
	 
	 
 If there is a manual different than the one I linked I would love to know about it. If it is in the eqemu.gitbook.io site, I haven't been able to find where to setup and manage merchants.  
		
	
		
		
		
		
		
		
		
		
		
	
		
		
	
	
	 | 
 
 
	 
	
		 
	 
 
	
	
		
	
	
	
		
		
		
			
			 
			
				03-06-2020, 07:41 PM
			
			
			
		  
	 | 
 
	
		
		
		
			  | 
			
			
				
				
				 Developer 
				
				
				
			 | 
			  | 
			
				
				
					Join Date: Mar 2003 
					
					
					
						Posts: 1,500
					 
					
					
					
					     
				 
				
			 | 
		 
		 
		
	 | 
 
	
	
	
		
		
		
			
			
			 
			
		
		
		
		Not sure what specifically you aren't finding on merchants. My comment was to the question title and your response about assigning scripts based on NPC name. 
		
	
		
		
		
		
		
		
		
		
		
	
		
		
	
	
	 | 
 
 
	 
	
		 
	 
 
	
	
		
	
	
	
		
		
		
			
			 
			
				03-07-2020, 10:51 AM
			
			
			
		  
	 | 
 
	
		
		
		
			  | 
			
			
				
				
				 Demi-God 
				
				
				
			 | 
			  | 
			
				
				
					Join Date: Oct 2010 
					
					
					
						Posts: 1,332
					 
					
					
					
					     
				 
				
			 | 
		 
		 
		
	 | 
 
	
	
	
		
		
		
			
			
			 
			
		
		
		
		
	Quote: 
	
	
		
			
				
					Originally Posted by  Bytebait
					 
				 
				I want to make a Merchant 
			
		 | 
	 
	 
 I'm assuming, once you created the npc, you set it's npc class to 41 (to enable merchant) ? You can do that in-game by targetting the npc and typing #npcedit set class 41 (then #repop) or if using an editor, you go into the npc_types table and change it there.  
		
	
		
		
		
		
		
		
		
		
		
	
		
		
	
	
	 | 
 
 
	 
	
		 
	 
 
	
	
		
	
	
	
		
		
		
			
			 
			
				03-08-2020, 01:53 AM
			
			
			
		  
	 | 
 
	
		
		
		
			
			| 
			
				
				
				 Sarnak 
				
				
				
			 | 
			  | 
			
				
				
					Join Date: Oct 2014 
					Location: Colorado 
					
					
						Posts: 74
					 
					
					
					
					     
				 
				
			 | 
		 
		 
		
	 | 
 
	
	
	
		
		
		
			
			
			 
			
		
		
		
		
	Quote: 
	
	
		
			
				
					Originally Posted by  Huppy
					 
				 
				I'm assuming, once you created the npc, you set it's npc class to 41 (to enable merchant) ? You can do that in-game by targetting the npc and typing #npcedit set class 41 (then #repop) or if using an editor, you go into the npc_types table and change it there. 
			
		 | 
	 
	 
 I did, I'm able to sell, though haven't figured out how to assign items to sell and it also doesn't store the items sold to it.  
		
	
		
		
		
		
		
		
		
		
		
	
		
		
	
	
	 | 
 
 
	 
	
		 
	 
 
	
	
		
	
	
	
		
		
		
			
			 
			
				03-08-2020, 04:28 AM
			
			
			
		  
	 | 
 
	
		
		
		
			  | 
			
			
				
				
				 Demi-God 
				
				
				
			 | 
			  | 
			
				
				
					Join Date: Oct 2010 
					
					
					
						Posts: 1,332
					 
					
					
					
					     
				 
				
			 | 
		 
		 
		
	 | 
 
	
	
	
		
		
		
			
			
			 
			
		
		
		
		Even though there is various tools for editing the database, (EOC, etc.) I use George's Tools for editing merchants, spawns, etc. Few steps to installing it but works for me. 
http://www.georgestools.chrsschb.com/
As far as merchants keeping items sold to them, make sure, in  variables table MerchantsKeepItems is set to 1 and in  rule_values table World:ClearTempMerchantlist is set to false  
		
	
		
		
		
		
		
		
		
		
		
	
		
		
	
	
	 | 
 
 
	 
	
		 
	 
 
	
	
		
	
	
	
		
		
		
			
			 
			
				03-08-2020, 11:52 PM
			
			
			
		  
	 | 
 
	
		
		
		
			
			| 
			
				
				
				 Sarnak 
				
				
				
			 | 
			  | 
			
				
				
					Join Date: Oct 2014 
					Location: Colorado 
					
					
						Posts: 74
					 
					
					
					
					     
				 
				
			 | 
		 
		 
		
	 | 
 
	
	
	
		
		
		
			
			
			 
			
		
		
		
		
	Quote: 
	
	
		
			
				
					Originally Posted by  Huppy
					 
				 
				Even though there is various tools for editing the database, (EOC, etc.) I use George's Tools for editing merchants, spawns, etc. Few steps to installing it but works for me. 
http://www.georgestools.chrsschb.com/
As far as merchants keeping items sold to them, make sure, in  variables table MerchantsKeepItems is set to 1 and in  rule_values table World:ClearTempMerchantlist is set to false  
			
		 | 
	 
	 
 you're awesome, thank you.  
		
	
		
		
		
		
		
		
		
		
		
	
		
		
	
	
	 | 
 
 
	 
	
		 
	 
 
 
	
		
	
	
	
	
	
		
	
		 
		Posting Rules
	 | 
 
	
		
		You may not post new threads 
		You may not post replies 
		You may not post attachments 
		You may not edit your posts 
		 
		
		
		
		
		HTML code is Off 
		 
		
	  | 
 
 
	 | 
	
		
	 | 
 
 
All times are GMT -4. The time now is 08:36 PM. 
 
		 
	 
 
 
     | 
     | 
    
   
      | 
     | 
      | 
    
   
     | 
      | 
     | 
    
   
       | 
      | 
       | 
     
    
    
  | 
   |