Version: 1.1/size]
By: Dargor
Introduction
This script works like Diablo 2 "Gears Set" system. Lets say you have a set of "Mithril" items:
Mithril Blade, Mithril Shield, Mithril Armor, etc.
If you have all the "Mithril" set equipped, you gain stats bonuses.
Please tell me if you have any ideas for new features!
Features
• Can specify the required Weapons and Armors for every sets
• Can specify the HP, MP, ATK, DEF, SPI and AGI bonuses
Script
Code:
#==============================================================================
# ** Equipment Sets
#------------------------------------------------------------------------------
#  © Dargor, 2009
# Â 24/02/09
# Â Version 1.1
# Â Requested by teth
#------------------------------------------------------------------------------
# Â VERSION HISTORY:
# Â - 1.0 Â (18/02/09), Initial release
# - 1.1 (24/02/09), Fix a method aliasing bug
#------------------------------------------------------------------------------
# Â INTRODUCTION:
# Â Â This script works like Diablo 2 "Gears Set" system.
# Â Â Lets say you have a set of "Mithril" items:
# Â Â Â Â Mithril Blade, Mithril Shield, Mithril Armor, etc.
# Â Â If you have all the "Mithril" set equipped, you gain stats bonuses.
#------------------------------------------------------------------------------
# Â INSTRUCTIONS:
# Â Â Â 1) Place this script ABOVE Main
# Â Â Â 2) Edit the constants in the Equip_Sets module
#------------------------------------------------------------------------------
# Â NOTES:
# Â Â Â - When defining required items in Set_Weapon, Set_Armor1, etc.,
# Â Â Â Â you are not required to specify an item for each item kind.
# Â Â Â Â
# Â Â Â Â Example: If you specify an item for Armor1,2,3 & 4 but not for Weapon
# Â Â Â Â Â Â Â Â Â then this set doesn't require a weapon to give bonuses.
#==============================================================================
Â
#==============================================================================
# ** Equipment Set Configuration module
#==============================================================================
Â
module Equip_Sets
 # ID of sets available in the game
 Sets = [1]
 # Required Weapons
 # SYNTAX: { Set ID => required weapon ID }
 Set_Weapon = { 1 => 1}
 # Required Shields
 # SYNTAX: { Set ID => required shield ID }
 Set_Armor1 = { 1 => 1}
 # Required Helmets
 # SYNTAX: { Set ID => required helmet ID }
 Set_Armor2 = { 1 => 7}
 # Required Body Armors
 # SYNTAX: { Set ID => required body armor ID }
 Set_Armor3 = { 1 => 13}
 # Required Accessories
 # SYNTAX: { Set ID => required accessory ID }
 Set_Armor4 = { 1 => 23}
 # Set Stats Bonus
 # SYNTAX: { Set ID => [HP, MP, ATK, DEF, SPI, AGI] }
 Set_Bonus = { 1 => [100, 25, 10, 5, 10, 5] }
 # Full Set Equipped SE
 Full_Set_SE = 'Chime2'
end
Â
#==============================================================================
# ** Sound
#------------------------------------------------------------------------------
# Â This module plays sound effects. It obtains sound effects specified in the
# database from $data_system, and plays them.
#==============================================================================
Â
module Sound
 # Limit
 def self.play_full_set
  se = RPG::SE.new(Equip_Sets::Full_Set_SE)
  se.play
 end
end
Â
#==============================================================================
# ** Game_Battler
#------------------------------------------------------------------------------
# Â This class deals with battlers. It's used as a superclass of the Game_Actor
# and Game_Enemy classes.
#==============================================================================
Â
class Game_Battler
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_equip_set_battler_clear_extra_values clear_extra_values
 alias dargor_vx_equip_set_battler_maxhp maxhp
 alias dargor_vx_equip_set_battler_maxmp maxmp
 alias dargor_vx_equip_set_battler_atk atk
 alias dargor_vx_equip_set_battler_def def
 alias dargor_vx_equip_set_battler_spi spi
 alias dargor_vx_equip_set_battler_agi agi
 #--------------------------------------------------------------------------
 # * Clear Values Added to Parameter
 #--------------------------------------------------------------------------
 def clear_extra_values
  dargor_vx_equip_set_battler_clear_extra_values
  clear_set_extra_values
 end
 #--------------------------------------------------------------------------
 # * Clear Values Added to Parameter
 #--------------------------------------------------------------------------
 def clear_set_extra_values
  @set_maxhp_plus = 0
  @set_maxmp_plus = 0
  @set_atk_plus = 0
  @set_def_plus = 0
  @set_spi_plus = 0
  @set_agi_plus = 0
 end
 #--------------------------------------------------------------------------
 # * Get Maximum HP
 #--------------------------------------------------------------------------
 def maxhp
  bonus = dargor_vx_equip_set_battler_maxhp + @set_maxhp_plus
  n = [[bonus, 1].max, maxhp_limit].min
  return n
 end
 #--------------------------------------------------------------------------
 # * Get Maximum MP
 #--------------------------------------------------------------------------
 def maxmp
  bonus = dargor_vx_equip_set_battler_maxmp + @set_maxmp_plus
  n = [[bonus, 0].max, 9999].min
  return n
 end
 #--------------------------------------------------------------------------
 # * Get Attack
 #--------------------------------------------------------------------------
 def atk
  bonus = dargor_vx_equip_set_battler_atk + @set_atk_plus
  n = [[bonus, 1].max, 999].min
  return n
 end
 #--------------------------------------------------------------------------
 # * Get Defense
 #--------------------------------------------------------------------------
 def def
  bonus = dargor_vx_equip_set_battler_def + @set_def_plus
  n = [[bonus, 1].max, 999].min
  return n
 end
 #--------------------------------------------------------------------------
 # * Get Spirit
 #--------------------------------------------------------------------------
 def spi
  bonus = dargor_vx_equip_set_battler_spi + @set_spi_plus
  n = [[bonus, 1].max, 999].min
  return n
 end
 #--------------------------------------------------------------------------
 # * Get Agility
 #--------------------------------------------------------------------------
 def agi
  bonus = dargor_vx_equip_set_battler_agi + @set_agi_plus
  n = [[bonus, 1].max, 999].min
  return n
 end
 #--------------------------------------------------------------------------
 # * Apply Bonus of Full Equipment Set
 #--------------------------------------------------------------------------
 def apply_equipment_set_bonus(set_id)
  if set_id != 0
   @set_maxhp_plus = Equip_Sets::Set_Bonus[set_id][0]
   @set_maxmp_plus = Equip_Sets::Set_Bonus[set_id][1]
   @set_atk_plus = Equip_Sets::Set_Bonus[set_id][2]
   @set_def_plus = Equip_Sets::Set_Bonus[set_id][3]
   @set_spi_plus = Equip_Sets::Set_Bonus[set_id][4]
   @set_agi_plus = Equip_Sets::Set_Bonus[set_id][5]
  else
   clear_set_extra_values
  end
 end
end
Â
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# Â This class handles actors. It's used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================
Â
class Game_Actor < Game_Battler
 #--------------------------------------------------------------------------
 # * Public Instance Variables
 #--------------------------------------------------------------------------
 attr_reader :equipped_set_id
 #--------------------------------------------------------------------------
 # * Alias Listing
 #--------------------------------------------------------------------------
 alias dargor_vx_equip_set_actor_setup setup
 alias dargor_vx_equip_set_actor_change_equip change_equip
 #--------------------------------------------------------------------------
 # * Setup
 #  actor_id  : actor ID
 #--------------------------------------------------------------------------
 def setup(actor_id)
  dargor_vx_equip_set_actor_setup(actor_id)
  @equipped_set_id = 0
 end
 #--------------------------------------------------------------------------
 # * Check if a full set is equipped
 #--------------------------------------------------------------------------
 def full_set_equipped?
  for set_id in Equip_Sets::Sets
   if set_weapon_equipped?(set_id) && set_armor_equipped?(set_id, 1) &&
     set_armor_equipped?(set_id, 2) && set_armor_equipped?(set_id, 3) &&
     set_armor_equipped?(set_id, 4)
    @equipped_set_id = set_id
    return true
   end
  end
  @equipped_set_id = 0
  apply_equipment_set_bonus(0)
  return false
 end
 #--------------------------------------------------------------------------
 # * Check if a full set is equipped (weapon)
 #--------------------------------------------------------------------------
 def set_weapon_equipped?(set_id)
  if Equip_Sets::Set_Weapon.has_key?(set_id)
   result = @weapon_id == Equip_Sets::Set_Weapon[set_id]
  else
   result = true
  end
  return result
 end
 #--------------------------------------------------------------------------
 # * Check if a full set is equipped (armor)
 #--------------------------------------------------------------------------
 def set_armor_equipped?(set_id, armor_id)
  result = false
  case armor_id
  when 1
   if Equip_Sets::Set_Armor1.has_key?(set_id)
    result = @armor1_id == Equip_Sets::Set_Armor1[set_id]
   else
    result = true
   end
  when 2
   if Equip_Sets::Set_Armor2.has_key?(set_id)
    result = @armor2_id == Equip_Sets::Set_Armor2[set_id]
   else
    result = true
   end
  when 3
   if Equip_Sets::Set_Armor3.has_key?(set_id)
    result = @armor3_id == Equip_Sets::Set_Armor3[set_id]
   else
    result = true
   end
  when 4
   if Equip_Sets::Set_Armor4.has_key?(set_id)
    result = @armor4_id == Equip_Sets::Set_Armor4[set_id]
   else
    result = true
   end
  end
  return result
 end
 #--------------------------------------------------------------------------
 # * Change Equipment (designate object)
 #   equip_type : Equip region (0..4)
 #   item    : Weapon or armor (nil is used to unequip)
 #   test    : Test flag (for battle test or temporary equipment)
 #--------------------------------------------------------------------------
 def change_equip(equip_type, item, test = false)
  dargor_vx_equip_set_actor_change_equip(equip_type, item, test)
  unless test
   if full_set_equipped? and
    apply_equipment_set_bonus(@equipped_set_id)
    Sound.play_full_set
   end
  end
 end
end
Instructions
Place this script above Main.
Refer to the script header and comments for more informations.
Compatibility
Should be compatible with everything.
Credits and Thanks
Thanks to teth for requesting this script!