Alright, here's a modified version of his script.
#===============================================================================
# Skill Categories
# Version 1.3
# Author gameus
#-------------------------------------------------------------------------------
# Intro:
# Adds Skill Categories to the Default Battle System. For every Skill Category
# your actor gets a new command, assuming they know skills from that category.
# Actors also get their default "Skill" command.
#
# Features:
# -Adds new battle commands for each category
# -Separates all skills from every other category/normal category
# -All skills still display in the normal Skill Scene
# -Have as many categories as you want
#
# Version History:
# 1.3 - Added compatibility with Chaos Rage Limit System by Blizzard
# 1.2 - Fixed small bug with Easy Overdrive System by Blizzard
# 1.1 - Added compatibility with Easy Overdrive System by Blizzard
# 1.0 - Initial Release
#
# Instructions:
# Jump down to the configuration, here's where you will define your Skill
# Categories.
# SKILL_SETS = {
# "Rank 1" => 17,
# "Rank 2" => 18,
# "Rank 3" => 19,
# }
# To add a new category, add a new line under the last category and follow
# the template:
# "Category Name" => Element_Id,
# Name it whatever, and make sure to give it an unused element id.
#
# To add skills to these categories, you have to add these elements to the
# skills. Say you wanted Skills 1, 2, 3 to be under the category with the
# element id of 17, these three skills need to have element id 17 in order
# to be considered in that category.
#
# Compatibility:
# -Not tested with anything other than the default battle system.
# -Will not work with Skill Separation add-on from Tons of Add-ons by Blizzard
# But this script would be useless if you were to use it.
# -Will work with Battle Memory Commands by gameus
# -Will not work properly with Battle Icons by Juan, however, other scripts
# that add similar functionality should work depending on the naming
# conventions that are required.
# -Not tested with SDK (Probably won't work)
# -Works perfectly with Easy Overdrive System by Blizzard. Place this script
# below his.
# -If you run into any other scripts that don't work with it, just post it in
# the topic and I'll try to look at it.
# -Works with Unique Skill Commands by Blizzard.
# -Works with Chaos Rage Limit System by Blizzard, make sure you place this
# script below it.
#
# Credits:
# gameus ~ For creating it
# MarkHest ~ For requesting it and testing it
#===============================================================================
module Gameus
SKILL_SETS = {
"White Magic" => 17,
"Black Magic" => 18,
"Rank 3" => 19,
}
def self.skill_help(category)
case category
when "White Magic" then 'Defensive magic that heals and protects allies'
when "Black Magic" then 'Offensive magic that damages enemies'
when "Rank 3" then 'High level magic'
else
'Abilities unique to that of the actor'
end
end
end
$gg_skill_categories = 1.3
#-------------------------------------------------------------------------------
# Scene_Battle
#-------------------------------------------------------------------------------
class Scene_Battle
alias gg_phase3_setup_command_lat phase3_setup_command_window
def phase3_setup_command_window
gg_phase3_setup_command_lat
@actor_command_window.new_items(@active_battler.generate_commands)
end
alias gg_cats_update_phase3_basic_command update_phase3_basic_command
def update_phase3_basic_command
if $crls != nil && $crls >= 6.2
battler = (BlizzCFG::RTAB_ACTIVE ? @active_actor : @active_battler)
restore_commands(battler)
return if update_sls_input(battler)
return if update_srs_input(battler)
return if update_cds_input(battler)
end
if $easy_overdrive != nil && $easy_overdrive >= 2.21
battler = (BlizzCFG::RTAB_ACTIVE ? @active_actor : @active_battler)
restore_commands(battler)
return if update_overdrive_input(battler)
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
phase3_prior_actor
return
end
if Input.trigger?(Input::C)
case @actor_command_window.index
when 0
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 0
start_enemy_select
when 1..@actor_command_window.commands.size - 3
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 1
start_skill_select
when @actor_command_window.commands.size - 2
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 0
@active_battler.current_action.basic = 1
phase3_next_actor
when @actor_command_window.commands.size - 1
$game_system.se_play($data_system.decision_se)
@active_battler.current_action.kind = 2
start_item_select
end
return
end
end
alias gg_cats_start_skill_select start_skill_select
def start_skill_select
gg_cats_start_skill_select
index = @actor_command_window.index
@skill_window.index = 0
@skill_window.refresh(@actor_command_window.commands[index]) if index > 1
end
end
#-------------------------------------------------------------------------------
# Game_Actor
#-------------------------------------------------------------------------------
class Game_Actor < Game_Battler
def generate_commands
s1, s2 = $data_system.words.attack, $data_system.words.skill
s3, s4 = $data_system.words.guard, $data_system.words.item
si = []
Gameus::SKILL_SETS.each_key {|key|
skills = @skills.find_all {|id|
$data_skills[id].element_set.include?(Gameus::SKILL_SETS[key])}
si.push(key) if skills != []}
return [s1, s2] + si + [s3, s4]
end
end
#-------------------------------------------------------------------------------
# Window_Command
#-------------------------------------------------------------------------------
class Window_Command < Window_Selectable
attr_accessor :commands
def new_items(commands)
self.contents.dispose if self.contents != nil
self.contents = nil
@item_max = commands.size
@commands = commands
self.contents = Bitmap.new(width - 32, @item_max * 32)
refresh
end
if $crls != nil && $crls >= 6.2
alias gg_refresh_skill_cats_lat refresh
def refresh
for i in 0...@item_max
draw_item(i, normal_color)
end
gg_refresh_skill_cats_lat
end
end
end
#-------------------------------------------------------------------------------
# Window_Skill
#-------------------------------------------------------------------------------
class Window_Skill < Window_Selectable
alias gg_cats_refresh_skill_window_lat refresh
def refresh(category = "")
=begin
if !$scene.is_a?(Scene_Battle)
gg_cats_refresh_skill_window_lat
return
end
=end
if self.contents != nil
self.contents.dispose
self.contents = nil
end
rank = category == "" ? nil : Gameus::SKILL_SETS[category]
@data = []
@actor.skills.each {|id|
skill = $data_skills[id]
if skill != nil
if rank == nil
flag = true
Gameus::SKILL_SETS.each_value {|element|
flag = false if skill.element_set.include?(element)}
@data.push(skill) if flag
else
@data.push(skill) if skill.element_set.include?(rank)
end
end}
@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
end
#==============================================================================
# Window Horizontal Command
# Created By SephirothSpawn (11.03.05)
# Last Updated: 11.03.05
#==============================================================================
class Window_HorizCommand < Window_Selectable
attr_reader :commands
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(commands, width = 640, height = 64)
super(0, 0, width, height)
add_width = [commands.size-4, 0].max * 152
self.contents = Bitmap.new(width + add_width - 32, height - 32)
@commands = commands
@item_max = @commands.size
@column_max = @commands.size
refresh
self.index = 0
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
width = self.width - 32
off = (self.contents.width) / @item_max
x = 4 + index * off
self.contents.draw_text(x, 0, off - 32, 32, @commands[index])
end
#--------------------------------------------------------------------------
# * Disable Item
# index : item number
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index, disabled_color)
end
#--------------------------------------------------------------------------
# * Update Cursor Rectangle
#--------------------------------------------------------------------------
def update_cursor_rect
# If cursor position is less than 0
if @index < 0
self.cursor_rect.empty
return
end
# Get current row
row = @index / @column_max
# If current row is before top row
if row < self.top_row
# Scroll so that current row becomes top row
self.top_row = row
end
# If current row is more to back than back row
if row > self.top_row + (self.page_row_max - 1)
# Scroll so that current row becomes back row
self.top_row = row - (self.page_row_max - 1)
end
# Calculate cursor width
cursor_width = self.contents.width / @column_max - 32
# Calculate cursor coordinates
left_column = self.ox / 152
if @index < left_column
self.ox -= 152
elsif @index > left_column + 3
self.ox += 152
end
puts self.ox
x = @index % @column_max * (cursor_width + 32) - self.ox
y = @index / @column_max * 32 - self.oy
# Update cursor rectangle
self.cursor_rect.set(x, y, cursor_width, 32)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
last_index = @index
super
if self.active and @item_max > 0 and @index >= 0
# If the right directional button was pressed
if Input.trigger?(Input::RIGHT) && @index == @item_max - 1 && last_index == @item_max - 1
# Move cursor right
$game_system.se_play($data_system.cursor_se)
@index = 0
self.ox = 0
elsif Input.trigger?(Input::LEFT) && @index == 0 && last_index == 0
# Move cursor left
$game_system.se_play($data_system.cursor_se)
@index = @item_max - 1
if @index > 4
self.ox = 152 * (@index - 3)
end
end
end
end
def update_help
@help_window.set_text(Gameus.skill_help(@commands[self.index]))
end
end
#==============================================================================
# ** Scene_Skill
#------------------------------------------------------------------------------
# This class performs skill screen processing.
#==============================================================================
class Scene_Skill
#--------------------------------------------------------------------------
# * Object Initialization
# actor_index : actor index
#--------------------------------------------------------------------------
def initialize(actor_index = 0, equip_index = 0)
@actor_index = actor_index
end
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Get actor
@actor = $game_party.actors[@actor_index]
# Make help window, status window, and skill window
@help_window = Window_Help.new
@category_id = 0
@last_index = 0
@status_window = Window_HorizCommand.new(self.make_commands)
@status_window.y = 64
@status_window.help_window = @help_window
@skill_window = Window_Skill.new(@actor)
# Associate help window
@skill_window.help_window = @help_window
@skill_window.active = false
@skill_window.index = -1
@skill_window.refresh(@status_window.commands[0])
# Make target window (set to invisible / inactive)
@target_window = Window_Target.new
@target_window.visible = false
@target_window.active = false
@status_window.update_help
# 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
@status_window.dispose
@skill_window.dispose
@target_window.dispose
end
#--------------------------------------------------------------------------
# * Create Skill Categories command list
#--------------------------------------------------------------------------
def make_commands
# Initialize variables
commands = ['Skill']
ranks = Gameus::SKILL_SETS.values
# Check every skill the actor has
@actor.skills.each {|id|
# Skip if not a skill
skill = $data_skills[id]
next if skill.nil?
# Compare skill's element set with defined skill categories
sc = skill.element_set & ranks
# If skill belongs to one of the skill categories
if sc.size == 1
# Add the skill category if it hasn't been added yet
commands.push(Gameus::SKILL_SETS.index(sc[0])) if !commands.include?(Gameus::SKILL_SETS.index(sc[0]))
end
}
return commands
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@help_window.update
@status_window.update
@skill_window.update
@target_window.update
# Choosing a skill category
if @status_window.active
update_selection
return
end
# If skill window is active: call update_skill
if @skill_window.active
update_skill
return
end
# If skill target is active: call update_target
if @target_window.active
update_target
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (if status window is active)
#--------------------------------------------------------------------------
def update_selection
if @status_window.index != @last_index
@last_index = @status_window.index
@skill_window.refresh(@status_window.commands[@last_index])
end
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
$scene = Scene_Menu.new(1)
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
@skill_window.active = true
@status_window.active = false
end
end
#--------------------------------------------------------------------------
# * Frame Update (if skill window is active)
#--------------------------------------------------------------------------
def update_skill
# If B button was pressed
if Input.trigger?(Input::B)
@skill_window.index = 0
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen
@skill_window.active = false
@skill_window.index = -1
@status_window.active = true
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Get currently selected data on the skill window
@skill = @skill_window.skill
# If unable to use
if @skill == nil or not @actor.skill_can_use?(@skill.id)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# If effect scope is ally
if @skill.scope >= 3
# Activate target window
@skill_window.active = false
@target_window.x = (@skill_window.index + 1) % 2 * 304
@target_window.visible = true
@target_window.active = true
# Set cursor position to effect scope (single / all)
if @skill.scope == 4 || @skill.scope == 6
@target_window.index = -1
elsif @skill.scope == 7
@target_window.index = @actor_index - 10
else
@target_window.index = 0
end
# If effect scope is other than ally
else
# If common event ID is valid
if @skill.common_event_id > 0
# Common event call reservation
$game_temp.common_event_id = @skill.common_event_id
# Play use skill SE
$game_system.se_play(@skill.menu_se)
# Use up SP
@actor.sp -= @skill.sp_cost
# Remake each window content
@skill_window.refresh
@target_window.refresh
# Switch to map screen
$scene = Scene_Map.new
return
end
end
return
end
# If R button was pressed
if Input.trigger?(Input::R)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To next actor
@actor_index += 1
@actor_index %= $game_party.actors.size
# Switch to different skill screen
$scene = Scene_Skill.new(@actor_index)
return
end
# If L button was pressed
if Input.trigger?(Input::L)
# Play cursor SE
$game_system.se_play($data_system.cursor_se)
# To previous actor
@actor_index += $game_party.actors.size - 1
@actor_index %= $game_party.actors.size
# Switch to different skill screen
$scene = Scene_Skill.new(@actor_index)
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when target window is active)
#--------------------------------------------------------------------------
def update_target
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Erase target window
@skill_window.active = true
@target_window.visible = false
@target_window.active = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If unable to use because SP ran out
unless @actor.skill_can_use?(@skill.id)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# If target is all
if @target_window.index == -1
# Apply skill use effects to entire party
used = false
for i in $game_party.actors
used |= i.skill_effect(@actor, @skill)
end
end
# If target is user
if @target_window.index <= -2
# Apply skill use effects to target actor
target = $game_party.actors[@target_window.index + 10]
used = target.skill_effect(@actor, @skill)
end
# If single target
if @target_window.index >= 0
# Apply skill use effects to target actor
target = $game_party.actors[@target_window.index]
used = target.skill_effect(@actor, @skill)
end
# If skill was used
if used
# Play skill use SE
$game_system.se_play(@skill.menu_se)
# Use up SP
@actor.sp -= @skill.sp_cost
# Remake each window content
@skill_window.refresh
@target_window.refresh
# If entire party is dead
if $game_party.all_dead?
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If command event ID is valid
if @skill.common_event_id > 0
# Command event call reservation
$game_temp.common_event_id = @skill.common_event_id
# Switch to map screen
$scene = Scene_Map.new
return
end
end
# If skill wasn't used
unless used
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
end