Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Gold Variance (1.0)
- # 03/02/2012
- # By Pacman (based off a script by modern algebra)
- # Gold drops in RMVXA are static by default, with every creature always dropping
- # the exact same amount every time you kill them. This script allows you to
- # change that by making them drop a random amount between values that you
- # choose.
- # Set VARIANCE to the default amount gold drops will vary by.
- #
- #===============================================================================
- #
- # BEGIN CONFIGURATION
- #
- module GOLD_VAR
- VARIANCE = 20 # Amount gold drops will vary by default.
- end
- #
- # END CONFIGURATION
- #
- #===============================================================================
- #==============================================================================
- # ** RPG::Enemy
- #------------------------------------------------------------------------------
- # Data class for enemies. Subclass of RPG::BaseItem.
- #==============================================================================
- class RPG::Enemy < RPG::BaseItem
- #--------------------------------------------------------------------------
- # Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :gold_variance
- #--------------------------------------------------------------------------
- # Alias listing
- #--------------------------------------------------------------------------
- unless self.method_defined?(:pacman_goldvar_gold)
- alias pacman_goldvar_gold gold
- end
- #--------------------------------------------------------------------------
- # * Enemy Gold
- #--------------------------------------------------------------------------
- def gold(*args, &block)
- g = pacman_goldvar_gold(*args, &block); n = gold_variance
- g + (rand(n).to_i)
- end
- #--------------------------------------------------------------------------
- # * Get Gold Variance
- #--------------------------------------------------------------------------
- def gold_variance
- @gold_variance = GOLD_VAR::VARIANCE
- if self.note[/\\GOLD[_ ]?VAR\[(\d+)\]/i] != nil
- @gold_variance = $1.to_i
- end
- @gold_variance
- end
- end
- $imported ||= {}
- $imported[:pac_gold_variance]
- #===============================================================================
- #
- # END OF SCRIPT
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement