Difference between revisions of "Shops (Programming)"

From Hellmoo Wiki Archive
Jump to navigation Jump to search
imported>MagmaSeven
imported>NecanThrope
 
(2 intermediate revisions by the same user not shown)
Line 7: Line 7:
3.  Create a sales case.  This will hold the items for sale.  @d #2801
3.  Create a sales case.  This will hold the items for sale.  @d #2801


4.  Link all of the above by setting the following properties: clerk and case on your shop room.  Case and shop on your shopkeeper.  And clerk and shop on your case.
4.  Link all of the above by typing {{cmd|@linkall}}


5.  Put the items you wish to have sold in the sales case.   
5.  Put the items you wish to have sold in the sales case.   
6.  Invoke the case's {{cmd|:snapshot_stock()}} verb.  This takes all of the items in the case and instructs the case to spawn new ones on heartbeat if any of them are sold.





Latest revision as of 22:24, 3 January 2011

How to make a shop

1. Create a shop room. @d #2173

2. Create a shopkeeper. @d #29525

3. Create a sales case. This will hold the items for sale. @d #2801

4. Link all of the above by typing @linkall

5. Put the items you wish to have sold in the sales case.

6. Invoke the case's :snapshot_stock() verb. This takes all of the items in the case and instructs the case to spawn new ones on heartbeat if any of them are sold.


Set the properties for the shopkeeper as you wish, along with his npc properties. Here is a list of them:

.hate_freaks = INT (0-1). This defines whether the shopkeeper will serve freaks or not.

.protection_contract = ID. A protection contract is automatically produced for the shopkeeper, though in theory it could be set to #-1 to make the shop not have a protection contract.

.will_haggle = INT (0-1). Whether players can haggle with the shopkeeper or not.

.haggle_difficulty = INT (10- -10). Affects how easy it is to haggle with the shopkeeper. Negative is more difficult, -5 is standard, positive numbers may make it too easy to haggle.

.min_haggle_price = INT (1-*). The minimum value a shopkeeper will allow for haggling, set to an appropriate amount to reflect the goods sold.

.auto_replenish = INT (0-1). Whether or not the shopkeeper will automatically restock the case, leave at 1 unless you have some funky restocking procedure in place.


There are also properties on the case to set, here are a few:

.fridge = INT (0-100). This affects the rate at which rottable objects will rot, set at 100 if the shop sells food.

.refrigerator = INT (0-100). Probably the same as .fridge.

.fulfilled_needs = LIST IDs. @d $need to find out needs and set the .fulfilled_needs to that which the consumers have, that way the consumer should 'learn' what the shop sells and go there to fulfil their need and suggest the shop to other consumers. This allows the consumers to go and buy stuff and consume it.

.haggle_cooldown = INT (0-*). Time, in seconds in which players cannot haggle again without irritating the shopkeeper. Default is 1800 (30 minutes).

.max_unstocked = INT (1-*). The number of items minimum at which the shopkeeper won't restock the case, if it is equal to the number of items in the stock list, then they will always restock to the maximum.


Additionally, the room in which the shop is has properties which affect the shop:

.markup = FLOAT (1.0-*). The price of all items sold are multiplied by this property, setting it at 2.0 will double the prices, setting it below 1.0 may not work properly, but it should in theory.

.buyback = FLOAT (0.1 - 1.0). The price of items sold back to the shopkeeper, setting this above 1.0 will allow players to buy and resell the stuff for a profit which is stupid. But players are stupid. Defaults to 0.4.

.security_system = ID. The security system which the shop is tethered to, allows cops to come and curb stomp whoever happens to be causing trouble in the shop. Defaults to the FCPD security system, this could cause mysterious things like K-9's travelling to the other side of the world to kill players.

.security_doors = INT (0-1). Whether or not the shop has security shutters, to stop people getting out after a fight's happened. Defaults to 1.


Don't forget to set the shopkeeper's @messages, and also their .conversation if it strikes your fancy.