Troop EXP Multiplier
Troop EXP Multiplierby 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:
Code:
<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.
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 Code:
=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.list.each do |cmd|
if cmd.code == 108 && cmd.parameters =~ /<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
本贴来自国际rpgmaker官方论坛作者:stupid enough to like FF13处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/troop-exp-multiplier.59959/
页:
[1]