One feature that would be really neat is some way to control your summoned monsters/pets. I'm trying to make a FFXI inspired summoner class, but i have no way to control the summons using BABS.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Quote from: KK20 on May 23, 2014, 01:46:58 am
Try sticking module BlizzABS before class Processor and putting another end at the bottom.
module BlizzABS
class Processor
alias sls_blizz_exp_result exp_result
def exp_result(enemy)
job_points = sls_blizz_exp_result(enemy)
if JS_ENEMY_JOB_POINTS[enemy.id] != nil
job_points = JS_ENEMY_JOB_POINTS[enemy.id]
end
# iterate through all actors and pets
($BlizzABS.actors + $BlizzABS.pets).each {|b|
# increase JOB POINTS if actor is valid and actor can get EXP
if b.valid? && !b.battler.cant_get_exp?
b.js_get_job_points(job_points)
end
}
end
end
end

#==============================================================================
# ** Job System by Charlie Fleed
#
# Version: 0.2
# Author: Charlie Fleed
#==============================================================================
#==============================================================================
# ** CONFIGURATION
#==============================================================================
JS_ACTIVE_JOBS_DEFAULT = 1
JS_PASSIVE_JOBS_DEFAULT = 2
# class_id => [skill_id1, skill_id2]
JS_JOB_SKILLS = {
4 => [69,70,71,72],
5 => [73,74,75,76],
6 => [77,78,79,80],
7 => [1,2,3,4,5,6,53,54],
8 => [7,11,15,36,38,42,46,52]
}
# skill_id => cost
JS_SKILL_COSTS = {
1 => 1,
2 => 2,
3 => 3,
4 => 1,
5 => 2,
6 => 3,
7 => 4,
11 => 4,
15 => 4,
36 => 4,
38 => 4,
42 => 4,
46 => 4,
52 => 4,
53 => 4,
54 => 4,
69 => 2,
70 => 3,
71 => 4,
72 => 5,
73 => 2,
74 => 3,
75 => 4,
76 => 5,
77 => 2,
78 => 3,
79 => 4,
80 => 5
}
# skill_id => level_required
JS_SKILL_LEVEL_REQUIREMENTS = {
3 => 5,
6 => 5,
}
# skill_id => [required_skill_id1, required_skill_id2]
JS_SKILL_SKILLS_REQUIREMENTS = {
2 => [1],
5 => [4],
46 => [36,38,42]
}
# item_id => class_id
JS_ADD_JOB_ITEMS = {
33 => 7,
34 => 6,
35 => 8,
36 => 5,
37 => 4
}
# enemy_id => job_points
JS_ENEMY_JOB_POINTS = {
1 => 10
}
# Intergration with Charlie Fleed's CTB
REMOVED_ACTORS_JOB_POINTS_QUOTA = 0.5
TRANSFORMED_ACTORS_JOB_POINTS_QUOTA = 0.5
SWITCHED_ACTORS_JOB_POINTS_QUOTA = 0.5
#==============================================================================
# ** END OF CONFIGURATION
#==============================================================================
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :available_jobs
attr_accessor :active_jobs
attr_accessor :passive_jobs
attr_accessor :max_active_jobs
attr_accessor :max_passive_jobs
attr_accessor :job_points
attr_accessor :learned_skills
#--------------------------------------------------------------------------
# * Object Initialization
# actor_id : actor ID
#--------------------------------------------------------------------------
alias js_initialize initialize
def initialize(actor_id)
js_initialize(actor_id)
@available_jobs = []
@max_active_jobs = JS_ACTIVE_JOBS_DEFAULT
@max_passive_jobs = JS_PASSIVE_JOBS_DEFAULT
@active_jobs = []
@max_active_jobs.times do @active_jobs.push(nil) end
@passive_jobs = []
@max_passive_jobs.times do @passive_jobs.push(nil) end
@job_points = {}
@learned_skills = {}
end
#--------------------------------------------------------------------------
# *
#--------------------------------------------------------------------------
def add_available_job(job_id)
@available_jobs.push(job_id)
# initialize points and skills
@job_points[job_id] = 0
@learned_skills[job_id] = []
end
#--------------------------------------------------------------------------
# *
#--------------------------------------------------------------------------
def set_passive_job(job_id, position)
@passive_jobs[position] = job_id
return if job_id == nil
for skill_id in @learned_skills[job_id]
learn_skill(skill_id)
end
end
#--------------------------------------------------------------------------
# *
#--------------------------------------------------------------------------
def remove_passive_job(job_id, position)
return if job_id == nil
@passive_jobs[position] = nil
for skill_id in @learned_skills[job_id]
forget_skill(skill_id)
end
end
#--------------------------------------------------------------------------
# *
#--------------------------------------------------------------------------
def set_active_job(job_id, position)
@active_jobs[position] = job_id
return if job_id == nil
for skill_id in @learned_skills[job_id]
learn_skill(skill_id)
end
end
#--------------------------------------------------------------------------
# *
#--------------------------------------------------------------------------
def remove_active_job(job_id, position)
return if job_id == nil
@active_jobs[position] = nil
for skill_id in @learned_skills[job_id]
forget_skill(skill_id)
end
end
#--------------------------------------------------------------------------
# *
#--------------------------------------------------------------------------
def js_learn_skill(job_id, skill_id)
@learned_skills[job_id].push(skill_id)
learn_skill(skill_id)
end
#--------------------------------------------------------------------------
# *
#--------------------------------------------------------------------------
def js_learn_all_skills
for job_id in @active_jobs + @passive_jobs
next if job_id == nil
for skill_id in @learned_skills[job_id]
learn_skill(skill_id)
end
end
end
#--------------------------------------------------------------------------
# *
#--------------------------------------------------------------------------
def js_skill_learn?(skill_id)
result = false
for learned_skills in @learned_skills.values
if learned_skills.include?(skill_id)
return true
end
end
return false
end
#--------------------------------------------------------------------------
# *
#--------------------------------------------------------------------------
def js_can_learn?(skill_id, job_id)
if not @learned_skills[job_id].include?(skill_id)
if @job_points[job_id] >= JS_SKILL_COSTS[skill_id]
if JS_SKILL_SKILLS_REQUIREMENTS[skill_id] == nil or
(@learned_skills[job_id] &
JS_SKILL_SKILLS_REQUIREMENTS[skill_id]).size ==
JS_SKILL_SKILLS_REQUIREMENTS[skill_id].size
if JS_SKILL_LEVEL_REQUIREMENTS[skill_id] == nil or
@level >= JS_SKILL_LEVEL_REQUIREMENTS[skill_id]
return true
end
end
end
end
return false
end
#--------------------------------------------------------------------------
# *
#--------------------------------------------------------------------------
def js_get_job_points(value)
for i in 0 ... @max_active_jobs
next if @active_jobs[i] == nil
@job_points[@active_jobs[i]] += job_points
end
end
end
#==============================================================================
# ** Window_Job_Skills
#------------------------------------------------------------------------------
#
#==============================================================================
class Window_Job_Skills < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(320, 128, 320, 352)
@actor = actor
@job_id = nil
@column_max = 1
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Acquiring Skill
#--------------------------------------------------------------------------
def skill
return nil if @job_id == nil or self.index == -1
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
return if @job_id == nil
@data = []
for i in 0 ... JS_JOB_SKILLS[@job_id].size
skill = $data_skills[JS_JOB_SKILLS[@job_id][i]]
if skill != nil
@data.push(skill)
end
end
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
skill = @data[index]
if @actor.js_can_learn?(skill.id, @job_id)
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4
y = index * 32
rect = Rect.new(x, y, self.width - 32 - 4, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 32, y, 204, 32, skill.name, 0)
if @actor.js_skill_learn?(skill.id)
self.contents.draw_text(x + 236, y, 48, 32, "Aprendida", 2)
else
self.contents.draw_text(x + 236, y, 48, 32, JS_SKILL_COSTS[skill.id].to_s, 2)
end
end
#--------------------------------------------------------------------------
# * Help Text Update
#--------------------------------------------------------------------------
def job_id=(value)
if @job_id != value
@job_id = value
refresh
end
end
end
#==============================================================================
# ** Window_Jobs
#------------------------------------------------------------------------------
#
#==============================================================================
class Window_Jobs < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 128, 320, 128)
@actor = actor
@column_max = 1
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Acquiring job_id
#--------------------------------------------------------------------------
def job_id
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
self.contents = Bitmap.new(width - 32, (@actor.max_active_jobs +
@actor.max_passive_jobs) * 32)
for i in 0 ... @actor.max_active_jobs
x = 0
y = i * 32
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.font.color = system_color
self.contents.font.size = 16
self.contents.draw_text(4, y, 32, 32, "Atv:", 0)
self.contents.font.size = 24
if @actor.active_jobs[i] != nil
self.contents.font.color = normal_color
self.contents.draw_text(x + 36, y, 88, 32, $data_classes[@actor.active_jobs[i]].name, 2)
@data.push(@actor.active_jobs[i])
else
@data.push(nil)
end
end
for i in 0 ... @actor.max_passive_jobs
x = 0
y = (i + @actor.max_active_jobs) * 32
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.font.color = system_color
self.contents.font.size = 16
self.contents.draw_text(4, y, 32, 32, "Pass:", 0)
self.contents.font.size = 24
if @actor.passive_jobs[i] != nil
self.contents.font.color = normal_color
self.contents.draw_text(x + 36, y, 88, 32, $data_classes[@actor.passive_jobs[i]].name, 2)
@data.push(@actor.passive_jobs[i])
else
@data.push(nil)
end
end
@item_max = @data.size
end
end
#==============================================================================
# ** Window_Available_Jobs
#------------------------------------------------------------------------------
#
#==============================================================================
class Window_Available_Jobs < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 256, 320, 224)
@actor = actor
@column_max = 1
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Acquiring job_id
#--------------------------------------------------------------------------
def job_id
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...@actor.available_jobs.size
@data.push(@actor.available_jobs[i])
end
@data.push(nil)
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
job_id = @data[index]
return if job_id == nil
if @actor.active_jobs.include?(job_id) or @actor.passive_jobs.include?(job_id)
self.contents.font.color = disabled_color
else
self.contents.font.color = normal_color
end
x = 0
y = index * 32
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(x + 4, y, 200, 32, $data_classes[job_id].name, 0)
self.contents.draw_text(x + 204, y, 84, 32, @actor.job_points[job_id].to_s + " PD", 2)
end
end
#==============================================================================
# ** Window_Character_Info
#------------------------------------------------------------------------------
#
#==============================================================================
class Window_Character_Info < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 64, 640, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = nil
@job_id = nil
end
#--------------------------------------------------------------------------
# * Set Values
#--------------------------------------------------------------------------
def set_values(actor, job_id)
# If at least one value differs from last time
if @actor != actor or @job_id != job_id
@actor = actor
@job_id = job_id
refresh
end
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# Redraw text
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 160, 32, @actor.name)
return if @job_id == nil
self.contents.font.color = system_color
self.contents.draw_text(164, 0, 60, 32, "Disciplina:", 0)
self.contents.font.color = normal_color
self.contents.draw_text(224, 0, 100, 32, $data_classes[@job_id].name)
self.contents.font.color = system_color
self.contents.draw_text(324, 0, 60, 32, "PD:", 0)
self.contents.font.color = normal_color
self.contents.draw_text(384, 0, 60, 32, @actor.job_points[@job_id].to_s)
end
end
#==============================================================================
# ** Window_Skill_Info
#------------------------------------------------------------------------------
#
#==============================================================================
class Window_Skill_Info < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(640, 128, 320, 352)
self.contents = Bitmap.new(width - 32, height - 32)
@skill = nil
end
#--------------------------------------------------------------------------
# * Set Value
#--------------------------------------------------------------------------
def set_skill(skill)
# If the value differs from last time
if @skill != skill
@skill = skill
refresh
end
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# Redraw text
self.contents.clear
return if @skill == nil
x = 4
y = 0
self.contents.font.color = system_color
self.contents.draw_text(x, y, self.width - 40, 32, "Habilidade:")
y += 32
self.contents.font.color = normal_color
bitmap = RPG::Cache.icon(@skill.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.draw_text(x + 28, y, self.width - 32 -32, 32, @skill.name)
y += 32
self.contents.font.color = system_color
self.contents.draw_text(x, y, self.width - 40, 32, "Nível Necessário:")
self.contents.font.color = normal_color
y += 32
if JS_SKILL_LEVEL_REQUIREMENTS[@skill.id] != nil
self.contents.draw_text(x, y, self.width - 40, 32,
JS_SKILL_LEVEL_REQUIREMENTS[@skill.id].to_s)
end
y += 32
self.contents.font.color = system_color
self.contents.draw_text(x, y, self.width - 40, 32, "Habilidades Necessárias:")
self.contents.font.color = normal_color
y += 32
if JS_SKILL_SKILLS_REQUIREMENTS[@skill.id] != nil
for i in 0 ... JS_SKILL_SKILLS_REQUIREMENTS[@skill.id].size
req_skill = $data_skills[JS_SKILL_SKILLS_REQUIREMENTS[@skill.id][i]]
bitmap = RPG::Cache.icon(req_skill.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.draw_text(x + 28, y, self.width - 32 -32, 32, req_skill.name)
y += 32
end
end
end
end
#==============================================================================
# ** Scene_Jobs
#------------------------------------------------------------------------------
#
#==============================================================================
class Scene_Jobs
#--------------------------------------------------------------------------
# * Object Initialization
# actor_index : actor index
#--------------------------------------------------------------------------
def initialize(actor_index = 0)
@actor_index = actor_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Get actor
@actor = $game_party.actors[@actor_index]
# Make windows
@help_window = Window_Help.new
@character_info_window = Window_Character_Info.new
@jobs_window = Window_Jobs.new(@actor)
@available_jobs_window = Window_Available_Jobs.new(@actor)
@job_skills_window = Window_Job_Skills.new(@actor)
@skill_info_window = Window_Skill_Info.new
@jobs_window.title = "Disciplinas Atuais"
@jobs_window.refresh_title
@available_jobs_window.title = "Disciplinas Disponiveis"
@available_jobs_window.refresh_title
@job_skills_window.title = "Habilidades de Disciplina"
@job_skills_window.refresh_title
@skill_info_window.title = "Informação de Habilidades"
@skill_info_window.refresh_title
if $game_party.actors.size > 1
@character_info_window.title = "<< Q W >>"
@character_info_window.refresh_title
end
@last_window = nil
@learning = false
# windows positions
@jobs_window_x = 0
@available_jobs_window_x = 0
@job_skills_window_x = 320
@skill_info_window_x = 640
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@help_window.dispose
@character_info_window.dispose
@jobs_window.dispose
@available_jobs_window.dispose
@job_skills_window.dispose
@skill_info_window.dispose
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@jobs_window.refresh
@available_jobs_window.refresh
@job_skills_window.refresh
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
# move windows
@jobs_window.x -= 16 if @jobs_window.x > @jobs_window_x
@jobs_window.x += 16 if @jobs_window.x < @jobs_window_x
@available_jobs_window.x -= 16 if @available_jobs_window.x > @available_jobs_window_x
@available_jobs_window.x += 16 if @available_jobs_window.x < @available_jobs_window_x
@job_skills_window.x -= 16 if @job_skills_window.x > @job_skills_window_x
@job_skills_window.x += 16 if @job_skills_window.x < @job_skills_window_x
@skill_info_window.x -= 16 if @skill_info_window.x > @skill_info_window_x
@skill_info_window.x += 16 if @skill_info_window.x < @skill_info_window_x
@available_jobs_window.update
@job_skills_window.update
@skill_info_window.set_skill(@job_skills_window.skill)
if @jobs_window.active
# If R button was pressed
if Input.trigger?(Input::R)
# Play decision SE
$game_system.se_play($data_system.decision_se)
@actor_index = (@actor_index + 1) % $game_party.actors.size
$scene = Scene_Jobs.new(@actor_index)
return
end
# If L button was pressed
if Input.trigger?(Input::L)
# Play decision SE
$game_system.se_play($data_system.decision_se)
@actor_index = (@actor_index - 1) % $game_party.actors.size
$scene = Scene_Jobs.new(@actor_index)
return
end
@jobs_window.update
update_jobs
return
end
if @available_jobs_window.active
update_available_jobs
return
end
if @job_skills_window.active
update_job_skills
return
end
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update_jobs
@job_skills_window.job_id = @jobs_window.job_id
@character_info_window.set_values(@actor, @jobs_window.job_id)
@help_window.set_text("Aperte o botão de confirmação para selecionar Disciplinas, seta direita para aprender Habilidades.")
# If C button was pressed
if Input.trigger?(Input::C)
@jobs_window.active = false
@available_jobs_window.active = true
@available_jobs_window.index = 0
return
end
# If SHIFT button was pressed
if Input.trigger?(Input::SHIFT)
@jobs_window.active = false
@available_jobs_window.active = true
@available_jobs_window.index = 0
@learning = true
return
end
# If Right button was pressed
if Input.trigger?(Input::RIGHT)
return if @jobs_window.job_id == nil
@last_window = @jobs_window
@jobs_window.active = false
@job_skills_window.active = true
@job_skills_window.index = 0
# Set windows movement
@jobs_window_x = -320
@available_jobs_window_x = -320
@job_skills_window_x = 0
@skill_info_window_x = 320
return
end
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to map screen
$scene = Scene_Map.new
return
end
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update_available_jobs
@character_info_window.set_values(@actor, @available_jobs_window.job_id)
@job_skills_window.job_id = @available_jobs_window.job_id
if @learning
@help_window.set_text("Pressione seta direita para aprender Habilidades")
else
@help_window.set_text("Pressione o botão de confirmação para selecionar Disciplina, seta direita para aprender Habilidades.")
end
# If B button was pressed
if Input.trigger?(Input::B)
@jobs_window.active = true
@available_jobs_window.active = false
@available_jobs_window.index = -1
@learning = false
end
# If Right button was pressed
if Input.trigger?(Input::RIGHT)
return if @available_jobs_window.job_id == nil
@last_window = @available_jobs_window
@available_jobs_window.active = false
@job_skills_window.active = true
@job_skills_window.index = 0
# Set windows movement
@jobs_window_x = -320
@available_jobs_window_x = -320
@job_skills_window_x = 0
@skill_info_window_x = 320
return
end
unless @learning
# If C button was pressed
if Input.trigger?(Input::C)
if @jobs_window.index < @actor.max_active_jobs
job_id = @actor.active_jobs[@jobs_window.index]
# Remove the current active job
@actor.remove_active_job(job_id, @jobs_window.index)
# Remove if active job
for i in 0 ... @actor.active_jobs.size
if @actor.active_jobs[i] == @available_jobs_window.job_id
@actor.remove_active_job(@available_jobs_window.job_id, i)
end
end
# Remove if passive job
for i in 0 ... @actor.passive_jobs.size
if @actor.passive_jobs[i] == @available_jobs_window.job_id
@actor.remove_passive_job(@available_jobs_window.job_id, i)
end
end
@actor.set_active_job(@available_jobs_window.job_id, @jobs_window.index)
# Needed for skills in more than one job
@actor.js_learn_all_skills
else
job_id = @actor.passive_jobs[@jobs_window.index - @actor.max_active_jobs]
# Remove the current passive job
@actor.remove_passive_job(job_id,
@jobs_window.index - @actor.max_active_jobs)
# Remove if active job
for i in 0 ... @actor.active_jobs.size
if @actor.active_jobs[i] == @available_jobs_window.job_id
@actor.remove_active_job(@available_jobs_window.job_id, i)
end
end
# Remove if passive job
for i in 0 ... @actor.passive_jobs.size
if @actor.passive_jobs[i] == @available_jobs_window.job_id
@actor.remove_passive_job(@available_jobs_window.job_id, i)
end
end
@actor.set_passive_job(@available_jobs_window.job_id,
@jobs_window.index - @actor.max_active_jobs)
# Needed for skills in more than one job
@actor.js_learn_all_skills
end
@available_jobs_window.refresh
@jobs_window.refresh
@jobs_window.active = true
@character_info_window.set_values(@actor, @available_jobs_window.job_id)
@available_jobs_window.active = false
@available_jobs_window.index = -1
# Play equip SE
$game_system.se_play($data_system.equip_se)
return
end
end
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update_job_skills
@help_window.set_text(@job_skills_window.skill.description)
# If B button was pressed
if Input.trigger?(Input::B) or Input.trigger?(Input::LEFT)
@last_window.active = true
@job_skills_window.active = false
@job_skills_window.index = -1
# Set windows movement
@jobs_window_x = 0
@available_jobs_window_x = 0
@job_skills_window_x = 320
@skill_info_window_x = 640
return
end
# If C button was pressed
if Input.trigger?(Input::C)
skill = @job_skills_window.skill
if @actor.js_can_learn?(skill.id, @last_window.job_id)
# Play decision SE
$game_system.se_play($data_system.decision_se)
@actor.js_learn_skill(@last_window.job_id, skill.id)
@actor.job_points[@last_window.job_id] -= JS_SKILL_COSTS[skill.id]
@job_skills_window.refresh
@available_jobs_window.refresh
@character_info_window.refresh
return
end
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias update_js update
def update
update_js
# If waiting
if @wait_count > 0
# Decrease wait count
@wait_count -= 1
return
end
case @phase
when 5.1 # after battle phase job points
update_phase5_1
end
end
#--------------------------------------------------------------------------
# * Start After Battle Phase
#--------------------------------------------------------------------------
alias start_phase5_js start_phase5
def start_phase5
# Make windows
@job_points_window = Window_Job_Points.new
job_points = 0
# Loop
for enemy in $game_troop.enemies
# If enemy is not hidden
unless enemy.hidden
# Add EXP
if JS_ENEMY_JOB_POINTS[enemy.id] != nil
job_points += JS_ENEMY_JOB_POINTS[enemy.id]
else
job_points += enemy.exp
end
end
end
# Obtaining JOB POINTS
# This is processed BEFORE return party in Charlie Fleed's CTB
@actors_to_check = []
if $charlie_lee_ctb !=nil # DETECTS Charlie Fleed's CTB
# Actors removed for summon
for a in $game_party.removed_actors
@actors_to_check.push(a)
end
# Original form of transformed actors
for a in $game_party.transformed_actors
@actors_to_check.push(a)
end
# Actors in the backup party
for a in $game_party.backup_actors
@actors_to_check.push(a)
end
end
for a in $game_party.actors
@actors_to_check.push(a)
end
job_points_base = job_points
for actor in @actors_to_check
job_points = job_points_base
if actor.cant_get_exp? == false
if $charlie_lee_ctb !=nil # DETECTS CHARLIE FLEED'S CTB
# Actors removed for summon
if $game_party.removed_actors.include?(actor)
job_points = Integer(job_points_base * REMOVED_ACTORS_JOB_POINTS_QUOTA)
end
# Original form of transformed actors
if $game_party.transformed_actors.include?(actor)
if $game_party.removed_actors.include?($game_actors[actor.transformed_form_id])
job_points = Integer(job_points_base * TRANSFORMED_ACTORS_JOB_POINTS_QUOTA * REMOVED_ACTORS_LEARNING_EXP_QUOTA)
elsif $game_party.backup_actors.include?($game_actors[actor.transformed_form_id])
job_points = Integer(job_points_base * TRANSFORMED_ACTORS_JOB_POINTS_QUOTA * SWITCHED_ACTORS_LEARNING_EXP_QUOTA)
else
job_points = Integer(job_points_base * TRANSFORMED_ACTORS_JOB_POINTS_QUOTA)
end
end
# Actors in the backup party
if $game_party.backup_actors.include?(actor)
job_points = Integer(job_points_base * SWITCHED_ACTORS_JOB_POINTS_QUOTA)
end
end
for i in 0 ... actor.max_active_jobs
next if actor.active_jobs[i] == nil
actor.job_points[actor.active_jobs[i]] += job_points
@job_points_window.entries.push(actor.name + " earned " +
job_points.to_s + " JPs for the job " + $data_classes[actor.active_jobs[i]].name)
end
end
end
if not @job_points_window.entries.empty?
@job_points_window.index = 0
end
# Original call
start_phase5_js
end
#--------------------------------------------------------------------------
# * Frame Update (after battle phase)
#--------------------------------------------------------------------------
alias update_phase5_js update_phase5
def update_phase5
# If wait count is larger than 0
if @phase5_wait_count > 0
update_phase5_js
else
# If C button was pressed
if Input.trigger?(Input::C)
if not @job_points_window.entries.empty?
@job_points_window.visible = true
@job_points_window.refresh
@job_points_window.active = true
@result_window.visible = false
if $charlie_lee_ctb != nil and $charlie_lee_ctb_version != nil and $charlie_lee_ctb_version >= 2.11
@result_window2.visible = false
end
@phase = 5.1
@wait_count = 16
else
# Dispose job_points window
@job_points_window.dispose
battle_end(0)
end
end
end
end
#--------------------------------------------------------------------------
# * Frame Update (after battle phase - JOB POINTS WINDOW)
#--------------------------------------------------------------------------
def update_phase5_1
# Update job points window
@job_points_window.update
# If C button was pressed
if Input.trigger?(Input::C)
# Dispose job points window
@job_points_window.dispose
battle_end(0)
return
end
end
end
#==============================================================================
# ** Window_Job_Points
#------------------------------------------------------------------------------
#
#==============================================================================
class Window_Job_Points < Window_Selectable
#--------------------------------------------------------------------------
# *
#--------------------------------------------------------------------------
attr_accessor :entries
#--------------------------------------------------------------------------
# *
#--------------------------------------------------------------------------
def initialize()
@entries = []
super(80, 0, 480, @entries.size * 32 + 32)
self.active = false
self.opacity = 160
self.back_opacity = 255
self.contents_opacity = 255
self.z = 203
self.visible = false
end
#--------------------------------------------------------------------------
# *
#--------------------------------------------------------------------------
def refresh
self.height = [@entries.size * 32 + 32, 192].min
@item_max = @entries.size
self.y = 160 - height / 2
self.contents = Bitmap.new(width - 32, @item_max * 32)
self.contents.clear
x = 4
y = 4
for entry in @entries
self.contents.draw_text(x, y, self.width - 40, 32, entry)
y += 32
end
end
end
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# This class deals with battlers. It's used as a superclass for the Game_Actor
# and Game_Enemy classes.
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Application of Item Effects
# item : item
#--------------------------------------------------------------------------
alias item_effect_js item_effect
def item_effect(item)
if JS_ADD_JOB_ITEMS[item.id] != nil
if @available_jobs.include?(JS_ADD_JOB_ITEMS[item.id])
return false
else
add_available_job(JS_ADD_JOB_ITEMS[item.id])
return true
end
else
return item_effect_js(item)
end
end
end
#==============================================================================
# ** Window_Available_Jobs
#------------------------------------------------------------------------------
#
#==============================================================================
class Window_Jobs_2 < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 64, 304, 224)
@actor = nil
@column_max = 1
self.active = false
self.index = -1
self.visible = false
self.z = 9999
end
#--------------------------------------------------------------------------
# * Set Actor
#--------------------------------------------------------------------------
def set_actor(actor)
if @actor != actor
@actor = actor
refresh
end
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...@actor.available_jobs.size
@data.push(@actor.available_jobs[i])
end
@data.push(nil)
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
job_id = @data[index]
return if job_id == nil
x = 0
y = index * 32
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(x + 4, y, 90, 32, $data_classes[job_id].name, 0)
end
end
#==============================================================================
# ** Scene Item
#------------------------------------------------------------------------------
#==============================================================================
class Scene_Item
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
alias js_main main
def main
@jobs_window = Window_Jobs_2.new
@jobs_window.title = "Disciplinas Disponiveis"
@jobs_window.refresh_title
# Original call
js_main
@jobs_window.dispose
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
alias js_update update
def update
if @target_window.active and @target_window.index >= 0
@jobs_window.set_actor($game_party.actors[@target_window.index])
if @target_window.x == 0
@jobs_window.x = 336
else
@jobs_window.x = 0
end
@jobs_window.visible = true
else
@jobs_window.visible = false
end
# Original call
js_update
end
#--------------------------------------------------------------------------
# * Update Target
#--------------------------------------------------------------------------
alias js_update_target update_target
def update_target
# Original call
js_update_target
if Input.trigger?(Input::C)
@jobs_window.refresh
end
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# TITLE SUPPORT
#--------------------------------------------------------------------------
attr_accessor :title
alias title_initialize initialize
def initialize(x, y, width, height)
# Title support
@title = ""
@title_sprite = Sprite.new
@title_sprite.x = x + 4
@title_sprite.y = y + 2
@title_sprite.bitmap = Bitmap.new([1, width - 8].max, 16)
@title_sprite.bitmap.font.size = 16
@title_sprite.bitmap.font.bold = true
title_initialize(x, y, width, height)
end
def x=(value)
super
@title_sprite.x = self.x + 4
end
def y=(value)
super
@title_sprite.y = self.y
end
def z=(value)
super
@title_sprite.z = self.z + 2
end
def visible=(value)
super
@title_sprite.visible = value
end
alias title_dispose dispose
def dispose
title_dispose
@title_sprite.bitmap.dispose
@title_sprite.dispose
end
def refresh_title
@title_sprite.x = x + 4
@title_sprite.y = y + 2
@title_sprite.bitmap.clear
@title_sprite.bitmap.font.color = system_color
@title_sprite.bitmap.draw_text(@title_sprite.bitmap.rect, @title)
end
end
class Processor
alias sls_blizz_exp_result exp_result
def exp_result(enemy)
job_points = sls_blizz_exp_result(enemy)
if JS_ENEMY_JOB_POINTS[enemy.id] != nil
job_points = JS_ENEMY_JOB_POINTS[enemy.id]
end
# iterate through all actors and pets
($BlizzABS.actors + $BlizzABS.pets).each {|b|
# increase JOB POINTS if actor is valid and actor can get EXP
if b.valid? && !b.battler.cant_get_exp?
b.js_get_job_points(job_points)
end
}
end
endQuote from: Probe on August 07, 2010, 02:40:21 am
Some asked a similar question a long time ago. Here's what Blizz had to say:Quote from: Blizzard on November 16, 2009, 04:14:40 am
What's the error message?
@Rose:
A. Either use Health Bars or get a special script. I think somebody has made one already.
B. I already said that most scripts of that type won't work with Blizz-ABS. You need versions that do.
Quote from: winkio on July 10, 2010, 07:59:08 pm
Blizz-ABS already has that support for attacking, skill use, etc. It will be fully implemented for all graphics in version 3.0.
#==============================================================================
# 移動パターン増加 Ver 1.00
# 配布元・サポートURL
# By COGHWELL
# http://members.jcom.home.ne.jp/cogwheel/
#==============================================================================
# O script permite que a imagem do character tenha mais
# que 4 frames.
#
# Para definir a quantidade de frames basta definir o nome
# da imagem da seguinte forma.
#
# Hero[X],png
#
# No lugar do X coloque a quantidade de frames desejada
#==============================================================================
#==============================================================================
# ■ Game_Character (分割定義 2)
#------------------------------------------------------------------------------
# キャラクターを扱うクラスです。このクラスは Game_Player クラスと Game_Event
# クラスのスーパークラスとして使用されます。
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
# ジャンプ中、移動中、停止中で分岐
if jumping?
update_jump
elsif moving?
update_move
else
update_stop
end
# アニメカウントが最大値を超えた場合
# ※最大値は、基本値 18 から移動速度 * 1 を引いた値
# ファイル名に[n]が入っている場合、通常の(n-1)/4の速度でパターン更新
if @character_name[/\[(\d+)\]/]
@anime_count = 20 if @anime_count > 0 and @pattern == @original_pattern
if @anime_count * ($1.to_i - 1) / 4 > 18 - @move_speed * 2
# 停止時アニメが OFF かつ 停止中の場合
if not @step_anime and @stop_count > 0
# パターンをオリジナルに戻す
@pattern = @original_pattern
# 停止時アニメが ON または 移動中の場合
else
# パターンを更新
@pattern = @pattern % ($1.to_i - 1) + 1
end
# アニメカウントをクリア
@anime_count = 0
end
else
# 通常キャラのパターン更新処理(デフォルトの処理をコピペしただけ)
if @anime_count > 18 - @move_speed * 2
# 停止時アニメが OFF かつ 停止中の場合
if not @step_anime and @stop_count > 0
# パターンをオリジナルに戻す
@pattern = @original_pattern
# 停止時アニメが ON または 移動中の場合
else
# パターンを更新
@pattern = (@pattern + 1) % 4
end
# アニメカウントをクリア
@anime_count = 0
end
end
# ウェイト中の場合
if @wait_count > 0
# ウェイトカウントを減らす
@wait_count -= 1
return
end
# 移動ルート強制中の場合
if @move_route_forcing
# カスタム移動
move_type_custom
return
end
# イベント実行待機中またはロック状態の場合
if @starting or lock?
# 自律移動はしない
return
end
# 停止カウントが一定の値 (移動頻度から算出) を超えた場合
if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
# 移動タイプで分岐
case @move_type
when 1 # ランダム
move_type_random
when 2 # 近づく
move_type_toward_player
when 3 # カスタム
move_type_custom
end
end
end
end
#==============================================================================
# ■ Sprite_Character
#------------------------------------------------------------------------------
# キャラクター表示用のスプライトです。Game_Character クラスのインスタンスを
# 監視し、スプライトの状態を自動的に変化させます。
#==============================================================================
class Sprite_Character < RPG::Sprite
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
# タイル ID、ファイル名、色相のどれかが現在のものと異なる場合
if @tile_id != @character.tile_id or
@character_name != @character.character_name or
@character_hue != @character.character_hue
# タイル ID とファイル名、色相を記憶
@tile_id = @character.tile_id
@character_name = @character.character_name
@character_hue = @character.character_hue
# タイル ID が有効な値の場合
if @tile_id >= 384
self.bitmap = RPG::Cache.tile($game_map.tileset_name,
@tile_id, @character.character_hue)
self.src_rect.set(0, 0, 32, 32)
self.ox = 16
self.oy = 32
# タイル ID が無効な値の場合
else
self.bitmap = RPG::Cache.character(@character.character_name,
@character.character_hue)
# ファイル名に[n]が入っている場合、パターン数を横:n, 縦:4とみなす
if @character.character_name[/\[(\d+)\]/]
@cw = bitmap.width / $1.to_i
@ch = bitmap.height / 4
# ファイル名に[D]が入っていない場合、通常通り横:4, 縦:4とする
else
@cw = bitmap.width / 4
@ch = bitmap.height / 4
end
self.ox = @cw / 2
self.oy = @ch
end
end
# 可視状態を設定
self.visible = (not @character.transparent)
# グラフィックがキャラクターの場合
if @tile_id == 0
# 転送元の矩形を設定
sx = @character.pattern * @cw
sy = (@character.direction - 2) / 2 * @ch
self.src_rect.set(sx, sy, @cw, @ch)
end
# スプライトの座標を設定
self.x = @character.screen_x
self.y = @character.screen_y
self.z = @character.screen_z(@ch)
# 不透明度、合成方法、茂み深さを設定
self.opacity = @character.opacity
self.blend_type = @character.blend_type
self.bush_depth = @character.bush_depth
# アニメーション
if @character.animation_id != 0
animation = $data_animations[@character.animation_id]
animation(animation, true)
@character.animation_id = 0
end
end
end
# ついでにメニュー画面でパターンが多いグラフィックを使用した場合の表記変更
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# ゲーム中のすべてのウィンドウのスーパークラスです。
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● グラフィックの描画
# actor : アクター
# x : 描画先 X 座標
# y : 描画先 Y 座標
#--------------------------------------------------------------------------
def draw_actor_graphic(actor, x, y)
bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
if actor.character_name[/\[(\d+)\]/]
cw = bitmap.width / $1.to_i
ch = bitmap.height / 4
else
cw = bitmap.width / 4
ch = bitmap.height / 4
end
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
end
#==============================================================================
# ■ Window_SaveFile
#------------------------------------------------------------------------------
# セーブ画面およびロード画面で表示する、セーブファイルのウィンドウです。
#==============================================================================
class Window_SaveFile < Window_Base
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# ファイル番号を描画
self.contents.font.color = normal_color
name = "File #{@file_index + 1}"
self.contents.draw_text(4, 0, 600, 32, name)
@name_width = contents.text_size(name).width
# セーブファイルが存在する場合
if @file_exist
# キャラクターを描画
for i in 0...@characters.size
bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
if @characters[i][0][/\[(\d+)\]/]
cw = bitmap.width / $1.to_i
ch = bitmap.height / 4
else
cw = bitmap.width / 4
ch = bitmap.height / 4
end
src_rect = Rect.new(0, 0, cw, ch)
x = 300 - @characters.size * 32 + i * 64 - cw / 2
self.contents.blt(x, 68 - ch, bitmap, src_rect)
end
# プレイ時間を描画
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.color = normal_color
self.contents.draw_text(4, 8, 600, 32, time_string, 2)
# タイムスタンプを描画
self.contents.font.color = normal_color
time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
self.contents.draw_text(4, 40, 600, 32, time_string, 2)
end
end
end
#==============================================================================
# ■ Game_Player
#------------------------------------------------------------------------------
# プレイヤーを扱うクラスです。イベントの起動判定や、マップのスクロールなどの
# 機能を持っています。このクラスのインスタンスは $game_player で参照されます。
#==============================================================================
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# ● アニメーションアップデート
#--------------------------------------------------------------------------
def anime_update
# アニメカウントが最大値を超えた場合
# ※最大値は、基本値 18 から移動速度 * 1 を引いた値
# ファイル名に[n]が入っている場合、通常の(n-1)/4の速度でパターン更新
if @character_name[/\[(\d+)\]/]
@anime_count = 20 if @anime_count > 0 and @pattern == @original_pattern
if @anime_count * ($1.to_i - 1) / 4 > 18 - @move_speed * 2
# 停止時アニメが OFF かつ 停止中の場合
if not @step_anime and @stop_count > 0
# パターンをオリジナルに戻す
@pattern = @original_pattern
# 停止時アニメが ON または 移動中の場合
else
# パターンを更新
@pattern = @pattern % ($1.to_i - 1) + 1
end
# アニメカウントをクリア
@anime_count = 0
end
else
# 通常キャラのパターン更新処理(デフォルトの処理をコピペしただけ)
if @anime_count > 18 - @move_speed * 2
# 停止時アニメが OFF かつ 停止中の場合
if not @step_anime and @stop_count > 0
# パターンをオリジナルに戻す
@pattern = @original_pattern
# 停止時アニメが ON または 移動中の場合
else
# パターンを更新
@pattern = (@pattern + 1) % 4
end
# アニメカウントをクリア
@anime_count = 0
end
end
end
end
Quote from: Lobstrosity on June 11, 2010, 06:28:44 amQuoteI forget what system that FF2 used, is that the same as FFV. Some of all that American/Japanese version number differences gets confusing. If it is the type kinda like FF Tactics, I was thinking of creating something like that.
Like jragyn00 said, it is a interesting levelling up system where your magic has a level (1, 2, 3, ect) and once it reaches a certain level, its power will stop. oOEvilmanaOo, were you just looking for a script where the magic levels up? Or are you looking for one completely like FF2, where your skills improve depending on which weapon you're using, including your base stats? (Like your strength increasing whenever you attack and your defense improving when you are attacked)
Quote from: WhiteRose on June 07, 2010, 02:22:35 pm
http://forum.chaos-project.com/index.php?topic=122.0

)
Quote from: WhiteRose on April 20, 2010, 05:20:18 pmQuote from: oOEvilmanaOo on April 20, 2010, 03:35:19 pm
actually i didn't made the character, i just found it
*Facepalms at own stupidity for not reading your post more thoroughly*
NAMKCOR is the best pixel artist around here, but I think he's been pretty busy. Still, someone will come take at look at it for you sooner or later.
Slightly off-topic: Someone should make a template for Blizz-ABS actions sprites; it would make this kind of thing easier for everyone, and we'd have less requests as even people who aren't really spriters would be able to just follow the template.
. And i think too that the template would help.