#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#             #[b]            [/b][b] [/b]Battle Skill Combination#            Version: 1.0#            Author: Devil Knight#            Date: 2nd  Oct, 2014#-------------------------------------------------------------------------------# Description:##    This Script allow you to Combine Between Skills To Make Stronger One##-------------------------------------------------------------------------------# Instruction:##   - In Editablel Region do the following:#     #    - In Skill Combination Section Write name of the skills that will Combine##    - Should Be Like This:#       "(first skill name)(space)(+)(space)(second skill name)"##    - If The Combination of skills was not in skill_combination then #      the second skill will executed#        #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=module Devil_Knight module  Skill_Combination  #---------------------------------------------------------------------    #                                 #  #          Start of EDITABLE REGION            #  #                                 #  #--------------------------------------------------------------------  Skills =   {   #                 combination    :skill_combination    =>  ["Fire + Fire", "Thunder + Thunder"],   #                   |         |   # Result of combination        V         V    :combination_result   =>  [  "Flame",     "Spark" ],   #                   |         |   # Result of combination Skill ID    V         V    :combination_result_id  =>  [   53,        61    ], # Take it from Skill ID From Database   }  #---------------------------------------------------------------------    #                                 #  #          End of EDITABLE REGION             #  #                                 #  #-------------------------------------------------------------------- endend#==============================================================================# ** Window_BattleSkill#------------------------------------------------------------------------------#  This window is for selecting skills to use in the battle window.#============================================================================== class Window_BattleSkill < Window_SkillList #-------------------------------------------------------------------------- # * Handling Processing for OK and Cancel Etc. #-------------------------------------------------------------------------- alias devil_knight_skill_combination_window_battleskill_process_handling  process_handling def process_handling  devil_knight_skill_combination_window_battleskill_process_handling()  return process_select      if select_enabled?   && Input.trigger?(:SHIFT)  # Assign Button to Skill Select  return process_select_cancel  if select_disabled?   && Input.trigger?(:CTRL)  # Assign Button to Skill Select Cancel end #-------------------------------------------------------------------------- # * New Method: Get Activation State of Select Processing #-------------------------------------------------------------------------- def select_enabled?  handle?(:select) end  #-------------------------------------------------------------------------- # * New Method: Call Select Handler #-------------------------------------------------------------------------- def call_select_handler  call_handler(:select) end #-------------------------------------------------------------------------- # * New Method: Get Activation State of Select Disabled Processing #-------------------------------------------------------------------------- def select_disabled?  handle?(:cancel_select) end #-------------------------------------------------------------------------- # * New Method: Call Select Cancel Handler #-------------------------------------------------------------------------- def call_select_cancel_handler  call_handler(:cancel_select) end #-------------------------------------------------------------------------- # * New Method: Processing When Select Button Is Pressed #-------------------------------------------------------------------------- def process_select  if current_item_enabled?   Sound.play_ok   Input.update    call_select_handler  else   Sound.play_buzzer  end end #-------------------------------------------------------------------------- # * New Method: Processing When Select Cancel Button Is Pressed #-------------------------------------------------------------------------- def process_select_cancel   Sound.play_buzzer   call_select_cancel_handler endend #==============================================================================# ** Scene_Battle#------------------------------------------------------------------------------#  This class performs battle screen processing.#============================================================================== class Scene_Battle < Scene_Base include Devil_Knight::Skill_Combination attr_accessor   :first_skill   # Assign First Selected Skill attr_accessor   :secound_skill  # Assign Secound Selected Skill #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- alias devil_knight_skill_combination_scene_battle_start  start def start  devil_knight_skill_combination_scene_battle_start()  @first_skill   = nil  @secound_skill  = nil end #-------------------------------------------------------------------------- # * Create Skill Window #-------------------------------------------------------------------------- alias devil_knight_skill_combination_scene_battle_create_skill_window  create_skill_window def create_skill_window  devil_knight_skill_combination_scene_battle_create_skill_window()  @skill_window.set_handler(:select,       method(:on_skill_select))  @skill_window.set_handler(:cancel_select,   method(:on_skill_select_cancel)) end #-------------------------------------------------------------------------- # * Skill [OK] #-------------------------------------------------------------------------- alias devil_knight_skill_combination_scene_battle_on_skill_ok  on_skill_ok def on_skill_ok  if @first_skill != nil  && @secound_skill != nil  # Check Is There Any Selected Skill   @skill = $data_skills[get_skill_combination_result] # Assign The Result Combination Skill    BattleManager.actor.input.set_skill(@skill.id)   BattleManager.actor.last_skill.object = @skill   @first_skill  = nil  # Delete The First Assigned Skill   @secound_skill = nil  # Delete The Secound Assigned Skill   if !@skill.need_selection?    @skill_window.hide    next_command   elsif @skill.for_opponent?    select_enemy_selection   else    select_actor_selection   end  else   devil_knight_skill_combination_scene_battle_on_skill_ok()  end end #-------------------------------------------------------------------------- # * New Method: Get The Result Of Skills Combination #-------------------------------------------------------------------------- def get_skill_combination_result  i = -1  current_combination = @first_skill.name + " + " + @secound_skill.name # Make Text of Combination Skills Names To Check  Skills[:skill_combination].each do |combination|   if combination == current_combination    i += 1    return Skills[:combination_result_id][i]  # Return Result of Combination Skill ID   else    i += 1   end  end  return @secound_skill.id  # Return The ID of Secound Skill end #-------------------------------------------------------------------------- # * New Method: Skill [Select] #-------------------------------------------------------------------------- def on_skill_select  if @first_skill == nil  # Check if First Skill Has Been Selected   @first_skill   = @skill_window.item  # Assign First  Skill   @help_window.set_text(@first_skill.name + " + ")  # Text Appear in Help Window For clarification  else   @secound_skill = @skill_window.item # Assign Secound  Skill   @help_window.set_text(@first_skill.name + " + " + @secound_skill.name)  # Text Appear in Help Window For clarification  end end #-------------------------------------------------------------------------- # * New Method: Skill [Cancel Select] #-------------------------------------------------------------------------- def on_skill_select_cancel  if @secound_skill != nil # Check if Secound Skill Has Been Selected    @secound_skill = nil  # Delete The Secound Assigned Skill   @help_window.set_text(@first_skill.name + " + ")  # Text Appear in Help Window For clarification  elsif @first_skill != nil # Check if First Skill Has Been Selected   @first_skill = nil  # Delete The First Assigned Skill   @help_window.clear  # Clear Help Window  end end #-------------------------------------------------------------------------- # * Start Actor Command Selection #-------------------------------------------------------------------------- alias devil_knight_skill_combination_scene_battle_start_actor_command_selection  start_actor_command_selection  def start_actor_command_selection  @first_skill   = nil # Delete The First Assigned Skill  @secound_skill  = nil # Delete The Secound Assigned Skill  devil_knight_skill_combination_scene_battle_start_actor_command_selection() endend