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

[转载发布] DL: Class Armor

[复制链接]
累计送礼:
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 19:55:27 | 显示全部楼层 |阅读模式



    Script: Class Armor
    Difficulty: Medium
    Short Version: Equipping Armor will change your Class.

    Spoiler: Script
                    Code:       
    1. #--------------------------------#
    2. # Dramatic Lightning Co Presents:
    3. # Class Armor
    4. #--------------------------------#
    5. # Feel like dressing up?  This script allows you to change classes when you
    6. # equip certain armors.  You could recreate Final Fantasy 14's Job System
    7. # or fake a sub class here.  You can still change your default class and
    8. # learn skills not related to a class.
    9. # Place a <DLArmorClass x> tag in your weapon/armor notebox,
    10. # x being the class id you want to change into.
    11. #--------------------------------#
    12. module DL
    13.   module ARMORCLASS
    14.     SLOTID = 3 #0-4 refers to equipment slot, 3 being Body Armor, 0 being Weapon.
    15.     EXPKEEP = false #true keeps level on armor change, while false has individual class levels
    16.     SKILLRESET = false #skills reset on equip.
    17.     DEFSKILLLEARN = false #learn default class skills regardless of armor
    18.    
    19.   end
    20. end
    21. #--------------------------------#
    22. #Technical stuff below
    23. #--------------------------------#
    24. class RPG::BaseItem
    25.   def armor_class
    26.     aclass = 0
    27.     regex = /<DLArmorClass\s*(\d+)\s*>/i
    28.     res = self.note.match(regex)
    29.     if res
    30.       aclass = res[1].to_i
    31.     end
    32.     return aclass
    33.   end
    34. end
    35. class Game_Actor < Game_Battler
    36.   alias dl_init_equips init_equips
    37.   def init_equips(equips)
    38.     dl_init_equips(equips)
    39.     @default_class_id = @class_id
    40.     @skills2 = []
    41.     update_armor
    42.     refresh
    43.   end
    44.   alias dl_change_equip change_equip
    45.   def change_equip(slot_id, item)
    46.     dl_change_equip(slot_id, item)
    47.     update_armor
    48.     refresh
    49.   end
    50.   def update_armor
    51.     if @equips[DL::ARMORCLASS::SLOTID].object and $data_armors[@equips[DL::ARMORCLASS::SLOTID].object.id].armor_class > 0
    52.       change_class($data_armors[@equips[DL::ARMORCLASS::SLOTID].object.id].armor_class, DL::ARMORCLASS::EXPKEEP)
    53.     else
    54.       change_class(@default_class_id, DL::ARMORCLASS::EXPKEEP)
    55.     end
    56.      update_skills
    57.   end
    58.   def change_default_class(new_class_id)
    59.     @default_class_id = new_class_id if new_class_id > 0
    60.   end
    61.   def update_skills
    62.     init_skills if DL::ARMORCLASS::SKILLRESET
    63.     if DL::ARMORCLASS::DEFSKILLLEARN and @class_id != @default_class_id
    64.       change_class(@default_class_id, DL::ARMORCLASS::EXPKEEP)
    65.       self.class.learnings.each do |learning|
    66.         learn_skill(learning.skill_id) if learning.level <= @level
    67.       end
    68.       if @equips[DL::ARMORCLASS::SLOTID].object and $data_armors[@equips[DL::ARMORCLASS::SLOTID].object.id].armor_class > 0
    69.         change_class($data_armors[@equips[DL::ARMORCLASS::SLOTID].object.id].armor_class, DL::ARMORCLASS::EXPKEEP)
    70.       end
    71.     end
    72.     @skills2.each do |skill_id|
    73.       @skills.push(skill_id)
    74.     end
    75.   end
    76.   alias dl_level_up level_up
    77.   def level_up
    78.     dl_level_up
    79.     if DL::ARMORCLASS::DEFSKILLLEARN and @class_id != @default_class_id and DL::ARMORCLASS::EXPKEEP
    80.       $data_classes[@default_class_id].learnings.each do |learning|
    81.         learn_skill(learning.skill_id) if learning.level == @level
    82.       end
    83.     end
    84.   end
    85.   def learn_skill2(skill_id)
    86.     unless skill_learn?($data_skills[skill_id])
    87.       @skills2.push(skill_id)
    88.       @skills.push(skill_id)
    89.       @skills.sort!
    90.     end
    91.   end
    92.   alias dl_forget_skill forget_skill
    93.   def forget_skill(skill_id)
    94.     dl_forget_skill(skill_id)
    95.     @skills2.delete(skill_id)
    96.   end
    97.   
    98. end
    99. class Game_Interpreter #overwrite
    100.   def command_321
    101.     actor = $game_actors[@params[0]]
    102.     actor.change_default_class(@params[1]) if actor && $data_classes[@params[1]]
    103.     actor.update_armor
    104.   end
    105.   def command_318
    106.     iterate_actor_var(@params[0], @params[1]) do |actor|
    107.       if @params[2] == 0
    108.         actor.learn_skill2(@params[3])
    109.       else
    110.         actor.forget_skill(@params[3])
    111.       end
    112.     end
    113.   end
    114. end
    复制代码

    Version 1.1.0
    -Change Class in the Event page will change your default class.
    -Adding or Removing a Skill in the Event page adds a skill that isn't affected by SKILLRESET.

    I made this for a request.  Anyway, if you equip a specific Armor with this script, you will gain the class assigned to that armor.  Don't worry, you can return to your previous Class just by unequipping your Armor.  In order to use this script, place this notetag in your Armor/Weapon notebox:

    <DLArmorClass x>

    And replace x with the Class ID (1,2,etc) you want to change to.  Remember, the notebox is the white box in the lower-right corner.

    ---

    Now that you got that out of the way, the tricky part is how you want to further customize your Armor/Class interaction.  In the Script, you'll find four variables:

    SLOTID
    EXPKEEP
    SKILLRESET
    DEFSKILLLEARN


    SLOTID is the Equipment Slot you want to restrict your Class mods to for simplicity sake.  That means that if this slot is set to Body Armor, the notetags won't trigger on Helmets or Accessories.  You can also set this to your mainhand Weapon.

    EXPKEEP will let you have one Level among all Classes if set to true.  If false, each Class has its own level/exp; think Final Fantasy XIV's Job system.

    SKILLRESET will reset your Skills whenever you change class.  If false, you could eventually learn skills from all Classes.

    DEFSKILL will allow you to learn Skills from your default and equipped class.  If false, you only get skills from your current class.

    ---

    Next, here's some combinations:

    EXPKEEP = false
    SKILLRESET = false


    By default, all Classes other than your starting Class starts at Level 1.  Thankfully, Level are saved for each level, meaning you can switch between a  Level 15 Paladin and a Level 1 Thief with ease.  Because of this, you can learn all the Skills if you level up every Class.

    EXPKEEP = false
    SKILLRESET = true


    When you change Class, you don't keep the skills from your previous class, but thankfully you'll regain the Skills you learned with your currect Class.  If you set DEFSKILLLEARN to true, Skills from your Default Class can be used in other classes.

    EXPKEEP = true
    SKILLRESET = false


    You keep your Level regardless of Classes, but you will also skip out of gaining Skills from other classes when leveling up.  The best suggestion is to have Skills share the same level requirement so that you can present a choice for players when they level up.  Setting DEFSKILLLEARN to true will give you Default Class Skills when you level up regardless of equipped Class.

    EXPKEEP = true
    SKILLRESET = true


    If you equip an Armor, you also gain the Skills you'll have at that level.  If you also use DEFSKILLLEARN and put it to true, equipping armor is like putting on a Subclass.


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-18 08:53 , Processed in 0.078045 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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