RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Change Class Using Weapons

0 Members and 2 Guests are viewing this topic.

**
Rep:
Level 83
プログラマです
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


Code: [Select]
#=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


  • SeMcDun

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

*
The Hero of Rhyme
Rep:
Level 83
( ͡° ͜ʖ ͡°)
2014 Queen of RMRKProject of the Year 20142014 Best RPG Maker User - Story2011 Best Newbie2014 Best RPG Maker User - Creativity2014 Kindest Member2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best Yuyubabe Smiley2012 Best RPG Maker User (Creativity);o
Hey, this is pretty cool! Thanks for sharing! ;o
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]


*
Rep:
Level 93
<o>_<o>
2014 Funniest MemberParticipant - GIAW 11Bronze - GIAW 92011 Best RPG Maker User (Creativity)
Definitely one of the coolest aspects of FF14. I don't make games anymore, but if I did I'd use this script.

*
The Hero of Rhyme
Rep:
Level 83
( ͡° ͜ʖ ͡°)
2014 Queen of RMRKProject of the Year 20142014 Best RPG Maker User - Story2011 Best Newbie2014 Best RPG Maker User - Creativity2014 Kindest Member2013 Queen of RMRKBronze SS AuthorBronze Writing ReviewerSecret Santa 2013 ParticipantFor taking arms in the name of your breakfast.GOOD!For frequently finding and reporting spam and spam bots2012 Best Yuyubabe Smiley2012 Best RPG Maker User (Creativity);o
and here we have a malson sighting, in a habitat not much like its native homeland
Spoiler for My Games and Art:
ℒℴѵℯ❤


My Artwork Thread

The Lhuvia Tales [Current]

Ambassador [Complete]

The Postman [Complete]

The Wyvern [Complete]

Phoenix Wright: Haunted Turnabout [Complete]

Major Arcana [Cancelled]