item_group.txt 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. //===== rAthena Documentation ================================
  2. //= Item Database
  3. //===== By: ==================================================
  4. //= rAthena Dev Team
  5. //===== Last Updated: ========================================
  6. //= 20170915
  7. //===== Description: =========================================
  8. //= Explanation of the item_group.txt file and structure.
  9. //============================================================
  10. Items within an item group can be retrieved through the 'groupranditem',
  11. 'getrandgroupitem', and 'getgroupitem' script commands.
  12. The table below explains which fields are accessed in each.
  13. +===============+=================+====================+================+
  14. | Field | 'groupranditem' | 'getrandgroupitem' | 'getgroupitem' |
  15. +===============+=================+====================+================+
  16. | GroupID | YES | YES | YES |
  17. +===============+=================+====================+================+
  18. | ItemID | YES | YES | YES |
  19. +===============+=================+====================+================+
  20. | Rate | YES | YES | YES |
  21. +===============+=================+====================+================+
  22. | Amount | no | OPTIONAL | YES |
  23. +===============+=================+====================+================+
  24. | Random | OPTIONAL | OPTIONAL | YES |
  25. +===============+=================+====================+================+
  26. | isAnnounced | no | no | YES |
  27. +===============+=================+====================+================+
  28. | Duration | no | no | YES |
  29. +===============+=================+====================+================+
  30. | GUID | no | no | YES |
  31. +===============+=================+====================+================+
  32. | isBound | no | no | YES |
  33. +===============+=================+====================+================+
  34. | isNamed | no | no | YES |
  35. +===============+=================+====================+================+
  36. ---------------------------------------
  37. GroupID: See the "Item Group ID" section in 'src/map/itemdb.hpp' and the "item groups" section in 'src/map/script_constants.hpp'.
  38. Supports IG_* constants.
  39. ---------------------------------------
  40. ItemID: Available item_id that will be obtained from this item group.
  41. Supports AegisName of the item.
  42. ---------------------------------------
  43. Rate: Probability to get the item. Not a percentage value!
  44. Examples:
  45. IG_MyItemGroup,Knife,5
  46. IG_MyItemGroup,Dagger,1
  47. - Knife has chance 5/6 (83.3%) to be obtained
  48. - Dagger has chance 1/6 (16.7%) to be obtained
  49. ---------------------------------------
  50. Amount: Amount of item that will be obtained.
  51. ---------------------------------------
  52. Random: Set this to '0' and the item will always be obtained ("must" item).
  53. Random value will allocates where the item will be stored at random group.
  54. (max. random group is 4, defined as MAX_ITEMGROUP_RANDGROUP in 'src/map/itemdb.cpp'.)
  55. Item Group:
  56. IG_MyItemGroup,Knife,0,1,0 //a "must" item
  57. IG_MyItemGroup,Dagger,0,1,0 //a "must" item
  58. IG_MyItemGroup,Stiletto,5,1,1 //random at group 1
  59. IG_MyItemGroup,Stiletto_,2,1,1 //random at group 1
  60. IG_MyItemGroup,Stiletto,5,1,2 //random at group 2
  61. IG_MyItemGroup,Dagger_,4,1,2 //random at group 2
  62. Usages:
  63. getgroupitem(<group_id>)
  64. ------------
  65. -> 'getgroupitem(IG_MyItemGroup);'
  66. - Player always gets 1x Knife and 1x Dagger
  67. - Player has chance to get 1x Stiletto by chance 5/7 from group 1
  68. - Player has chance to get 1x Stiletto_ by chance 2/7 from group 1
  69. - Player has chance to get 1x Stiletto by chance 5/9 from group 2
  70. - Player has chance to get 1x Dagger_ by chance 4/9 from group 2
  71. getrandgroupitem(<group_id>{,<quantity>{,<sub_group>}})
  72. ------------
  73. -> 'getrandgroupitem(IG_MyItemGroup);'
  74. - Random Group: 1, Amount: [Based on list]
  75. - Equals to: getrandgroupitem(IG_MyItemGroup,0) and getrandgroupitem(IG_MyItemGroup,0,1)
  76. - Player has chance to get 1x Stiletto by chance 5/7 from group 1
  77. - Player has chance to get 1x Stiletto_ by chance 2/7 from group 1
  78. - 'must' and 'group 2' are ignored
  79. -> 'getrandgroupitem(IG_MyItemGroup,1);'
  80. - Random Group: 1, Amount: 2, ignore 'amount' on the list
  81. - Equals to: getrandgroupitem(IG_MyItemGroup,1,1)
  82. - Player has chance to get 2x Stiletto by chance 5/7 from group 1
  83. - Player has chance to get 2x Stiletto_ by chance 2/7 from group 1
  84. - 'must' and 'group 2' are ignored
  85. -> 'getrandgroupitem(IG_MyItemGroup,3,0);'
  86. - Random Group: 'must', Amount: 2, ignore 'amount' on the list
  87. - Player has chance to get 3x Knife by chance 1/2 from 'must' group
  88. - Player has chance to get 3x Dagger by chance 1/2 from 'must' group
  89. - 'group 1' and 'group 2' are ignored
  90. groupranditem(<group id>{,<sub_group>})
  91. ------------
  92. This command only returns an Item ID from random group. Combine with 'getitem'
  93. to retrieve the items.
  94. -> 'groupranditem(IG_MyItemGroup);'
  95. - Random Group: 1
  96. - Returns Item ID of Stiletto by chance 5/7 from group 1
  97. - Returns Item ID of Stiletto_ by chance 2/7 from group 1
  98. - 'must' and 'group 2' are ignored
  99. -> 'groupranditem(IG_MyItemGroup,0);'
  100. - Random Group: 0
  101. - Returns Item ID of Knife by chance 5/7 from 'must' group
  102. - Returns Item ID of Dagger by chance 2/7 from 'must' group
  103. - 'group 1' and 'group 2' are ignored
  104. -----------------------------------------
  105. If the 'Rate' for random '0' is not 0 (more than 0), that means this item
  106. also can be obtained as random item.
  107. If you want the "must" item only can be obtained without random chance,
  108. change the 'Rate' for this item to 0.
  109. Example:
  110. IG_MyItemGroup2,Knife,0,1,0
  111. IG_MyItemGroup2,Dagger,5,1,0
  112. IG_MyItemGroup2,Stiletto,2,1,1
  113. -> usage: 'getgroupitem(IG_MyItemGroup2);'
  114. - 1x Knife always be obtained
  115. - 1x Dagger always be obtained and also has chance to get 1 more by
  116. chance 5/7
  117. - 1x Stiletto can be obtained by chance 2/7
  118. result -> player will get 1x Knife, 1x Dagger, and 1x Dagger or 1x Stiletto
  119. -> usage: 'getrandgroupitem(IG_MyItemGroup2,1);' (Ignores 'Amount' field)
  120. - 1x Knife never be obtained!
  121. - 1x Dagger can be obtained by chance 5/7
  122. - 1x Stiletto can be obtained by chance 2/7
  123. result -> player will get only 1x Dagger or 1x Stiletto
  124. ---------------------------------------
  125. isAnnounced: If player obtained this item, it will be broadcast to the server.
  126. "[Player] has won [Item] from 'Box'"
  127. ---------------------------------------
  128. Duration: Makes the item a rental item, which will be expire in the given amount
  129. of minutes. Not intended for use with stackable items.
  130. ---------------------------------------
  131. GUID: Makes the given item(s) with Unique ID. Item will be stacked ONLY each group
  132. when it obtained. Cannot be stacked with same item, even it's stackable item.
  133. Example, there is Box (just call it Apple_Box) that contains 3x Apples with
  134. GUID = 1. When Apples appear it will stack for each 3 even another 3x Apples
  135. are appeared by same box. So it will be filled in inventory as:
  136. 3x Apples | 3x Apples | so on... | nx Apples (normal)
  137. ---------------------------------------
  138. isBound: Binds the obtained item.
  139. See 'getitembound' in 'doc/script_commands.txt' for valid bound types.
  140. ---------------------------------------
  141. isNamed: Inscribes the item with the obtainer's name.
  142. ---------------------------------------
  143. Supports to import other file, usage:
  144. import: db/path/filename.txt
  145. Example:
  146. import: db/re/item_bluebox.txt