[Crossfire-wiki] [Crossfire DokuWiki] page added: dev:shops

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Fri Dec 8 09:15:55 CST 2006


A page in your DokuWiki was added or changed. Here are the details:

Date        : 2006/12/08 09:15
User        : ryo
Edit Summary: created from doc/Developers/shops

This guide explains how to implement shop headers on maps.

===== Shop headers =====

There are 5 headers related to shops that can be present in a map. Any given map may have some, all or none of them (although in the later case, it isn't considered to be a shop).

==== shopitems ====

this is a semi-colon deliminated list of item types and values. Each entry is a name of an item type (from the array in common/item.c) followed by an optional colon then a value in the range -100 to 100 (if this is missing, the default value of 0 is used.

This value is a measure of how much items of that type are prefered. Neutrality is represented by 0 (so a theoretical 'general' store would have 0 for everything), a positive preference for certain item types is a positive value, and negative preference for item types is a negative value.

As a special note, the character * may be used once to set a preference for 
everything not explicitly listed otherwise (this value would in most cases be negative)

for example, a typical magic shop might have the string:
<code>
shopitems amulet:25;ring:40;potion:40;book:35;scroll:40;spellbook:40;skillscroll:50;wand:40;*:-50
</code>

and an armour shop might have the string:
<code>
shopitems armour:50;shield:50;helmet:40;cloak:40;boots:40;gloves:40;bracers:50;girdle:50;*:-50
</code>

All possible name values for items are listed in common/item.c, however there are only some that are likely to be used (doors are not sold very often....) this list is not definitive or neccesarily up-to-date, but is a reasonable starting point for constructing a new shop.

<code>
rod
book
horn
amulet
potion
ring
inorganic
spellbook
wand
scroll
power_crystal

arrow
bow
weapon

armour
shield
helmet
cloak
boots
gloves
bracers
girdle

flesh
food
drink
treasure
gem
skill tool
lighter
light source
lamp
tool
container
item_transformer

armour improver
weapon improver
skillscroll

building material
</code>

==== shopmin ====
This is an integer value. It is the minimum value that the object must have in order to be considered by purchase for a shop. This is not the same as the price offered, which can be substantially below shopmin.

FIXME in what currency?

==== shopmax ====
This is an integer value. It uses value like shopmin does, however it is not a fixed upper limit. 

The value is adjusted downwards if it is in excess of one half of shopmax. The output value is the minimum of shopmax and one half of shopmax plus the square root of one half of shopmax

Note that the value is only an aspect of the final price, and the actual price offered for an item can be substantially less than shopmax, even when the item's value in in excess of that.

==== shoprace ====
If the player matches shoprace, this has no effect, if they do not, the price offered is only 80% of what it would otherwise be.

==== shopgreed ====
This is a multiplier on all prices offered, items brought from the player are done so at a price divided by the greed, items sold to a player are overcharged by a factor of shopgreed.

FIXME percent value like 75? or 7.5?

===== Recognising different types of shops =====

Whilst a hit and miss approach will work if there are items of known value to measure prices with, it is possible to also guage the manner in which a shop will trade with the bargaining skill. Merely use_skill bargaining on an appropriate shop, and the details about the shop will be displayed.

===== Value estimation =====
No longer does examining an item display the exact sale price you will get (not least because there /is/ no exact sale price anymore...). Instead an estimate is given, the quality of this estimate is based on your knowledge of any skills that could identify the item, and the bargaining skill, as well as a fair degree of luck. Remember, just because you think an item is worth a lot, doesn't mean any shopkeepers do.

The estimate given can be improved by leveling skills related to the class of item in question, and the bargaining skill. Also, by acquiring other objects that are similar, and comparing and merging them, your evaluation of the value of the objects can change. This does not always mean greater accuracy however.



IP-Address  : 213.174.127.3
Old Revision: none
New Revision: http://wiki.metalforge.net/doku.php/dev:shops

-- 
This mail was generated by DokuWiki at
http://wiki.metalforge.net/




More information about the crossfire-wiki mailing list