じ☆ve冰风 发表于 2026-8-2 09:31:03

Class Change via Weapon Type Equip

Made for a request here.

This script changes the actor's class according to the weapon type he/she is using.

So equipping weapon will change the class id to be the same as the weapon type's id.

Features:

Change Class ID based on Weapon Type ID

How to Use:

Paste this below Material and above Main

Set up your class change preferences in the Script's SETTINGS AREA

Set up your weapon types and classes in the database editor to make sure both share the same id

Compatibility:

This script overwrites the OK command in the equip scene.

So there might be a chance of conflict if you have another custom script overwriting the same place.

Terms of Use:

Free for both commercial and non-commercial

Script:

Spoiler                Code:       
#==============================================================================# ■ Meow Face Change Class via Weapon Type#------------------------------------------------------------------------------# Change the Actor's Class ID according to equipped Weapon Type ID#==============================================================================# How to Use:# Paste this below Material and above Main# Set your preferences in the script's SETTINGS AREA#==============================================================================module MeowCCvW #DO NOT REMOVE!!#==============================================================================# Settings Area#==============================================================================  KEEP_EXP = false #(true/false) whether or not to keep exp from previous class  INHERIT_SKILL = false #(true/false) whether or not to keep skills from previous class#==============================================================================# End of Settings Area# Edit anything past this line at your own risk!#==============================================================================endclass Game_Actor < Game_Battler  def update_skills    self.class.learnings.each do |learning|      learn_skill(learning.skill_id) if learning.level <= @level    end  endendclass Scene_Equip < Scene_MenuBase  def on_item_ok #Overwrite    Sound.play_equip    @actor.change_equip(@slot_window.index, @item_window.item)    if @slot_window.index == 0 && @item_window.item.is_a?(RPG::Weapon)      @actor.change_class(@item_window.item.wtype_id,MeowCCvW::KEEP_EXP)      !MeowCCvW::INHERIT_SKILL ? @actor.init_skills : @actor.update_skills    end    @slot_window.activate    @slot_window.refresh    @item_window.unselect    @item_window.refresh  endend








本贴来自国际rpgmaker官方论坛作者:MeowFace处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/class-change-via-weapon-type-equip.53103/
页: [1]
查看完整版本: Class Change via Weapon Type Equip