Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] Job Changing/EXP Script

To me the most important addition would be basic requirements for jobs (like 5 levels of priest for cleric). Obviously you could get a little more tricky with the requirements but I think that basic function would add a lot and hopefully isn't too hard to code.
 
ok I just noticed something...

ok at the beginning of my game I have 1 character... maybe a 2nd Helper char (not actually controllable)

well unless I have 4 people I get this error...

Code:
script 'profession' line 437: nomethoderror occured.
undefined method 'class_id' for nil:NilClass

actually forget that I sorta changed something and it works for me now heheee

here is what I changed the actual change is on line #359
@item_max = 4
was changed to this
@item_max = $game_party.members.size

so now I have the following from lines 356-364

Code:
class Window_CurrentParty < Window_Selectable
  def initialize
    super(48, 80, 256, 64)
    @item_max = $game_party.members.size # this was set to 4 but that caused the class changer to crash on me mwahahaa so not its set to get the ammount of people in my party yaaaay
    @column_max = @item_max
    create_contents
    self.index = 0
    refresh
  end

now if only there was a way to lock helper chars classes
 
Great script. Like the guys above I'd love to see a means to make certain classes available to certain characters and not others. That would be a plus :)
 
I really love this script, but as has been stated, I'm really looking forward to those changes. I just wanted to say thank you to you, Prexus, for all your hard work, It really is appreciated!

Edit: I have been tinkering with the script as I wanted to retain the skills obtained from leveling up after changing classes. If anybody is interested, I found it does just that simply by deleting line 54. My lines 52-57 read:

Code:
def define_skills(id = nil)
    id = @class_id if id == nil
    for i in $data_classes[id].learnings
      learn_skill(i.skill_id) if i.level <= @class_level[id]
    end
  end

I hope this helps you guys. I haven't found any errors with deleting that line so far, but I'm no scripter. I just thought I might share for those of you looking for the same effect as I was. Best wishes and thanks again Prexus for such a great script!
 
hmm I am messing with that too... I think I am gonna check if there is a way to have an keep skill if it has an element set
 
im getting an error on line 437 when this was added to my own game

Script 'Proffesion' line 437: NoMethodError occured.
undefined method '[]' for nill:NilClass

my line 437 is

      level = @member.class_level[$data_classes.id]
 
Can someone make this script compatable with the GTBS?
Because you don't get Job EXP when you kill a monster in Tactical Battle System...

Thanks in advance!
 
Another interesting idea was to lock all jobs, but one and as soon as you finish some quest or buy in gold or whatever kind of restriction you may wish to add (that can be activated / deactivated with an in-game switch) unlock the specific job.
This idea I'm suggesting is somehow derivated from the Job Change Quests from Ragnarok Online AND from the Final Fantasy V Job System.
 
I've finally come up with a way to have "locked" jobs! Granted, this won't fit everybody's agenda in the way they want it, but I've found a way to have certain jobs available at one point, with more jobs becoming available with a simple in-game event. The process is a little convoluted and could probably be done much easier with a script, but alas, I am no scripter. Here goes:

In order to "unlock" jobs, we will be loading different classes.rvdata files. These files contain your classes database and Prexus' script has each class available to choose from the classes.rvdata file. In order to not have to completely tear apart Prexus' script, I simply decided it would be easier to change the classes file to a different classes file. So, at some point in the game, when you want new jobs "unlocked" you simply call this event and it will alter the file used for the classes database.

Event: Script:
Code:
$data_classes       = 
load_data("Data/Classes2.rvdata")

Now this will tell the entire game engine to stop looking at Classes.rvdata and start looking at Classes2.rvdata

The question is now, where do we get these other files? Inorder to obtain these files, create another project and create the classes database EXACTLY the same, and then add in the additional classes AFTER the given ones. By doing this, when we change files, the game can still find everything needed from the first classes, in addition to having new information for the new classes. It is imperative that you re-create the classes EXACTLY the same, otherwise we might end up with some nasty errors or something where the game tries to load you as one class yet you come out as another class (this is because the game uses class IDs and if in classes.rvdata your paladin is ID 001 and in classes2.rvdata your mage is ID 001, your paladin might become a mage or something odd like that) Anyways, once you have this made, go to this projects game folder/Data and copy the Classes.rvdata file to your desktop. Once there, rename this file "Classes2.rvdata" and navigate to your main game's folder/Data and past this in there.

Now, when you call the event given above, the game will start using Classes2.rvdata as its classes file and as such, the new classes available in classes2.rvdata will be available in Prexus' job changing system. Woo! BUT! We aren't done yet, as this method has a problem...

While playing through the game, yes, this does change the classes file the game uses, but a problem occurs when you try and load a saved game. See, this script change is only temporary and valid for as long as the session lasts, but if one saves a game, then tries to load their saved game, one finds that classes.rvdata was loaded and not classes2.rvdata! The reason this occurs is under Main in the scripting area (this is what gets the game up and running) it calls Scene_Title.new, which, when loaded, has a method called "start" which includes "load_database" which tells the game to load classes.rvdata.

This can be seen here:

Code:
#--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    load_database                     # Load database
    create_game_objects               # Create game objects
    check_continue                    # Determine if continue is enabled
    create_title_graphic              # Create title graphic
    create_command_window             # Create command window
    play_title_music                  # Play title screen music
  end
  #--------------------------------------------------------------------------
  # * Execute Transition
  #--------------------------------------------------------------------------
  def perform_transition
    Graphics.transition(20)
  end
  #--------------------------------------------------------------------------
  # * Post-Start Processing
  #--------------------------------------------------------------------------
  def post_start
    super
    open_command_window
  end
  #--------------------------------------------------------------------------
  # * Pre-termination Processing
  #--------------------------------------------------------------------------
  def pre_terminate
    super
    close_command_window
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_command_window
    snapshot_for_background
    dispose_title_graphic
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    @command_window.update
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0    #New game
        command_new_game
      when 1    # Continue
        command_continue
      when 2    # Shutdown
        command_shutdown
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Load Database
  #--------------------------------------------------------------------------
  def load_database
    $data_actors        = load_data("Data/Actors.rvdata")
    $data_classes       = load_data("Data/Classes.rvdata")
    $data_skills        = load_data("Data/Skills.rvdata")
    $data_items         = load_data("Data/Items.rvdata")
    $data_weapons       = load_data("Data/Weapons.rvdata")
    $data_armors        = load_data("Data/Armors.rvdata")
    $data_enemies       = load_data("Data/Enemies.rvdata")
    $data_troops        = load_data("Data/Troops.rvdata")
    $data_states        = load_data("Data/States.rvdata")
    $data_animations    = load_data("Data/Animations.rvdata")
    $data_common_events = load_data("Data/CommonEvents.rvdata")
    $data_system        = load_data("Data/System.rvdata")
    $data_areas         = load_data("Data/Areas.rvdata")
  end

The problem is, we can't change this file directly as. if we change it to load classes2.rvdata, the game will load that no matter what, even if one starts a new game. So the trick to fixing this is to make the game load classes2.rvdata ONLY if it is unlocked in game. In order to do this, we will need to create a variable, a common event, and alter the game code slightly.

Firstly, the variable. This is the variable which will be used in order to check which classes.rvdata file to load. Along with the event which switches the classes file as given above, add in a variable control which will set your variable to some constant (I will use 1 for now. If you are looking to have jobs being unlocked multiple times in a Final Fantasy V fashion, each time you unlock new jobs, change the variable to a different constant, ie 2, 3, etc.) The reason we need this variable is that variables are saved with a game save and this will allow us to check to see if the player has unlocked the jobs yet or not. Have that one done? Now onto the...

Common Event! We need this common event to call when the game firsts loads which will check against the variable and load the appropriate classes.rvdata file. The common event should be rather simple to create, as it is simply checking against the variable and, if the variable equals the required constant, switching the classes.rvdata file. Like this:

Event:
Conditional Branch: Variable [####: Job Availability] is equal to 1
Script: $data_classes       =
load_data("Data/Classes2.rvdata")

Conditional Branch: Variable [####: Job Availability] is equal to 2
Script: $data_classes       =
load_data("Data/Classes3.rvdata")

Conditional Branch: Variable [####: Job Availability] is equal to 3
$data_classes       =
load_data("Data/Classes4.rvdata")

and so on, for how many ever job "unlockings" your game has.

Now we have our variable and Common Event set, we just need to put them to use! The trick here is to implement this change as soon as the saved game data is loaded to avoid any sticky errors. The game data is loaded under the Scene_File section of the scripts section. We will be adding in one line of code here which will execute this common event immediately after the game loads the saved data. You can either insert the line right into the game code or, if you prefer, we could create a new file to place under your scripts area.

Editing the game code:
We are concerned with lines 183-196 of Scene_File. This is where the actual loading of the game takes place. We will alter our code to look like this:
Code:
#--------------------------------------------------------------------------
  # * Execute Load
  #--------------------------------------------------------------------------
  def do_load
    file = File.open(@savefile_windows[@index].filename, "rb")
    read_save_data(file)
    file.close
    $game_temp.common_event_id = 001 #Change this number to your common event ID
    $scene = Scene_Map.new
    RPG::BGM.fade(1500)
    Graphics.fadeout(60)
    Graphics.wait(40)
    @last_bgm.play
    @last_bgs.play
  end

All we are adding in is, right after the game file loads, just before anything happens, we are calling our common event (don't forget to change 001 to your Common Event ID!) to check for our variable (which literally JUST loaded) and changing the classes.rvdata file to the appropriate file, given the circumstances. That is basically it!

Adding in a new Script:
Simply place this script before any other scripts you have:
Code:
#==============================================================================
# ** Scene_File
#------------------------------------------------------------------------------
#  This class performs the save and load screen processing.
#==============================================================================

class Scene_File < Scene_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     saving     : save flag (if false, load screen)
  #     from_title : flag: it was called from "Continue" on the title screen
  #     from_event : flag: it was called from the "Call Save Screen" event
  #--------------------------------------------------------------------------
  def initialize(saving, from_title, from_event)
    @saving = saving
    @from_title = from_title
    @from_event = from_event
  end
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    @help_window = Window_Help.new
    create_savefile_windows
    if @saving
      @index = $game_temp.last_file_index
      @help_window.set_text(Vocab::SaveMessage)
    else
      @index = self.latest_file_index
      @help_window.set_text(Vocab::LoadMessage)
    end
    @savefile_windows[@index].selected = true
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @help_window.dispose
    dispose_item_windows
  end
  #--------------------------------------------------------------------------
  # * Return to Original Screen
  #--------------------------------------------------------------------------
  def return_scene
    if @from_title
      $scene = Scene_Title.new
    elsif @from_event
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new(4)
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @help_window.update
    update_savefile_windows
    update_savefile_selection
  end
  #--------------------------------------------------------------------------
  # * Create Save File Window
  #--------------------------------------------------------------------------
  def create_savefile_windows
    @savefile_windows = []
    for i in 0..3
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
    end
    @item_max = 4
  end
  #--------------------------------------------------------------------------
  # * Dispose of Save File Window
  #--------------------------------------------------------------------------
  def dispose_item_windows
    for window in @savefile_windows
      window.dispose
    end
  end
  #--------------------------------------------------------------------------
  # * Update Save File Window
  #--------------------------------------------------------------------------
  def update_savefile_windows
    for window in @savefile_windows
      window.update
    end
  end
  #--------------------------------------------------------------------------
  # * Update Save File Selection
  #--------------------------------------------------------------------------
  def update_savefile_selection
    if Input.trigger?(Input::C)
      determine_savefile
    elsif Input.trigger?(Input::B)
      Sound.play_cancel
      return_scene
    else
      last_index = @index
      if Input.repeat?(Input::DOWN)
        cursor_down(Input.trigger?(Input::DOWN))
      end
      if Input.repeat?(Input::UP)
        cursor_up(Input.trigger?(Input::UP))
      end
      if @index != last_index
        Sound.play_cursor
        @savefile_windows[last_index].selected = false
        @savefile_windows[@index].selected = true
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Confirm Save File
  #--------------------------------------------------------------------------
  def determine_savefile
    if @saving
      Sound.play_save
      do_save
    else
      if @savefile_windows[@index].file_exist
        Sound.play_load
        do_load
      else
        Sound.play_buzzer
        return
      end
    end
    $game_temp.last_file_index = @index
  end
  #--------------------------------------------------------------------------
  # * Move cursor down
  #     wrap : Wraparound allowed
  #--------------------------------------------------------------------------
  def cursor_down(wrap)
    if @index < @item_max - 1 or wrap
      @index = (@index + 1) % @item_max
    end
  end
  #--------------------------------------------------------------------------
  # * Move cursor up
  #     wrap : Wraparound allowed
  #--------------------------------------------------------------------------
  def cursor_up(wrap)
    if @index > 0 or wrap
      @index = (@index - 1 + @item_max) % @item_max
    end
  end
  #--------------------------------------------------------------------------
  # * Create Filename
  #     file_index : save file index (0-3)
  #--------------------------------------------------------------------------
  def make_filename(file_index)
    return "Save#{file_index + 1}.rvdata"
  end
  #--------------------------------------------------------------------------
  # * Select File With Newest Timestamp
  #--------------------------------------------------------------------------
  def latest_file_index
    index = 0
    latest_time = Time.at(0)
    for i in 0...@savefile_windows.size
      if @savefile_windows[i].time_stamp > latest_time
        latest_time = @savefile_windows[i].time_stamp
        index = i
      end
    end
    return index
  end
  #--------------------------------------------------------------------------
  # * Execute Save
  #--------------------------------------------------------------------------
  def do_save
    file = File.open(@savefile_windows[@index].filename, "wb")
    write_save_data(file)
    file.close
    return_scene
  end
  #--------------------------------------------------------------------------
  # * Execute Load
  #--------------------------------------------------------------------------
  def do_load
    file = File.open(@savefile_windows[@index].filename, "rb")
    read_save_data(file)
    file.close
    $game_temp.common_event_id = 001 #Change this to your Common Event ID number
    $scene = Scene_Map.new
    RPG::BGM.fade(1500)
    Graphics.fadeout(60)
    Graphics.wait(40)
    @last_bgm.play
    @last_bgs.play
  end
  #--------------------------------------------------------------------------
  # * Write Save Data
  #     file : write file object (opened)
  #--------------------------------------------------------------------------
  def write_save_data(file)
    characters = []
    for actor in $game_party.members
      characters.push([actor.character_name, actor.character_index])
    end
    $game_system.save_count += 1
    $game_system.version_id = $data_system.version_id
    @last_bgm = RPG::BGM::last
    @last_bgs = RPG::BGS::last
    Marshal.dump(characters,           file)
    Marshal.dump(Graphics.frame_count, file)
    Marshal.dump(@last_bgm,            file)
    Marshal.dump(@last_bgs,            file)
    Marshal.dump($game_system,         file)
    Marshal.dump($game_message,        file)
    Marshal.dump($game_switches,       file)
    Marshal.dump($game_variables,      file)
    Marshal.dump($game_self_switches,  file)
    Marshal.dump($game_actors,         file)
    Marshal.dump($game_party,          file)
    Marshal.dump($game_troop,          file)
    Marshal.dump($game_map,            file)
    Marshal.dump($game_player,         file)
  end
  #--------------------------------------------------------------------------
  # * Read Save Data
  #     file : file object for reading (opened)
  #--------------------------------------------------------------------------
  def read_save_data(file)
    characters           = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    @last_bgm            = Marshal.load(file)
    @last_bgs            = Marshal.load(file)
    $game_system         = Marshal.load(file)
    $game_message        = Marshal.load(file)
    $game_switches       = Marshal.load(file)
    $game_variables      = Marshal.load(file)
    $game_self_switches  = Marshal.load(file)
    $game_actors         = Marshal.load(file)
    $game_party          = Marshal.load(file)
    $game_troop          = Marshal.load(file)
    $game_map            = Marshal.load(file)
    $game_player         = Marshal.load(file)
    if $game_system.version_id != $data_system.version_id
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
  end
end

If your Common Event ID is not 001, make sure you go and change it where indicated in the script (it is located under the "Execute Load" section. That's basically it!

And NOW, we finally have a working way to unlock jobs. Just be careful about any locations in the game code where it says to load classes.rvdata specifically. I am currently unaware of any, but there might be some, as this will case the game to start using classes.rvdata instead of the classes2.rvdata which we want it to use. Worst comes worst, you can probably use that common event we created and drop it in there with the code to fix it up, but again, you might not need to worry about this.

Just remember when creating your classes2.rvdata files and such to, when selecting skills for the class to learn, select skill numbers which are unused in your main game (ie. let the new job "Monk" learn the skill "Whirlwind Fist", at level 5. In order to do this, On classes2.rvdata have the skill be skill number 98. In your creation of classes.rvdata2 you need not define this skill at all, what is important is the number, but make darn sure in your main game skill number 98 is whirlwind fist!) Worst comes worst, you can also import skills2.rvdata etc., which, if anybody wants to know how to do, just ask. (Or if you would like me to make a demo kinda thing, I'd be more than happy to.)

But, I think that about covers everything, so get out there and make some RPGs!

Lastly, I would like to thank Prexus for such an amazing script. You really have done some exceptional work, and I look forward to future versions which will completely dwarf my workings of "locked jobs". Thanks again Prexus!

Edit: I just threw together a quick demo to show it works. You can download it here:
http://www.mediafire.com/?nvjdtwfygq9
 

Marpy

Member

I'm using Dargor's Large Party Script. Is there any way to make the class change window a little larger, to hold six actors?
 
@Marpy, Here u go:
Code:
#==============================================================================
# ** Prexus - Job Changer (v1.0)
#------------------------------------------------------------------------------
#  This is a Job Changing system, made by Prexus. It does several things, up to
#  and including changing Jobs:
#    * You can change in between any Job in the 'Class' tab of the Database.
#    * Experience is totalled for characters and their Jobs, individually.
#    * Jobs gain levels, Jobs determine what skills you learn in the Class tab.
#    * Job Levels/Exp are remembered when changing jobs.
#    * An interface for changing jobs.
#    * Interface will show available/unavailable skills when highlighting a job
#      and pressing Shift.
#
#  It also includes a Window_Base method (draw_seperator,) that is useful for
#  drawing a fancy line to separate one area of a window from another, and the
#  Window_Confirm class. A subclass of Window_Selectable that creates a small
#  Yes/No confirmation window.
#
#  To call the Job Changer interface, use $scene = Scene_ClassChange.new
#  To increase the level of a specific job for an actor:
#    <#Game_Actor>.class_level_up(ID of Class)
#  For example:
#    $game_party.members[0].class_level_up(2)
#  Would increase the leading member's Warrior class level in the demo.
#
#  - Changelog (v1.0)
#    * Initial Release
#==============================================================================


ENEMY_CLASS_EXP = {
}
ENEMY_CLASS_EXP.default = -1 # Don't Change This Value (-1)

class Game_Actor < Game_Battler
  attr_accessor :class_exp
  attr_accessor :class_level
  #--------------------------------------------------------------------------
  alias prex_prof_g_actor_setup setup
  #--------------------------------------------------------------------------
  def setup(actor_id)
    prex_prof_g_actor_setup(actor_id)
    @class_exp = {}
    @class_exp.default = 0
    @class_level = {}
    @class_level.default = 1
    define_skills
  end
  #--------------------------------------------------------------------------
  def define_skills(id = nil)
    id = @class_id if id == nil
    @skills = []
    for i in $data_classes[id].learnings
      learn_skill(i.skill_id) if i.level <= @class_level[id]
    end
  end
  #--------------------------------------------------------------------------
  def class_change_exp(exp, id = nil, show = false)
    id = @class_id if id == nil
    last_level = @class_level[id]
    last_skills = skills
    @class_exp[id] = [[exp, 9999999].min, 0].max
    while @class_exp[id] >= @exp_list[@class_level[id]+1] and @exp_list[@class_level[id]+1] > 0
      class_level_up(id)
    end
    while @class_exp[id] < @exp_list[@class_level[id]]
      class_level_down(id)
    end
    if show and @class_level[id] > last_level
      display_class_level_up(skills - last_skills, id)
    end
  end
  #--------------------------------------------------------------------------
  def class_exp_s(id = nil)
    id = @class_id if id == nil
    return @exp_list[@class_level[id]+1] > 0 ? @class_exp[id] : "-------"
  end
  #--------------------------------------------------------------------------
  def next_class_exp_s(id = nil)
    id = @class_id if id == nil
    return @exp_list[@class_level[id]+1] > 0 ? @exp_list[@class_level[id]+1] : "-------"
  end
  #--------------------------------------------------------------------------
  def next_class_rest_exp_s(id = nil)
    id = @class_id if id == nil
    return @exp_list[@class_level[id]+1] > 0 ?
      (@exp_list[@class_level[id]+1] - @class_exp[id]) : "-------"
  end
  #--------------------------------------------------------------------------
  def class_level_up(id = nil, adjust = false)
    id = @class_id if id == nil
    @class_level[id] += 1
    @class_exp[id] = @exp_list[@class_level[id]]
    if adjust
      define_skills(id)
    else
      define_skills
    end
  end
  #--------------------------------------------------------------------------
  def class_level_down(id = nil, adjust = false)
    id = @class_id if id == nil
    @class_level[id] -= 1
    @class_exp[id] = @exp_list[@class_level[id]]
    if adjust
      define_skills(id)
    else
      define_skills
    end
  end
  #--------------------------------------------------------------------------
  def class_gain_exp(exp, id = nil, show = false)
    id = @class_id if id == nil
    if double_exp_gain
      class_change_exp(@class_exp[id] + exp * 2, id, show)
    else
      class_change_exp(@class_exp[id] + exp, id, show)
    end
  end
  #--------------------------------------------------------------------------
  def class_change_level(level, id = nil, show = false)
    id = @class_id if id == nil
    level = [[level, 99].min, 1].max
    class_change_exp(@exp_list[level], id, show)
  end
  #--------------------------------------------------------------------------
  def level_up
    @level += 1
  end
  #--------------------------------------------------------------------------
  def class_id=(class_id)
    @class_id = class_id
    for i in 0..4     # Remove unequippable items
      change_equip(i, nil) unless equippable?(equips[i])
    end
    define_skills
  end
  #--------------------------------------------------------------------------
  def display_class_level_up(new_skills, id)
    $game_message.new_page
    text = sprintf(Vocab::ClassLevelUp, @name, $data_classes[id].name, Vocab::level, @level)
    $game_message.texts.push(text)
    for skill in new_skills
      text = sprintf(Vocab::ObtainSkill, skill.name)
      $game_message.texts.push(text)
    end
  end
end

module Vocab
  ObtainClassExp       = "%s Class EXP were received!"
  ClassLevelUp         = "%s is now %s %s %s!"
end

class Game_Troop < Game_Unit
  def class_exp_total
    exp = 0
    for enemy in dead_members
      next if enemy.hidden
      if ENEMY_CLASS_EXP[enemy.enemy.id] >= 0
        exp += ENEMY_CLASS_EXP[enemy.enemy.id]
      else
        exp += enemy.exp
      end
    end
    return exp
  end
end

class Scene_Battle < Scene_Base
  def display_exp_and_gold
    exp = $game_troop.exp_total
    gold = $game_troop.gold_total
    class_exp = $game_troop.class_exp_total
    $game_party.gain_gold(gold)
    text = sprintf(Vocab::Victory, $game_party.name)
    $game_message.texts.push('\|' + text)
    if exp > 0
      text = sprintf(Vocab::ObtainExp, exp)
      $game_message.texts.push('\.' + text)
    end
    if class_exp > 0
      text = sprintf(Vocab::ObtainClassExp, class_exp)
      $game_message.texts.push('\.' + text)
    end
    if gold > 0
      text = sprintf(Vocab::ObtainGold, gold, Vocab::gold)
      $game_message.texts.push('\.' + text)
    end
    wait_for_message
  end
  #--------------------------------------------------------------------------
  def display_level_up
    exp = $game_troop.exp_total
    class_exp = $game_troop.class_exp_total
    for actor in $game_party.existing_members
      last_level = actor.level
      last_skills = actor.skills
      actor.gain_exp(exp, true)
      actor.class_gain_exp(class_exp, nil, true)
    end
    wait_for_message
  end
end

class Scene_ClassChange < Scene_Base
  def start
    create_menu_background
    create_windows
  end
  #--------------------------------------------------------------------------
  def create_windows
    @party_window = Window_CurrentParty.new
    @class_window = Window_ClassPick.new(@party_window.member)
    @skill_window = Window_ClassSkills.new
    @show_window = Window_ShowSkills.new(@party_window.member)
    @help_window = Window_Help.new
    @help_window.visible = false
    @help_window.close
    @help_window.x = 48
    @help_window.y = 280
    @help_window.width = 448
    @help_window.create_contents
    @show_window.help_window = @help_window
    @confirm_window = Window_Confirm.new
  end
  #--------------------------------------------------------------------------
  def update_windows
    @party_window.update
    @class_window.update(@party_window.member)
    @skill_window.update
    @show_window.update
    @help_window.update
    @confirm_window.update
    if @party_window.active
      @skill_window.set(@party_window.member, nil)
    elsif @class_window.active
      @skill_window.set(@party_window.member, @class_window.item)
    end
  end
  #--------------------------------------------------------------------------
  def terminate
    super
    @party_window.dispose
    @class_window.dispose
    @skill_window.dispose
    @show_window.dispose
    @help_window.dispose
    @confirm_window.dispose
  end
  #--------------------------------------------------------------------------
  def update
    super
    update_windows
    update_input
  end
  #--------------------------------------------------------------------------
  def update_input
    if @party_window.active
      if Input.trigger?(Input::B)
        Sound.play_cancel
        $scene = Scene_Map.new
      elsif Input.trigger?(Input::C)
        Sound.play_decision
        @class_window.active = true
        @class_window.index = 0
        @party_window.active = false
      end
    elsif @class_window.active
      if Input.trigger?(Input::B)
        Sound.play_cancel
        @party_window.active = true
        @class_window.active = false
        @class_window.index = -1
      elsif Input.trigger?(Input::C)
        if @class_window.item.id == @class_window.member.class_id
          Sound.play_buzzer
          return
        end
        Sound.play_decision
        @confirm_window.visible = true
        @confirm_window.active = true
        @confirm_window.index = 0
        @confirm_window.open
        @class_window.active = false
      elsif Input.trigger?(Input::A)
        Sound.play_decision
        @show_window.set(@party_window.member, @class_window.item.id)
        @show_window.active = true
        @show_window.index = 0
        @show_window.open
        @help_window.visible = true
        @help_window.open
        @class_window.active = false
      end
    elsif @show_window.active
      if Input.trigger?(Input::B)
        Sound.play_cancel
        @class_window.active = true
        @show_window.active = false
        @show_window.index = -1
        @show_window.close
        @help_window.close
      end
    elsif @confirm_window.active
      if Input.trigger?(Input::B)
        Sound.play_cancel
        if @confirm_window.index == 1
          @confirm_window.active = false
          @confirm_window.index = -1
          @confirm_window.close
          @class_window.active = true
          return
        else
          @confirm_window.index = 1
          return
        end
      elsif Input.trigger?(Input::C)
        case @confirm_window.index
        when 0
          Sound.play_decision
          member = @class_window.member
          member.class_id = @class_window.item.id
          @confirm_window.active = false
          @confirm_window.index = -1
          @confirm_window.close
          @class_window.refresh
          @skill_window.refresh
          @class_window.active = true
        when 1
          @confirm_window.active = false
          @confirm_window.index = -1
          @confirm_window.close
          @class_window.active = true
          return
        end
      end
    end
  end
end

class Window_Base < Window
  def draw_seperator(x, y, width, height, color = Color.new(255, 255, 255))
    edge = (width / 4)
    self.contents.gradient_fill_rect(x, y, edge, height, Color.new(0, 0, 0, 0), color)
    self.contents.fill_rect(x + edge, y, width / 2, height, color)
    self.contents.gradient_fill_rect(x + width - edge, y, edge, height, color, Color.new(0, 0, 0, 0))
  end
end

class Window_CurrentParty < Window_Selectable
  def initialize
    super(48, 80, 256, 99)
    @item_max = $game_party.members.size
    @column_max = 3
    create_contents
    self.index = 0
    refresh
  end
  #--------------------------------------------------------------------------
  def member
    return $game_party.members[self.index]
  end
  #--------------------------------------------------------------------------
  def refresh
    for i in 0...@item_max
      rect = item_rect(i)
      self.contents.clear_rect(rect)
    end
    for i in 0...$game_party.members.size
      rect = item_rect(i)
      bitmap = Cache.character($game_party.members[i].character_name)
      sign = $game_party.members[i].character_name[/^[\!\$]./]
      if sign != nil and sign.include?('$')
        cw = bitmap.width / 3
        ch = bitmap.height / 4
      else
        cw = bitmap.width / 12
        ch = bitmap.height / 8
      end
      n = $game_party.members[i].character_index
      src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
      self.contents.blt(rect.x, rect.y, bitmap, src_rect, 255)
    end
  end
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = Rect.new(0, 0, 0, 0)
    rect.width = (contents.width + @spacing) / @column_max - @spacing
    rect.height = 32
    rect.x = index % @column_max * (rect.width + @spacing)
    rect.y = index / @column_max * 32
    return rect
  end
end

class Window_ClassPick < Window_Selectable
  def initialize(member = nil)
    super(48, 178, 256, 158)
    @item_max = $data_classes.size - 1
    create_contents
    @member = member
    self.index = -1
    self.active = false
    refresh
  end
  #--------------------------------------------------------------------------
  def update(member = nil)
    super()
    return if member == @member
    @member = member
    refresh
  end
  #--------------------------------------------------------------------------
  def member
    return @member
  end
  #--------------------------------------------------------------------------
  def item
    return $data_classes[self.index + 1]
  end
  #--------------------------------------------------------------------------
  def refresh
    for i in 0..@item_max
      rect = item_rect(i)
      self.contents.clear_rect(rect)
    end
    for i in 1..@item_max
      next unless $data_classes[i]
      y = (i-1) * WLH
      w = self.contents.width
      self.contents.font.color.alpha = (@member.class_id == $data_classes[i].id ? 128 : 255)
      self.contents.draw_text(0, y, w, WLH, $data_classes[i].name)
      next unless @member
      level = @member.class_level[$data_classes[i].id]
      self.contents.draw_text(0, y, w, WLH, "Lv. " + level.to_s, 2)
    end
  end
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = Rect.new(0, 0, 0, 0)
    rect.width = (contents.width + @spacing) / @column_max - @spacing
    rect.height = WLH
    rect.x = index % @column_max * (rect.width + @spacing)
    rect.y = index / @column_max * (WLH)
    return rect
  end
end

class Window_ClassSkills < Window_Base
  def initialize(member = nil, class_obj = nil)
    super(304, 80, 192, 256)
    create_contents
    @member = member
    @class_obj = class_obj
    refresh
  end
  #--------------------------------------------------------------------------
  def member
    return @member
  end
  #--------------------------------------------------------------------------
  def item
    return @class_obj
  end
  #--------------------------------------------------------------------------
  def set(member, class_obj)
    old_member = @member
    @member = member
    old_class_obj = @class_obj
    @class_obj = class_obj
    refresh if (old_member != @member) or (old_class_obj != @class_obj)
  end
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    return unless @member
    c = (@class_obj != nil ? @class_obj : $data_classes[@member.class_id])
    x, y = 0, 0
    w = self.contents.width
    self.draw_actor_face(@member, x, y, 48)
    self.draw_actor_name(@member, x + 52, y)
    self.contents.draw_text(x + 52, y + WLH, w, WLH, $data_classes[@member.class_id].name)
    self.draw_actor_level(@member, x, y + WLH*2)
    self.draw_icon(142, self.contents.width - 24, y + WLH*2)
    self.contents.draw_text(x, y + WLH*2, self.contents.width - 12, WLH, 'Skills', 2)
    self.draw_seperator(x, y + WLH * 3 + 11, w, 2)
    return unless @class_obj
    self.contents.draw_text(x, y + WLH*4, w, WLH, c.name)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y + WLH*5, w, WLH, "Class #{Vocab::level_a}")
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y + WLH*5, w, WLH, @member.class_level[c.id], 2)
    s1 = @member.class_exp_s(c.id)
    s2 = @member.next_class_rest_exp_s(c.id)
    s_next = sprintf(Vocab::ExpNext, Vocab::level)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y + WLH * 7, w, WLH, Vocab::ExpTotal)
    self.contents.draw_text(x, y + WLH * 8, w, WLH, s_next)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y + WLH * 7, w, WLH, s1, 2)
    self.contents.draw_text(x, y + WLH * 8, w, WLH, s2, 2)
  end
end

class Window_ShowSkills < Window_Selectable
  def initialize(member, class_id = nil)
    super(48, 80, 448, 200)
    @member = member
    @class_id = (class_id != nil ? class_id : @member.class_id)
    @item_max = $data_classes[@class_id].learnings.size
    @column_max = 3
    create_contents
    self.index = -1
    self.active = false
    self.openness = 0
    refresh
  end
  #--------------------------------------------------------------------------
  def set(member, class_id)
    old_member = @member
    @member = member
    old_class_id = @class_id
    @class_id = class_id
    @item_max = $data_classes[@class_id].learnings.size unless @class_id == nil
    create_contents
    refresh
  end
  #--------------------------------------------------------------------------
  def refresh
    return if @class_id == nil
    return if $data_classes[@class_id].learnings.empty?
    for i in 0...@item_max
      rect = item_rect(i)
      learning = $data_classes[@class_id].learnings[i]
      next unless learning
      self.contents.font.color.alpha = (@member.class_level[@class_id] >= learning.level ? 255 : 128)
      self.contents.draw_text(rect, $data_skills[learning.skill_id].name)
    end
  end
  #--------------------------------------------------------------------------
  def update_help
    if $data_classes[@class_id].learnings.empty?
      self.help_window.set_text('')
      return
    end
    level = $data_classes[@class_id].learnings[self.index].level
    skill = $data_skills[$data_classes[@class_id].learnings[self.index].skill_id]
    self.help_window.set_text(skill == nil ? '' : "[Level #{level}] #{skill.description}")
  end
end

class Window_Confirm < Window_Selectable
  def initialize(index = -1)
    super(192, 168, 160, 80)
    create_contents
    @item_max = 2
    @column_max = 2
    self.index = index
    self.active = false
    self.openness = 0
    refresh
  end
  #--------------------------------------------------------------------------
  def refresh
    for i in 0..@item_max
      rect = item_rect(i)
      self.contents.clear_rect(rect)
    end
    self.contents.draw_text(0, 0, self.contents.width, WLH, "Confirm?", 1)
    rect = item_rect(0)
    self.contents.draw_text(rect, "Yes", 1)
    rect = item_rect(1)
    self.contents.draw_text(rect, "No", 1)
  end
  #--------------------------------------------------------------------------
  def item_rect(index)
    rect = Rect.new(0, 0, 0, 0)
    rect.width = (contents.width + @spacing) / @column_max - @spacing
    rect.height = WLH
    rect.x = index % @column_max * (rect.width + @spacing)
    rect.y = (index / @column_max * WLH) + WLH
    return rect
  end
end
 

Marpy

Member

Another group of questions that slipped my mind:
A: Is it possible to set variables depending on classes? For example, the variable number would be the actor id, while the number is the class id. Useful for NPCs who would tell the PCs something, or such, but only if they are of a certain class.
B: Is it possible to change PC options depending on character class? Say Rouge gets Two Weapon Style, while Paladin gets Super Guard, while Grappler gets Critical Bonus?
C: Is it possible to set a max job level to like 30?
 
Is it possible to set variables depending on classes? For example, the variable number would be the actor id, while the number is the class id. Useful for NPCs who would tell the PCs something, or such, but only if they are of a certain class.

You can do this by creating an event, choosing conditional branch, going to the 4th tab, choosing script, and inputting the following:

Code:
$game_party.members[0].class_id == 1

The above code will check if the lead character (this is represented by the 0, if you want a different character, the second would be 1, the third 2, and the fourth 3) is of the 1st class (you can change that 1 to any number which corresponds with the class you want). If you have any problems, let me know.

Is it possible to set a max job level to like 30?

Just look for this piece of code in Prexus' script and replace the 99 to whatever you want the max level to be.

Code:
  def class_change_level(level, id = nil, show = false)
    id = @class_id if id == nil
    level = [[level, 99].min, 1].max
    class_change_exp(@exp_list[level], id, show)
  end


Is it possible to change PC options depending on character class? Say Rouge gets Two Weapon Style, while Paladin gets Super Guard, while Grappler gets Critical Bonus?

I have just finished up the new version of my alterations/add-ons of Prexus' script! This script is to be placed just after Prexus' Job Changing/EXP script in the Materials section. My plugin script adds a number of new features as follows:

- The Ability to Assign Player Character Attributes (ie Dual Wield) by Class
- The Ability to Alter a Character's Stats by Class (ie. Knight Gets 15% ATK Increase While Magician Receives 10% INT Increase)
- The Ability to Choose to Retain Skills (Currently All-Or-None) on Class Change
- Added "Jobs" to the Main Menu
- Added The Ability to Unlock Jobs in a Final Fantasy V Manner

I feel these extra features add a lot to Prexus' script and I figured I would post my plugin script here so you all may use it if you want. Please note, I take no credit for Prexus' work, as Prexus deserves all the credit for it. I have simply created a script to alter Prexus' already outstanding script. I hope you all enjoy my plugin script. If you have any questions or find any errors, feel free to PM me and I will be more than happy to assist. Additionally, please note, this is my first ever self-written script, so don't be too hard on me if it isn't the best/ doesn't look very nice. I spent at least 10+ hours making it, and tried hard to make it look nice. Anyways, I hope you all enjoy.

Code:
#-------------------------------------------------------------------------------
#               Prexus' Job Changing/EXP Script Plugin
#                         By: Scarecrow580
#
# Please note I do NOT claim ownership of Prexus' script, I have simply created
# a Plugin to be used in conjunction with it. Prexus gets all credit for his
# work.
#
# This plugin for Prexus' Job Changing Script adds a few useful features to
# Prexus' already amazing script. This plugin script is to be installed directly
# below Prexus' Job Changing/EXP script.
#
# This Plugin Script Adds:
#
# - The Ability to Assign Player Character Attributes (ie Dual Wield) by Class
# - The Ability to Alter a Character's Stats by Class
# - Choose to Retain Skills (Currently All-Or-None) on Class Change
# - Added "Jobs" to the Main Menu
# - Added The Ability to Unlock Jobs in a Final Fantasy V Manner
# 
#-------------------------------------------------------------------------------
class Game_Actor < Game_Battler
  #-----------------------------------------------------------------------------
  # * Public Instance Variables
  #-----------------------------------------------------------------------------
  attr_reader   :name                     # name
  attr_reader   :character_name           # character graphic filename
  attr_reader   :character_index          # character graphic index
  attr_reader   :face_name                # face graphic filename
  attr_reader   :face_index               # face graphic index
  attr_reader   :class_id                 # class ID
  attr_reader   :weapon_id                # weapon ID
  attr_reader   :armor1_id                # shield ID
  attr_reader   :armor2_id                # helmet ID
  attr_reader   :armor3_id                # body armor ID
  attr_reader   :armor4_id                # accessory ID
  attr_reader   :level                    # level
  attr_reader   :exp                      # experience
  attr_accessor :last_skill_id            # for cursor memory: Skill
  attr_accessor :two_swords_style         # Two Swords Style
  attr_accessor :fixed_equipment          # Fixed Equipment
  attr_accessor :auto_battle              # Auto Battle
  attr_accessor :super_guard              # Super Guard
  attr_accessor :pharmacology             # Pharmacology
  attr_accessor :critical_bonus           # Critical Bonus
  attr_accessor :held_hp                  # Alter HP
  attr_accessor :held_mp                  # Alter MP
  attr_accessor :held_atk                 # Alter ATK
  attr_accessor :held_def                 # Alter DEF
  attr_accessor :held_spi                 # Alter SPI
  attr_accessor :held_agi                 # Alter AGI
  #-----------------------------------------------------------------------------
  # * Object Initialization
  #     actor_id : actor ID
  #-----------------------------------------------------------------------------
  def initialize(actor_id)
    super()
    setup(actor_id)
    @last_skill_id = 0
    define_attributes
    define_stats
  end
  #-----------------------------------------------------------------------------
  # Defines Stats. This Method Is Called When Actors Are Initialized,
  # When define_skills Is Run, and When a Character Levels Up
  #--------------------------------------------------------------------------
  def define_stats
    define_hp
    define_mp
    define_attack
    define_defense
    define_spirit
    define_agility
  end
  #-----------------------------------------------------------------------------
  #*****************Do Not Change Anything Above This Block*********************
  #-----------------------------------------------------------------------------
  
  
  #-----------------------------------------------------------------------------
  # Defines HP Stat By Class. Proper Class Selection (By Class ID):
  # if @class_id == 1 or @class_id == 3 or @class_id == etc. etc.
  #-----------------------------------------------------------------------------
  def define_hp
    @held_hp = actor.parameters[0, @level]
    
    id = @class_id
    if @class_id == 0 # Classes With 5% HP Bonus. Change Only This Line!
      @held_hp = @held_hp*1.05
    else
      @held_hp = @held_hp
    end
    
    id = @class_id
    if @class_id == 0 # Classes With 10% HP Bonus. Change Only This Line!
      @held_hp = @held_hp*1.10
    else
      @held_hp = @held_hp
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% HP Bonus. Change Only This Line!
      @held_hp = @held_hp*1.15
    else
      @held_hp = @held_hp
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% HP Bonus. Change Only This Line!
      @held_hp = @held_hp*1.20
    else
      @held_hp = @held_hp
    end

    id = @class_id
    if @class_id == 0 # Classes With 5% HP Loss. Change Only This Line!
      @held_hp = @held_hp*0.95
    else
      @held_hp = @held_hp
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% HP Loss. Change Only This Line!
      @held_hp = @held_hp*0.90
    else
      @held_hp = @held_hp
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% HP Loss. Change Only This Line!
      @held_hp = @held_hp*0.85
    else
      @held_hp = @held_hp
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% HP Loss. Change Only This Line!
      @held_hp = @held_hp*0.80
    else
      @held_hp = @held_hp
    end

    @held_hp = @held_hp.ceil
    self.maxhp=(@held_hp)
  end
  #-----------------------------------------------------------------------------
  # Defines MP Stat By Class. Proper Class Selection (By Class ID):
  #  if @class_id == 1 or @class_id == 3 or @class_id == etc. etc.
  #-----------------------------------------------------------------------------
  def define_mp
    @held_mp = actor.parameters[1, @level]

    id = @class_id
    if @class_id == 0 # Classes With 5% MP Bonus. Change Only This Line!
      @held_mp = @held_mp*1.05
    else
      @held_mp = @held_mp
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% MP Bonus. Change Only This Line!
      @held_mp = @held_mp*1.10
    else
      @held_mp = @held_mp
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% MP Bonus. Change Only This Line!
      @held_mp = @held_mp*1.15
    else
      @held_mp = @held_mp
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% MP Bonus. Change Only This Line!
      @held_mp = @held_mp*1.20
    else
      @held_mp = @held_mp
    end

    id = @class_id
    if @class_id == 0 # Classes With 5% MP Loss. Change Only This Line!
      @held_mp = @held_mp*0.95
    else
      @held_mp = @held_mp
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% MP Loss. Change Only This Line!
      @held_mp = @held_mp*0.90
    else
      @held_mp = @held_mp
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% MP Loss. Change Only This Line!
      @held_mp = @held_mp*0.85
    else
      @held_mp = @held_mp
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% MP Loss. Change Only This Line!
      @held_mp = @held_mp*0.80
    else
      @held_mp = @held_mp
    end

    @held_mp = @held_mp.ceil
    self.maxmp=(@held_mp)
  end
  #-----------------------------------------------------------------------------
  # Defines ATK Stat By Class. Proper Class Selection (By Class ID):
  # if @class_id == 1 or @class_id == 3 or @class_id == etc. etc.
  #-----------------------------------------------------------------------------
  def define_attack
    @held_atk = actor.parameters[2, @level]

    id = @class_id
    if @class_id == 0 # Classes With 5% ATK Bonus. Change Only This Line!
      @held_atk = @held_atk*1.05
    else
      @held_atk = @held_atk
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% ATK Bonus. Change Only This Line!
      @held_atk = @held_atk*1.10
    else
      @held_atk = @held_atk
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% ATK Bonus. Change Only This Line!
      @held_atk = @held_atk*1.15
    else
      @held_atk = @held_atk
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% ATK Bonus. Change Only This Line!
      @held_atk = @held_atk*1.20
    else
      @held_atk = @held_atk
    end

    id = @class_id
    if @class_id == 0 # Classes With 5% ATK Loss. Change Only This Line!
      @held_atk = @held_atk*0.95
    else
      @held_atk = @held_atk
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% ATK Loss. Change Only This Line!
      @held_atk = @held_atk*0.90
    else
      @held_atk = @held_atk
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% ATK Loss. Change Only This Line!
      @held_atk = @held_atk*0.85
    else
      @held_atk = @held_atk
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% ATK Loss. Change Only This Line!
      @held_atk = @held_atk*0.80
    else
      @held_atk = @held_atk
    end

    @held_atk = @held_atk.ceil
    self.atk=(@held_atk)
  end
  #-----------------------------------------------------------------------------
  # Defines DEF Stat By Class. Proper Class Selection (By Class ID):
  # if @class_id == 1 or @class_id == 3 or @class_id == etc. etc.
  #-----------------------------------------------------------------------------
  def define_defense
    @held_def = actor.parameters[3, @level]
    
    id = @class_id
    if @class_id == 0 # Classes With 5% DEF Bonus. Change Only This Line!
      @held_def = @held_def*1.05
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% DEF Bonus. Change Only This Line!
      @held_def = @held_def*1.10
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% DEF Bonus. Change Only This Line!
      @held_def = @held_def*1.15
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% DEF Bonus. Change Only This Line!
      @held_def = @held_def*1.20
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 5% DEF Loss. Change Only This Line!
      @held_def = @held_def*0.95
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% DEF Loss. Change Only This Line!
      @held_def = @held_def*0.90
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% DEF Loss. Change Only This Line!
      @held_def = @held_def*0.85
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% DEF Loss. Change Only This Line!
      @held_def = @held_def*0.80
    else
      @held_def = @held_def
    end

    @held_def = @held_def.ceil
    self.definitely_defense=(@held_def)
  end
  #-----------------------------------------------------------------------------
  # Defines SPI Stat By Class. Proper Class Selection (By Class ID):
  # if @class_id == 1 or @class_id == 3 or @class_id == etc. etc.
  #-----------------------------------------------------------------------------
  def define_spirit
    @held_spi = actor.parameters[4, @level]

    id = @class_id
    if @class_id == 0 # Classes With 5% SPI Bonus. Change Only This Line!
      @held_spi = @held_spi*1.05
    else
      @held_spi = @held_spi
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% SPI Bonus. Change Only This Line!
      @held_spi = @held_spi*1.10
    else
      @held_spi = @held_spi
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% SPI Bonus. Change Only This Line!
      @held_spi = @held_spi*1.15
    else
      @held_spi = @held_spi
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% SPI Bonus. Change Only This Line!
      @held_spi = @held_spi*1.20
    else
      @held_spi = @held_spi
    end

    id = @class_id
    if @class_id == 0 # Classes With 5% SPI Loss. Change Only This Line!
      @held_spi = @held_spi*0.95
    else
      @held_spi = @held_spi
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% SPI Loss. Change Only This Line!
      @held_spi = @held_spi*0.90
    else
      @held_spi = @held_spi
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% SPI Loss. Change Only This Line!
      @held_spi = @held_spi*0.85
    else
      @held_spi = @held_spi
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% SPI Loss. Change Only This Line!
      @held_spi = @held_spi*0.80
    else
      @held_spi = @held_spi
    end

    @held_spi = @held_spi.ceil
    self.spi=(@held_spi)
  end
  #-----------------------------------------------------------------------------
  # Defines AGI Stat By Class. Proper Class Selection (By Class ID):
  # if @class_id == 1 or @class_id == 3 or @class_id == etc. etc.
  #-----------------------------------------------------------------------------
  def define_agility
    @held_agi = actor.parameters[5, @level]

    id = @class_id
    if @class_id == 0 # Classes With 5% AGI Bonus. Change Only This Line!
      @held_agi = @held_agi*1.05
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% AGI Bonus. Change Only This Line!
      @held_agi = @held_agi*1.10
    else
      @held_agi = @held_agi
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% AGI Bonus. Change Only This Line!
      @held_agi = @held_agi*1.15
    else
      @held_agi = @held_agi
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% AGI Bonus. Change Only This Line!
      @held_agi = @held_agi*1.20
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 5% AGI Loss. Change Only This Line!
      @held_agi = @held_agi*0.95
    else
      @held_agi = @held_agi
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% AGI Loss. Change Only This Line!
      @held_agi = @held_agi*0.90
    else
      @held_agi = @held_agi
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% AGI Loss. Change Only This Line!
      @held_agi = @held_agi*0.85
    else
      @held_agi = @held_agi
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% AGI Loss. Change Only This Line!
      @held_agi = @held_agi*0.80
    else
      @held_agi = @held_agi
    end

    @held_agi = @held_agi.ceil
    self.agi=(@held_agi)
  end
  #-----------------------------------------------------------------------------
  # Defines Attributes. This Method Determines, By Class ID, If PC Attributes
  # Are Active. Proper Class Selection (By Class ID):
  # if @class_id == 1 or @class_id == 3 or @class_id == etc. etc.
  #-----------------------------------------------------------------------------
  def define_attributes
    
   id = @class_id
   if @class_id == 0 #Classes Which Have Dual Wield. Change Only This Line!
     @two_swords_style = 1
   else
     @two_swords_style = 0
   end
   
   if @class_id == 0 #Classes Which Have Fixed Equipment. Change Only This Line!
      @fixed_equipment = 1
   else
      @fixed_equipment = 0
    end
    
   if @class_id == 0 #Classes Which Have Auto-Battle. Change Only This Line!
      @auto_battle = 1
   else
      @auto_battle = 0
    end
    
   if @class_id == 0 #Classes Which Have Super Guard. Change Only This Line!
      @super_guard = 1
   else
      @super_guard = 0
    end
    
   if @class_id == 0 #Classes Which Have Pharmacology. Change Only This Line!
      @pharmacology = 1
   else
      @pharmacology =0
    end
    
   if @class_id == 0 #Classes Which Have Critical Bonus. Change Only This Line!
      @critical_bonus = 1
   else
      @critical_bonus =0
    end    
  end
  
  #-----------------------------------------------------------------------------
  # This Is an Alteration Of a Piece of Code From Prexus' Script. It Has Been
  # Altered to Call The Methods Created Above. Additionally, If You Want To
  # Retain Skills Learned (Currently All-Or-None) When Changing Classes
  # Delete The Line Marked Below.
  #-----------------------------------------------------------------------------
  def define_skills(id = nil)
    id = @class_id if id == nil
    @skills = [] #Delete for Skill Retention. Change Only This Line!
    for i in $data_classes[id].learnings
      learn_skill(i.skill_id) if i.level <= @class_level[id]
    end
    define_attributes # This is Where We Call Our Method.
    define_stats # This is Where We Call Our Other Method.
  end
end
  #-----------------------------------------------------------------------------
  # This is an Alteration Of a Piece of Prexus' Script. It Has Been Altered
  # Such That You Can Unlock Jobs in a Final Fantasy V Manner. While This
  # Is Slightly Confusing, It Is Rather Easy To Implement. In The Code Below,
  # There is a Marked Section Where, If You Want The Jobs Unlocking System,
  # You Will Alter The Line As Indicated Below, Else, Leave it Alone.
  # The n Below, Is to be Replaced With The ID of a Variable. In Order To Use
  # The Job Unlocking System, You Must Set Variable n to a Number. If The
  # Variable is Set to 1, All Jobs Are Available. If the Variable Is Set Greater
  # Than 1, For Each Unit Above One, One Job Will Be Left Off The Job Selection
  # List. So, If The Variable Is 2, The Last Class In Your Classes Tab Will
  # Be Left Off The List. In Order to Unlock Jobs, Begin The Game With A Higher
  # Variable Number, and When New Jobs Are Unlocked, Simply Alter The Variable
  # To a Lower Number, Eventually Reaching 1 (ie. All Jobs Available)
  # This Can Additionally Be Used To Create Classes Which The Player Is Never
  # Aloowed To Select. Simply Make The Unselectable Class The Lowest Class In
  # The Classes Tab. Then, Make The Variable Never Equal to One. In This Way,
  # This Class Will Never Be "Unlocked".
  #-----------------------------------------------------------------------------
class Window_ClassPick < Window_Selectable
  def initialize(member = nil)
    super(48, 178, 256, 158)
    @item_max = $data_classes.size - 1 # Replace 1 with $game_variables.[](n)
    create_contents
    @member = member
    self.index = -1
    self.active = false
    refresh
  end
end
#-------------------------------------------------------------------------------
#******************Do Not Change Anything Below This Block**********************
#-------------------------------------------------------------------------------
class Game_Actor < Game_Battler
  #-----------------------------------------------------------------------------
  # I was Receiving Errors When Using the def=(new_def) Method So I Have 
  # Created a New Method Which Does the Same Thing.
  #-----------------------------------------------------------------------------
  # * Set Defense
  #     new_def : new defense
  #-----------------------------------------------------------------------------
  def definitely_defense=(new_def)
    @def_plus += new_def - self.def
    @def_plus = [[@def_plus, -999].max, 999].min
  end
  
  #-----------------------------------------------------------------------------
  # The Following Has Been Taken From Game_Actor and Has Been Altered Such That
  # Given A Call To Check if PC Attributes Are Active, It Will Return the
  # Correct Response Based on the attr_accessor Value Given Above
  #-----------------------------------------------------------------------------
  
  #-----------------------------------------------------------------------------
  # * Get Critical Ratio
  #-----------------------------------------------------------------------------
  def cri
    n = 4
    n += 4 if @critical_bonus == 1
    for weapon in weapons.compact
      n += 4 if weapon.critical_bonus
    end
    return n
  end
  #-----------------------------------------------------------------------------
  # * Get [Dual Wield] Option
  #-----------------------------------------------------------------------------
  def two_swords_style
    if @two_swords_style == 1
       return true
     else
       return false
     end
  end
  #-----------------------------------------------------------------------------
  # * Get [Fixed Equipment] Option
  #-----------------------------------------------------------------------------
  def fix_equipment
    if @fixed_equipment == 1
      return true
    else
      return false
    end
  end
  #-----------------------------------------------------------------------------
  # * Get [Automatic Battle] Option
  #-----------------------------------------------------------------------------
  def auto_battle
    if @auto_battle == 1
      return true 
    else
      return false
    end
  end
  #-----------------------------------------------------------------------------
  # * Get [Super Guard] Option
  #-----------------------------------------------------------------------------
  def super_guard
    if @super_guard == 1
      return true 
    else
      return false
    end
  end
  #-----------------------------------------------------------------------------
  # * Get [Pharmacology] Option
  #-----------------------------------------------------------------------------
  def pharmacology
    if @pharmacology == 1
      return true
    else
      return false
    end
  end
  #-----------------------------------------------------------------------------
  # This Is an Alteration Of a Piece of Code From Prexus' Script. It Has Been
  # Altered to Call The Methods Created Above
  #-----------------------------------------------------------------------------
  def class_id=(class_id)
    @class_id = class_id
    for i in 0..4 
      change_equip(i, nil) # A Small Portion of Code Was Deleted Here On Purpose
    end
    define_attributes #This IS Where We Will Call Our Method
    define_stats      #This is Where We Will Call Our Other Method
    define_skills
  end
  #-----------------------------------------------------------------------------
  # Because Stats Are Determined By Level, We Need to Call The Method
  # define_stats Whenever There is A Level Change.
  #-----------------------------------------------------------------------------
  
  #-----------------------------------------------------------------------------
  # * Level Up (As Taken From Prexus' Script)
  #-----------------------------------------------------------------------------
   def level_up
    @level += 1
    define_stats # This is Where We Will Call Our Method
  end
  #-----------------------------------------------------------------------------
  # * Level Down
  #-----------------------------------------------------------------------------
  def level_down
    @level -= 1
    define_stats # This is Where We Will Call Our Method
  end
  #-----------------------------------------------------------------------------
  # * Change Level
  #     level : new level
  #     show  : Level up display flag
  #-----------------------------------------------------------------------------
  def change_level(level, show)
    level = [[level, 99].min, 1].max
    change_exp(@exp_list[level], show)
    define_stats # This is Where We Will Call Our Method
  end
  #-----------------------------------------------------------------------------
end

#-------------------------------------------------------------------------------
# The Following Section Places "Jobs" Into The Main Menu. This Section Alters
# All of The Indexes From Other Windows (ie. Window_Equip) Such That Upon
# Cancelling, You Return To the Correct Position In the Main Menu.
#-------------------------------------------------------------------------------

class Scene_Menu < Scene_Base
  #-----------------------------------------------------------------------------
  # * Create Command Window
  #-----------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::item
    s2 = "Jobs"
    s3 = Vocab::skill
    s4 = Vocab::equip
    s5 = Vocab::status
    s6 = Vocab::save
    s7 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # If number of party members is 0
      @command_window.draw_item(0, false)     # Disable item
      @command_window.draw_item(1, false)     # Disable skill
      @command_window.draw_item(2, false)     # Disable equipment
      @command_window.draw_item(3, false)     # Disable status
    end
    if $game_system.save_disabled             # If save is forbidden
      @command_window.draw_item(4, false)     # Disable save
    end
  end
  #-----------------------------------------------------------------------------
  # * Update Command Selection
  #-----------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # Item
        $scene = Scene_Item.new
      when 1  #Jobs
        $scene = Scene_ClassChange.new
      when 2,3,4  # Skill, equipment, status
        start_actor_selection
      when 5      # Save
        $scene = Scene_File.new(true, false, false)
      when 6      # End Game
        $scene = Scene_End.new
      end
    end
  end
  #-----------------------------------------------------------------------------
  # * Update Actor Selection
  #-----------------------------------------------------------------------------
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 2  # skill
        $scene = Scene_Skill.new(@status_window.index)
      when 3  # equipment
        $scene = Scene_Equip.new(@status_window.index)
      when 4  # status
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end

class Scene_Skill < Scene_Base
  #------------------------------------------------------------------------------
  # * Return to Original Screen
  #-----------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new(2)
  end
end

class Scene_Equip < Scene_Base
  #-----------------------------------------------------------------------------
  # * Return to Original Screen
  #-----------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new(3)
  end
end

class Scene_Status < Scene_Base
  #-----------------------------------------------------------------------------
  # * Return to Original Screen
  #-----------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new(4)
  end
end

class Scene_End < Scene_Base
  #-----------------------------------------------------------------------------
  # * Return to Original Screen
  #-----------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new(6)
  end
end

class Scene_File < Scene_Base
  #-----------------------------------------------------------------------------
  # * Return to Original Screen
  #-----------------------------------------------------------------------------
  def return_scene
    if @from_title
      $scene = Scene_Title.new
    elsif @from_event
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new(5)
    end
  end
end

#-------------------------------------------------------------------------------
# The Following Section of Code Has Been Taken From Prexus' Job Changing/EXP
# Script. There is Only One Altered Line Which Takes The Player To The Main
# Menu Rather Than Back to the Map When Cancelling Out of The Job Changing
# Window.
#-------------------------------------------------------------------------------
class Scene_ClassChange < Scene_Base
  def update_input
    if @party_window.active
      if Input.trigger?(Input::B)
        Sound.play_cancel
        $scene = Scene_Menu.new(1) #Returns to Menu When Cancelling Job Change
      elsif Input.trigger?(Input::C)
        Sound.play_decision
        @class_window.active = true
        @class_window.index = 0
        @party_window.active = false
      end
    elsif @class_window.active
      if Input.trigger?(Input::B)
        Sound.play_cancel
        @party_window.active = true
        @class_window.active = false
        @class_window.index = -1
      elsif Input.trigger?(Input::C)
        if @class_window.item.id == @class_window.member.class_id
          Sound.play_buzzer
          return
        end
        Sound.play_decision
        @confirm_window.visible = true
        @confirm_window.active = true
        @confirm_window.index = 0
        @confirm_window.open
        @class_window.active = false
      elsif Input.trigger?(Input::A)
        Sound.play_decision
        @show_window.set(@party_window.member, @class_window.item.id)
        @show_window.active = true
        @show_window.index = 0
        @show_window.open
        @help_window.visible = true
        @help_window.open
        @class_window.active = false
      end
    elsif @show_window.active
      if Input.trigger?(Input::B)
        Sound.play_cancel
        @class_window.active = true
        @show_window.active = false
        @show_window.index = -1
        @show_window.close
        @help_window.close
      end
    elsif @confirm_window.active
      if Input.trigger?(Input::B)
        Sound.play_cancel
        if @confirm_window.index == 1
          @confirm_window.active = false
          @confirm_window.index = -1
          @confirm_window.close
          @class_window.active = true
          return
        else
          @confirm_window.index = 1
          return
        end
      elsif Input.trigger?(Input::C)
        case @confirm_window.index
        when 0
          Sound.play_decision
          member = @class_window.member
          member.class_id = @class_window.item.id
          @confirm_window.active = false
          @confirm_window.index = -1
          @confirm_window.close
          @class_window.refresh
          @skill_window.refresh
          @class_window.active = true
        when 1
          @confirm_window.active = false
          @confirm_window.index = -1
          @confirm_window.close
          @class_window.active = true
          return
        end
      end
    end
  end
end
#-------------------------------------------------------------------------------

Lastly, I would like to thank Prexus for such an amazing script.
 
As said above by Scarecrow thanks for this great script and thanks to Scarecrow for the great Plug-in.

I did have a problem (Now Solved with some playing around) When using Lettuces Stat Distribution Script along with the Plug-In, but simply removing the code that creates the job menu and then moving the Stat Distribution script below the Plug-In solved all problems that i could see.

But apart from that The Script and the Plug-In both work brilliantly.

Thanks a lot to bother of you for such great work =).


**Help to those who want to use Lettuces Stat Distribution Script and This Script and Plug-In**
As mentioned above i came across a problem when trying to use both Lettuces Script and the plug-In. After some playing around (please note i am totally new to this) i noticed that the Plug-In was calling the Status window from the original source instead of Lettuces Script. All you simply need to do is find this code:

Code:
      when 4  # status
        $scene = Scene_Status.new(@status_window.index)
      end

And then replace it with this:

Code:
when 4  # status
        $scene = Scene_Stat_Dist.new(@status_window.index)
      end

This should fix the display error that occurs when trying to use both scripts.

I know this is a very simple thing to do, but there are a quite alot of people using this who have no programming knowledge.
 
Well, I've added one new feature to the plug-in today: Blue Mage Support! I noticed that on the first page of this thread it was mentioned that if a character is a Blue Mage where skills are not learned by level, upon changing from and then back to a blue mage, the learned skill was lost. I have made it so now, upon inputting the correct skill IDs and the Class ID which is the Blue Mage into the script, learned skills which are not gained from leveling but rather from enemies will remain intact when switching back to a blue mage. This can also be used to create skills which will remain intact regardless of which class is chosen. In other words, you can use this new addition to create skills which, once learned, will stay with the character regardless of class, while all other class specific skills change. I thought this was a valuable addition to the plugin and as such I am giving you the new version. It is the same plugin as above, except it has this added feature. Enjoy =)

Code:
#-------------------------------------------------------------------------------
#               Prexus' Job Changing/EXP Script Plugin
#                         By: Scarecrow580
#                           Version: 1.1
#
# Please note I do NOT claim ownership of Prexus' script, I have simply created
# a Plugin to be used in conjunction with it. Prexus gets all credit for his
# work.
#
# This plugin for Prexus' Job Changing Script adds a few useful features to
# Prexus' already amazing script. This plugin script is to be installed directly
# below Prexus' Job Changing/EXP script.
#
# This Plugin Script Adds:
#
# - The Ability to Assign Player Character Attributes (ie Dual Wield) by Class
# - The Ability to Alter a Character's Stats by Class
# - Choose to Retain Skills (Currently All-Or-None) on Class Change
# - Added "Jobs" to the Main Menu
# - Added The Ability to Unlock Jobs in a Final Fantasy V Manner
# - Added Blue Mage/Specific Skill Retention Support
# 
#-------------------------------------------------------------------------------
class Game_Actor < Game_Battler
  #-----------------------------------------------------------------------------
  # * Public Instance Variables
  #-----------------------------------------------------------------------------
  attr_reader   :name                     # name
  attr_reader   :character_name           # character graphic filename
  attr_reader   :character_index          # character graphic index
  attr_reader   :face_name                # face graphic filename
  attr_reader   :face_index               # face graphic index
  attr_reader   :class_id                 # class ID
  attr_reader   :weapon_id                # weapon ID
  attr_reader   :armor1_id                # shield ID
  attr_reader   :armor2_id                # helmet ID
  attr_reader   :armor3_id                # body armor ID
  attr_reader   :armor4_id                # accessory ID
  attr_reader   :level                    # level
  attr_reader   :exp                      # experience
  attr_accessor :last_skill_id            # for cursor memory: Skill
  attr_accessor :two_swords_style         # Two Swords Style
  attr_accessor :fixed_equipment          # Fixed Equipment
  attr_accessor :auto_battle              # Auto Battle
  attr_accessor :super_guard              # Super Guard
  attr_accessor :pharmacology             # Pharmacology
  attr_accessor :critical_bonus           # Critical Bonus
  attr_accessor :held_hp                  # Alter HP
  attr_accessor :held_mp                  # Alter MP
  attr_accessor :held_atk                 # Alter ATK
  attr_accessor :held_def                 # Alter DEF
  attr_accessor :held_spi                 # Alter SPI
  attr_accessor :held_agi                 # Alter AGI
  attr_accessor :skill_one                # Blue Mage Skill One
  attr_accessor :skill_two                # Blue Mage Skill Two
  attr_accessor :skill_three              # Blue Mage Skill Three
  attr_accessor :skill_four               # Blue Mage Skill Four
  attr_accessor :skill_five               # Blue Mage Skill Five
  attr_accessor :skill_six                # Blue Mage Skill Six
  attr_accessor :skill_seven              # Blue Mage Skill Seven
  attr_accessor :skill_eight              # Blue Mage Skill Eight
  attr_accessor :skill_nine               # Blue Mage Skill Nine
  attr_accessor :skill_ten                # Blue Mage Skill Ten
  attr_accessor :skill_eleven             # Blue Mage Skill Eleven
  attr_accessor :skill_twelve             # Blue Mage Skill Twelve
  attr_accessor :skill_thirteen           # Blue Mage Skill Thirteen
  attr_accessor :skill_fourteen           # Blue Mage Skill Fourteen
  attr_accessor :skill_fifteen            # Blue Mage Skill Fifteen
  attr_accessor :skill_sixteen            # Blue Mage Skill Sixteen
  attr_accessor :skill_seventeen          # Blue Mage Skill Seventeen
  attr_accessor :skill_eighteen           # Blue Mage Skill Eighteen
  attr_accessor :skill_nineteen           # Blue Mage Skill Nineteen
  attr_accessor :skill_twenty             # Blue Mage Skill Twenty
  #-----------------------------------------------------------------------------
  # * Object Initialization
  #     actor_id : actor ID
  #-----------------------------------------------------------------------------
  def initialize(actor_id)
    super()
    setup(actor_id)
    @last_skill_id = 0
    define_attributes
    define_stats
    @skill_one = 0
    @skill_two = 0
    @skill_three = 0
    @skill_four = 0
    @skill_five = 0
    @skill_six = 0
    @skill_seven = 0
    @skill_eight = 0
    @skill_nine = 0
    @skill_ten = 0
    @skill_eleven = 0
    @skill_twelve = 0
    @skill_thirteen = 0
    @skill_fourteen = 0
    @skill_fifteen = 0
    @skill_sixteen = 0
    @skill_seventeen = 0
    @skill_eighteen = 0
    @skill_nineteen = 0
    @skill_twenty = 0
    define_blue_mage_skills
  end
  #-----------------------------------------------------------------------------
  # Defines Stats. This Method Is Called When Actors Are Initialized,
  # When define_skills Is Run, and When a Character Levels Up
  #--------------------------------------------------------------------------
  def define_stats
    define_hp
    define_mp
    define_attack
    define_defense
    define_spirit
    define_agility
  end
  #-----------------------------------------------------------------------------
  #*****************Do Not Change Anything Above This Block*********************
  #-----------------------------------------------------------------------------
  
  
  #-----------------------------------------------------------------------------
  # Defines HP Stat By Class. Proper Class Selection (By Class ID):
  # if @class_id == 1 or @class_id == 3 or @class_id == etc. etc.
  #-----------------------------------------------------------------------------
  def define_hp
    @held_hp = actor.parameters[0, @level]
    
    id = @class_id
    if @class_id == 0 # Classes With 5% HP Bonus. Change Only This Line!
      @held_hp = @held_hp*1.05
    else
      @held_hp = @held_hp
    end
    
    id = @class_id
    if @class_id == 0 # Classes With 10% HP Bonus. Change Only This Line!
      @held_hp = @held_hp*1.10
    else
      @held_hp = @held_hp
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% HP Bonus. Change Only This Line!
      @held_hp = @held_hp*1.15
    else
      @held_hp = @held_hp
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% HP Bonus. Change Only This Line!
      @held_hp = @held_hp*1.20
    else
      @held_hp = @held_hp
    end

    id = @class_id
    if @class_id == 0 # Classes With 5% HP Loss. Change Only This Line!
      @held_hp = @held_hp*0.95
    else
      @held_hp = @held_hp
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% HP Loss. Change Only This Line!
      @held_hp = @held_hp*0.90
    else
      @held_hp = @held_hp
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% HP Loss. Change Only This Line!
      @held_hp = @held_hp*0.85
    else
      @held_hp = @held_hp
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% HP Loss. Change Only This Line!
      @held_hp = @held_hp*0.80
    else
      @held_hp = @held_hp
    end

    @held_hp = @held_hp.ceil
    self.maxhp=(@held_hp)
  end
  #-----------------------------------------------------------------------------
  # Defines MP Stat By Class. Proper Class Selection (By Class ID):
  #  if @class_id == 1 or @class_id == 3 or @class_id == etc. etc.
  #-----------------------------------------------------------------------------
  def define_mp
    @held_mp = actor.parameters[1, @level]

    id = @class_id
    if @class_id == 0 # Classes With 5% MP Bonus. Change Only This Line!
      @held_mp = @held_mp*1.05
    else
      @held_mp = @held_mp
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% MP Bonus. Change Only This Line!
      @held_mp = @held_mp*1.10
    else
      @held_mp = @held_mp
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% MP Bonus. Change Only This Line!
      @held_mp = @held_mp*1.15
    else
      @held_mp = @held_mp
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% MP Bonus. Change Only This Line!
      @held_mp = @held_mp*1.20
    else
      @held_mp = @held_mp
    end

    id = @class_id
    if @class_id == 0 # Classes With 5% MP Loss. Change Only This Line!
      @held_mp = @held_mp*0.95
    else
      @held_mp = @held_mp
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% MP Loss. Change Only This Line!
      @held_mp = @held_mp*0.90
    else
      @held_mp = @held_mp
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% MP Loss. Change Only This Line!
      @held_mp = @held_mp*0.85
    else
      @held_mp = @held_mp
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% MP Loss. Change Only This Line!
      @held_mp = @held_mp*0.80
    else
      @held_mp = @held_mp
    end

    @held_mp = @held_mp.ceil
    self.maxmp=(@held_mp)
  end
  #-----------------------------------------------------------------------------
  # Defines ATK Stat By Class. Proper Class Selection (By Class ID):
  # if @class_id == 1 or @class_id == 3 or @class_id == etc. etc.
  #-----------------------------------------------------------------------------
  def define_attack
    @held_atk = actor.parameters[2, @level]

    id = @class_id
    if @class_id == 0 # Classes With 5% ATK Bonus. Change Only This Line!
      @held_atk = @held_atk*1.05
    else
      @held_atk = @held_atk
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% ATK Bonus. Change Only This Line!
      @held_atk = @held_atk*1.10
    else
      @held_atk = @held_atk
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% ATK Bonus. Change Only This Line!
      @held_atk = @held_atk*1.15
    else
      @held_atk = @held_atk
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% ATK Bonus. Change Only This Line!
      @held_atk = @held_atk*1.20
    else
      @held_atk = @held_atk
    end

    id = @class_id
    if @class_id == 0 # Classes With 5% ATK Loss. Change Only This Line!
      @held_atk = @held_atk*0.95
    else
      @held_atk = @held_atk
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% ATK Loss. Change Only This Line!
      @held_atk = @held_atk*0.90
    else
      @held_atk = @held_atk
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% ATK Loss. Change Only This Line!
      @held_atk = @held_atk*0.85
    else
      @held_atk = @held_atk
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% ATK Loss. Change Only This Line!
      @held_atk = @held_atk*0.80
    else
      @held_atk = @held_atk
    end

    @held_atk = @held_atk.ceil
    self.atk=(@held_atk)
  end
  #-----------------------------------------------------------------------------
  # Defines DEF Stat By Class. Proper Class Selection (By Class ID):
  # if @class_id == 1 or @class_id == 3 or @class_id == etc. etc.
  #-----------------------------------------------------------------------------
  def define_defense
    @held_def = actor.parameters[3, @level]
    
    id = @class_id
    if @class_id == 0 # Classes With 5% DEF Bonus. Change Only This Line!
      @held_def = @held_def*1.05
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% DEF Bonus. Change Only This Line!
      @held_def = @held_def*1.10
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% DEF Bonus. Change Only This Line!
      @held_def = @held_def*1.15
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% DEF Bonus. Change Only This Line!
      @held_def = @held_def*1.20
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 5% DEF Loss. Change Only This Line!
      @held_def = @held_def*0.95
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% DEF Loss. Change Only This Line!
      @held_def = @held_def*0.90
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% DEF Loss. Change Only This Line!
      @held_def = @held_def*0.85
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% DEF Loss. Change Only This Line!
      @held_def = @held_def*0.80
    else
      @held_def = @held_def
    end

    @held_def = @held_def.ceil
    self.definitely_defense=(@held_def)
  end
  #-----------------------------------------------------------------------------
  # Defines SPI Stat By Class. Proper Class Selection (By Class ID):
  # if @class_id == 1 or @class_id == 3 or @class_id == etc. etc.
  #-----------------------------------------------------------------------------
  def define_spirit
    @held_spi = actor.parameters[4, @level]

    id = @class_id
    if @class_id == 0 # Classes With 5% SPI Bonus. Change Only This Line!
      @held_spi = @held_spi*1.05
    else
      @held_spi = @held_spi
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% SPI Bonus. Change Only This Line!
      @held_spi = @held_spi*1.10
    else
      @held_spi = @held_spi
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% SPI Bonus. Change Only This Line!
      @held_spi = @held_spi*1.15
    else
      @held_spi = @held_spi
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% SPI Bonus. Change Only This Line!
      @held_spi = @held_spi*1.20
    else
      @held_spi = @held_spi
    end

    id = @class_id
    if @class_id == 0 # Classes With 5% SPI Loss. Change Only This Line!
      @held_spi = @held_spi*0.95
    else
      @held_spi = @held_spi
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% SPI Loss. Change Only This Line!
      @held_spi = @held_spi*0.90
    else
      @held_spi = @held_spi
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% SPI Loss. Change Only This Line!
      @held_spi = @held_spi*0.85
    else
      @held_spi = @held_spi
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% SPI Loss. Change Only This Line!
      @held_spi = @held_spi*0.80
    else
      @held_spi = @held_spi
    end

    @held_spi = @held_spi.ceil
    self.spi=(@held_spi)
  end
  #-----------------------------------------------------------------------------
  # Defines AGI Stat By Class. Proper Class Selection (By Class ID):
  # if @class_id == 1 or @class_id == 3 or @class_id == etc. etc.
  #-----------------------------------------------------------------------------
  def define_agility
    @held_agi = actor.parameters[5, @level]

    id = @class_id
    if @class_id == 0 # Classes With 5% AGI Bonus. Change Only This Line!
      @held_agi = @held_agi*1.05
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% AGI Bonus. Change Only This Line!
      @held_agi = @held_agi*1.10
    else
      @held_agi = @held_agi
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% AGI Bonus. Change Only This Line!
      @held_agi = @held_agi*1.15
    else
      @held_agi = @held_agi
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% AGI Bonus. Change Only This Line!
      @held_agi = @held_agi*1.20
    else
      @held_def = @held_def
    end

    id = @class_id
    if @class_id == 0 # Classes With 5% AGI Loss. Change Only This Line!
      @held_agi = @held_agi*0.95
    else
      @held_agi = @held_agi
    end

    id = @class_id
    if @class_id == 0 # Classes With 10% AGI Loss. Change Only This Line!
      @held_agi = @held_agi*0.90
    else
      @held_agi = @held_agi
    end

    id = @class_id
    if @class_id == 0 # Classes With 15% AGI Loss. Change Only This Line!
      @held_agi = @held_agi*0.85
    else
      @held_agi = @held_agi
    end

    id = @class_id
    if @class_id == 0 # Classes With 20% AGI Loss. Change Only This Line!
      @held_agi = @held_agi*0.80
    else
      @held_agi = @held_agi
    end

    @held_agi = @held_agi.ceil
    self.agi=(@held_agi)
  end
  #-----------------------------------------------------------------------------
  # Defines Attributes. This Method Determines, By Class ID, If PC Attributes
  # Are Active. Proper Class Selection (By Class ID):
  # if @class_id == 1 or @class_id == 3 or @class_id == etc. etc.
  #-----------------------------------------------------------------------------
  def define_attributes
    
   id = @class_id
   if @class_id == 0 #Classes Which Have Dual Wield. Change Only This Line!
     @two_swords_style = 1
   else
     @two_swords_style = 0
   end
   
   if @class_id == 0 #Classes Which Have Fixed Equipment. Change Only This Line!
      @fixed_equipment = 1
   else
      @fixed_equipment = 0
    end
    
   if @class_id == 0 #Classes Which Have Auto-Battle. Change Only This Line!
      @auto_battle = 1
   else
      @auto_battle = 0
    end
    
   if @class_id == 0 #Classes Which Have Super Guard. Change Only This Line!
      @super_guard = 1
   else
      @super_guard = 0
    end
    
   if @class_id == 0 #Classes Which Have Pharmacology. Change Only This Line!
      @pharmacology = 1
   else
      @pharmacology =0
    end
    
   if @class_id == 0 #Classes Which Have Critical Bonus. Change Only This Line!
      @critical_bonus = 1
   else
      @critical_bonus =0
    end    
  end
  
  #-----------------------------------------------------------------------------
  # This Is an Alteration Of a Piece of Code From Prexus' Script. It Has Been
  # Altered to Call The Methods Created Above. Additionally, If You Want To
  # Retain Skills Learned (Currently All-Or-None) When Changing Classes
  # Delete The Line Marked Below.
  #-----------------------------------------------------------------------------
  def define_skills(id = nil)
    define_blue_mage_skills # Keeps Track of Blue Mage Skills
    id = @class_id if id == nil
    @skills = [] #Delete for Skill Retention. Change Only This Line!
    for i in $data_classes[id].learnings
      learn_skill(i.skill_id) if i.level <= @class_level[id]
    end
    define_attributes # This is Where We Call Our Method.
    define_stats # This is Where We Call Our Other Method.
    learn_blue_mage_skills # Learns Blue Mage skills if Applicable
  end

  #-----------------------------------------------------------------------------
  # This Method Determines If Blue Mage Skill Has Been Learned or Not.
  # Only Change What the Comments Below Say to Change. The Skill IDs You Will
  # Input Are The Skill IDs of the Skills Your Blue Mage Class Can Learn
  # Or Alternately Input The Skills You Want To Carry Over (See Note In Next
  # Block For Further Instructions/Better Explanation.
  #-----------------------------------------------------------------------------
  def define_blue_mage_skills

      if check_skill(0) == 1 #Where 0 is, Insert First Skill ID
         @skill_one = 1
      else
         @skill_one = @skill_one
      end

      if check_skill(0) == 1 #Where 0 is, Insert Second Skill ID
         @skill_two = 1
      else
         @skill_two = @skill_two
      end

      if check_skill(0) == 1 #Where 0 is, Insert Third Skill ID
         @skill_three = 1
      else
         @skill_three = @skill_three
      end

      if check_skill(0) == 1 #Where 0 is, Insert Fourth Skill ID
         @skill_four = 1
      else
         @skill_four = @skill_four
      end

      if check_skill(0) == 1 #Where 0 is, Insert Fifth Skill ID
         @skill_five = 1
      else
         @skill_five = @skill_five
      end

      if check_skill(0) == 1 #Where 0 is, Insert Sixth Skill ID
         @skill_six = 1
      else
         @skill_six = @skill_six
      end

      if check_skill(0) == 1 #Where 0 is, Insert Seventh Skill ID
         @skill_seven = 1
      else
         @skill_seven = @skill_seven
      end

      if check_skill(0) == 1 #Where 0 is, Insert Eighth Skill ID
         @skill_eight = 1
      else
         @skill_eight = @skill_eight
      end

      if check_skill(0) == 1 #Where 0 is, Insert Ninth Skill ID
         @skill_nine = 1
      else
         @skill_nine = @skill_nine
      end

      if check_skill(0) == 1 #Where 0 is, Insert Tenth Skill ID
         @skill_ten = 1
      else
         @skill_ten = @skill_ten
      end

      if check_skill(0) == 1 #Where 0 is, Insert Eleventh Skill ID
         @skill_eleven = 1
      else
         @skill_eleven = @skill_eleven
      end

      if check_skill(0) == 1 #Where 0 is, Insert Twelfth Skill ID
         @skill_twelve = 1
      else
         @skill_twelve = @skill_twelve
      end

      if check_skill(0) == 1 #Where 0 is, Insert Thirteenth Skill ID
         @skill_thirteen = 1
      else
         @skill_thirteen = @skill_thirteen
      end

      if check_skill(0) == 1 #Where 0 is, Insert Fourteenth Skill ID
         @skill_fourteen = 1
      else
         @skill_fourteen = @skill_fourteen
      end

      if check_skill(0) == 1 #Where 0 is, Insert Fifteenth Skill ID
         @skill_fifteen = 1
      else
         @skill_fifteen = @skill_fifteen
      end

      if check_skill(0) == 1 #Where 0 is, Insert Sixteenth Skill ID
         @skill_sixteen = 1
      else
         @skill_sixteen = @skill_sixteen
      end

      if check_skill(0) == 1 #Where 0 is, Insert Seventeenth Skill ID
         @skill_seventeen = 1
      else
         @skill_seventeen = @skill_seventeen
      end

      if check_skill(0) == 1 #Where 0 is, Insert Eighteenth Skill ID
         @skill_eighteen = 1
      else
         @skill_eighteen = @skill_eighteen
      end

      if check_skill(0) == 1 #Where 0 is, Insert Nineteenth Skill ID
         @skill_nineteen = 1
      else
         @skill_nineteen = @skill_nineteen
      end

      if check_skill(0) == 1 #Where 0 is, Insert Twentieth Skill ID
         @skill_twenty = 1
      else
         @skill_twenty = @skill_twenty
      end
  end
  #-----------------------------------------------------------------------------
  # This Method Will Be Used to Learn the Blue Mage Skills. All You Need to
  # Alter is The Single Line Commented On Below. You Will Be Instructed to
  # Insert The Blue Mage Class ID. Additionally, Replace the 0 With the Skill
  # IDs Above (ie If You Use 27 as The Twentieth Skill ID Above, Also Put
  # 27 Under Twentieth Skill ID Below.
  # Note that This Can Also Be Used If You Want to Create Skills Which Once
  # Learned Carry From Class to Class if You Don't Want All Skills to Carry
  # In Order to Make Certain Skills Carry Over, Delete the Entire Line Which
  # Asks You to Replace 0 With Blue Mage Class ID. By Doing This, Once Learned,
  # A Skill Will Carry Over To All Classes.
  #-----------------------------------------------------------------------------
  def learn_blue_mage_skills

      if @class_id == 0 #Replace 0 With Blue Mage Class ID
         
         if @skill_one == 1
            learn_skill(0) # Where 0 is, Insert First Skill ID
         end

         if @skill_two == 1
            learn_skill(0) # Where 0 is, Insert Second Skill ID
         end
            
         if @skill_three == 1
            learn_skill(0) # Where 0 is, Insert Third Skill ID
         end

         if @skill_four == 1
            learn_skill(0) # Where 0 is, Insert Fourth Skill ID
         end

         if @skill_five == 1
            learn_skill(0) # Where 0 is, Insert Fifth Skill ID
         end

         if @skill_six == 1
            learn_skill(0) # Where 0 is, Insert Sixth Skill ID
         end

         if @skill_seven == 1
            learn_skill(0) # Where 0 is, Insert Seventh Skill ID
         end

         if @skill_eight == 1
            learn_skill(0) # Where 0 is, Insert Eighth Skill ID
         end

         if @skill_nine == 1
            learn_skill(0) # Where 0 is, Insert Ninth Skill ID
         end

         if @skill_ten == 1
            learn_skill(0) # Where 0 is, Insert Tenth Skill ID
         end

         if @skill_eleven == 1
            learn_skill(0) # Where 0 is, Insert Eleventh Skill ID
         end

         if @skill_twelve == 1
            learn_skill(0) # Where 0 is, Insert Twelfth Skill ID
         end

         if @skill_thirteen == 1
            learn_skill(0) # Where 0 is, Insert Thirteenth Skill ID
         end

         if @skill_fourteen == 1
            learn_skill(0) # Where 0 is, Insert Fourteenth Skill ID
         end

         if @skill_fifteen == 1
            learn_skill(0) # Where 0 is, Insert Fifteenth Skill ID
         end

         if @skill_sixteen == 1
            learn_skill(0) # Where 0 is, Insert Sixteenth Skill ID
         end

         if @skill_seventeen == 1
            learn_skill(0) # Where 0 is, Insert Seventeenth Skill ID
         end

         if @skill_eighteen == 1
            learn_skill(0) # Where 0 is, Insert Eighteenth Skill ID
         end

         if @skill_nineteen == 1
            learn_skill(0) # Where 0 is, Insert Nineteenth Skill ID
         end

         if @skill_twenty == 1
            learn_skill(0) # Where 0 is, Insert Twentieth Skill ID
         end
    end
  end
end
  #-----------------------------------------------------------------------------
  # This is an Alteration Of a Piece of Prexus' Script. It Has Been Altered
  # Such That You Can Unlock Jobs in a Final Fantasy V Manner. While This
  # Is Slightly Confusing, It Is Rather Easy To Implement. In The Code Below,
  # There is a Marked Section Where, If You Want The Jobs Unlocking System,
  # You Will Alter The Line As Indicated Below, Else, Leave it Alone.
  # The n Below, Is to be Replaced With The ID of a Variable. In Order To Use
  # The Job Unlocking System, You Must Set Variable n to a Number. If The
  # Variable is Set to 1, All Jobs Are Available. If the Variable Is Set Greater
  # Than 1, For Each Unit Above One, One Job Will Be Left Off The Job Selection
  # List. So, If The Variable Is 2, The Last Class In Your Classes Tab Will
  # Be Left Off The List. In Order to Unlock Jobs, Begin The Game With A Higher
  # Variable Number, and When New Jobs Are Unlocked, Simply Alter The Variable
  # To a Lower Number, Eventually Reaching 1 (ie. All Jobs Available)
  # This Can Additionally Be Used To Create Classes Which The Player Is Never
  # Aloowed To Select. Simply Make The Unselectable Class The Lowest Class In
  # The Classes Tab. Then, Make The Variable Never Equal to One. In This Way,
  # This Class Will Never Be "Unlocked".
  #-----------------------------------------------------------------------------
class Window_ClassPick < Window_Selectable
  def initialize(member = nil)
    super(48, 178, 256, 158)
    @item_max = $data_classes.size - 1 # Replace 1 with $game_variables.[](n)
    create_contents
    @member = member
    self.index = -1
    self.active = false
    refresh
  end
end
#-------------------------------------------------------------------------------
#******************Do Not Change Anything Below This Block**********************
#-------------------------------------------------------------------------------
class Game_Actor < Game_Battler
  #-----------------------------------------------------------------------------
  # I was Receiving Errors When Using the def=(new_def) Method So I Have 
  # Created a New Method Which Does the Same Thing.
  #-----------------------------------------------------------------------------
  # * Set Defense
  #     new_def : new defense
  #-----------------------------------------------------------------------------
  def definitely_defense=(new_def)
    @def_plus += new_def - self.def
    @def_plus = [[@def_plus, -999].max, 999].min
  end
  
  #-----------------------------------------------------------------------------
  # The Following Has Been Taken From Game_Actor and Has Been Altered Such That
  # Given A Call To Check if PC Attributes Are Active, It Will Return the
  # Correct Response Based on the attr_accessor Value Given Above
  #-----------------------------------------------------------------------------
  
  #-----------------------------------------------------------------------------
  # * Get Critical Ratio
  #-----------------------------------------------------------------------------
  def cri
    n = 4
    n += 4 if @critical_bonus == 1
    for weapon in weapons.compact
      n += 4 if weapon.critical_bonus
    end
    return n
  end
  #-----------------------------------------------------------------------------
  # * Get [Dual Wield] Option
  #-----------------------------------------------------------------------------
  def two_swords_style
    if @two_swords_style == 1
       return true
     else
       return false
     end
  end
  #-----------------------------------------------------------------------------
  # * Get [Fixed Equipment] Option
  #-----------------------------------------------------------------------------
  def fix_equipment
    if @fixed_equipment == 1
      return true
    else
      return false
    end
  end
  #-----------------------------------------------------------------------------
  # * Get [Automatic Battle] Option
  #-----------------------------------------------------------------------------
  def auto_battle
    if @auto_battle == 1
      return true 
    else
      return false
    end
  end
  #-----------------------------------------------------------------------------
  # * Get [Super Guard] Option
  #-----------------------------------------------------------------------------
  def super_guard
    if @super_guard == 1
      return true 
    else
      return false
    end
  end
  #-----------------------------------------------------------------------------
  # * Get [Pharmacology] Option
  #-----------------------------------------------------------------------------
  def pharmacology
    if @pharmacology == 1
      return true
    else
      return false
    end
  end
  #-----------------------------------------------------------------------------
  # This Is an Alteration Of a Piece of Code From Prexus' Script. It Has Been
  # Altered to Call The Methods Created Above
  #-----------------------------------------------------------------------------
  def class_id=(class_id)
    @class_id = class_id
    for i in 0..4 
      change_equip(i, nil) # A Small Portion of Code Was Deleted Here On Purpose
    end
    define_attributes #This IS Where We Will Call Our Method
    define_stats      #This is Where We Will Call Our Other Method
    define_skills
  end
  #-----------------------------------------------------------------------------
  # Because Stats Are Determined By Level, We Need to Call The Method
  # define_stats Whenever There is A Level Change.
  #-----------------------------------------------------------------------------
  
  #-----------------------------------------------------------------------------
  # * Level Up (As Taken From Prexus' Script)
  #-----------------------------------------------------------------------------
   def level_up
    @level += 1
    define_stats # This is Where We Will Call Our Method
  end
  #-----------------------------------------------------------------------------
  # * Level Down
  #-----------------------------------------------------------------------------
  def level_down
    @level -= 1
    define_stats # This is Where We Will Call Our Method
  end
  #-----------------------------------------------------------------------------
  # * Change Level
  #     level : new level
  #     show  : Level up display flag
  #-----------------------------------------------------------------------------
  def change_level(level, show)
    level = [[level, 99].min, 1].max
    change_exp(@exp_list[level], show)
    define_stats # This is Where We Will Call Our Method
  end
  #-----------------------------------------------------------------------------
  # Check Skill Is a Method to Determine if an Actor Has a Given Skill
  #     skill_id : skill ID
  #-----------------------------------------------------------------------------
  def check_skill(skill_id)
    if skill_learn?($data_skills[skill_id])
       return 1
    else
       return 0
    end
  end
end

#-------------------------------------------------------------------------------
# The Following Section Places "Jobs" Into The Main Menu. This Section Alters
# All of The Indexes From Other Windows (ie. Window_Equip) Such That Upon
# Cancelling, You Return To the Correct Position In the Main Menu.
#-------------------------------------------------------------------------------

class Scene_Menu < Scene_Base
  #-----------------------------------------------------------------------------
  # * Create Command Window
  #-----------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::item
    s2 = "Jobs"
    s3 = Vocab::skill
    s4 = Vocab::equip
    s5 = Vocab::status
    s6 = Vocab::save
    s7 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # If number of party members is 0
      @command_window.draw_item(0, false)     # Disable item
      @command_window.draw_item(1, false)     # Disable skill
      @command_window.draw_item(2, false)     # Disable equipment
      @command_window.draw_item(3, false)     # Disable status
    end
    if $game_system.save_disabled             # If save is forbidden
      @command_window.draw_item(4, false)     # Disable save
    end
  end
  #-----------------------------------------------------------------------------
  # * Update Command Selection
  #-----------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # Item
        $scene = Scene_Item.new
      when 1  #Jobs
        $scene = Scene_ClassChange.new
      when 2,3,4  # Skill, equipment, status
        start_actor_selection
      when 5      # Save
        $scene = Scene_File.new(true, false, false)
      when 6      # End Game
        $scene = Scene_End.new
      end
    end
  end
  #-----------------------------------------------------------------------------
  # * Update Actor Selection
  #-----------------------------------------------------------------------------
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 2  # skill
        $scene = Scene_Skill.new(@status_window.index)
      when 3  # equipment
        $scene = Scene_Equip.new(@status_window.index)
      when 4  # status
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end

class Scene_Skill < Scene_Base
  #------------------------------------------------------------------------------
  # * Return to Original Screen
  #-----------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new(2)
  end
end

class Scene_Equip < Scene_Base
  #-----------------------------------------------------------------------------
  # * Return to Original Screen
  #-----------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new(3)
  end
end

class Scene_Status < Scene_Base
  #-----------------------------------------------------------------------------
  # * Return to Original Screen
  #-----------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new(4)
  end
end

class Scene_End < Scene_Base
  #-----------------------------------------------------------------------------
  # * Return to Original Screen
  #-----------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new(6)
  end
end

class Scene_File < Scene_Base
  #-----------------------------------------------------------------------------
  # * Return to Original Screen
  #-----------------------------------------------------------------------------
  def return_scene
    if @from_title
      $scene = Scene_Title.new
    elsif @from_event
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new(5)
    end
  end
end

#-------------------------------------------------------------------------------
# The Following Section of Code Has Been Taken From Prexus' Job Changing/EXP
# Script. There is Only One Altered Line Which Takes The Player To The Main
# Menu Rather Than Back to the Map When Cancelling Out of The Job Changing
# Window.
#-------------------------------------------------------------------------------
class Scene_ClassChange < Scene_Base
  def update_input
    if @party_window.active
      if Input.trigger?(Input::B)
        Sound.play_cancel
        $scene = Scene_Menu.new(1) #Returns to Menu When Cancelling Job Change
      elsif Input.trigger?(Input::C)
        Sound.play_decision
        @class_window.active = true
        @class_window.index = 0
        @party_window.active = false
      end
    elsif @class_window.active
      if Input.trigger?(Input::B)
        Sound.play_cancel
        @party_window.active = true
        @class_window.active = false
        @class_window.index = -1
      elsif Input.trigger?(Input::C)
        if @class_window.item.id == @class_window.member.class_id
          Sound.play_buzzer
          return
        end
        Sound.play_decision
        @confirm_window.visible = true
        @confirm_window.active = true
        @confirm_window.index = 0
        @confirm_window.open
        @class_window.active = false
      elsif Input.trigger?(Input::A)
        Sound.play_decision
        @show_window.set(@party_window.member, @class_window.item.id)
        @show_window.active = true
        @show_window.index = 0
        @show_window.open
        @help_window.visible = true
        @help_window.open
        @class_window.active = false
      end
    elsif @show_window.active
      if Input.trigger?(Input::B)
        Sound.play_cancel
        @class_window.active = true
        @show_window.active = false
        @show_window.index = -1
        @show_window.close
        @help_window.close
      end
    elsif @confirm_window.active
      if Input.trigger?(Input::B)
        Sound.play_cancel
        if @confirm_window.index == 1
          @confirm_window.active = false
          @confirm_window.index = -1
          @confirm_window.close
          @class_window.active = true
          return
        else
          @confirm_window.index = 1
          return
        end
      elsif Input.trigger?(Input::C)
        case @confirm_window.index
        when 0
          Sound.play_decision
          member = @class_window.member
          member.class_id = @class_window.item.id
          @confirm_window.active = false
          @confirm_window.index = -1
          @confirm_window.close
          @class_window.refresh
          @skill_window.refresh
          @class_window.active = true
        when 1
          @confirm_window.active = false
          @confirm_window.index = -1
          @confirm_window.close
          @class_window.active = true
          return
        end
      end
    end
  end
end
#-------------------------------------------------------------------------------

And again, my thanks to Prexus for making the Job Changing/EXP Script!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top