Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

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.

Reply
 
Thread Tools Display Modes
  #1  
Old 03-06-2020, 02:27 AM
Bytebait
Sarnak
 
Join Date: Oct 2014
Location: Colorado
Posts: 74
Default 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
Reply With Quote
  #2  
Old 03-06-2020, 01:41 PM
Bytebait
Sarnak
 
Join Date: Oct 2014
Location: Colorado
Posts: 74
Default

Ok, it looks like the name of the NPC needs to be the same name as the pl file for it to trigger.
Reply With Quote
  #3  
Old 03-06-2020, 02:02 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Or NPC ID. It's all in the manual.
Reply With Quote
  #4  
Old 03-06-2020, 02:45 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

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
Reply With Quote
  #5  
Old 03-06-2020, 05:20 PM
nilbog
Hill Giant
 
Join Date: Nov 2007
Posts: 197
Default

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);
}
__________________
https://www.project1999.com
Reply With Quote
  #6  
Old 03-06-2020, 05:35 PM
Bytebait
Sarnak
 
Join Date: Oct 2014
Location: Colorado
Posts: 74
Default

Quote:
Originally Posted by joligario View Post
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.
Reply With Quote
  #7  
Old 03-06-2020, 07:41 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

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.
Reply With Quote
  #8  
Old 03-07-2020, 10:51 AM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,333
Default

Quote:
Originally Posted by Bytebait View Post
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.
__________________
Hanging out at Antonica.World
Reply With Quote
  #9  
Old 03-08-2020, 01:53 AM
Bytebait
Sarnak
 
Join Date: Oct 2014
Location: Colorado
Posts: 74
Default

Quote:
Originally Posted by Huppy View Post
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.
Reply With Quote
  #10  
Old 03-08-2020, 04:28 AM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,333
Default

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
__________________
Hanging out at Antonica.World
Reply With Quote
  #11  
Old 03-08-2020, 11:52 PM
Bytebait
Sarnak
 
Join Date: Oct 2014
Location: Colorado
Posts: 74
Default

Quote:
Originally Posted by Huppy View Post
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:30 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3