Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, DotBot, Yandex

Members: 0
Guests: 7
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » 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, 1:33 pm
Go to the top of the page
Go to the bottom of the page

dbna2
Sorcerer
GroupMembers
Posts600
JoinedDec 2, 2008

Does anyone have a snippet or know where to find a snippet for player ran shops?
       
Post is unread #2 Oct 31, 2013, 3:15 am   Last edited Oct 31, 2013, 3: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, 7:33 am
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
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, 2:02 pm
Go to the top of the page
Go to the bottom of the page

ayuri
Magician
GroupMembers
Posts239
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
vendor.

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,
ayuri
       
Post is unread #5 Nov 14, 2014, 8:39 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
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 >>