Weapons Change Class
Version: 1.0
Author: SeMcDun
Date: 2014.12.23
Version History
- <Version 1.0> 2014.12.23 - Completed
Planned Future Versions
- <Version 2.0> - Normally an actor can only use skills from the class they currently are. I'd like to add an option that allows an actor to select up to X skills to use in battle that they have learned from other classes.
Description
Weapon types and classes are linked.
If an actor equips a sword, their class changes to Swordsman.
If an actor equips a staff their class changes to mage.
Etc. etc.
Features
Simple class changing system.
Instructions
The weapon type id in the database has to be the same as the class id in the database.
Script
#=begin
#===============================================================================
# SeM's Weapons Change Class VXA
# ~ v1.0
# By SeMcDun
# Last Update: 2014.12.23
#===============================================================================
# Description;
# -- Equipping different types of weapon will change the actor's class.
# -- Eg. Equip a sword to become a swordsman
# Equip a staff to become a magician
#
# Note;
# -- The ID of the Weapon Type has to match the ID of the class.
#
#===============================================================================
#===============================================================================
$imported = {} if $imported.nil?
$imported["SEM-weapons_change_class"] = true
#===============================================================================
module SEM
module WCC
# Whether or not changing class stops an actor using skills from another
# class
REMOVE_SKILLS = true
end # WCC
end # SEM
#==================================
# Do not allow a blank weapon
#----------------------------------
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles actors. It is used within the Game_Actors class
# ($game_actors) and is also referenced from the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Change Equipment
# slot_id: Equipment slot ID
# item: Weapon/armor (remove equipment if nil)
#--------------------------------------------------------------------------
alias ga_ce_sem_cc change_equip
def change_equip(slot_id, item)
return if slot_id == 0 && item == nil
if slot_id == 0
change_class(item.wtype_id)
# Refresh skills
if SEM::WCC::REMOVE_SKILLS == true
init_skills
end # if remove skills == true
end # slot_id == 0 (weapon)
ga_ce_sem_cc(slot_id, item)
end
end # Game_Actor
#==============================================================================
# ** Window_EquipItem
#------------------------------------------------------------------------------
# This window displays choices when opting to change equipment on the
# equipment screen.
#==============================================================================
class Window_EquipItem < Window_ItemList
#--------------------------------------------------------------------------
# * overwrite: Include in Item List?
#--------------------------------------------------------------------------
def include?(item)
return true if item == nil
return false unless item.is_a?(RPG::EquipItem)
return false if @slot_id < 0
if @slot_id != 0
return false if item.etype_id != @actor.equip_slots[@slot_id]
return @actor.equippable?(item)
end # if slot_id is not a weapon
return true
end
end # Window_EquipItem
Credit
Thanks
- Final Fantasy XIV - For giving me the idea.
Support
Post any problems here and I'll get round to fixing them.
Known Compatibility Issues
I am not sure if scripts affecting skill learning would work alongside this.
Demo
See attached.
Terms of Use
Terms of Use for RMVXA Scripts Database