Save-Point
KSummon XP - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html)
+---- Thread: KSummon XP (/thread-7341.html)



KSummon XP - kyonides - 10-10-2018

KSummon XP


Kiwi + Mango + Maracuya Versions


by Kyonides-Arkanthes

Introduction

[rant] Go to hell! [/rant] Nah, just kidding!  Laughing

This scriptlet will allow you to set a summon weapon or armor skill. It would allow a mage or cleric summon it in order to help a fellow comrade in battle improve his or her attack stats. Still, you gotta know it might fail and leave the comrade in a difficult situation by not equipping a decent weapon or body armor, if any...

According to some furry Elder Scrolls fan, it's known as Bound Weapons or Armors... I have never played it so it was impossible for me to even imagine it was kind of popular there.

It is possible to enable a sprite to pop up right when the summon was successful by telling you its actual name. (Even so I dislike this option to be honest with you.)

Since Maracuya Version...

You now can let monsters change your heroes' equipment! But that's not all they can do! They might be allowed to set a state on a hero preventing him from casting a spell to get a better piece of equipment. Unless that hero isn't a mage, that means some serious business, guys! Shocked

Wait! Don't leave! There's more I got to tell you! There might be a way to setup some sort of recoil if the afflicted hero uses a weapon! Darn Recoil State! Laughing + Tongue sticking out

Compatibility
  • Default XP Battle System
  • Brenda's Visual Battlers
  • Action Cost System
  • Agility Based Battlesystem
  • MakirouAru's ATB
  • ParaDog's ATB
  • XRXS65
  • Cogwheel's RTAB (without popup message)
  • ???
 
The Very Same Script

Kiwi Version
Code:
# * KSummon XP - Kiwi aka the Weapon and Armor Edition

#   Scripter : Kyonides-Arkanthes
#   2018-10-12

# This is a scriptlet that will allow you to use a magic skill to perform a
# weapon or armor summon bypassing the database limitations that should prevent
# you from doing so.

# Please notice that the default return values for WEAPONS and ARMORS hashes are
# the weapon or armor ID the target hero will get if the skill fails.

module KSummon
  # Use a pop up sprite to tell the player it was a successful summon
  USE_POP_UP_LABEL = true # true - Show it, nil - Don't even dare!
  WEAPON_SKILL = 81 # Cannot be the same as BODY_ARMOR_SKILL
  WEAPONS = {} # You Can't Touch This!
  WEAPONS.default = 0 # This value should be set to 0 or any existing Weapon ID
  WEAPONS[1] = (33..38).to_a # Add Sword ID's for Aluxes
  WEAPONS[2] = (39..44).to_a # Add Spear ID's for Basil
  BODY_ARMOR_SKILL = 82 # Cannot be the same as WEAPON_SKILL
  BODY_ARMORS = {} # You Can't Touch This!
  BODY_ARMORS.default = 0 # This value should be set to 0 or any existing Armor ID
  BODY_ARMORS[1] = (33..38).to_a # Add Body Armor ID's for Aluxes
  BODY_ARMORS[2] = (39..44).to_a # Add Body Armor ID's for Basil
  # End of Configuration Section #
  module_function
  def clear_equipment
    @weapons.clear
    @body_armors.clear
  end
  def weapons() @weapons end
  def body_armors() @body_armors end
  @weapons = {}
  @body_armors = {}
end

class Game_Battler
  alias gm_b_skill_effect skill_effect
  def skill_effect(user, skill)
    result = gm_b_skill_effect(user, skill)
    case skill.id
    when KSummon::WEAPON_SKILL
      force_change_equip(:weapon, true)
      if KSummon::USE_POP_UP_LABEL and @weapon_id != 0
        self.damage = $data_weapons[@weapon_id].name
      end
    when KSummon::BODY_ARMOR_SKILL
      force_change_equip(:body, true)
      if KSummon::USE_POP_UP_LABEL and @armor3_id != 0
        self.damage = $data_armors[@armor3_id].name
      end
    end
    return result
  end
end

class Game_Actor
  def force_change_equip(kind, set_equipment)
    case kind
    when :weapon
      if set_equipment
        KSummon.weapons[@actor_id] = @weapon_id
        ary = KSummon::WEAPONS[@class_id]
        return @weapon_id = ary[rand(ary.size)]
      else
        weapons = KSummon.weapons
        return unless weapons.keys.include?(@actor_id)
        @weapon_id = weapons[@actor_id]
        return KSummon.weapons.delete(@actor_id)
      end
    when :body
      if set_equipment
        KSummon.body_armors[@actor_id] = @armor3_id
        ary = KSummon::BODY_ARMORS[@class_id]
        return @armor3_id = ary[rand(ary.size)]
      else
        armors = KSummon.body_armors
        return unless armors.keys.include?(@actor_id)
        @armor3_id = KSummon.body_armors[@actor_id]
        return KSummon.body_armors.delete(@actor_id)
      end
    end
  end
end

class Scene_Battle
  alias kyon_ksummon_scn_battle_end battle_end
  def battle_end(result)
    $game_party.actors.each do |actor|
      actor.force_change_equip(:weapon, nil)
      actor.force_change_equip(:body, nil)
    end
    KSummon.clear_equipment
    kyon_ksummon_scn_battle_end(result)
  end
end

Mango Version
Code:
# * KSummon XP - Mango Version

#   aka the Weapon and Armor and Accessory Edition
#   Scripter : Kyonides-Arkanthes
#   2018-10-12

# This is a scriptlet that will allow you to use a magic skill to perform a
# weapon or body armor or accessory summon bypassing the database limitations
# that should prevent you from doing so.

# Please notice that the default return values for WEAPONS and ARMORS hashes are
# the weapon or armor ID the target hero will get if the skill fails.

# * How does the Mango Exclusive DONT_LOSE_EQUIP_RATE feature actually work?

#   RN   : Random Number - between 0 and 100
#   DLER : DONT_LOSE_EQUIP_RATE[equipment_kind]
#   ML   : Mage's Level * MAGE_LVL_MULTIPLIER

# The script makes the following check if the summon fails:
#   Checks if RN is greater than DLER + ML
# Possible Outcomes:
#   It's Greater than... Yeah, forget all about that piece of equipment pal!
#   It's Equal to or Less than... You keep your darn piece of equipment. Yeah...

module KSummon
  # Use a pop up sprite to tell the player it was a successful summon
  USE_POP_UP_LABEL = true # true - Show it, nil - Don't even dare!
  # Keep the equipment the mage has summoned for you till the battle ends?
  KEEP_EQUIPMENT_TILL_BATTLE_ENDS = nil # Values: true - keep it, nil - no way!
  MAGE_LVL_MULTIPLIER = 1 # Mage's Level * Multiplier
  # Equiment Loss Prevention Rates for Weapons, Body Armors and Accessories
  # between 1 and 100 (Percent) not including Mage Level Multiplier
  DONT_LOSE_EQUIP_RATE = { :weapon => 50, :body => 65, :accessory => 75 }
  # Turns for Weapons, Body Armors and Accessories between 1 and 1000
  TURNS = { :weapon => 5, :body => 7, :accessory => 10 }
  WEAPON_SKILL = 81 # Cannot be the same as BODY_ARMOR_SKILL or ACCESSORY_SKILL
  WEAPONS = {} # You Can't Touch This!
  WEAPONS.default = 0 # This value should be set to 0 or any existing Weapon ID
  WEAPONS[1] = (33..38).to_a # Add Sword ID's for Aluxes
  WEAPONS[2] = (39..44).to_a # Add Spear ID's for Basil
  BODY_ARMOR_SKILL = 82 # Cannot be the same as WEAPON_SKILL
  BODY_ARMORS = {} # You Can't Touch This!
  BODY_ARMORS.default = 0 # Value should be set to 0 or any existing Armor ID
  BODY_ARMORS[1] = (33..38).to_a # Add Body Armor ID's for Aluxes
  BODY_ARMORS[2] = (39..44).to_a # Add Body Armor ID's for Basil
  ACCESSORY_SKILL = 83 # Cannot be the same as WEAPON_SKILL
  ACCESSORIES = {} # You Can't Touch This!
  ACCESSORIES.default = 0 # Value should be set to 0 or any existing Armor ID
  ACCESSORIES[1] = (33..38).to_a # Add Body Armor ID's for Aluxes
  ACCESSORIES[2] = (39..44).to_a # Add Body Armor ID's for Basil
  # End of Configuration Section #
  class Equip
    attr_reader :id, :kind
    def initialize(equip_id, kind)
      @id = equip_id
      @kind = kind
      @turns = TURNS[kind]
    end
    def no_turns() @turns == 0 end
    def decrease_turn() @turns -= 1 end
  end
  module_function
  def decrease_turn
    return if KEEP_EQUIPMENT_TILL_BATTLE_ENDS
    @weapons.each do |k, e|
      e.decrease_turn
      reset_equip(:weapon, k) if e.no_turns
    end
    @body_armors.each do |k, e|
      e.decrease_turn
      reset_equip(:body, k) if e.no_turns
    end
    @accessor.each do |k, e|
      e.decrease_turn
      reset_equip(:accessory, k) if e.no_turns
    end
  end

  def reset_equip(kind, key)
    $game_actors[key].force_reset_equip(kind) rescue nil
    case kind
    when :weapon then @weapons.delete(key)
    when :body then @body_armors.delete(key)
    when :accessory then @accessor.delete(key)
    end
  end

  def clear_equipment
    @weapons.clear
    @body_armors.clear
    @accessor.clear
  end
  def equip_lost?(kind)
    rand(100) > DONT_LOSE_EQUIP_RATE[kind] + @mage_lvl * MAGE_LVL_MULTIPLIER
  end
  def store_weapon(hid, wid) @weapons[hid] = Equip.new(wid, :weapon) end
  def store_body_armor(hid, bid) @body_armors[hid] = Equip.new(bid, :body) end
  def store_accessory(hid, aid) @accessor[hid] = Equip.new(aid, :accessory) end
  def weapons() @weapons end
  def body_armors() @body_armors end
  def accessories() @accessor end
  def mage_lvl=(level) @mage_lvl = level end
  @weapons = Hash.new{ Equip.new(0, :weapon) }
  @body_armors = Hash.new{ Equip.new(0, :body) }
  @accessor = Hash.new{ Equip.new(0, :accessory) }
end

class Game_Battler
  alias gm_b_skill_effect skill_effect
  def skill_effect(user, skill)
    result = gm_b_skill_effect(user, skill)
    case skill.id
    when KSummon::WEAPON_SKILL
      force_set_equip(:weapon, result, user.level)
      if KSummon::USE_POP_UP_LABEL and @weapon_id != 0
        self.damage = $data_weapons[@weapon_id].name
      end
    when KSummon::BODY_ARMOR_SKILL
      force_set_equip(:body, result, user.level)
      if KSummon::USE_POP_UP_LABEL and @armor3_id != 0
        self.damage = $data_armors[@armor3_id].name
      end
    when KSummon::ACCESSORY_SKILL
      force_set_equip(:accessory, result, user.level)
      if KSummon::USE_POP_UP_LABEL and @armor4_id != 0
        self.damage = $data_armors[@armor4_id].name
      end
    end
    return result
  end
end

class Game_Actor
  def force_set_equip(kind, success, mage_level)
    KSummon.mage_lvl = mage_level
    case kind
    when :weapon
      if success
        KSummon.store_weapon(@actor_id, @weapon_id)
        ary = KSummon::WEAPONS[@class_id]
        return @weapon_id = ary[rand(ary.size)]
      else
        @weapon_id = 0 if KSummon.equip_lost?(kind)
        return 0
      end
    when :body
      if success
        KSummon.store_body_armor(@actor_id, @armor3_id)
        ary = KSummon::BODY_ARMORS[@class_id]
        return @armor3_id = ary[rand(ary.size)]
      else
        @armor3_id = 0 if KSummon.equip_lost?(kind)
        return 0
      end
    when :accessory
      if success
        KSummon.store_accessory(@actor_id, @armor4_id)
        ary = KSummon::ACCESSORIES[@class_id]
        return @armor4_id = ary[rand(ary.size)]
      else
        @armor4_id = 0 if KSummon.equip_lost?(kind)
        return 0
      end
    end
  end

  def force_reset_equip(*kinds)
    kinds.each do |kind|
      case kind
      when :weapon
        weapons = KSummon.weapons
        next unless weapons.keys.include?(@actor_id)
        @weapon_id = weapons[@actor_id].id
        next
      when :body
        armors = KSummon.body_armors
        next unless armors.keys.include?(@actor_id)
        @armor3_id = armors[@actor_id].id
        next
      when :accessory
        accessories = KSummon.accessories
        next unless accessories.keys.include?(@actor_id)
        @armor4_id = accessories[@actor_id].id
      end
    end
  end
end

class Scene_Battle
  alias kyon_ksummon_scn_battle_sp4 start_phase4
  alias kyon_ksummon_scn_battle_end battle_end
  def start_phase4
    KSummon.decrease_turn
    kyon_ksummon_scn_battle_sp4
  end

  def battle_end(result)
    if KSummon::KEEP_EQUIPMENT_TILL_BATTLE_ENDS
      team = $game_party.actors
      team.each {|actor| actor.force_reset_equip(:weapon, :body, :accessory) }
      KSummon.clear_equipment
    end
    kyon_ksummon_scn_battle_end(result)
  end
end

Maracuya Version
Code:
# * KSummon XP - Maracuya Version
#   aka the Weapon and Armor and Accessory Edition
#   Scripter : Kyonides-Arkanthes
#   2018-12-06

# This is a scriptlet that will allow you to use a magic skill to perform a
# weapon or body armor or accessory summon bypassing the database limitations
# that should prevent you from doing so.

# Please notice that the default return values for WEAPONS & ARMORS hashes are
# the weapon or armor ID the target hero will get if the skill fails.

# Now Monsters can also change your heroes' equipment if they use any of the
# skills set here! All of the DEMOTE_ constants are used by Monsters!

# You can also set Recoil to true if you want to... *Insert Evil Laugh Here*

# * How does the Mango Exclusive DONT_LOSE_EQUIP_RATE feature actually work?

#   RN   : Random Number - between 0 and 100
#   DLER : DONT_LOSE_EQUIP_RATE[equipment_kind]
#   ML   : Mage's Level * MAGE_LVL_MULTIPLIER

# The script makes the following check if the summon fails:
#   Checks if RN is greater than DLER + ML
# Possible Outcomes:
#   It's Greater than... Yeah, forget all about that piece of equipment pal!
#   It's Equal to or Less than... You keep your darn piece of equipment. Yeah...

module KSummon
  # Use a pop up sprite to tell the player it was a successful summon
  USE_POP_UP_LABEL = true # true - Show it, nil - Don't even dare!
  ALLOW_HAUNTED_ACTOR_RECOIL = true # true - Friends get hurt!
  # Keep the equipment the mage has summoned for you till the battle ends?
  KEEP_EQUIPMENT_TILL_BATTLE_ENDS = nil # Values: true - keep it, nil - no way!
  MAGE_LVL_MULTIPLIER = 1 # Mage's Level * Multiplier
  MONSTER_LVL_MULTIPLIER = 1 # Monster's Level * Multiplier
  HAUNTED_ACTOR_RECOIL_PERCENT = 25 # Between 0 and 1000%!?
  # Equiment Loss Prevention Rates for Weapons, Body Armors and Accessories
  # between 1 and 100 (Percent) not including Mage Level Multiplier
  DONT_LOSE_EQUIP_RATE = { :weapon => 50, :body => 65, :accessory => 75 }
  # Turns for Weapons, Body Armors and Accessories between 1 and 1000
  TURNS = { :weapon => 5, :body => 7, :accessory => 10 }
  WEAPON_SKILL = 81 # Cannot be the same as BODY_ARMOR_SKILL or ACCESSORY_SKILL
  BODY_ARMOR_SKILL = 82 # Cannot be the same as WEAPON_SKILL
  ACCESSORY_SKILL = 83 # Cannot be the same as WEAPON_SKILL
  DEMOTE_WEAPON_SKILL = 84 # Used by Monsters!
  DEMOTE_ARMOR_SKILL = 85
  DEMOTE_ACCESS_SKILL = 86
  HAUNTED_ACTOR_STATE = 17
  WEAPONS = {} # You Can't Touch This!
  WEAPONS.default = 0 # This value should be set to 0 or any existing Weapon ID
  DEMOTE_WEAPONS = {} # You Can't Touch This!
  DEMOTE_WEAPONS.default = 0 # Set to 0 or any existing Weapon ID
  WEAPONS[1] = (33..38).to_a # Add Sword ID's for Aluxes
  WEAPONS[2] = (39..44).to_a # Add Spear ID's for Basil
  DEMOTE_WEAPONS[1] = (33..38).to_a # Add Sword ID's for Aluxes
  DEMOTE_WEAPONS[2] = (39..44).to_a # Add Spear ID's for Basil
  BODY_ARMORS = {} # You Can't Touch This!
  BODY_ARMORS.default = 0 # Value should be set to 0 or any existing Armor ID
  DEMOTE_BODY_ARMORS = {} # You Can't Touch This!
  DEMOTE_BODY_ARMORS.default = 0 # Set to 0 or any existing Armor ID
  BODY_ARMORS[1] = (33..38).to_a # Add Body Armor ID's for Aluxes
  BODY_ARMORS[2] = (39..44).to_a # Add Body Armor ID's for Basil
  DEMOTE_BODY_ARMORS[1] = (33..38).to_a # Add Body Armor ID's for Aluxes
  DEMOTE_BODY_ARMORS[2] = (39..44).to_a # Add Body Armor ID's for Basil
  ACCESSORIES = {} # You Can't Touch This!
  ACCESSORIES.default = 0 # Value should be set to 0 or any existing Armor ID
  DEMOTE_ACCESSORIES = {} # You Can't Touch This!
  DEMOTE_ACCESSORIES.default = 0 # Set to 0 or any existing Armor ID
  ACCESSORIES[1] = (33..38).to_a # Add Body Armor ID's for Aluxes
  ACCESSORIES[2] = (39..44).to_a # Add Body Armor ID's for Basil
  DEMOTE_ACCESSORIES[1] = (33..38).to_a # Add Body Armor ID's for Aluxes
  DEMOTE_ACCESSORIES[2] = (39..44).to_a # Add Body Armor ID's for Basil
  MONSTER_LEVELS = { 1 => 5, 2 => 10 }
  MONSTER_LEVELS.default = 1 # Default Value for excluded monsters
  # Do Not Edit This Array!
  POSITIVE_SKILLS = [WEAPON_SKILL, BODY_ARMOR_SKILL, ACCESSORY_SKILL]
  # End of Configuration Section #
  class Equip
    attr_reader :id, :kind
    def initialize(equip_id, kind)
      @id = equip_id
      @kind = kind
      @turns = TURNS[kind]
    end
    def no_turns() @turns == 0 end
    def decrease_turn() @turns -= 1 end
  end
  module_function
  def decrease_turn
    return if KEEP_EQUIPMENT_TILL_BATTLE_ENDS
    @weapons.each do |k, e|
      e.decrease_turn
      reset_equip(:weapon, k) if e.no_turns
    end
    @body_armors.each do |k, e|
      e.decrease_turn
      reset_equip(:body, k) if e.no_turns
    end
    @accessor.each do |k, e|
      e.decrease_turn
      reset_equip(:accessory, k) if e.no_turns
    end
    @monster_weapons.each do |k, e|
      e.decrease_turn
      monster_reset_equip(:weapon, k) if e.no_turns
    end
    @monster_body_armors.each do |k, e|
      e.decrease_turn
      monster_reset_equip(:body, k) if e.no_turns
    end
    @monster_accessor.each do |k, e|
      e.decrease_turn
      monster_reset_equip(:accessory, k) if e.no_turns
    end
  end

  def clear_equipment
    @weapons.clear
    @body_armors.clear
    @accessor.clear
    @monster_weapons.clear
    @monster_body_armors.clear
    @monster_accessor.clear
  end

  def equip_lost?(kind)
    rand(100) > DONT_LOSE_EQUIP_RATE[kind] + @mage_lvl * MAGE_LVL_MULTIPLIER
  end

  def monster_equip_lost?(kind)
    lvl = @monster_lvl * MONSTER_LVL_MULTIPLIER
    rand(100) > DONT_LOSE_EQUIP_RATE[kind] + lvl
  end

  def store_monster_weapon(hid, wid)
    @monster_weapons[hid] = Equip.new(wid, :weapon)
  end

  def store_monster_body_armor(hid, bid)
    @monster_body_armors[hid] = Equip.new(bid, :body)
  end

  def store_monster_accessory(hid, aid)
    @monster_accessor[hid] = Equip.new(aid, :accessory)
  end
  def store_weapon(hid, wid) @weapons[hid] = Equip.new(wid, :weapon) end
  def store_body_armor(hid, bid) @body_armors[hid] = Equip.new(bid, :body) end
  def store_accessory(hid, aid) @accessor[hid] = Equip.new(aid, :accessory) end
  def weapons() @weapons end
  def body_armors() @body_armors end
  def accessories() @accessor end
  def monster_weapons() @monster_weapons end
  def monster_body_armors() @monster_body_armors end
  def monster_accessories() @monster_accessor end
  def mage_lvl=(level) @mage_lvl = level end
  def monster_lvl=(level) @monster_lvl = level end
  @weapons = Hash.new{ Equip.new(0, :weapon) }
  @body_armors = Hash.new{ Equip.new(0, :body) }
  @accessor = Hash.new{ Equip.new(0, :accessory) }
  @monster_weapons = Hash.new{ Equip.new(0, :weapon) }
  @monster_body_armors = Hash.new{ Equip.new(0, :body) }
  @monster_accessor = Hash.new{ Equip.new(0, :accessory) }
  @mage_lvl = 0
  @monster_lvl = 0
end

class Game_Battler
  alias gm_b_attack_effect attack_effect
  alias gm_b_skill_effect skill_effect
  def attack_effect(atker)
    result = gm_b_attack_effect(atker)
    if atker.is_a?(Game_Actor) and @damage > 0
      if @states.include?(KSummon::HAUNTED_ACTOR_RECOIL_STATE)
        return result unless KSummon::ALLOW_HAUNTED_ACTOR_RECOIL
        pos = rand($game_party.actors.size)
        hero = $game_party.smooth_target_actor(pos)
        hero.damage = @damage * KSummon::HAUNTED_ACTOR_RECOIL_PERCENT / 100
      end
    end
    result
  end

  def skill_effect(user, skill)
    result = gm_b_skill_effect(user, skill)
    case skill.id
    when KSummon::WEAPON_SKILL
      force_set_equip(:weapon, result, user.level)
      keeps_equipment = @weapon_id > 0
    when KSummon::BODY_ARMOR_SKILL
      force_set_equip(:body, result, user.level)
      keeps_equipment = @armor3_id > 0
    when KSummon::ACCESSORY_SKILL
      force_set_equip(:accessory, result, user.level)
      keeps_equipment = @armor4_id > 0
    when KSummon::DEMOTE_WEAPON_SKILL
      lvl = KSummon::MONSTER_LEVELS[user.id]
      monster_set_equip(:weapon, result, lvl)
      keeps_equipment = @weapon_id > 0
    when KSummon::DEMOTE_ARMOR_SKILL
      lvl = KSummon::MONSTER_LEVELS[user.id]
      monster_set_equip(:body, result, lvl)
      keeps_equipment = @armor3_id > 0
    when KSummon::DEMOTE_ACCESS_SKILL
      lvl = KSummon::MONSTER_LEVELS[user.id]
      monster_set_equip(:accessory, result, lvl)
      keeps_equipment = @armor4_id > 0
    end
    if KSummon::USE_POP_UP_LABEL and keeps_equipment
      self.damage = $data_weapons[@weapon_id].name
    end
    return result
  end
end

class Game_Actor
  def force_set_equip(kind, success, mage_level)
    KSummon.mage_lvl = mage_level
    case kind
    when :weapon
      if success
        KSummon.store_weapon(@actor_id, @weapon_id)
        ary = KSummon::WEAPONS[@class_id]
        return @weapon_id = ary[rand(ary.size)]
      else
        @weapon_id = 0 if KSummon.equip_lost?(kind)
        return 0
      end
    when :body
      if success
        KSummon.store_body_armor(@actor_id, @armor3_id)
        ary = KSummon::BODY_ARMORS[@class_id]
        return @armor3_id = ary[rand(ary.size)]
      else
        @armor3_id = 0 if KSummon.equip_lost?(kind)
        return 0
      end
    when :accessory
      if success
        KSummon.store_accessory(@actor_id, @armor4_id)
        ary = KSummon::ACCESSORIES[@class_id]
        return @armor4_id = ary[rand(ary.size)]
      else
        @armor4_id = 0 if KSummon.equip_lost?(kind)
        return 0
      end
    end
  end

  def force_reset_equip(*kinds)
    kinds.each do |kind|
      case kind
      when :weapon
        weapons = KSummon.weapons
        next unless weapons.keys.include?(@actor_id)
        @weapon_id = weapons[@actor_id].id
        next
      when :body
        armors = KSummon.body_armors
        next unless armors.keys.include?(@actor_id)
        @armor3_id = armors[@actor_id].id
        next
      when :accessory
        accessories = KSummon.accessories
        next unless accessories.keys.include?(@actor_id)
        @armor4_id = accessories[@actor_id].id
      end
    end
  end

  def monster_set_equip(kind, success, mage_level)
    KSummon.monster_lvl = mage_level
    case kind
    when :weapon
      if success
        KSummon.monster_store_weapon(@actor_id, @weapon_id)
        ary = KSummon::DEMOTE_WEAPONS[@class_id]
        return @weapon_id = ary[rand(ary.size)]
      else
        @weapon_id = 0 if KSummon.monster_equip_lost?(kind)
        return 0
      end
    when :body
      if success
        KSummon.monster_store_body_armor(@actor_id, @armor3_id)
        ary = KSummon::DEMOTE_BODY_ARMORS[@class_id]
        return @armor3_id = ary[rand(ary.size)]
      else
        @armor3_id = 0 if KSummon.monster_equip_lost?(kind)
        return 0
      end
    when :accessory
      if success
        KSummon.monster_store_accessory(@actor_id, @armor4_id)
        ary = KSummon::DEMOTE_ACCESSORIES[@class_id]
        return @armor4_id = ary[rand(ary.size)]
      else
        @armor4_id = 0 if KSummon.monster_equip_lost?(kind)
        return 0
      end
    end
  end

  def monster_reset_equip(*kinds)
    kinds.each do |kind|
      case kind
      when :weapon
        weapons = KSummon.monster_weapons
        next unless weapons.keys.include?(@actor_id)
        @weapon_id = weapons[@actor_id].id
        next
      when :body
        armors = KSummon.monster_body_armors
        next unless armors.keys.include?(@actor_id)
        @armor3_id = armors[@actor_id].id
        next
      when :accessory
        accessories = KSummon.monster_accessories
        next unless accessories.keys.include?(@actor_id)
        @armor4_id = accessories[@actor_id].id
      end
    end
  end

  alias kyon_ksummon_gm_actor_scu? skill_can_use?
  def skill_can_use?(sid)
    skill = (KSummon::POSITIVE_SKILLS.include?(sid) and @skills.include?(skid))
    has_state = @states.include?(KSummon::HAUNTED_ACTOR_RECOIL_STATE)
    return false if skill and has_state
    kyon_ksummon_gm_actor_scu?(sid)
  end
end

class Scene_Battle
  alias kyon_ksummon_scn_battle_sp4 start_phase4
  alias kyon_ksummon_scn_battle_end battle_end
  def start_phase4
    KSummon.decrease_turn
    kyon_ksummon_scn_battle_sp4
  end

  def battle_end(result)
    if KSummon::KEEP_EQUIPMENT_TILL_BATTLE_ENDS
      team = $game_party.actors
      team.each do |actor|
        actor.force_reset_equip(:weapon, :body, :accessory)
        actor.monster_set_equip(:weapon, :body, :accessory)
      end
      KSummon.clear_equipment
    end
    kyon_ksummon_scn_battle_end(result)
  end
end

FAQ

Q: Why did you make it if... (followed by some complain)
A: Well, I don't care if you like it or not, I crafted it just because.

Q: Is it compatible with my custom battle system?
A: How the hell should I know?  Laughing + Tongue sticking out Just go and test it yourself and later on send me some pm telling me all about it so I can add it to the BS compatibility list.

Terms & Conditions

You must credit me for making the script.
All versions are free for commercial and non commercial games, but I will ask you to pay a small fee in case you go commercial.


RE: KSummon XP - kyonides - 10-11-2018

Noseless Bump!

Early this morning I have published a new version of KSummon XP Kiwi Version with a bug fix included. By the way, the new Mango version is already available! It includes extra features exclusive for that version!

Shocked

They include the possibility to summon accessories, and the possibility to keep the summoned equipment till the battle ends or after n turns!

Grinning 

Melana: Would it work in a previously saved game? Confused
Scripter: You bet! It only features temporary stuff that will never be saved in a game file of any kind.
Melana: That sounds very convenient indeed! Shocked
Scripter: Just don't forget to setup the Constants found in my KSummon module correctly and everything will be fine!
Melana: Good! I don't need to setup those skills in the Skill Database tab.
Scripter: Happy with a sweat Actually... you still need to do that to make it work. Keep in mind those skills are meant to be cast during battles only.


RE: KSummon XP - DerVVulfman - 10-13-2018

If anyone's interested, it does work fine with Brenda's Visual Battlers. It also works with the Action Cost System by Fomar0153, The Agility Based Battlesystem by Syvkal, MakirouAru's ATB, ParaDog's ATB, XRXS65 by Fukuyama, and the RTAB system by Cogwheel. But you cannot take advantage of the Summons Pop system in KSummons when using RTAB because RTAB rewrites the damage pop system... you'd have to turn kyonides's Summons Pops off.

And of some AT bar systems, you might have to severely increase how many turns it takes for weapons or the like to vanish in the Mango system. Some of these act more like how many FRAMES instead of turns. Confused So a setting of 5 turns doesn't last long at all.

Ciao. Happy


RE: KSummon XP - kyonides - 12-06-2018

A Bound BUMP!

I have updated KSummon XP once again, guys! Laughing

What's New in Maracuya Version?

You now can let monsters change your heroes' equipment! But that's not all they can do! They might be allowed to set a state on a hero preventing him from casting a spell to get a better piece of equipment. Unless that hero isn't a mage, that means some serious business, guys! Shocked

Wait! Don't leave! There's more I got to tell you! There might be a way to setup some sort of recoil if the afflicted hero uses a weapon! Darn Recoil State! Laughing + Tongue sticking out