Summon

Summon
Version: 2.1

Introduction
This script simulate the Final Fantasy X Aeons.
For more information about Aeons look here.

Features
  • Summon multiple actors
  • Change BGM when summon
  • Summon rest in battle for n Turns
  • Transition when summon
  • Summon Status Window
  • Can develop the summon Attributes
  • The summon can learn skill by items
  • Can disable the experience acquisition
  • Can remove only the summoner
  • Remove everyone but the summoner remain
  • Summon by item


Demo v1.7
Here

Script

Summon Script 2.1 Spoiler
#===============================================================================
# Summon
#===============================================================================
# The Sleeping Leonhart
# Version 2.1
# 21-9-2007
#===============================================================================
# With this script you can summon like in Final Fantasy X.
# The summon is an hero created in the database.
# The skill with wich you call the summon is a normal skill created in the database
#===============================================================================
module Evocation
  #Sintax:
  #Evocated_Actor = {Skill ID => [Actor Id 1, Actor Id 2 etc...]}
  Evocated_Actor = {81 => [3,4], 57 =>[5,6], 61 => [9]}
 
  #Id of skill wich remove only the summoner
  Remove_Only_Summoner = {61 => true}
  Remove_Only_Summoner.default = false
 
  #Sintax:
  #Summon_Item = {Item ID => Skill ID}
  #The item recall the id of the skill and use his
  #summon property (like Turn, BGM, etc..)(If this is not clear please send me a PM)
  Summon_Item = {1 => 81}
 
  #Id of skill wich remove everyone but the summoner remain
  Summoner_Rest = {81 => true}
  Summoner_Rest.default = false
 
  #Id of the skill to racall the summon
  Return_Id = 83
 
  #Name of transtion
  Transition = "001-Blind01"
 
  #Sintax:
  #BGM = {Skill ID => BGM Name}
  BGM = {81 => "005-Boss01"
  } #Define the BGM played during the summon turns
  #BGM for undeclarated summon
  #nil = not change BGM
  BGM.default = nil
 
  #Sintax:
  #Turn = {Skill ID => Turns}
  #0 = Unlimited
  Turn = {81 => 2
  } #Define how many turns the summon/s is/are in battle
  #Turn for undeclarated summon
  Turn.default = 0
 
  #If true the summon receive experience(same as the party)
  Experience = false
end
#==============================================================================
# ** 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
  attr_accessor   :evocated
  # Aliasing old Method
  alias tsl_evocation_game_actor_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  def initialize(actor_id)
    super()
    @evocated = false
    # Call old Method
    tsl_evocation_game_actor_initialize(actor_id)
  end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================
class Scene_Battle
  # Aliasing old Method
  alias tsl_evocation_scene_battle_main main
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    @last_party = []
    @evocation = false
    @evocated_turn = 0
    @summon = []
    # Call old Method
    tsl_evocation_scene_battle_main
  end
 
  # Aliasing old Method
  alias tsl_evocation_scene_battle_judge judge
  #--------------------------------------------------------------------------
  # * Determine Battle Win/Loss Results
  #--------------------------------------------------------------------------
  def judge
    if @evocation == true
      if $game_party.all_dead?
        party_return
      end
      if @summon != []
        if summon_dead?
          party_return
        end
      end
    end
    # Call old Method
    tsl_evocation_scene_battle_judge
  end
  def summon_dead?
    if @summon.size == 0
      return false
    end
    for actor in @summon
      if actor.hp > 0
        return false
      end
    end
    return true
  end
  # Aliasing old Method
  alias tsl_evocation_scene_battle_update_phase4_step5 update_phase4_step5
  def update_phase4_step5
    evocated?
    # Call old Method
    tsl_evocation_scene_battle_update_phase4_step5
  end
  #--------------------------------------------------------------------------
  # * Determine if Summon or recall Party
  #--------------------------------------------------------------------------
  def evocated?
    if Evocation::Summon_Item.include?(@item.id)
      @id = Evocation::Summon_Item[@item.id]
    else
      @id = @skill.id
    end
    if Evocation::Evocated_Actor.include?(@id)
      if Evocation::BGM.include?(@id)
        if Evocation::BGM != nil
          Audio.bgm_play("Audio/BGM/" + Evocation::BGM[@id], 100, 100)
          $game_system.bgm_memorize
        end
      end
      @summon_turn = Evocation::Turn[@id]
      @evocated_turn = $game_temp.battle_turn
      evocate_actor(Evocation::Evocated_Actor[@id])
    end
    if @id == Evocation::Return_Id
      party_return
    end
  end
  #--------------------------------------------------------------------------
  # * Call the summon
  #--------------------------------------------------------------------------
  def evocate_actor(actors)
    #Memorize the old party
    unless @evocation == true
      for i in 0..$game_party.actors.size - 1
        @last_party[i] = $game_party.actors[i].id
      end
    end
    #Change Escape Condition
    @escape = $game_temp.battle_can_escape
    $game_temp.battle_can_escape = false
    #Clear the party
    if Evocation::Remove_Only_Summoner[@id]
      $game_party.remove_actor(@active_battler.id)
    else
      $game_party.actors.clear
    end
    #Execute the transition
    if Evocation::Transition != nil
      Graphics.freeze
      $game_temp.transition_processing = true
      $game_temp.transition_name = Evocation::Transition
    end
    #Summon the actor
    if Evocation::Remove_Only_Summoner[@id]
      for i in 0..actors.size - 1
        $game_party.add_actor(actors[i])
        @summon[i] = $game_actors[actors[i]]
        $game_actors[actors[i]].evocated = true
      end
    else
      if Evocation::Summoner_Rest[@id]
        $game_party.add_actor(@active_battler.id)
      end
      for i in 0..actors.size - 1
        $game_party.add_actor(actors[i])
        $game_actors[actors[i]].evocated = true
      end
    end
    #Set the value of variable
    @evocation = true
    @spriteset.dispose
    @spriteset = Spriteset_Battle.new
    @status_window.refresh
    @skill = nil
    @item = nil
  end
  #--------------------------------------------------------------------------
  # * Recall old Party
  #--------------------------------------------------------------------------
  def party_return
    $game_system.bgm_play($game_system.bgm_memorize)
    $game_party.actors.clear
    if Evocation::Transition != nil
      Graphics.freeze
      $game_temp.transition_processing = true
      $game_temp.transition_name = Evocation::Transition
    end
    $game_temp.battle_can_escape = @escape
    for i in 0..@last_party.size - 1
      $game_party.add_actor(@last_party[i])
    end
    @spriteset.dispose
    @spriteset = Spriteset_Battle.new
    @status_window.refresh
    @summon_turn = 0
    @evocation = false
    @summon = []
    @skill = nil
    @item = nil
  end
 
  # Aliasing old Method
  alias tsl_evocation_scene_battle_update_phase4_step6 update_phase4_step6
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 6 : refresh)
  #--------------------------------------------------------------------------
  def update_phase4_step6
    if @summon_turn != 0
      if ($game_temp.battle_turn - @evocated_turn) == @summon_turn and @evocation
        party_return
      end
    end
    # Call old Method
    tsl_evocation_scene_battle_update_phase4_step6
  end
 
  # Aliasing old Method
  alias tsl_evocation_scene_battle_start_phase5 start_phase5
  #--------------------------------------------------------------------------
  # * Start After Battle Phase
  #--------------------------------------------------------------------------
  def start_phase5
    if @evocation
      party_return
    end
    if Evocation::Experience
      exp = 0
      for enemy in $game_troop.enemies
        unless enemy.hidden
          exp += enemy.exp
        end
      end
      for i in 1...$data_actors.size
        actor = $game_actors[i]
        if actor.cant_get_exp? == false
          if actor.evocated == true
            last_level = actor.level
            actor.exp += exp
            actor.evocated = false
          end
        end
      end
    end
    # Call old Method
    tsl_evocation_scene_battle_start_phase5
  end
end
Expand to see the code.

Summon Script - RTAB Version beta Spoiler
#===============================================================================
# Summon RTAB Version
#===============================================================================
# The Sleeping Leonhart
# Version beta
# 27-9-2007
#===============================================================================
# With this script you can summon like in Final Fantasy X.
# The summon is an hero created in the database.
# The skill with wich you call the summon is a normal skill created in the database
#===============================================================================
module Evocation
  #Sintax:
  #Evocated_Actor = {Skill ID => [Actor Id 1, Actor Id 2 etc...]}
  Evocated_Actor = {81 => [3,4], 57 =>[5,6], 61 => [9]}
 
  #Id of skill wich remove only the summoner
  Remove_Only_Summoner = {61 => true}
  Remove_Only_Summoner.default = false
 
  #Sintax:
  #Summon_Item = {Item ID => Skill ID}
  #The item recall the id of the skill and use his
  #summon property (like Turn, BGM, etc..)(If this is not clear please send me a PM)
  Summon_Item = {1 => 81}
 
  #Id of skill wich remove everyone but the summoner remain
  Summoner_Rest = {81 => true}
  Summoner_Rest.default = false
 
  #Id of the skill to racall the summon
  Return_Id = 83
 
  #Name of transtion
  Transition = "001-Blind01"
 
  #Sintax:
  #BGM = {Skill ID => BGM Name}
  BGM = {81 => "005-Boss01"
  } #Define the BGM played during the summon turns
  #BGM for undeclarated summon
  #nil = not change BGM
  BGM.default = nil
 
  #Sintax:
  #Turn = {Skill ID => Turns}
  #0 = Unlimited
  Turn = {81 => 2
  } #Define how many turns the summon/s is/are in battle
  #Turn for undeclarated summon
  Turn.default = 0
 
  #If true the summon receive experience(same as the party)
  Experience = false
end
#==============================================================================
# ** 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
  attr_accessor   :evocated
  # Aliasing old Method
  alias tsl_evocation_game_actor_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor_id : actor ID
  #--------------------------------------------------------------------------
  def initialize(actor_id)
    # Call old Method
    tsl_evocation_game_actor_initialize(actor_id)
    @evocated = false
  end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================
class Scene_Battle
  # Aliasing old Method
  alias tsl_evocation_scene_battle_main main
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    @last_party = []
    @evocation = false
    @evocated_turn = 0
    @summon = []
    # Call old Method
    tsl_evocation_scene_battle_main
  end
 
  # Aliasing old Method
  alias tsl_evocation_scene_battle_judge judge
  #--------------------------------------------------------------------------
  # * Determine Battle Win/Loss Results
  #--------------------------------------------------------------------------
  def judge
    if @evocation == true
      if $game_party.all_dead?
        party_return
      end
      if @summon != []
        if summon_dead?
          party_return
        end
      end
    end
    # Call old Method
    tsl_evocation_scene_battle_judge
  end
  def summon_dead?
    if @summon.size == 0
      return false
    end
    for actor in @summon
      if actor.hp > 0
        return false
      end
    end
    return true
  end
  # Aliasing old Method
  alias tsl_evocation_scene_battle_update_phase4_step5 update_phase4_step5
  def update_phase4_step5(battler)
    evocated?(battler)
    # Call old Method
    tsl_evocation_scene_battle_update_phase4_step5(battler)
  end
  #--------------------------------------------------------------------------
  # * Determine if Summon or recall Party
  #--------------------------------------------------------------------------
  def evocated?(battler)
    if Evocation::Summon_Item.include?(@item.id)
      @id = Evocation::Summon_Item[@item.id]
    else
      @id = @skill.id
    end
    if Evocation::Evocated_Actor.include?(@id)
      if Evocation::BGM.include?(@id)
        if Evocation::BGM != nil
          Audio.bgm_play("Audio/BGM/" + Evocation::BGM[@id], 100, 100)
          $game_system.bgm_memorize
        end
      end
      @summon_turn = Evocation::Turn[@id]
      @evocated_turn = $game_temp.battle_turn
      evocate_actor(Evocation::Evocated_Actor[@id])
    end
    if @id == Evocation::Return_Id
      party_return
    end
  end
  #--------------------------------------------------------------------------
  # * Call the summon
  #--------------------------------------------------------------------------
  def evocate_actor(actors)
    #Memorize the old party
    @status_window.dispose
    unless @evocation == true
      for i in 0..$game_party.actors.size - 1
        @last_party[i] = $game_party.actors[i].id
      end
    end
    #Change Escape Condition
    @escape = $game_temp.battle_can_escape
    $game_temp.battle_can_escape = false
    #Clear the party
    if Evocation::Remove_Only_Summoner[@id]
      $game_party.remove_actor(@active_battler.id)
    else
      $game_party.actors.clear
    end
    #Execute the transition
    if Evocation::Transition != nil
      Graphics.freeze
      $game_temp.transition_processing = true
      $game_temp.transition_name = Evocation::Transition
    end
    #Summon the actor
    if Evocation::Summoner_Rest[@id]
      $game_party.add_actor(@active_battler.id)
    end
    for i in 0..actors.size - 1
      $game_party.add_actor(actors[i])
      $game_actors[actors[i]].at = 0
      $game_actors[actors[i]].atp = 0
      $scene.spell_reset($game_actors[actors[i]])
      $game_actors[actors[i]].damage_pop = {}
      $game_actors[actors[i]].damage = {}
      $game_actors[actors[i]].damage_sp = {}
      $game_actors[actors[i]].critical = {}
      $game_actors[actors[i]].recover_hp = {}
      $game_actors[actors[i]].recover_sp = {}
      $game_actors[actors[i]].state_p = {}
      $game_actors[actors[i]].state_m = {}
      $game_actors[actors[i]].animation = []
      if Evocation::Remove_Only_Summoner[@id]
        @summon[i] = $game_actors[actors[i]]
      end
      #@status_window.refresh
      $game_actors[actors[i]].evocated = true
    end
    #Set the value of variable
    @spriteset.dispose
    @spriteset = Spriteset_Battle.new
    @status_window = Window_BattleStatus.new
    @evocation = true
    @skill = nil
    @item = nil
  end
  #--------------------------------------------------------------------------
  # * Recall old Party
  #--------------------------------------------------------------------------
  def party_return
    $game_system.bgm_play($game_system.bgm_memorize)
    $game_party.actors.clear
    if Evocation::Transition != nil
      Graphics.freeze
      $game_temp.transition_processing = true
      $game_temp.transition_name = Evocation::Transition
    end
    $game_temp.battle_can_escape = @escape
    for i in 0..@last_party.size - 1
      $game_party.add_actor(@last_party[i])
    end
    @spriteset.dispose
    @spriteset = Spriteset_Battle.new
    @summon_turn = 0
    @evocation = false
    @summon = []
    @skill = nil
    @item = nil
  end
 
  # Aliasing old Method
  alias tsl_evocation_scene_battle_update_phase4_step6 update_phase4_step6
  #--------------------------------------------------------------------------
  # * Frame Update (main phase step 6 : refresh)
  #--------------------------------------------------------------------------
  def update_phase4_step6(battler)
    if @summon_turn != 0
      if ($game_temp.battle_turn - @evocated_turn) == @summon_turn and @evocation
        party_return
      end
    end
    # Call old Method
    tsl_evocation_scene_battle_update_phase4_step6(battler)
  end
 
  # Aliasing old Method
  alias tsl_evocation_scene_battle_start_phase5 start_phase5
  #--------------------------------------------------------------------------
  # * Start After Battle Phase
  #--------------------------------------------------------------------------
  def start_phase5
    if @evocation == true
      party_return
    end
    if Evocation::Experience
      exp = 0
      for enemy in $game_troop.enemies
        unless enemy.hidden
          exp += enemy.exp
        end
      end
      for i in 1...$data_actors.size
        actor = $game_actors[i]
        if actor.cant_get_exp? == false
          if actor.evocated == true
            last_level = actor.level
            actor.exp += exp
            actor.evocated = false
          end
        end
      end
    end
    # Call old Method
    tsl_evocation_scene_battle_start_phase5
  end
end


class Window_BattleStatus < Window_Base
  alias tsl_evocation_windowbattlestatus_refresh refresh
  def refresh(number = 0)
    if number == nil
      number = 0
    end
    tsl_evocation_windowbattlestatus_refresh(number = 0)
  end
  alias tsl_evocation_windowbattlestatus_atrefresh at_refresh
  def at_refresh(number = 0)
    if number == nil
      number = 0
    end
    tsl_evocation_windowbattlestatus_atrefresh(number = 0)
  end
end
Expand to see the code.

Summon Status & Development 1.5 Spoiler
#===============================================================================
# SummonStatus & Development
#===============================================================================
# The Sleeping Leonhart
# Version 1.5
# 19-9-2007
#===============================================================================
# Status Window for the summon script & development system.
#===============================================================================

module Summon_Development
  #Id of item usable with summon
  Summon_item_id = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]
 
  #Syntax:
  #Attribute_Item = {Item Id => [Attribute Advancement, Number of item]}
  Hp_Item = {1=>[500,2]}
  Sp_Item = {2=>[40,1]}
  Atk_Item = {3=>[5,2]}
  Str_Item = {4=>[5,5]}
  PDef_Item = {5=>[5,5]}
  MDef_Item = {6=>[5,5]}
  Agi_Item = {7=>[5,5]}
  Int_Item = {8=>[5,5]}
  Dex_Item = {9=>[5,5]}
  Eva_Item = {10=>[1,99]}
 
  #Syntax:
  #Skill_Item = {Item Id => Skill Learned}
  Skill_Item = {1=>10,3=>25}
end

class Game_Battler
  attr_accessor     :atks
  attr_accessor     :pdefs
  attr_accessor     :mdefs
  attr_accessor     :evas
  alias tsl_summondevelop_game_battler_initialize initialize
  def initialize
    @atks = 0
    @pdefs = 0
    @mdefs = 0
    @evas = 0
    tsl_summondevelop_game_battler_initialize
  end
  alias tsl_summondevelop_game_battler_atk atk
  def atk
    value = tsl_summondevelop_game_battler_atk
    value += @atks
    return value
  end
  alias tsl_summondevelop_game_battler_pdef pdef
  def pdef
    value = tsl_summondevelop_game_battler_pdef
    value += @pdefs
    return value
  end
  alias tsl_summondevelop_game_battler_mdef mdef
  def mdef
    value = tsl_summondevelop_game_battler_mdef
    value += @mdefs
    return value
  end
  alias tsl_summondevelop_game_battler_eva eva
  def eva
    value = tsl_summondevelop_game_battler_eva
    value += @evas
    return value
  end
end

class Window_SummonStatus < Window_Base
  def initialize(actor)
    super(160, 64, 480, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = $game_actors[actor]
    refresh
  end
  def refresh
    self.contents.clear
    draw_actor_graphic(@actor, 40, 112)
    draw_actor_name(@actor, 4, 0)
    draw_actor_class(@actor, 4 + 144, 0)
    draw_actor_level(@actor, 96, 32)
    draw_actor_state(@actor, 96, 64)
    draw_actor_hp(@actor, 96, 112, 172)
    draw_actor_sp(@actor, 96, 144, 172)
    draw_actor_parameter(@actor, 0, 192, 0)
    draw_actor_parameter(@actor, 0, 224, 1)
    draw_actor_parameter(@actor, 0, 256, 2)
    draw_actor_parameter(@actor, 0, 288, 3)
    draw_actor_parameter(@actor, 256, 192, 4)
    draw_actor_parameter(@actor, 256, 224, 5)
    draw_actor_parameter(@actor, 256, 256, 6)
    self.contents.font.color = system_color
    self.contents.draw_text(256, 288, 120, 32, "Evasion")
    self.contents.font.color = normal_color
    self.contents.draw_text(256 + 120, 288, 36, 32, @actor.eva.to_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(256, 48, 80, 32, "Exp")
    self.contents.draw_text(256, 80, 80, 32, "Next")
    self.contents.font.color = normal_color
    self.contents.draw_text(256 + 80, 48, 84, 32, @actor.exp_s, 2)
    self.contents.draw_text(256 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
  end
end

class Window_SummonCommand < Window_Selectable
  def initialize
    super(0, 64, 160, 416)
    self.contents = Bitmap.new(width - 32, @item_max * 32)
    @learned = []
    @command = []
    $summon_party = []
    refresh
    self.index = 0
  end
  def refresh
    self.contents.clear
    for i in 1..$data_actors.size - 1
      for j in 1..$data_skills.size - 1
        actor = $game_actors[i]
        if actor.skill_learn?(j.id) and Evocation::Evocated_Actor.include?(j.id)
          @learned.push(j.id)
        end
      end
    end
      for i in [email hidden] - 1
        for j in 0..Evocation::Evocated_Actor[@learned[i]].size - 1
          @command.push(Evocation::Evocated_Actor[@learned[i]][j])
        end
      end
    @item_max = @command.size
    self.contents = Bitmap.new(width - 32, @item_max * 32)
    for i in [email hidden] - 1
      $summon_party[i] = @command[i]
      draw_item(i)
    end
  end
  def actor
    return @command[self.index]
  end
  def draw_item(index)
    x = 4
    y = index * 32
    self.contents.draw_text(x, y, 160, 32, $data_actors[@command[index]].name)
  end
  def update_cursor_rect
    if self.index == -1
      self.cursor_rect.set(0, 0, 128, @item_max * 32)
    else
      self.cursor_rect.set(0, @index * 32, 128, 32)
    end
  end
end

class Window_SummonChoice < Window_Selectable
  def initialize
    super(0, 0, 640, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    @commands = ["Item","Abilities","Attribute"]
    @item_max = 3
    @column_max = 3
    draw_item(0, normal_color)
    draw_item(1, normal_color)
    draw_item(2, normal_color)
    self.active = false
    self.index = 0
  end
 
  def draw_item(index, color)
    self.contents.font.color = color
    rect = Rect.new(index * 160 + 4, 0, 128 - 10, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index], 1)
  end
 
  def update_cursor_rect
    self.cursor_rect.set(index * 160, 0, 128, 32)
  end
end

class Window_Summon_Item < Window_Selectable
  def initialize
    super(160, 64, 480, 416)
    @column_max = 1
    refresh
    self.index = 0
    if $game_temp.in_battle
      self.y = 64
      self.height = 272
      self.back_opacity = 160
    end
  end
  def item
    return @data[self.index]
  end
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        for j in 0...Summon_Development::Summon_item_id.size
          if i == Summon_Development::Summon_item_id[j]
          @data.push($data_items [i] )
        end
      end
    end
  end
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      self.contents.font.size = 20
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.item_number(item.id)
    end
    self.contents.font.color = normal_color
    x = 4 + index % 1 * (240 + 32)
    y = index / 1 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 204, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 220, y, 24, 32, number.to_s, 2)
  end
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end

class Window_SummonAttribute < Window_Selectable
  def initialize
    super(0, 0, 640, 288)
    @column_max = 1
    refresh
    self.index = 0
  end
  def item
    return @data[self.index]
  end
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if Summon_Development::Hp_Item.include?(i) or Summon_Development::Sp_Item.include?(i) or
          Summon_Development::Atk_Item.include?(i) or Summon_Development::Str_Item.include?(i) or
          Summon_Development::PDef_Item.include?(i) or Summon_Development::MDef_Item.include?(i) or
          Summon_Development::Agi_Item.include?(i) or Summon_Development::Int_Item.include?(i) or
          Summon_Development::Dex_Item.include?(i) or Summon_Development::Eva_Item.include?(i)
          @data.push($data_items[i])
        end
      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
  def item_max
    return @item_max
  end
  def draw_item(index)
    item = @data[index]
    number = $game_party.item_number(item.id)
    self.contents.font.color = normal_color
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    n = 0
    lose = 0
    text = " ["
    if Summon_Development::Hp_Item.include?(item.id)
      text.concat(" HP + #{Summon_Development::Hp_Item[item.id][0]}")
      n += 1
      lose += Summon_Development::Hp_Item[item.id][1]
    end
    if Summon_Development::Sp_Item.include?(item.id)
      text.concat(" SP + #{Summon_Development::Sp_Item[item.id][0]}")
      n += 1
      lose += Summon_Development::Sp_Item[item.id][1]
    end
    if Summon_Development::Atk_Item.include?(item.id)
      text.concat(" Attack + #{Summon_Development::Atk_Item[item.id][0]}")
      n += 1
      lose += Summon_Development::Atk_Item[item.id][1]
    end
    if Summon_Development::Str_Item.include?(item.id)
      text.concat(" Strenght + #{Summon_Development::Str_Item[item.id][0]}")
      n += 1
      lose += Summon_Development::Str_Item[item.id][1]
    end
    if Summon_Development::PDef_Item.include?(item.id)
      text.concat(" Phis. Def. + #{Summon_Development::PDef_Item[item.id][0]}")
      n += 1
      lose += Summon_Development::PDef_Item[item.id][1]
    end
    if Summon_Development::MDef_Item.include?(item.id)
      text.concat(" Mag. Def. + #{Summon_Development::MDef_Item[item.id][0]}")
      n += 1
      lose += Summon_Development::MDef_Item[item.id][1]
    end
    if Summon_Development::Agi_Item.include?(item.id)
      text.concat(" Agility + #{Summon_Development::Agi_Item[item.id][0]}")
      n += 1
      lose += Summon_Development::Agi_Item[item.id][1]
    end
    if Summon_Development::Int_Item.include?(item.id)
      text.concat(" Intelligence + #{Summon_Development::Int_Item[item.id][0]}")
      n += 1
      lose += Summon_Development::Int_Item[item.id][1]
    end
    if Summon_Development::Dex_Item.include?(item.id)
      text.concat(" Dexterity + #{Summon_Development::Dex_Item[item.id][0]}")
      n += 1
      lose += Summon_Development::Dex_Item[item.id][1]
    end
    if Summon_Development::Eva_Item.include?(item.id)
      text.concat(" Evasion + #{Summon_Development::Eva_Item[item.id][0]}")
      n += 1
      lose += Summon_Development::Eva_Item[item.id][1]
    end
    lost = lose / n
    lost = lost.to_i
    text.concat("]")
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 256, 32, item.name)
    self.contents.font.color = system_color
    self.contents.draw_text(x + 28 + self.contents.text_size(item.name).width, y, 256-32,32 , text)
    self.contents.draw_text(x + 28 + self.contents.text_size(item.name).width + self.contents.text_size(text).width, y, 480-32,32 ," x " + lost.to_s)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 512, y, 128,32 ," : " + number.to_s)
  end
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end

class Window_SummonAttributeStatus < Window_Base
  def initialize(actor)
    super(0, 288, 640, 192)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = $game_actors[actor]
    refresh
  end
  def refresh
    self.contents.clear
    draw_actor_hp(@actor, 0, 0, 172)
    draw_actor_sp(@actor, 256, 0, 172)
    draw_actor_parameter(@actor, 0, 32, 0)
    draw_actor_parameter(@actor, 0, 64, 1)
    draw_actor_parameter(@actor, 0, 96, 2)
    draw_actor_parameter(@actor, 0, 128, 3)
    draw_actor_parameter(@actor, 256, 32, 4)
    draw_actor_parameter(@actor, 256, 64, 5)
    draw_actor_parameter(@actor, 256, 96, 6)
    self.contents.font.color = system_color
    self.contents.draw_text(256, 128, 120, 32, "Evasion")
    self.contents.font.color = normal_color
    self.contents.draw_text(256 + 120, 128, 36, 32, @actor.eva.to_s, 2)
  end
end

class Window_SummonAbilities < Window_Selectable
  def initialize
    super(0, 64, 640, 480-64)
    @column_max = 1
    refresh
    self.index = 0
  end
  def item
    return @data[self.index]
  end
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 1...$data_items.size
      if $game_party.item_number(i) > 0
        if Summon_Development::Skill_Item.include?(i)
          @data.push($data_items[i])
        end
      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
  def draw_item(index)
    item = @data[index]
    number = $game_party.item_number(item.id)
    self.contents.font.color = normal_color
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    text = " [Learn #{$data_skills[Summon_Development::Skill_Item[item.id]].name}]"
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 480-32, 32, item.name)
    self.contents.font.color = system_color
    self.contents.draw_text(x + 28 + self.contents.text_size(item.name).width, y, 480-32,32 , text)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 28 + self.contents.text_size(item.name).width + self.contents.text_size(text).width, y, 480-32,32 ," x " + number.to_s)
  end
  def update_help
    @help_window.set_text(self.item == nil ? "" : $data_skills[Summon_Development::Skill_Item[self.item.id]].description)
  end
end

class Scene_SummonStatus
  def main
    @command_window = Window_SummonCommand.new
    @target_window = Window_SummonCommand.new
    @target_window.visible = false
    @target_window.active = false
    @index = @command_window.actor
    @info_window = Window_SummonStatus.new(@index)
    @help_window = Window_Help.new
    @item_window = Window_Summon_Item.new
    @choice = Window_SummonChoice.new
    @choice.active = false
    @item_window.active = false
    @item_window.visible = false
    @item_window.help_window = @help_window
    @help_window.visible = false
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @command_window.dispose
    @target_window.dispose
    @info_window.dispose
    @choice.dispose
    @item_window.dispose
    @help_window.dispose
  end
  def update
    @command_window.update
    @target_window.update
    @info_window.update
    @choice.update
    @item_window.update
    @help_window.update
    if @command_window.active
      update_command
      return
    end
    if @choice.active
      update_choice
      return
    end
    if @item_window.active
      update_item
      return
    end
    if @target_window.active
      update_target
      return
    end
  end
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(4)
      return
    end
    if Input.trigger?(Input::DOWN)
      @info_window.dispose
      @index = @command_window.actor
      @info_window = Window_SummonStatus.new(@index)
    end
    if Input.trigger?(Input::UP)
      @info_window.dispose
      @index = @command_window.actor
      @info_window = Window_SummonStatus.new(@index)
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      @choice.active = true
      @command_window.active = false
      return
    end
  end
  def update_choice
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @choice.active = false
      @command_window.active = true
      return
    end
    if Input.trigger?(Input::C)
      case @choice.index
      when 0
        $game_system.se_play($data_system.decision_se)
        @item_window.active = true
        @item_window.visible = true
        @help_window.visible = true
        @choice.active = false
        @choice.visible = false
        @info_window.visible = false
      when 1
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_SummonAbilities.new(@command_window.actor)
      when 2
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_SummonAttribute.new(@command_window.actor)
      return
      end
    end
  end
  def update_item
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @choice.active = true
      @item_window.active = false
      @item_window.visible = false
      @help_window.visible = false
      @choice.visible = true
      @info_window.visible = true
      return
    end
    if Input.trigger?(Input::C)
      @item = @item_window.item
      unless @item.is_a?(RPG::Item)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      unless $game_party.item_can_use?(@item.id)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      if @item.scope >= 3
        @item_window.active = false
        @item_window.visible = false
        @target_window.active = true
        @target_window.visible = true
        @command_window.visible = false
        @info_window.dispose
        @index = @command_window.actor
        @info_window = Window_SummonStatus.new(@index)
        @info_window.visible = true
        if @item.scope == 4 || @item.scope == 6
          @target_window.index = -1
        else
          @target_window.index = 0
        end
      else
        if @item.common_event_id > 0
          $game_temp.common_event_id = @item.common_event_id
          $game_system.se_play(@item.menu_se)
          if @item.consumable
            $game_party.lose_item(@item.id, 1)
            @item_window.draw_item(@item_window.index)
          end
          $scene = Scene_Map.new
          return
        end
      end
      return
    end
  end
  def update_target
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      unless $game_party.item_can_use?(@item.id)
        @item_window.refresh
      end
      @item_window.active = true
      @item_window.visible = true
      @command_window.visible = true
      @target_window.active = false
      @target_window.visible = false
      @info_window.visible = false
      return
    end
    unless @target_window.index == -1
      if Input.trigger?(Input::DOWN)
        @info_window.dispose
        @index = @target_window.actor
        @info_window = Window_SummonStatus.new(@index)
      end
      if Input.trigger?(Input::UP)
        @info_window.dispose
        @index = @target_window.actor
        @info_window = Window_SummonStatus.new(@index)
      end
    end
    if Input.trigger?(Input::C)
      if $game_party.item_number(@item.id) == 0
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if @target_window.index == -1
        used = false
        for i in $summon_party
          used |= $game_actors[i].item_effect(@item)
        end
      end
      if @target_window.index >= 0
        target = $game_actors[@target_window.actor]
        used = target.item_effect(@item)
      end
      @info_window.refresh
      if used
        $game_system.se_play(@item.menu_se)
        if @item.consumable
          $game_party.lose_item(@item.id, 1)
          @item_window.draw_item(@item_window.index)
        end
        if $game_party.all_dead?
          $scene = Scene_Gameover.new
          return
        end
        if @item.common_event_id > 0
          $game_temp.common_event_id = @item.common_event_id
          $scene = Scene_Map.new
          return
        end
      end
      unless used
        $game_system.se_play($data_system.buzzer_se)
      end
      return
    end
  end
end

class Scene_SummonAttribute
  def initialize(actor_index)
    @actor_index = actor_index
  end
  def main
    @actor = $game_actors[@actor_index]
    @item_window = Window_SummonAttribute.new
    @info_window = Window_SummonAttributeStatus.new(@actor_index)
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @item_window.dispose
    @info_window.dispose
  end
  def update
    @item_window.update
    @info_window.update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_SummonStatus.new
      return
    end
    if Input.trigger?(Input::C)
      @item = @item_window.item
      @lose = 0
      @n = 0
      if Summon_Development::Hp_Item.include?(@item.id)
        @actor.maxhp += Summon_Development::Hp_Item[@item.id][0]
        @lose += Summon_Development::Hp_Item[@item.id][1]
        @n += 1
      end
      if Summon_Development::Sp_Item.include?(@item.id)
        @actor.maxsp += Summon_Development::Sp_Item[@item.id][0]
        @lose += Summon_Development::Sp_Item[@item.id][1]
        @n += 1
      end
      if Summon_Development::Atk_Item.include?(@item.id)
        @actor.atks += Summon_Development::Atk_Item[@item.id][0]
        @lose += Summon_Development::Atk_Item[@item.id][1]
        @n += 1
      end
      if Summon_Development::Str_Item.include?(@item.id)
        @actor.str +=Summon_Development::Str_Item[@item.id][0]
        @lose += Summon_Development::Str_Item[@item.id][1]
        @n += 1
      end
      if Summon_Development::PDef_Item.include?(@item.id)
        @actor.pdefs += Summon_Development::PDef_Item[@item.id][0]
        @lose += Summon_Development::PDef_Item[@item.id][1]
        @n += 1
      end
      if Summon_Development::MDef_Item.include?(@item.id)
        @actor.mdefs += Summon_Development::MDef_Item[@item.id][0]
        @lose += Summon_Development::MDef_Item[@item.id][1]
        @n += 1
      end
      if Summon_Development::Agi_Item.include?(@item.id)
        @actor.agi += Summon_Development::Agi_Item[@item.id][0]
        @lose += Summon_Development::Agi_Item[@item.id][1]
        @n += 1
      end
      if Summon_Development::Int_Item.include?(@item.id)
        @actor.int += Summon_Development::Int_Item[@item.id][0]
        @lose += Summon_Development::Int_Item[@item.id][1]
        @n += 1
      end
      if Summon_Development::Dex_Item.include?(@item.id)
        @actor.dex += Summon_Development::Dex_Item[@item.id][0]
        @lose += Summon_Development::Dex_Item[@item.id][1]
        @n += 1
      end
      if Summon_Development::Eva_Item.include?(@item.id)
        @actor.evas += Summon_Development::Eva_Item[@item.id][0]
        @lose += Summon_Development::Eva_Item[@item.id][1]
        @n += 1
      end
      @index = @item_window.index
      $game_system.se_play($data_system.decision_se)
      $game_party.lose_item(@item.id, (@lose/@n).to_i)
      @item_window.dispose
      @item_window = Window_SummonAttribute.new
      @info_window.refresh
      unless @index >= @item_window.item_max
        @item_window.index=(@index)
      else
        @item_window.index=(0)
      end
      return
    end
  end
end

class Scene_SummonAbilities
  def initialize(actor_index)
    @actor_index = actor_index
  end
  def main
    @actor = $game_actors[@actor_index]
    @help_window = Window_Help.new
    @item_window = Window_SummonAbilities.new
    @item_window.help_window = @help_window
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @item_window.dispose
    @help_window.dispose
  end
  def update
    @item_window.update
    @help_window.update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_SummonStatus.new
      return
    end
    if Input.trigger?(Input::C)
      @item = @item_window.item
      unless @actor.skill_learn?(Summon_Development::Skill_Item[@item.id]) or @item_window.item == nil
        @actor.learn_skill(Summon_Development::Skill_Item[@item.id])
        $game_system.se_play($data_system.decision_se)
        $game_party.lose_item(@item.id, 1)
      else
        $game_system.se_play($data_system.buzzer_se)
      end
      @item_window.refresh
      return
    end
  end
end
Expand to see the code.

Instructions
Inside the script

Compatibility

Dont know.

I must working on it so this is not the definetive version, it's like a test.
Good work, looks good!
So at a quick glance (*about to fall asleep now*), all I need to do is create an actor like 'ROBOT GUARDIAN' and attach it to a skill ID. Then call the skill like normal.

Ex: Evocated_Actor = {55 => [12]}
With Actor #12 being 'ROBOT GUARDIAN',
and Skill #55 being 'Summon Robot Guardian'

But... and again... drowsy here...

Am I to understand that...
Evocated_Actor = {81 => [3,4] }
...allows you to summon actors 'in succession or randomly'? Like the first time skill #81 is used, it summons the third actor... then the next time it summons the fourth?

I guess Return_Id is the ID# of the Skill used to return the summoned actors back to where they come from (like 'Return Robot Guardian').
Quote:
Am I to understand that...
Evocated_Actor = {81 => [3,4] }
...allows you to summon actors 'in succession or randomly'? Like the first time skill #81 is used, it summons the third actor... then the next time it summons the fourth?

Summons all the actor declarated(Like magus sister in Final Fantasy X)
Quote:
I guess Return_Id is the ID# of the Skill used to return the summoned actors back to where they come from (like 'Return Robot Guardian').

Yes.. call back all the evocated actors
ALL?? Like you list five in the array and BAM!?? All five show?

Youch! Something tells me that the bad guys don't stand a chance. :)

But... what if two heroes have summonning abilities and both summoned some actors. If one 'hero' casts the 'Return ID' skill, do all the summoned actors get returned? Or does the system keep track of which 'hero' summoned what actors...?

-G'night :sleepy01:
Quote:
ALL?? Like you list five in the array and BAM!?? All five show?

Yes.

Quote:
If one 'hero' casts the 'Return ID' skill, do all the summoned actors get returned? Or does the system keep track of which 'hero' summoned what actors...?

All heroes return for now.
Maybe i can make two kind of "Return Skill"
The first call back all heroes, the second only one.
Does this summon the actor with the other battlers or does it remove the battle party, summons the actor, and when that actor is destroyed or retreats, makes the battlers return (Like FFX)
Quote:
Does this summon the actor with the other battlers or does it remove the battle party, summons the actor, and when that actor is destroyed or retreats, makes the battlers return (Like FFX)

Is a question?

If it is the answer is yes!
Yes, but what do you mean by 'yes'.

Basically, does this either

1. Summon the creature/summon/actor alongside the original ones

2. Summon the creature/summon/actor by itself and remove the original actors out of battle, bringing them back when the creature/summon/actor either dies or leaves.
I would like to ask the same question as kaze950.

Does it remove the current characters from battle when the creature is summoned?
I hope it does because I've looked all over for a summoning script!
I can summon with events but it has a glitch with Minkoffs Animated Battlers.
I would prefer it to have more then one function so for a certian class the sommun will take a place as a character and for another class it takes the place of the current characters.
It temp replaces the party with the summon. I think it would be helpful if the UnSummon/Recall command didn't have to be added to each summon. Adding the unsummon skill to each creature as it is summoned shouldn't be too hard... Or leave the summoner in the party so you can unsummon them...
I currently am making a D&D game, and i was wondering if you could edit this so that it summons the "summon" to the parties side not replace the party, that way the spell "Summon Monster IX" would work correctly.
Like an ally and if he dies(I think this is only for me if you re summon him he will get revived only that way a summoned monster can be revived from death.) Although the spell would cost alot of sp so it's still worth it.
I would love to see a demo of this.
People have requested this script for a long time but no one has made it before.
well there is a summonm script. Like FFX but it is done with events. Not sure how well that went but i got that. It works well. If we saw a demo of this summon maybe il switch to yours
This is an awesome script! I plan on using it in my next project.

There's just a few things I'd like to mention.
1. I'd like some kind of transitions. It looks a little funny to have that instantaneous party changing. Not only for the actual Summoning, but also for the Unsummoning, and for winning a battle.
2. If you summon a character, and then Escape, you will be playing on the map as that character. Kind of cool actually, but I don't think you intended to have it that way. If you fix this, I wouldn't mind having the option to have it the way it currently is as well.
3. This just an idea, have the ability to change the battle BGM as soon as you summon the character. Not very important, but it could be kind of cool.
4. I'd like the option to have some kind of timer. Say, after using a Summon ability, the Summoned Character stays there for 3 turns, then instantly unsummons. The ability to have it differently for each one would be cool too.
5. Most importantly, I'd like some kind of Summon Menu in the Status Menu somewhere, like the one for Aeons in Final Fantasy X. I haven't played in a while so my memory is kind of foggy, but I recall some kind of way to level them up, and use items to teach them new abilities, and some way to raise their stats. Also, some way to heal them would be nice.

Just some suggestions I think could improve this otherwise pretty cool script.
Now I'm busy but i update the script soon as possible
To Armor King 108:
1: Yes good idea.
2: ops XD
3, 4 & 5: I had already thought it.

Thanks and be patient.
That's good to know. I can wait just fine. I mean, I've started at least 10 projects and I haven't come close to finishing any of them. And the project I want to use this in I haven't started yet, and I probably won't start it anytime soon...so, yeah...whatever.
Just get it as close as you can to FFX and everyone will be happy :P
Updated
I added the Turn Feature, BGM feature, Transition Feature and fixed the escape Problem!

Now working on development system and status window!

I post a demo soon as possible!

Thanks to all for the comments

Edit:
Make the status window for the summon.
It's only a test(it's very similar to the actor status), i need suggestion to make the definitive version.
Hmmm...how would I go about calling that Summon Status Menu? I can't seem to figure it out. I'm bat at scripting by that way...

Anyway, I was thinking, does this work for enemies? I mean, there was a boss or two in Final Fantasy X that could Summon, I just think it would be a cool idea.
Quote:
Hmmm...how would I go about calling that Summon Status Menu? I can't seem to figure it out. I'm bat at scripting by that way...

Call the Summon Status Menu with:
$scene = Scene_SummonStatus.new
Expand to see the code.


Edit:
I've updated the Scene Status.
Now you can use item on summon.
The command abilities and attribute are not implemented yet.
is there something in this script like "the Summons will auto return after the battle is over"?

because if there is isnt, the player can decide to keep the summons lol.

it'll be better if the script has @auto_summon_return_call or something.
The summon return when all the enemies are defeated.
nice.. i dont see any flaws ATM. simple and short summoning script you got there :)
Updated:
Now you can develop the summon attributes!!!
Can it be possible so the summon takes a place of a player instead of all the team? like making an element so these types of skills will summon an ally instead of leaving the area for him?
http://www.hbgames.org/forums/showthread.php?t=14163

Try it with this script... there's a minor glitch, the original heroes' HP and SP bars aren't hidden...
the only missing thing is.. the demo! hahaha!

go lionheart! we are counting on you!

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=27616