User Name:


Forgot your password?
Vote for Us!
AFKMud 2.2.2
Mar 3, 2019 5:35 pm
By Samson
Nov 28, 2018 12:10 pm
By Keirath
First Immortal
Oct 12, 2018 2:02 pm
By GatewaySysop
Bug in do_climb( )
Jun 5, 2018 7:31 pm
By joeyfogas
question on overland code
May 31, 2018 12:03 pm
By joeyfogas
SmaugFUSS 1.9.3
Author: Various
Submitted by: Samson
AFKMud 2.2.2
Author: AFKMud Team
Submitted by: Samson
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Bing

Members: 0
Guests: 24
Newest Member
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds » Codebases » SmaugFUSS » Snippet? Player Made/Ran Shops
Forum Rules | Mark all | Recent Posts

Snippet? Player Made/Ran Shops
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Oct 30, 2013 3:33 pm
Go to the top of the page
Go to the bottom of the page

JoinedDec 3, 2008

Does anyone have a snippet or know where to find a snippet for player ran shops?
Post is unread #2 Oct 31, 2013 5:15 am   Last edited Oct 31, 2013 5:18 am by Patriot
Go to the top of the page
Go to the bottom of the page

Guest - (Unregistered)

I don't but I think you have to really think how you want to do that. I gave it some thought though, then did something else.

Perhaps making the shops go into a sql database is best route.

Otherwise use a setup like Samson's slay snippet, to generate your shops, and create each item in the shop, set a max number for the shops that players can sell. Then add a feature that after 10 days or whatnot, if it does not sell or get removed the shop is deleted. So you don't have a massive shops.dat file from players making shops and no longer playing.
Post is unread #3 Oct 31, 2013 9:33 am
Go to the top of the page
Go to the bottom of the page

JoinedMar 8, 2005

An SQL database has nothing to do with making player run shops. Good grief.

Think about the goal. You want shops that a player can open, sell goods from, buy goods from other players (and NPC's?), and perhaps have an NPC assistant that will operate the shop while you're offline, or adventuring, or whatever.

So, start with the standard NPC shop. If the code is entirely in the NPC itself, you'll need to refactor it so much of the shop functionality lies in the room code (or perhaps in an object which the player can set down to "open" the shop). If you go the room route, the admins will need to grant each player a room to use as a shop. If it's object based, it just needs to be coded so only the owner of the object can pick it up.

Let's go the object route. A player gets this object somehow (quest, money, whatever) and it provides the buy/sell/list/etc commands to the environment. You might also need commands to stock and remove items from the inventory (without buying or selling them), and commands to show the current money total, and deposit/withdraw funds. Finally, a command to summon an NPC shopkeeper, and dismiss him.

Do you NEED the NPC? Well, not really... but it's nice for flavor, and if you wanted to go the realism route of letting people try to shoplift or break into the till, the NPC could defend it.

So you make your sales cart object, the player buys it, and while in his inventory, stocks it with items and some cash. Then he plunks it down somewhere and perhaps summons the NPC vendor. When another player (or NPC?) wanders up, they find the room the cart is in acts like a regular shop. They can buy items (depleting the inventory, but adding to the till), maybe they can sell items.

The player who owns it can check the till, restock, adjust prices. Maybe you can let them set minimum and maximum prices so the vendor code can scale based on supply. If they have 10 loaves of bread, they're 1g each, but when they're down to 2 loaves, they might charge 3g each. Likewise, for buying items.... the vendor may pay at most 10X the item's "value" if it's rare, or refuse to buy it if it already has plenty (or not enough funds).
Post is unread #4 Oct 31, 2013 4:02 pm
Go to the top of the page
Go to the bottom of the page

JoinedJun 13, 2008

swfote 2.1.5 found on swfote.sf.net I think has some basic form of playershop (help pshops).
This is directly from the 'help pshops' command:

=-=-=-=-=-=- PSHOPS VENDOR -=-=-=-=-=-=
PShops or Player Shops are shops which a player can purchase and place a
vendor. These vendors can then sell items the player gives them. The
player is able to set a price on items the vendor sells.

Pricevendor: Use this command to set an items price.

Placevendor: Use this command to place a purchased vendor.

Buyvendor: Use this command to buy a vendor. Must be in a room with a

Collectcredits: Use this command to collect your money. A 5% fee will
be charged by the vendor.

Buyshop: Use this command to buy an empty shop. You need a shop to
place a vendor in. These cost 200,000 credits.

I'm unaware if the FUSS version of fote has it, my fuss game isn't running at the moment :D

Hope it helps,
Post is unread #5 Nov 14, 2014 10:39 pm
Go to the top of the page
Go to the bottom of the page

Black Hand
JoinedJan 1, 2002

*casts raise thread*

AFKMud also has guild/clan vendors manned by NPCs which would be ridiculously simple to backport since the entire framework already exists.
Pages:<< prev 1 next >>