vindaca510

V's Item Experience v0.4

Jan 30th, 2014
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 8.38 KB | None | 0 0
  1. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  2. #                                                                              #
  3. #                             V's Item Experience                              #
  4. #                                 Version  0.4                                 #
  5. #                                                                              #
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  7. #                                Written By:  V                                #
  8. #                        Last Edited:  January 30, 2013                        #
  9. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  10. #                                                                              #
  11. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  12. #                                                                              #
  13. #==============================================================================#
  14. #------------------------------------------------------------------------------#
  15. # ** Disclaimer                                                                #
  16. #------------------------------------------------------------------------------#
  17. #                                                                              #
  18. # This script was intended for Non-commercial use only, if you wish to use     #
  19. # this script in a commercial game please PM me at which ever site you found   #
  20. # this script. Either way please give me credit in your game script as the     #
  21. # writer of this script, and send me a PM abuot the release of the game/demo.  #
  22. #                                                                              #
  23. #------------------------------------------------------------------------------#
  24. # ** How To Use                                                                #
  25. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  26. #                                                                              #
  27. # * Use this tag in an items notebox if you wish to recive exp when using that #
  28. #   item.                                                                      #
  29. #             <Item_XP: Amount>                                                #
  30. #             <XP_Pot: Amount>                                                 #
  31. #                                                                              #
  32. #------------------------------------------------------------------------------#
  33. # ** Description                                                               #
  34. #------------------------------------------------------------------------------#
  35. #                                                                              #
  36. #  v0.1                                                                        #
  37. # ~=~=~=~                                                                      #
  38. #                                                                              #
  39. # * This script allows the actor to gain experience for using set items.       #
  40. #                                                                              #
  41. #  v0.2                                                                        #
  42. # ~=~=~=~                                                                      #
  43. #                                                                              #
  44. # * Bugs Fixed.                                                                #
  45. #                                                                              #
  46. #  v0.3                                                                        #
  47. # ~=~=~=~                                                                      #
  48. #                                                                              #
  49. # * Bugs Fixed.                                                                #
  50. #                                                                              #
  51. #  v0.4                                                                        #
  52. # ~=~=~=~                                                                      #
  53. #                                                                              #
  54. # * I added an option to create experience potion too.                         #                                                                #
  55. #                                                                              #
  56. #------------------------------------------------------------------------------#
  57. #==============================================================================#
  58.  
  59. #==============================================================================
  60. # ** V's Item Experience
  61. #==============================================================================
  62. #==============================================================================
  63. # ** Game_Actor
  64. #------------------------------------------------------------------------------
  65. #  This class handles actors. It is used within the Game_Actors class
  66. # ($game_actors) and is also referenced from the Game_Party class ($game_party).
  67. #==============================================================================
  68.  
  69. class Game_Actor < Game_Battler
  70.  
  71.   #--------------------------------------------------------------------------
  72.   # * Aliasing Method: Show Level Up Message
  73.   #--------------------------------------------------------------------------
  74.   alias :gadlu454535344  :display_level_up
  75.  
  76.   #--------------------------------------------------------------------------
  77.   # * Show Level Up Message
  78.   #     new_skills : Array of newly learned skills
  79.   #--------------------------------------------------------------------------
  80.   def display_level_up(new_skills)
  81.     gadlu454535344(new_skills) unless SceneManager.scene_is?(Scene_Battle)
  82.   end
  83.  
  84.   #--------------------------------------------------------------------------
  85.   # * XP Pot
  86.   #--------------------------------------------------------------------------
  87.   def xp_pot(item)
  88.     note = /<XP_Pot:\s*(\d*)>/i
  89.     item.note.scan(note)
  90.     if $1 && $1 != ""
  91.       item_xp = $1.to_i
  92.       gain_exp(item_xp)
  93.     end
  94.   end
  95.  
  96.   #--------------------------------------------------------------------------
  97.   # * Gain Item Experience
  98.   #--------------------------------------------------------------------------
  99.   def gain_item_xp(item)
  100.     note = /<Item_XP:\s*(\d*)>/i
  101.     item.note.scan(note)
  102.     if $1 && $1 != ""
  103.       item_xp = $1.to_i
  104.       gain_exp(item_xp)
  105.     end
  106.   end
  107.  
  108. end
  109.  
  110.  
  111. #==============================================================================
  112. # ** Scene_Item
  113. #------------------------------------------------------------------------------
  114. #  This class performs the item screen processing.
  115. #==============================================================================
  116.  
  117. class Scene_Item < Scene_ItemBase
  118.  
  119.   #--------------------------------------------------------------------------
  120.   # * Aliasing Method: Use Item
  121.   #--------------------------------------------------------------------------
  122.   alias :siui454343413  :use_item
  123.  
  124.   #--------------------------------------------------------------------------
  125.   # * Use Item
  126.   #--------------------------------------------------------------------------
  127.   def use_item
  128.     item_target_actors.each { |i| i.xp_pot(item) }
  129.     @actor.gain_item_xp(item)
  130.     siui454343413()
  131.   end
  132.  
  133. end
  134.  
  135.  
  136. #==============================================================================
  137. # ** Scene_Battle
  138. #------------------------------------------------------------------------------
  139. #  This class performs battle screen processing.
  140. #==============================================================================
  141.  
  142. class Scene_Battle < Scene_Base
  143.  
  144.   #--------------------------------------------------------------------------
  145.   # * Aliasing Method: Use Item
  146.   #--------------------------------------------------------------------------
  147.   alias :sbui5245245278  :use_item
  148.  
  149.   #--------------------------------------------------------------------------
  150.   # * Use Skill/Item
  151.   #--------------------------------------------------------------------------
  152.   def use_item
  153.     @target.xp_pot(@subject.current_action.item) unless @target.is_a?(Game_Enemy)
  154.     @subject.gain_item_xp(@subject.current_action.item) unless @subject.is_a?(Game_Enemy)
  155.     sbui5245245278()
  156.   end
  157.  
  158. end
Advertisement
Add Comment
Please, Sign In to add comment