Advertisement
Dekita

$D13x - Item Pack

Nov 18th, 2013
1,069
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.97 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Item Pack
  5. # -- Author : Dekita
  6. # -- Version : 1.0
  7. # -- Level : Easy
  8. # -- Requires : N/A
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={} if $D13x==nil
  15. $D13x[:Item_Pack]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 16/11/2o13 - Bugfix, ($D13x Unique Equip)
  21. # 13/o6/2o13 - Started, Finished
  22. #
  23. #===============================================================================
  24. # ☆ Introduction
  25. #-------------------------------------------------------------------------------
  26. # This script allows for "item packs", this is basically an item, that when you
  27. # open it, has a "random" item inside..
  28. #
  29. # To create one of these items simply make a normal item, that triggers
  30. # a common event.
  31. # in the common event simply use the script call to trigger the pack opening.
  32. #
  33. # Can also be used in normal events. This could easily be used to create a
  34. # choice based crafting system using events in game.
  35. #
  36. #===============================================================================
  37. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  38. #===============================================================================
  39. # 1. You MUST give credit to "Dekita" !!
  40. # 2. You are NOT allowed to repost this script.(or modified versions)
  41. # 3. You are NOT allowed to convert this script.
  42. # 4. You are NOT allowed to use this script for Commercial games.
  43. # 5. ENJOY!
  44. #
  45. # "FINE PRINT"
  46. # By using this script you hereby agree to the above terms and conditions,
  47. # if any violation of the above terms occurs "legal action" may be taken.
  48. # Not understanding the above terms and conditions does NOT mean that
  49. # they do not apply to you.
  50. # If you wish to discuss the terms and conditions in further detail you can
  51. # contact me at http://dekitarpg.wordpress.com/
  52. #
  53. #===============================================================================
  54. # ☆ Instructions
  55. #-------------------------------------------------------------------------------
  56. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  57. #
  58. #===============================================================================
  59. # ☆ Script Calls
  60. #-------------------------------------------------------------------------------
  61. # ItemPack.open(symbol)
  62. # replace symbol with the Pack[:symbol] for the pack you wish to open.
  63. # eg. ItemPack.open(:basic_e)
  64. #
  65. #===============================================================================
  66. # ☆ Help
  67. #-------------------------------------------------------------------------------
  68. # N/A
  69. #
  70. #===============================================================================
  71. module ItemPack
  72. #===============================================================================
  73. Pack={}# << Keep
  74.  
  75. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  76. # ☆ Message Settings
  77. #-----------------------------------------------------------------------------
  78. def self.text(item,amount,packname)
  79. return "You gained #{amount} #{item.name} from opening #{packname}."
  80. end
  81. Msg_BG = 0 # 0, 1 or 2
  82. Msg_Pos = 1 # 0, 1 or 2
  83.  
  84. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  85. # ☆ Pack Settings
  86. #-----------------------------------------------------------------------------
  87. # Adjust range based on how "Rare" the item is.
  88. # ALL numbers from 0 -> 999 MUST be included within the Range!!
  89. # A 0..99 (100) range is 10% chance, 0..9 (10) range is 1% chance.
  90. # :name = "The Items Display Name Used In Message"
  91. # :loot = [array of available loot(items) this pack offers]
  92. # :loot format = [:type , id, amnt, range],
  93. Pack[:basic_e]={
  94. :name => "Basic Equipment Pack",
  95. :loot => [
  96. [:weapon, 1, 1, 0..399],
  97. [:armor , 1, 1, 400..499],
  98. [:armor , 2, 1, 500..599],
  99. [:armor , 3, 1, 600..699],
  100. [:armor , 4, 1, 700..799],
  101. [:armor , 5, 1, 800..899],
  102. [:armor , 6, 1, 900..999],
  103. ],
  104. }
  105. #-----------------------------------------------------------------------------
  106. Pack[:world]={
  107. :name => "World Adventurer Pack",
  108. :loot => [
  109. [:item , 1, 5, 0..99],
  110. [:item , 2, 4, 100..199],
  111. [:item , 3, 3, 200..299],
  112. [:item , 4, 2, 300..399],
  113. [:item , 5, 1, 400..499],
  114. [:item , 6, 5, 500..599],
  115. [:item , 7, 4, 600..699],
  116. [:item , 8, 3, 700..799],
  117. [:weapon, 1, 1, 800..899],
  118. [:armor , 1, 1, 900..999],
  119. ],
  120. }
  121. #-----------------------------------------------------------------------------
  122. Pack[:devil]={
  123. :name => "Devil Worshiper Pack",
  124. :loot => [
  125. [:item , 1, 5, 0..99],
  126. [:item , 2, 4, 100..199],
  127. [:item , 3, 3, 200..299],
  128. [:item , 4, 2, 300..399],
  129. [:item , 5, 1, 400..499],
  130. [:item , 6, 5, 500..599],
  131. [:item , 7, 4, 600..699],
  132. [:item , 8, 3, 700..799],
  133. [:weapon, 1, 1, 800..899],
  134. [:armor , 1, 1, 900..999],
  135. ],
  136. }
  137. #-----------------------------------------------------------------------------
  138. # ADD more Pack[:symbol] to suit your needs..
  139. # ALWAYS copy the code from above and then modify it
  140. # IF you are unsure what to do.
  141. #-----------------------------------------------------------------------------
  142.  
  143. #####################
  144. # CUSTOMISATION END #
  145. #####################
  146. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  147. # #
  148. # http://dekitarpg.wordpress.com/ #
  149. # #
  150. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  151. #===============================================================================#
  152. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  153. # YES?\.\. #
  154. # OMG, REALLY? \| #
  155. # WELL SLAP MY FACE AND CALL ME A DRAGON.\..\.. #
  156. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  157. #===============================================================================#
  158. #-----------------------------------------------------------------------------
  159. # Trigger Pack Opening
  160. #-----------------------------------------------------------------------------
  161. def self.open(sym)
  162. numb = rand(1000)
  163. Pack[sym][:loot].each do |item|
  164. next unless item != nil
  165. next unless item[3].include?(numb)
  166. case item[0]
  167. when :item
  168. newi = $data_items[item[1]]
  169. $game_party.gain_item(newi,item[2])
  170. show_message(sym,newi,item[2])
  171. when :weapon
  172. if $D13x[:UniEquip]
  173. item[2].times do
  174. newi = Cloning_101.start_clone(:weapon,item[1],nil,true)
  175. show_message(sym,newi,1)
  176. end
  177. else
  178. newi = $data_weapons[item[1]]
  179. $game_party.gain_item(newi,item[2])
  180. show_message(sym,newi,item[2])
  181. end
  182. when :armor
  183. if $D13x[:UniEquip]
  184. item[2].times do
  185. newi = Cloning_101.start_clone(:armor,item[1],nil,true)
  186. show_message(sym,newi,1)
  187. end
  188. else
  189. newi = $data_weapons[item[1]]
  190. $game_party.gain_item(newi,item[2])
  191. show_message(sym,newi,item[2])
  192. end
  193. end
  194. end
  195. end
  196. #-----------------------------------------------------------------------------
  197. # Trigger Pack Message
  198. #-----------------------------------------------------------------------------
  199. def self.show_message(sym,item,val)
  200. pack = Pack[sym]
  201. msge = text(item,val,pack[:name])
  202. $game_message.new_page
  203. $game_message.background = Msg_BG
  204. $game_message.position = Msg_Pos
  205. $game_message.add(msge)
  206. end
  207.  
  208. end
  209.  
  210. #===============================================================================
  211. # http://dekitarpg.wordpress.com/
  212. #===============================================================================
  213. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement