Galv’s Equip Level-Up Bonuses V.1.0

#------------------------------------------------------------------------------#
#  Galv's Equip Level-Up Bonuses
#------------------------------------------------------------------------------#
#  For: RPGMAKER VX ACE
#  Version 1.0
#------------------------------------------------------------------------------#
#  2013-02-26 - Version 1.0 - release
#-------------------------------------------------------------------------------
#  Just a little mini-script that I thought might be useful. Allows you to
#  specify stat bonuses that equipment can give to the wearer on levelling up.
#  This bonus is not lost if the equipment is removed.
#-------------------------------------------------------------------------------
#  NOTETAG for ARMORS and WEAPONS
#-------------------------------------------------------------------------------
#
#  <eqb:mhp,mmp,atk,def,mat,mdf,agi,luk>    # Stat bonuses upon level up when
#                                           # that armor or equip is on actor.
#
#-------------------------------------------------------------------------------
#  EXAMPLE:
#  <eqb:0,0,10,0,5,0,0,0>     # Adds bonus 10 atk and 5 mat with each level up
#-------------------------------------------------------------------------------

class Game_Actor < Game_Battler
  alias galv_equip_stat_levels_level_up level_up
  def level_up
    galv_equip_stat_levels_level_up
    do_equip_bonus
  end

  def do_equip_bonus
    self.equips.each { |equip|
      next if equip.nil?
      equip.eqb.each_with_index { |bonus, i| self.add_param(i, bonus) }
    }
  end
end # Game_Actor < Game_Battler


class RPG::EquipItem
  def eqb
    if @eqb.nil?
      if @note =~ /<eqb:(.*)>/i
        @eqb = $1.split(",").map { |s| s.to_i }
      else
        @eqb = []
      end
    end
    @eqb
  end
end # RPG::EquipItem
Advertisements

12 thoughts on “Galv’s Equip Level-Up Bonuses V.1.0

  1. Legault says:

    Can’t this script work with percentajes? That would be awesome! Or maybe something like this:

    An item that when equiped, promotes growth of one selected stat, i.e: An item that when equiped, increases yor chance to get STR by 20% with each level up.

    Is this possible ? Thank you for sharing your work!

  2. David Bergstrom says:

    Another fantastic script here Galv! I was wondering though, is there any way to make this script compatible with your ‘Magic Shards’ script, so that shards equipped can affect level up stats?

    Thanks!
    Regards,
    David

  3. Willy says:

    Need Demo Please

  4. redeyedoh says:

    So, when I equip an Agility Bonus accessory and then unequip it, the Agility Bonus remains?

    If so, is there a way where I can change this so the bonus goes away when I unequip it? I’m trying to use this script for a system where there are multiple accessories like this, and I really don’t want the effects to remain when you equip a different accessory.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s