Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Shanghai Simple Script - Randomized Gold
- # Last Date Updated: 2010.05.03
- # Level: Easy
- #
- # Instead of every single slime dropping exactly 100 gold, have them randomized
- # so that they drop anywhere from 90 to 110. The amount of variation can be
- # adjusted.
- #===============================================================================
- # Instructions
- # -----------------------------------------------------------------------------
- # To install this script, open up your script editor and copy/paste this script
- # to an open slot below ▼ Materials but above ▼ Main. Remember to save.
- #===============================================================================
- $imported = {} if $imported == nil
- $imported["RandomizedGold"] = true
- module SSS
- # This is the percentage used to randomize gold.
- RANDOMIZED_GOLD_VARIATION = 20
- end
- #==============================================================================
- # ** Game_Enemy
- #==============================================================================
- class Game_Enemy < Game_Battler
- #--------------------------------------------------------------------------
- # * Get Gold
- #--------------------------------------------------------------------------
- def gold
- default_gold = enemy.gold
- variation = SSS::RANDOMIZED_GOLD_VARIATION
- lower = Integer(default_gold * (100 - variation) / 100)
- upper = Integer(default_gold * (100 + variation) / 100)
- value = lower + rand(upper - lower + 1)
- return value
- end
- end
- #===============================================================================
- #
- # END OF FILE
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement