script 'profession' line 437: nomethoderror occured.
undefined method 'class_id' for nil:NilClass
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
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
Cyrtii":13dubxyc said:And how do I put the actors Class lvl in his Status menu.
So how do I put the Class lvl in window_status?
$data_classes   =
load_data("Data/Classes2.rvdata")
#--------------------------------------------------------------------------
 # * 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
#--------------------------------------------------------------------------
 # * 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
#==============================================================================
# ** 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
#==============================================================================
# ** 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
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.
$game_party.members[0].class_id == 1
Is it possible to set a max job level to like 30?
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?
#-------------------------------------------------------------------------------
# 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
#-------------------------------------------------------------------------------
when 4 # status
$scene = Scene_Status.new(@status_window.index)
end
when 4 # status
$scene = Scene_Stat_Dist.new(@status_window.index)
end
#-------------------------------------------------------------------------------
# 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
#-------------------------------------------------------------------------------