item_group.txt 7.1 KB

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