Advertisement
Dekita

Untitled

Apr 19th, 2014
550
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.97 KB | None | 0 0
  1. if true # << Make true to use this script, false to disable.
  2. #===============================================================================
  3. #
  4. # ☆ $D13x - Item Tracker
  5. # -- Author : Dekita
  6. # -- Version : 1.0
  7. # -- Level : Easy / Normal
  8. # -- Requires : N/A
  9. # -- Engine : RPG Maker VX Ace.
  10. #
  11. #===============================================================================
  12. # ☆ Import
  13. #-------------------------------------------------------------------------------
  14. $D13x={}if$D13x==nil
  15. $D13x[:Item_Tracker]=true
  16. #===============================================================================
  17. # ☆ Updates
  18. #-------------------------------------------------------------------------------
  19. # D /M /Y
  20. # 17/o4/2o14 - Started, Finished,
  21. #
  22. #===============================================================================
  23. # ☆ Introduction
  24. #-------------------------------------------------------------------------------
  25. # Simple script to keep track of how many times the party has gained and used
  26. # items. Doesnt really do anything else.
  27. #
  28. #===============================================================================
  29. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  30. #===============================================================================
  31. # 1. You MUST give credit to "Dekita" !!
  32. # 2. You are NOT allowed to repost this script.(or modified versions)
  33. # 3. You are NOT allowed to convert this script.
  34. # 4. You are NOT allowed to use this script for Commercial games.
  35. # 5. ENJOY!
  36. #
  37. # "FINE PRINT"
  38. # By using this script you hereby agree to the above terms and conditions,
  39. # if any violation of the above terms occurs "legal action" may be taken.
  40. # Not understanding the above terms and conditions does NOT mean that
  41. # they do not apply to you.
  42. # If you wish to discuss the terms and conditions in further detail you can
  43. # contact me at http://dekitarpg.wordpress.com/
  44. #
  45. #===============================================================================
  46. # ☆ Instructions
  47. #-------------------------------------------------------------------------------
  48. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  49. #
  50. #===============================================================================
  51. # ☆ Script Calls
  52. #-------------------------------------------------------------------------------
  53. # $game_player.items_earned[ item.id ]
  54. # $game_player.items_spent[ item.id ]
  55. #
  56. #===============================================================================
  57. # ☆ Notetags ( default )
  58. #-------------------------------------------------------------------------------
  59. # N/A
  60. #
  61. #===============================================================================
  62. # ☆ HELP
  63. #-------------------------------------------------------------------------------
  64. # N/A
  65. #
  66. #===============================================================================
  67. module Item_Tracker
  68. #===============================================================================
  69. #-----------------------------------------------------------------------------
  70. # No Customisation Needed
  71. #-----------------------------------------------------------------------------
  72. #####################
  73. # CUSTOMISATION END #
  74. end #####################
  75. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  76. # #
  77. # http://dekitarpg.wordpress.com/ #
  78. # #
  79. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  80. #===============================================================================#
  81. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  82. # YES?\.\. #
  83. # OMG, REALLY? \| #
  84. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  85. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  86. #===============================================================================#
  87. class Game_Party < Game_Unit
  88. #===============================================================================
  89. #-----------------------------------------------------------------------------
  90. #
  91. #-----------------------------------------------------------------------------
  92. alias :gain_item_tracked :gain_item
  93. #-----------------------------------------------------------------------------
  94. #
  95. #-----------------------------------------------------------------------------
  96. def gain_item(item, amount, include_equip = false)
  97. erform_gain_itemt(item,amount)
  98. gain_item_tracked(item,amount,include_equip)
  99. end
  100. #-----------------------------------------------------------------------------
  101. #
  102. #-----------------------------------------------------------------------------
  103. def erform_gain_itemt(item,amount)
  104. return unless item
  105. return unless item.is_a?(RPG::Item)
  106. $game_player.items_earned[item.id] += amount.to_i if amount > 0
  107. $game_player.items_used[item.id] += amount.to_i if amount < 0
  108. end
  109. end
  110. #===============================================================================
  111. class Game_Player < Game_Character
  112. #===============================================================================
  113. #-----------------------------------------------------------------------------
  114. #
  115. #-----------------------------------------------------------------------------
  116. attr_accessor :items_earned
  117. attr_accessor :items_used
  118. #-----------------------------------------------------------------------------
  119. #
  120. #-----------------------------------------------------------------------------
  121. alias :init_itemtrack :initialize
  122. #-----------------------------------------------------------------------------
  123. #
  124. #-----------------------------------------------------------------------------
  125. def initialize
  126. init_itemtrack
  127. initialize_itemtrack
  128. end
  129. #-----------------------------------------------------------------------------
  130. #
  131. #-----------------------------------------------------------------------------
  132. def initialize_itemtrack
  133. @items_earned = [0] * $data_items.size
  134. @items_used = [0] * $data_items.size
  135. end
  136. end
  137. #==============================================================================#
  138. # http://dekitarpg.wordpress.com/ #
  139. #==============================================================================#
  140. end # if true # << Make true to use this script, false to disable.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement