summaryrefslogtreecommitdiff
path: root/docs/npc_vendor.md
blob: 86a57b92116823bde01b60e17d05f3d0b5becf1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# npc\_vendor

`Back-to:World`

**Table Structure**

This table holds the vendor data for all NPCs that sell items and currency. The price for each item or currency is in its item template as [BuyPrice](http://collab.kpsn.org/display/tc/item_template#item_template-BuyPrice) or as [ExtendedCost](http://collab.kpsn.org/display/tc/npc_vendor#npc_vendor-ExtendedCost).

## 3.3.5 version

<table style="width:100%;">
<colgroup>
<col width="16%" />
<col width="16%" />
<col width="16%" />
<col width="16%" />
<col width="16%" />
<col width="16%" />
</colgroup>
<tbody>
<tr class="odd">
<td><p><strong>Field</strong></p></td>
<td><p><strong>Type</strong></p></td>
<td><p><strong>Attributes</strong></p></td>
<td><p><strong>Key</strong></p></td>
<td><p><strong>Null</strong></p></td>
<td><p><strong>Default</strong></p></td>
</tr>
<tr class="even">
<td><p><a href="#npc_vendor-entry">entry</a></p></td>
<td><p>mediumint(8)</p></td>
<td><p>unsigned</p></td>
<td><p>PRI</p></td>
<td><p>NO</p></td>
<td><p>0</p></td>
</tr>
<tr class="odd">
<td><p><a href="#npc_vendor-slot">slot</a></p></td>
<td><p>smallint(6)</p></td>
<td><p>signed</p></td>
<td><p> </p></td>
<td><p>NO</p></td>
<td><p>0</p></td>
</tr>
<tr class="even">
<td><p><a href="#npc_vendor-item">item</a></p></td>
<td><p>mediumint(8)</p></td>
<td><p>signed</p></td>
<td><p>PRI</p></td>
<td><p>NO</p></td>
<td><p>0</p></td>
</tr>
<tr class="odd">
<td><p><a href="#npc_vendor-maxcount">maxcount</a></p></td>
<td><p>tinyint(3)</p></td>
<td><p>unsigned</p></td>
<td><p> </p></td>
<td><p>NO</p></td>
<td><p>0</p></td>
</tr>
<tr class="even">
<td><p><a href="#npc_vendor-incrtime">incrtime</a></p></td>
<td><p>int(10)</p></td>
<td><p>unsigned</p></td>
<td><p> </p></td>
<td><p>NO</p></td>
<td><p>0</p></td>
</tr>
<tr class="odd">
<td><p><a href="#npc_vendor-ExtendedCost">ExtendedCost</a></p></td>
<td><p>mediumint(8)</p></td>
<td><p>unsigned</p></td>
<td><p>PRI</p></td>
<td><p>NO</p></td>
<td><p>0</p></td>
</tr>
</tbody>
</table>

## 6.x.x version

| Field                                              | Type         | Attributes | Key | Null | Default |
|----------------------------------------------------|--------------|------------|-----|------|---------|
| [entry](#npc_vendor-entry)                         | mediumint(8) | unsigned   | PRI | NO   | 0       |
| [slot](#npc_vendor-slot)                           | smallint(6)  | signed     | MUL | NO   | 0       |
| [item](#npc_vendor-item)                           | mediumint(8) | signed     | PRI | NO   | 0       |
| [maxcount](#npc_vendor-maxcount)                   | mediumint(8) | unsigned   |     | NO   | 0       |
| [incrtime](#npc_vendor-incrtime)                   | int(10)      | unsigned   |     | NO   | 0       |
| [ExtendedCost](#npc_vendor-ExtendedCost)           | mediumint(8) | unsigned   | PRI | NO   | 0       |
| [type](#npc_vendor-type)                           | tinyint(3)   | unsigned   | PRI | NO   | 1       |
| [PlayerConditionID](#npc_vendor-PlayerConditionID) | int(10)      | unsigned   |     | NO   | 0       |
| [IgnoreFiltering](#npc_vendor-IgnoreFiltering)     | tinyint(3)   | unsigned   |     | NO   | 0       |
| [VerifiedBuild](#npc_vendor-VerifiedBuild)         | smallint(5)  | signed     |     | YES  | 0       |

 

 

**Field Descriptions**

### entry

The ID of the creature. See [creature\_template.entry](http://collab.kpsn.org/display/tc/creature_template#creature_template-entry).

### slot

Position of the item when the vendor window opens. The image below explains how the vendor-inventory slots are numbered. To continue on past the first page just use numbers 10, 11, 12, etc...

![](https://valkryst.com/blog/posts/How%20to%20Create%20a%20Vendor/ImageA.jpg){height="250"}

### item

The item ID. See  [item\_template.entry](http://collab.kpsn.org/display/tc/item_template#item_template-entry).

### maxcount

The maximum number of items carried by the vendor at any time. If you want the vendor to carry an unlimited number of the item then set this to **0** else set it to any positive number. In the image below the maxcount value is circled.

![](https://valkryst.com/blog/posts/How%20to%20Create%20a%20Vendor/ImageB.jpg){height="250"}

### incrtime

Combined with [maxcount](#npc_vendor-maxcount), this field tells how often (in seconds) the vendor list is refreshed and the limited item copies are restocked. For limited item copies, every refresh, the quantity is increased by [item\_template.BuyCount](http://collab.kpsn.org/display/tc/item_template#item_template-BuyCount) .

### ExtendedCost

The value here corresponds to the ID in [ItemExtendedCost.dbc](http://collab.kpsn.org/display/tc/ItemExtendedCost) and that ID controls the item's non monetary price, be it honor points, arena points, different types of badges or any combination of the above.