Advertisement
vindaca510

V's Lucky Gold Find v0.4

Aug 20th, 2013
646
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 7.15 KB | None | 0 0
  1.  
  2.  
  3. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  4. #                                                                              #
  5. #                             V's Lucky Gold Find                              #
  6. #                                 Version  0.4                                 #
  7. #                                                                              #
  8. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  9. #                                Written By:  V                                #
  10. #                          Last Edited:  March 4, 2014                         #
  11. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  12. #                                                                              #
  13. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  14.  
  15.  
  16. #==============================================================================#
  17. #------------------------------------------------------------------------------#
  18. # ** Disclaimer                                                                #
  19. #------------------------------------------------------------------------------#
  20. #                                                                              #
  21. # This script was intended for Non-commercial use only, if you wish to use     #
  22. # this script in a commercial game please PM me at which ever site you found   #
  23. # this script. Either way please give me credit in your game script as the     #
  24. # writer of this script, and send me a PM abuot the release of the game/demo.  #
  25. #                                                                              #
  26. #------------------------------------------------------------------------------#
  27. # ** How To Use                                                                #
  28. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  29. #                                                                              #
  30. # * This script is pretty much plug-and-play just two question below.          #
  31. #                                                                              #
  32. #------------------------------------------------------------------------------#
  33. # ** Description                                                               #
  34. #------------------------------------------------------------------------------#
  35. #                                                                              #
  36. #  v0.1                                                                        #
  37. # ~=~=~=~                                                                      #
  38. #                                                                              #
  39. # This script basically give you a 0.5% bonus for every point the party leader #
  40. # has in luck.                                                                 #
  41. #                                                                              #
  42. #  v0.2                                                                        #
  43. # ~=~=~=~                                                                      #
  44. #                                                                              #
  45. # Script has been set-up for Add-Ons.                                          #
  46. #                                                                              #
  47. #  v0.3                                                                        #
  48. # ~=~=~=~                                                                      #
  49. #                                                                              #
  50. # The script has been shortened for more compatibility.                        #
  51. #                                                                              #
  52. #  v0.4                                                                        #
  53. # ~=~=~=~                                                                      #
  54. #                                                                              #
  55. # I've added an option to only effect the battle gold rewards.                 #
  56. #                                                                              #
  57. #------------------------------------------------------------------------------#
  58. #==============================================================================#
  59.    
  60.  
  61. $imported = {} if $imported.nil?
  62. $imported["V_Lucky_Gold_Find"] = true
  63.  
  64. module V_Lucky_Gold_Find
  65.   module Specs
  66.    
  67. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  68. #                                                                              #
  69. #                           Start Customizable Area.                           #
  70. #                                                                              #
  71. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  72. #                                                                              #
  73. #                      ONLY EDIT AFTER THE EQUALS SYMBOL.                      #
  74. #                                                                              #
  75. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  76.    
  77.  
  78.   #============================================================================
  79.   # This controls if you only want to use the leader luck as a factor.
  80.   #============================================================================
  81.  
  82.     Battle_Increase_Only = true
  83.     Solo_Bonus = true
  84.     Bonus_Rate = 1
  85.  
  86.  
  87. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  88. #                                                                              #
  89. #         DO NOT EDIT PAST THIS POINT UNLESS YOU KNOW WHAT YOUR DOING.         #
  90. #                                                                              #
  91. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  92.    
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127. end
  128. end
  129. class Game_Party < Game_Unit
  130.   include V_Lucky_Gold_Find::Specs
  131.   unless Battle_Increase_Only == true
  132.     alias :gain_gold16311 :gain_gold
  133.     def gain_gold(amount)
  134.       s = $game_party.battle_members[0].param(7)
  135.       sba = s*Bonus_Rate
  136.       pb = 0
  137.       t = $game_party.battle_members.size
  138.       t.times { |i| pb += $game_party.battle_members[i - 1].param(7) }
  139.       pba = pb*Bonus_Rate
  140.       amount = (amount * sba).to_i if Solo_Bonus
  141.       amount = (amount * pba).to_i if Solo_Bonus == false
  142.       gain_gold16311(amount)
  143.     end
  144.   end
  145. end
  146. module BattleManager
  147.   include V_Lucky_Gold_Find::Specs
  148.   def self.gain_gold
  149.     s = $game_party.battle_members[0].param(7)
  150.     sba = s*Bonus_Rate
  151.     pb = 0
  152.     t = $game_party.battle_members.size
  153.     t.times { |i| pb += $game_party.battle_members[i - 1].param(7) }
  154.     pba = pb*Bonus_Rate
  155.     amount = ($game_troop.gold_total * sba).to_i if Solo_Bonus
  156.     amount = ($game_troop.gold_total * pba).to_i if Solo_Bonus == false
  157.     if amount > 0
  158.       text = sprintf(Vocab::ObtainGold, amount)
  159.       $game_message.add('\.' + text)
  160.       $game_party.gain_gold(amount)
  161.     end
  162.     wait_for_message
  163.   end
  164. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement