Quantcast
Channel: RGSS3 Scripts (RMVX Ace) Latest Topics
Viewing all articles
Browse latest Browse all 416

Troop EXP Multiplier

$
0
0

Troop EXP Multiplier

by lilyWhite

 

This script allows you to set a multiplier to the total experience points gained from defeated enemies for each troop. This can be used to give different amounts of EXP for troops composed of the same enemies (e.g. a boss encounter with an enemy can give doubled EXP, while later random encounters give normal EXP) or give greater EXP based on the size of the enemy troop.

 

How to Use: On the first page of the troop's Battle Event list, create a Comment with the notetag:

<expmulti: x>

where "x" is the EXP multiplier. The resulting total is rounded to the nearest integer value. If no multiplier is designated for a troop, it will give the normal totalled EXP value.

script.png

 

Free for use in any commercial or non-commercial project! Credit to "lilyWhite"; I reserve the right to be slightly miffed if you get the capitalization wrong. :3

 

The script is within the spoiler below. Just copy into the Script Editor, and set multipliers in the Troops tab of the Database.

Spoiler

=begin

  = Troop EXP Multiplier, by lilyWhite =
  This script allows you to set a multiplier to gained EXP for each enemy
  troop. This can let you create different troops composed of the same
  enemies that rewards different amounts of EXP for whatever reason, or you
  can have larger troops reward greater EXP. The result after the multiplier
  is applied is rounded to the nearest integer value. If no multiplier is
  designated, it will give the totalled EXP as normal.
  
  To use, create a comment on the first page of the troop's Battle Events and
  add this:
  
    <expmulti: x>
    
  where x is the desired multiplier.
  
    For example, with two enemies that give 10 EXP each and a notetag of
    <expmulti: 1.48>, the resulting EXP gain would be 30 EXP.
  
  Usage: Free to use in any commercial or non-commercial project! Credit to
  "lilyWhite"; I reserve the right to be slightly miffed if you get the
  capitalization wrong. :3
    
=end

module RPG
  class Troop
    #------------------------------------------------------------------------
    # Gets troop EXP multiplier
    #------------------------------------------------------------------------
    def troop_exp_multiplier
      exp_multiplier = 1
      @pages[0].list.each do |cmd|
        if cmd.code == 108 && cmd.parameters[0] =~ /<expmulti: (.*)>/i
          exp_multiplier = $1.to_f
        end
      end
      return exp_multiplier
    end
  end
end

class Game_Troop < Game_Unit
  #--------------------------------------------------------------------------
  # * Overwrite exp_total
  #--------------------------------------------------------------------------
  def exp_total
    (dead_members.inject(0) {|r, enemy| r += (enemy.exp * exp_multiplier) }).round
  end
  
  #--------------------------------------------------------------------------
  # Gets troop EXP multiplier
  #--------------------------------------------------------------------------
  def exp_multiplier
    return troop.troop_exp_multiplier
  end
end

 

 


Viewing all articles
Browse latest Browse all 416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>