forked from rathena/rathena
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitem_group.txt
184 lines (146 loc) · 7.66 KB
/
item_group.txt
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
//===== rAthena Documentation ================================
//= Item Database
//===== By: ==================================================
//= rAthena Dev Team
//===== Last Updated: ========================================
//= 20170915
//===== Description: =========================================
//= Explanation of the item_group.txt file and structure.
//============================================================
Items within an item group can be retrieved through the 'groupranditem',
'getrandgroupitem', and 'getgroupitem' script commands.
The table below explains which fields are accessed in each.
+===============+=================+====================+================+
| Field | 'groupranditem' | 'getrandgroupitem' | 'getgroupitem' |
+===============+=================+====================+================+
| GroupID | YES | YES | YES |
+===============+=================+====================+================+
| ItemID | YES | YES | YES |
+===============+=================+====================+================+
| Rate | YES | YES | YES |
+===============+=================+====================+================+
| Amount | no | OPTIONAL | YES |
+===============+=================+====================+================+
| Random | OPTIONAL | OPTIONAL | YES |
+===============+=================+====================+================+
| isAnnounced | no | no | YES |
+===============+=================+====================+================+
| Duration | no | no | YES |
+===============+=================+====================+================+
| GUID | no | no | YES |
+===============+=================+====================+================+
| isBound | no | no | YES |
+===============+=================+====================+================+
| isNamed | no | no | YES |
+===============+=================+====================+================+
---------------------------------------
GroupID: See the "Item Group ID" section in 'src/map/itemdb.hpp' and the "item groups" section in 'src/map/script_constants.hpp'.
Supports IG_* constants.
---------------------------------------
ItemID: Available item_id that will be obtained from this item group.
Supports AegisName of the item.
---------------------------------------
Rate: Probability to get the item. Not a percentage value!
Examples:
IG_MyItemGroup,Knife,5
IG_MyItemGroup,Dagger,1
- Knife has chance 5/6 (83.3%) to be obtained
- Dagger has chance 1/6 (16.7%) to be obtained
---------------------------------------
Amount: Amount of item that will be obtained.
---------------------------------------
Random: Set this to '0' and the item will always be obtained ("must" item).
Random value will allocates where the item will be stored at random group.
(max. random group is 4, defined as MAX_ITEMGROUP_RANDGROUP in 'src/map/itemdb.cpp'.)
Item Group:
IG_MyItemGroup,Knife,0,1,0 //a "must" item
IG_MyItemGroup,Dagger,0,1,0 //a "must" item
IG_MyItemGroup,Stiletto,5,1,1 //random at group 1
IG_MyItemGroup,Stiletto_,2,1,1 //random at group 1
IG_MyItemGroup,Stiletto,5,1,2 //random at group 2
IG_MyItemGroup,Dagger_,4,1,2 //random at group 2
Usages:
getgroupitem(<group_id>)
------------
-> 'getgroupitem(IG_MyItemGroup);'
- Player always gets 1x Knife and 1x Dagger
- Player has chance to get 1x Stiletto by chance 5/7 from group 1
- Player has chance to get 1x Stiletto_ by chance 2/7 from group 1
- Player has chance to get 1x Stiletto by chance 5/9 from group 2
- Player has chance to get 1x Dagger_ by chance 4/9 from group 2
getrandgroupitem(<group_id>{,<quantity>{,<sub_group>}})
------------
-> 'getrandgroupitem(IG_MyItemGroup);'
- Random Group: 1, Amount: [Based on list]
- Equals to: getrandgroupitem(IG_MyItemGroup,0) and getrandgroupitem(IG_MyItemGroup,0,1)
- Player has chance to get 1x Stiletto by chance 5/7 from group 1
- Player has chance to get 1x Stiletto_ by chance 2/7 from group 1
- 'must' and 'group 2' are ignored
-> 'getrandgroupitem(IG_MyItemGroup,1);'
- Random Group: 1, Amount: 2, ignore 'amount' on the list
- Equals to: getrandgroupitem(IG_MyItemGroup,1,1)
- Player has chance to get 2x Stiletto by chance 5/7 from group 1
- Player has chance to get 2x Stiletto_ by chance 2/7 from group 1
- 'must' and 'group 2' are ignored
-> 'getrandgroupitem(IG_MyItemGroup,3,0);'
- Random Group: 'must', Amount: 2, ignore 'amount' on the list
- Player has chance to get 3x Knife by chance 1/2 from 'must' group
- Player has chance to get 3x Dagger by chance 1/2 from 'must' group
- 'group 1' and 'group 2' are ignored
groupranditem(<group id>{,<sub_group>})
------------
This command only returns an Item ID from random group. Combine with 'getitem'
to retrieve the items.
-> 'groupranditem(IG_MyItemGroup);'
- Random Group: 1
- Returns Item ID of Stiletto by chance 5/7 from group 1
- Returns Item ID of Stiletto_ by chance 2/7 from group 1
- 'must' and 'group 2' are ignored
-> 'groupranditem(IG_MyItemGroup,0);'
- Random Group: 0
- Returns Item ID of Knife by chance 5/7 from 'must' group
- Returns Item ID of Dagger by chance 2/7 from 'must' group
- 'group 1' and 'group 2' are ignored
-----------------------------------------
If the 'Rate' for random '0' is not 0 (more than 0), that means this item
also can be obtained as random item.
If you want the "must" item only can be obtained without random chance,
change the 'Rate' for this item to 0.
Example:
IG_MyItemGroup2,Knife,0,1,0
IG_MyItemGroup2,Dagger,5,1,0
IG_MyItemGroup2,Stiletto,2,1,1
-> usage: 'getgroupitem(IG_MyItemGroup2);'
- 1x Knife always be obtained
- 1x Dagger always be obtained and also has chance to get 1 more by
chance 5/7
- 1x Stiletto can be obtained by chance 2/7
result -> player will get 1x Knife, 1x Dagger, and 1x Dagger or 1x Stiletto
-> usage: 'getrandgroupitem(IG_MyItemGroup2,1);' (Ignores 'Amount' field)
- 1x Knife never be obtained!
- 1x Dagger can be obtained by chance 5/7
- 1x Stiletto can be obtained by chance 2/7
result -> player will get only 1x Dagger or 1x Stiletto
---------------------------------------
isAnnounced: If player obtained this item, it will be broadcast to the server.
"[Player] has won [Item] from 'Box'"
---------------------------------------
Duration: Makes the item a rental item, which will be expire in the given amount
of minutes. Not intended for use with stackable items.
---------------------------------------
GUID: Makes the given item(s) with Unique ID. Item will be stacked ONLY each group
when it obtained. Cannot be stacked with same item, even it's stackable item.
Example, there is Box (just call it Apple_Box) that contains 3x Apples with
GUID = 1. When Apples appear it will stack for each 3 even another 3x Apples
are appeared by same box. So it will be filled in inventory as:
3x Apples | 3x Apples | so on... | nx Apples (normal)
---------------------------------------
isBound: Binds the obtained item.
See 'getitembound' in 'doc/script_commands.txt' for valid bound types.
---------------------------------------
isNamed: Inscribes the item with the obtainer's name.
---------------------------------------
Supports to import other file, usage:
import: db/path/filename.txt
Example:
import: db/re/item_bluebox.txt