Handeking shopkeeper sellinglist

Need help with your JScripts? Got questions concerning the DFNs? Come forward, step inside :)
Post Reply
warwick
UOX3 Neophyte
Posts: 33
Joined: Sun Dec 26, 2010 11:44 pm
Has thanked: 0
Been thanked: 0

Handeking shopkeeper sellinglist

Post by warwick »

Trying to manage with shopkeepers.
I have no problems to add new shopkeepers, the pricing is ok aswell i think, however, i try to set up a basic npc, then make him a shopkeeper, so far all is fine, what i want to do now, is to add things to his/hers sellinglist.

I have looked around in the forum aswell as in the guides, so far without luck, perhaps looking at the wrong place.

I tried to look in the scripts aswell, but i can't get any lead there.

I found different shopkeepers that spawns in there shops, but i want a permanent shop at a spesiffic place.

However if i want to add an item for sale at any vender, can i do so ingame, or do i have to go into the scrips?
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

You can add new items to shopkeepers either ingame or through the scripts.

In-game:
Check section 2.05 in my UOX3 guide
Note that any changes you do to a vendor in-game will only affect that individual vendor, and any new ones you spawn will be using the default settings.

Through scripts:
The advantage of doing it through the scripts is that the changes you do are global across all vendors of a specific type. If you change the DFN-settings for blacksmith vendors, all blacksmith vendors you spawn will be affected by those changes.

There are three script - or DFN - files you want to look at for this.

The first:
UOX3\dfndata\items\shoplist.dfn

The second and third:
dfndata\npc\
malevendors.dfn
femalevendors.dfn

In the first file you'll see various SHOPLIST sections. In each such section, the lines with SELLITEM are the items in the vendor's inventory that are for sale, while the RSHOPITEM lines are items the vendor can buy from players.

The price at which the NPC sells or buys these items are defined in the item DFN-scripts. Example: SELLITEM=0x0f43

0x0f43 is the item-ID for a specific item in the item-DFN files, more specifically the following item in UOX3\DFNDATA\ITEMS\GEAR\WEAPONS\axes.dfn:

Code: Select all

[0x0f43]
{ facing North
get=base_item
name=hatchet
id=0x0f43
weight=400
[color=red]value=30 15[/color]
layer=1
lodamage=2
hidamage=17
hp=31 80
spd=40
str=15
restock=10
movable=1
decay=1
type=216
good=24
}
I have highlighted the line that defines the sell-and buy-price for this item, which is a hatchet (axe). The first value (30) is the price the vendor sells the items for, while the second (15) is the price he will buy it back from the players at.

You can assign any item from the various DFN-files in DFNDATA\ITEMS\ to a SHOPLIST in shoplists.dfn, and then assign that shoplist to a specific vendor (in malevendors.dfn/femalevendors.dfn) using a line like SHOPLIST=<shoplist name>.

Example from malevendors.dfn:

Code: Select all

[m_weaponsmith]
{
GET=basevendor
NAMELIST=1
TITLE=the Weaponsmith
ID=0x0190
EQUIPITEM=listobject13
HAIRCOLOR=15
EQUIPITEM=listobject14
COLORMATCHHAIR
EQUIPITEM=0x13e4
EQUIPITEM=listobject20
COLORLIST=11
EQUIPITEM=listobject21
COLORLIST=11
EQUIPITEM=listobject22
COLORLIST=11
EQUIPITEM=listobject23
EQUIPITEM=listobject24
COLORLIST=11
BLACKSMITHING=400 600
ARMSLORE=400 600
ITEMID=400 600
FENCING=400 600
SWORDSMANSHIP=400 600
MACEFIGHTING=400 600
TACTICS=400 600
PARRYING=400 600
WRESTLING=400 600
MAGICRESISTANCE=400 600
[color=red]SHOPLIST=WeaponsmithShopping[/color]
}
That's the basics for this system, really. Sorry for the lengthy explanation. If you have any more questions about this don't hesitate to ask!
-= Ho Eyo He Hum =-
Post Reply