Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- #===============================================================================
- Title: Weapon Class Changing
- Author: Kadafi
- Date: Aug 8, 2017
- --------------------------------------------------------------------------------
- ** Change log
- Aug 10, 2017
- - Bug fixes
- Aug 9, 2017
- - Bug fixes
- Aug 8, 2017
- - Initial release
- --------------------------------------------------------------------------------
- ** Description
- Change actor class when a weapon equipped.
- --------------------------------------------------------------------------------
- ** Installation
- Place this script below Materials and above Main
- --------------------------------------------------------------------------------
- ** Usage
- Set the weapon notetag
- <change actor class: id>
- For example,
- <change actor class: 3>
- Set the Weapon Class based Skill notetag
- <ClassSkill>
- #===============================================================================
- =end
- $imported = {} if $imported.nil?
- $imported["Kadafi_WeaponClassChanging"] = true
- #===============================================================================
- # ** Configuration
- #===============================================================================
- module Kadafi
- module Class_Changing
- Keep_Exp = true
- end
- end
- #==============================================================================
- # ** RPG::Weapon
- #==============================================================================
- class RPG::Weapon < RPG::EquipItem
- #--------------------------------------------------------------------------
- # * Actor Change Class ID
- #--------------------------------------------------------------------------
- def actor_change_class_id
- note =~ /<change actor class: (\d+)>/i ? $1.to_i : 0
- end
- end
- #==============================================================================
- # ** Game_Actor
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # * Change Equipment
- #--------------------------------------------------------------------------
- alias old_change_equip change_equip
- def change_equip(slot_id, item)
- old_change_equip(slot_id, item)
- if slot_id == 0
- if item && @equips[slot_id].object == item
- if item.actor_change_class_id > 0
- if @class_id != item.actor_change_class_id
- keep_exp = Kadafi::Class_Changing::Keep_Exp
- change_class(item.actor_change_class_id, keep_exp)
- if @skill_id > 0
- if $data_skills[@skill_id].note =~ /<ClassSkill>/
- @skill_id = 0
- end
- end
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement