item_group.txt 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. //===== rAthena Documentation ================================
  2. //= Item Database
  3. //===== By: ==================================================
  4. //= rAthena Dev Team
  5. //===== Last Updated: ========================================
  6. //= 20210624
  7. //===== Description: =========================================
  8. //= Explanation of the item_group.yml 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. | Item | YES | YES | YES |
  19. +===============+=================+====================+================+
  20. | Rate | YES | YES | YES |
  21. +===============+=================+====================+================+
  22. | Amount | no | OPTIONAL | YES |
  23. +===============+=================+====================+================+
  24. | SubGroup | OPTIONAL | OPTIONAL | YES |
  25. +===============+=================+====================+================+
  26. | Announced | no | no | YES |
  27. +===============+=================+====================+================+
  28. | Duration | no | no | YES |
  29. +===============+=================+====================+================+
  30. | UniqueId | no | no | YES |
  31. +===============+=================+====================+================+
  32. | Bound | no | no | YES |
  33. +===============+=================+====================+================+
  34. | Named | 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. 'IG_' is appended to the name when the file is read.
  39. ---------------------------------------
  40. Index: Unique number that can be used to add the same Item with different data in the list.
  41. ---------------------------------------
  42. Item: Available item that will be obtained from this item group.
  43. Requires the AegisName of the item.
  44. ---------------------------------------
  45. Rate: Probability to get the item. Not a percentage value!
  46. Examples:
  47. - Group: MyItemGroup
  48. SubGroups:
  49. - SubGroup: 1
  50. List:
  51. - Index: 0
  52. Item: Knife
  53. Rate: 5
  54. - Index: 1
  55. Item: Dagger
  56. Rate: 1
  57. - Knife has chance 5/6 (83.3%) to be obtained
  58. - Dagger has chance 1/6 (16.7%) to be obtained
  59. ---------------------------------------
  60. Amount: Amount of item that will be obtained.
  61. ---------------------------------------
  62. SubGroup: Setting this to '0' makes the item always obtainable ("must" item).
  63. SubGroup value will allocate where the item will be stored at random group.
  64. Item Group:
  65. - Group: MyItemGroup
  66. SubGroups:
  67. - SubGroup: 0
  68. List:
  69. - Index: 0
  70. Item: Knife # "must" item(s)
  71. - Index: 1
  72. Item: Dagger # "must" item(s)
  73. - SubGroup: 1
  74. List:
  75. - Index: 0
  76. Item: Stiletto # random at SubGroup 1
  77. Rate: 5
  78. - Index: 1
  79. Item: Stiletto_ # random at SubGroup 1
  80. Rate: 2
  81. - SubGroup: 2
  82. List:
  83. - Index: 0
  84. Item: Stiletto # random at SubGroup 2
  85. Rate: 5
  86. - Index: 1
  87. Item: Dagger_ # random at SubGroup 2
  88. Rate: 4
  89. Usages:
  90. getgroupitem(<group_id>)
  91. ------------
  92. -> 'getgroupitem(IG_MyItemGroup);'
  93. - Player always gets 1x Knife and 1x Dagger
  94. - Player has chance to get 1x Stiletto by chance 5/7 from SubGroup 1
  95. - Player has chance to get 1x Stiletto_ by chance 2/7 from SubGroup 1
  96. - Player has chance to get 1x Stiletto by chance 5/9 from SubGroup 2
  97. - Player has chance to get 1x Dagger_ by chance 4/9 from SubGroup 2
  98. getrandgroupitem(<group_id>{,<quantity>{,<sub_group>}})
  99. ------------
  100. -> 'getrandgroupitem(IG_MyItemGroup);'
  101. - Random SubGroup: 1, Amount: [Based on list]
  102. - Equals to: getrandgroupitem(IG_MyItemGroup,0) and getrandgroupitem(IG_MyItemGroup,0,1)
  103. - Player has chance to get 1x Stiletto by chance 5/7 from SubGroup 1
  104. - Player has chance to get 1x Stiletto_ by chance 2/7 from SubGroup 1
  105. - 'must' and 'SubGroup 2' are ignored
  106. -> 'getrandgroupitem(IG_MyItemGroup,1);'
  107. - Random SubGroup: 1, Amount: 2, ignore 'amount' on the list
  108. - Equals to: getrandgroupitem(IG_MyItemGroup,1,1)
  109. - Player has chance to get 2x Stiletto by chance 5/7 from SubGroup 1
  110. - Player has chance to get 2x Stiletto_ by chance 2/7 from SubGroup 1
  111. - 'must' and 'SubGroup 2' are ignored
  112. -> 'getrandgroupitem(IG_MyItemGroup,3, 0);'
  113. - Random SubGroup: 'must', Amount: 2, ignore 'amount' on the list
  114. - Player has chance to get 3x Knife by chance 1/2 from 'must' SubGroup
  115. - Player has chance to get 3x Dagger by chance 1/2 from 'must' SubGroup
  116. - 'SubGroup 1' and 'SubGroup 2' are ignored
  117. groupranditem(<group id>{,<sub_group>})
  118. ------------
  119. This command only returns an Item ID from random SubGroup. Combine with 'getitem'
  120. to retrieve the items.
  121. -> 'groupranditem(IG_MyItemGroup);'
  122. - Random SubGroup: 1
  123. - Returns Item ID of Stiletto by chance 5/7 from SubGroup 1
  124. - Returns Item ID of Stiletto_ by chance 2/7 from SubGroup 1
  125. - 'must' and 'SubGroup 2' are ignored
  126. -> 'groupranditem(IG_MyItemGroup,0);'
  127. - Random SubGroup: 0
  128. - Returns Item ID of Knife by chance 5/7 from 'must' SubGroup
  129. - Returns Item ID of Dagger by chance 2/7 from 'must' SubGroup
  130. - 'SubGroup 1' and 'SubGroup 2' are ignored
  131. ---------------------------------------
  132. Announced: If player obtained this item, it will be broadcast to the server.
  133. "[Player] has won [Item] from 'Box'"
  134. ---------------------------------------
  135. Duration: Makes the item a rental item, which will be expire in the given amount
  136. of minutes. Not intended for use with stackable items.
  137. ---------------------------------------
  138. UniqueId: Makes the given item(s) with Unique ID. Item will be stacked ONLY each group
  139. when it obtained. Cannot be stacked with same item, even it's stackable item.
  140. Example, there is Box (just call it Apple_Box) that contains 3x Apples with
  141. UniqueId = 1. When Apples appear it will stack for each 3 even another 3x Apples
  142. are appeared by same box. So it will be filled in inventory as:
  143. 3x Apples | 3x Apples | so on... | nx Apples (normal)
  144. ---------------------------------------
  145. Bound: Binds the obtained item.
  146. See 'getitembound' in 'doc/script_commands.txt' for valid bound types.
  147. ---------------------------------------
  148. Named: Inscribes the item with the obtainer's name.
  149. ---------------------------------------