Page 1 of 1

Merchant Creation

Posted: Tue Apr 20, 2010 12:33 pm
by abndrew82
Hello

I am reading through the Wiki and looking at the Tutorials on the site, but have been unable to find a guide to creating merchants.

First what I am doing is making a small Village area in Village of Shin where my Players are going to start and get some small quests and buy their starting stuff they need. So I need to make a merchant here that will sell all the basic items.

I see this under the Database Spawns part of the Wiki

Merchant Fields

This allows you to configure the NPC as a merchant, note you should tag the entity command ie: frommerchant (see your entity_command table) or bank etc.

* merchant_id = The merchant list id
* merchant_type = (1 - no buy), (2 - no buy back), (3 - spells), (4 - crafting)

But dont really understand exactly what I have to do.

So am curious if I am on the right path with this thought process

Create a basic NPC Spawn
Make him a Merchant (Not sure Commands to do so though)
Add Items to him for Sale ( Not sure commands here either) (But would think could be done via DB also)

Another Question - Is there a list somewhere of what all the Class_Id's and Race_Id's are, cant seem to find one, that says what ID belongs to each class / race.

Thanks for any info, as I continue to learn this stuff and try and build my world

Drew

Re: Merchant Creation

Posted: Tue Apr 20, 2010 4:51 pm
by ZexisStryfe
Use the merchant_inventory table to set up merchant inventories. They assign the inventory to a merchant ID in the merchants table, then assign the same merchant ID to a spawn. You also need to set buy/sell as the primary action for the spawn.

Re: Merchant Creation

Posted: Tue Apr 20, 2010 4:55 pm
by abndrew82
Ok so my logic so far was basically correct

I think I understand and got this now, just gotta fine tune to make it work

I got an NPC Spawn created
I edited the entry for him in my database to give him a merchant_id and a merchant_type
Gave him merchant_type of 1 currently but testing those to get it working

I also Created a Merchant in the merchants table and added like 8 items to that Merchant ID and linked the merchant_id's and inventory_id's

I got it where I can open him up as a merchant, but he is listing nothing for sale, so leads me to think that my issue is somewhere in the merchant_inventory

Re: Merchant Creation

Posted: Wed Apr 21, 2010 3:49 pm
by abndrew82
Update on this issue, to see if anybody can understand what I am doing wrong

I have a merchant created now

But for some reason, no matter what I did at first, would he have anything to sell, I had him in the these tables with these settings

merchants
id = 2, merchant_id = 2, inventory_id = 7 description = mymerch

And then in the table merchant_inventory I had the following fields (The Item IDs there, are for some basic level 1 Tin Chainmail armor)

id = 1, inventory_id = 7, item_id=55132, quantity=6535
id = 2, inventory_id = 7, item_id=55133, quantity=6535
id = 3, inventory_id = 7, item_id=55134, quantity=6535
id = 4, inventory_id = 7, item_id=55135, quantity=6535
id = 5, inventory_id = 7, item_id=55136, quantity=6535

Now when was happening is he would show as a merchant but never would have anything for sale.

So I went and changed the Spawns Merchant ID from 2 to 1 (Which was for the current merchant that was already in game, who sells food, water, and a backpack)

This made it so that my merchant now sells those items, but I have since then tried to add more items to inventory table and changed all my previous items to be in inventory_id 1 so that all merchants would sell them.

But that appears to not work, he still only sells the 3 items. I have also added some other items, but nothing seems to want to actually add more items to the merchant.

Here is an export of the items I added most recent that also dont show up

INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (12, 1, 1004, 65535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (13, 1, 1000, 6535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (14, 1, 1001, 6535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (15, 1, 1002, 6535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (16, 1, 1003, 6535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (17, 1, 1004, 6535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (18, 1, 1005, 6535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (19, 1, 1006, 6535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (20, 1, 1007, 6535);

Any assistance would be greatly appreciated, really trying to get this merchant working, so that I can move onto beating my head against getting my quests working, which are another whole learning process for me to get some good more in depth quests for my world.

Re: Merchant Creation

Posted: Wed Apr 21, 2010 4:28 pm
by Zcoretri
abndrew82 wrote:Update on this issue, to see if anybody can understand what I am doing wrong

I have a merchant created now

But for some reason, no matter what I did at first, would he have anything to sell, I had him in the these tables with these settings

merchants
id = 2, merchant_id = 2, inventory_id = 7 description = mymerch

And then in the table merchant_inventory I had the following fields (The Item IDs there, are for some basic level 1 Tin Chainmail armor)

id = 1, inventory_id = 7, item_id=55132, quantity=6535
id = 2, inventory_id = 7, item_id=55133, quantity=6535
id = 3, inventory_id = 7, item_id=55134, quantity=6535
id = 4, inventory_id = 7, item_id=55135, quantity=6535
id = 5, inventory_id = 7, item_id=55136, quantity=6535

Now when was happening is he would show as a merchant but never would have anything for sale.

So I went and changed the Spawns Merchant ID from 2 to 1 (Which was for the current merchant that was already in game, who sells food, water, and a backpack)

This made it so that my merchant now sells those items, but I have since then tried to add more items to inventory table and changed all my previous items to be in inventory_id 1 so that all merchants would sell them.

But that appears to not work, he still only sells the 3 items. I have also added some other items, but nothing seems to want to actually add more items to the merchant.

Here is an export of the items I added most recent that also dont show up

INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (12, 1, 1004, 65535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (13, 1, 1000, 6535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (14, 1, 1001, 6535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (15, 1, 1002, 6535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (16, 1, 1003, 6535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (17, 1, 1004, 6535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (18, 1, 1005, 6535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (19, 1, 1006, 6535);
INSERT INTO `merchant_inventory` (`id`, `inventory_id`, `item_id`, `quantity`) VALUES (20, 1, 1007, 6535);

Any assistance would be greatly appreciated, really trying to get this merchant working, so that I can move onto beating my head against getting my quests working, which are another whole learning process for me to get some good more in depth quests for my world.
Are those item_id's valid? And why are your quantity values 6535 instead of 65535?
You are restarting your world server after each change?

Re: Merchant Creation

Posted: Wed Apr 21, 2010 5:50 pm
by abndrew82
That was the issue, restarted my server and nowb my merchant has the items, so going to finish tweaking him tomorrow, and move onto my quest work.

Ahh that is probably the issue. I have not restarted my world server since I started it, just been reloading spawns and such. And the quantity I just typed wrong in the post.

Will have to restart tonight and see if that solves my issue.

Thanks

Drew - posted from my droid