设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 116|回复: 0

[转载发布] Troop EXP Multiplier

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-1 14:05:56 | 显示全部楼层 |阅读模式
    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:

                    Code:       
    1. <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.


    [url=https://forums.rpgmakerweb.com/attachments/script-png.35699/][/url]


    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:       
    1. =begin
    2.   = Troop EXP Multiplier, by lilyWhite =
    3.   This script allows you to set a multiplier to gained EXP for each enemy
    4.   troop. This can let you create different troops composed of the same
    5.   enemies that rewards different amounts of EXP for whatever reason, or you
    6.   can have larger troops reward greater EXP. The result after the multiplier
    7.   is applied is rounded to the nearest integer value. If no multiplier is
    8.   designated, it will give the totalled EXP as normal.
    9.   
    10.   To use, create a comment on the first page of the troop's Battle Events and
    11.   add this:
    12.   
    13.     <expmulti: x>
    14.    
    15.   where x is the desired multiplier.
    16.   
    17.     For example, with two enemies that give 10 EXP each and a notetag of
    18.     <expmulti: 1.48>, the resulting EXP gain would be 30 EXP.
    19.   
    20.   Usage: Free to use in any commercial or non-commercial project! Credit to
    21.   "lilyWhite"; I reserve the right to be slightly miffed if you get the
    22.   capitalization wrong. :3
    23.    
    24. =end
    25. module RPG
    26.   class Troop
    27.     #------------------------------------------------------------------------
    28.     # Gets troop EXP multiplier
    29.     #------------------------------------------------------------------------
    30.     def troop_exp_multiplier
    31.       exp_multiplier = 1
    32.       @pages[0].list.each do |cmd|
    33.         if cmd.code == 108 && cmd.parameters[0] =~ /<expmulti: (.*)>/i
    34.           exp_multiplier = $1.to_f
    35.         end
    36.       end
    37.       return exp_multiplier
    38.     end
    39.   end
    40. end
    41. class Game_Troop < Game_Unit
    42.   #--------------------------------------------------------------------------
    43.   # * Overwrite exp_total
    44.   #--------------------------------------------------------------------------
    45.   def exp_total
    46.     (dead_members.inject(0) {|r, enemy| r += (enemy.exp * exp_multiplier) }).round
    47.   end
    48.   
    49.   #--------------------------------------------------------------------------
    50.   # Gets troop EXP multiplier
    51.   #--------------------------------------------------------------------------
    52.   def exp_multiplier
    53.     return troop.troop_exp_multiplier
    54.   end
    55. end
    复制代码








    本贴来自国际rpgmaker官方论坛作者:stupid enough to like FF13处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/troop-exp-multiplier.59959/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-17 23:19 , Processed in 0.117933 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表