CrowMakerVX

Ixfuru/DISE

Feb 26th, 2012
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 6.29 KB | None | 0 0
  1. ################################################################################
  2. ################################################################################
  3. #                         DatabaseIncreaseSE 1.0                               #  #
  4. #                              By: Ixfuru                                      #
  5. #                              2/26/2012                                       #
  6. ################################################################################
  7. ################################################################################
  8.  
  9. ################################################################################
  10. #                                                                              #
  11. #          This somewhat pointless little script will play a different SE      #
  12. # whenever the "Change Item", "Change Gold", "Change Weapon", "Change Armor"   #
  13. # and "Change Skills" commands are used to INCREASE the current amount.        #
  14. ################################################################################
  15.  
  16. ################################################################################
  17. #    Use this script if you want.  Just don't claim you made it.  If you use   #
  18. # it, you can send me a link so I can check it out.                            #
  19. ################################################################################
  20.  
  21. ################################################################################
  22. #            This is the first edition of the script, if you have ideas about  #
  23. # improving it and/or a problem using it, please contact me on the forums      #
  24. # through "The Finish Line" user forum, by PM-ing me, or by leaving a comment  #
  25. # in this topic.                                                               #
  26. ################################################################################
  27.  
  28. ################################################################################
  29. #           Thanks to GuyverBane whose CRITICAL SE script was the inspiration  #
  30. # for trying short script.  Also, to ModernAlgebra, whose EquipmentSets script #
  31. # has led me to believe I can vastly improve it.  (Which I will do upon further#
  32. # edumacations.                                                                #
  33. ################################################################################
  34. #                            CONFIGURATIONS                                    #
  35. ################################################################################
  36.  
  37.  
  38. module Dise
  39.  
  40.   GOLD_SE = "Shop" #SE you want to play when gaining gold
  41.   GSEV = 85           #Volume of SE upon gold gain
  42.   GSEP = 100             #Pitch of SE upon gold gain
  43.   ITEM_SE = "Item1"    #SE to play when Item is gained.
  44.   ISEV = 85              
  45.   ISEP = 100
  46.   WEAPON_SE = "Sword3"     #SE to play when Weapon is gained
  47.   WSEV = 85
  48.   WSEP = 100
  49.   ARMOR_SE = "Close2"      #SE to play when Armor is found
  50.   ASEV = 85
  51.   ASEP = 100
  52.   SKILL_SE = "Magic"         #SE to play when a Skill is learned via command
  53.   SSEV = 85
  54.   SSEP = 100
  55.  
  56. end
  57. ###############################################################################
  58. #     The following sectin isn't finished.  Thus it is commented out.         #
  59. #                 Probably best to leave it that way until I further          #
  60. #       understand RegExp enough to finish it.                                #
  61. ###############################################################################
  62. #~   CUSTOM_SE = ["Key", "Saint1", "Absorb1"]
  63.  
  64. #~  
  65. #~   def initialize
  66. #~     @dbkind = 0
  67. #~     @custom = check_database
  68. #~     @custom_se = check_regexp_custom
  69. #~   end
  70. #~  
  71. #~   def check_database
  72. #~     if @dbkind == 1
  73. #~       dbk = $data_items[id]
  74. #~       if self.note.scan[dbk](/<custom[[d,\s]+\]/i).include?
  75. #~       return true
  76. #~       check_regexp_custom
  77. #~       end
  78. #~     elsif @dbkind == 2
  79. #~       dbk = $data_weapons[id]
  80. #~       if self.note.scan[dbk](/<custom[[d,\s]+\]/i).include?
  81. #~         return true
  82. #~         check_regexp_custom
  83. #~       end
  84. #~     elsif @dbkind == 3
  85. #~       dbk = $data_armors[id]
  86. #~       if self.note.scan[dbk](/<custom[[d,\s]+\]/i).include?
  87. #~         return true
  88. #~         check_regexp_custom
  89. #~       end
  90. #~     elsif @dbkind == 4
  91. #~       dbk = $data_skills[id](/<custom[[d,\s]+\]/i).include?
  92. #~       return true
  93. #~       check_regexp_custom
  94. #~     end
  95. #~   else
  96. #~     return false
  97. #~   end
  98. #~  
  99. #~   def check_regexp_custom
  100. #~     if @custom == true
  101. #~       i = Dise::CUSTOM_SE[id]
  102. #~       return i
  103. #~     else
  104. #~       return 0
  105. #~     end
  106. #~   end
  107. #~  
  108. #~ end
  109. ################################################################################
  110. #                        !!!Edit below with caution!!!
  111. ################################################################################
  112.  
  113.  
  114. class Game_Interpreter
  115.  
  116.   alias Ix_Dise_125 command_125
  117.   def command_125
  118.     value = operate_value(@params[0], @params[1], @params[2])
  119.     Audio.se_play('AUDIO/SE/' + Dise::GOLD_SE, Dise::GSEV, Dise::GSEP)
  120.     $game_party.gain_gold(value)
  121.     return true
  122.   end
  123.  
  124.   alias Ix_Dise_126 command_126
  125.   def command_126
  126.     value = operate_value(@params[1], @params[2], @params[3])
  127.     Audio.se_play('AUDIO/SE/' + Dise::ITEM_SE, Dise::ISEV, Dise::ISEP)
  128.     $game_party.gain_item($data_items[@params[0]], value)
  129.     $game_map.need_refresh = true
  130.     return true
  131.   end
  132.  
  133.   alias Ix_Dise_127 command_127
  134.   def command_127
  135.     value = operate_value(@params[1], @params[2], @params[3])
  136.     Audio.se_play('AUDIO/SE/' + Dise::WEAPON_SE, Dise::WSEV, Dise::WSEP)
  137.     $game_party.gain_item($data_weapons[@params[0]], value, @params[4])
  138.     return true
  139.   end
  140.  
  141.   alias Ix_Dise_128 command_128
  142.   def command_128
  143.     value = operate_value(@params[1], @params[2], @params[3])
  144.     Audio.se_play('AUDIO/SE/' + Dise::ARMOR_SE, Dise::ASEV, Dise::ASEP)
  145.     $game_party.gain_item($data_armors[@params[0]], value, @params[4])
  146.     return true
  147.   end
  148.    
  149.   alias Ix_Dise_318 command_318
  150.   def command_318
  151.     actor = $game_actors[@params[0]]
  152.     if actor != nil
  153.       if @params[1] == 0
  154.         Audio.se_play('AUDIO/SE/' + Dise::SKILL_SE, Dise::SSEV, Dise::SSEP)
  155.         actor.learn_skill(@params[2])
  156.       else
  157.         actor.forget_skill(@params[2])
  158.       end
  159.     end
  160.     return true
  161.   end
  162. end
Advertisement
Add Comment
Please, Sign In to add comment