=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