Advanced Equipment Sets
Version: 2.0
Author: Welfare-Daddy Pacman (based on a script by Lettuce)
Date: April 16, 2011
Version History
- <Version 1.0> 04.16.2011 - Original Release
- <Version 2.0> 04.16.2011 - Added compatibility patch
Planned Future Versions
- <Version 2.1> Fix up the text on the item and equipment screens
- <Version 3.0> Add set bonus description on status screen
- <Version 3.1> Add element enchant feature
Description
The maker can create similar items of equipment in the database, and can choose to give the player a bonus for collecting them. This script allows you to decide which of these items give the player a stats boost, which stat it boosts and by how much.
A special thing about these sets is that the sets add up, meaning that if you equip 2 peices from set 1 and 3 pieces from set 2, you get both of the boosts for the sets. It also displays the equipment set name on any equipped items in the status, equipment and item windows.
Features
- Ability to create 'equipment sets' with bonus settings
- Easy-to-understand instructions with examples and formats
- Stackable set bonuses
- Displayed set names on the item, status and equipment screens
Screenshots
Quite not very applicable. It's plug-and-play, basically.
Instructions
Detailed instructions are in the script, follow them closely. Put this script below materials and under main in the script editor.
Script
=begin
Equipment Sets Bonus
Version 1.0
By Welfare-Daddy Pacman (based on a script by Lettuce)
Description: The maker can create similar items of equipment in the database,
and can choose to give the player a bonus for collecting them. This script
allows you to decide which of these items give the player a stats boost, which
stat it boosts and by how much.
A special thing about these sets is that the sets add up, meaning that if you
equip 2 peices from set 1 and 3 pieces from set 2, you get both of the boosts
for the sets.
Instructions: Configuration with instructions begins at line 25, and ends at
line 104.
Support: Just find me on RMRK.net, I'm on pretty much every night.
=end
#-------------------------------------------------------------------------------
# EDITING SECTION A - EQUIPMENT SETS LIST
#-------------------------------------------------------------------------------
# Add more sets like this.
# SetID => [weaponID,armor1ID, armor2ID, armor3ID, armor4ID]
# It is intended that the weapon, obviously, is the weapon of the set; armor1
# is a shield, armor2 is a head armor, armor3 is a body armor and armor4 is an
# accesory.
# Example:
# 1 => [1, 2, 3, 4, 5]
Sets = {
1 => [1,2,9,15,24],
2 => [2,1,7,14,23],
3 => []
} # If you touch this, bad things will happen.
#-------------------------------------------------------------------------------
# EDITING SECTION B - EQUIPMENT SETS BONUS LIST
#-------------------------------------------------------------------------------
# These must be in the same order as the sets you created above.
# "Set_Bonus" with 1 as the key will be the bonus for Sets 1 above
# The attribute values are as follows:
# 1: attack , 2: defense , 3: spirit, 4: agi, 5: health, 6: magic, 7: critical,
# 8: evasion.
# ~!All values EXCEPT FOR HEALTH AND MAGIC are in percentage!~
# i.e. 1000 is 10 times the stat's base value.
#
# If you want the set to only offer a bonus for having 2 or more pieces
# equipped, just leave the first secondary bracket empty, i.e:
# 1 => [ [],
# [4,20]
# []
# [7,10]
# [8,10]
# ]
# The format is as follows:
# SetID => [ [Attribute,Amount], # when 1 piece is equipped
# [Attribute,Amount], # when 2 pieces are equipped
# [Attribute,Amount], # when 3 pieces are equipped
# [Attribute,Amount], # when 4 pieces are equipped
# [Attribute,Amount] # when 5 pieces are equipped
# ] # Make sure you include this last bracket.
Set_Bonus = { # Do not touch this.
1 => [ [1,5], #if equiped with one of these(2,9,15,24), gets 5% ATK
[2,20], #if any 2 of these (2,9,15,24), gets 5% ATK and 20% DEF
[5,100], #3 pieces gives 100 extra HP etc etc
[6,20],
[7,30]
], # Don't touch this...
2 => [ [],
[3,1000],
[2,2000],
[5,1000],
[6,2000]
], # or this...
3 => [ [1,5],
[2,20],
[5,100],
[7,2000],
[8,50]
] # ESPECIALLY not this...
} # Do not touch this either.
#-------------------------------------------------------------------------------
# EDITING SECTION C - EQUIPMENT SET NAMES
#-------------------------------------------------------------------------------
# This one is simple. Just set it up like this:
# SetID => "Set Name"
Set_Names = { # Do not touch this.
1 => "Super Set",
2 => "Basic set",
3 => "Ultimate set"
} # I will find and eat you if you touch this.
# If you are wondering about the point of this feature, it displays the set name
# on the status, item and equipment screens under any equipment that is in a
# set.
#-------------------------------------------------------------------------------
# END EDITING SECTION - DO NOT TOUCH UNLESS YOU ARE A SCRIPTER
# AND EVEN THEN IT'S NOT THAT COOL.
#-------------------------------------------------------------------------------
class Game_Actor < Game_Battler
attr_accessor :bonus_set
attr_accessor :bonus_set_pieces
alias pacman_eq_bonus_setup setup
def setup(actor_id)
pacman_eq_bonus_setup(actor_id)
@bonus_set = []
for i in 1..Sets.size
weapons = [nil,Sets[i][0]]
armors = [Sets[i][1],Sets[i][2],Sets[i][3],Sets[i][4]]
if Sets[i].include?(@weapon_id)
@bonus_set.push(i) if !@bonus_set.include?(i)
end
if Sets[i].include?(@armor4_id)
@bonus_set.push(i) if !@bonus_set.include?(i)
end
if Sets[i].include?(@armor3_id)
@bonus_set.push(i) if !@bonus_set.include?(i)
end
if Sets[i].include?(@armor2_id)
@bonus_set.push(i) if !@bonus_set.include?(i)
end
if Sets[i].include?(@armor1_id)
@bonus_set.push(i) if !@bonus_set.include?(i)
end
end
@bonus_set_pieces = []
for i in 0...@bonus_set.size
@bonus_set_pieces.push(0)
end
if !@bonus_set.empty?
for i in 0...@bonus_set.size
weapons = [nil,Sets[@bonus_set[i]][0]]
armors = [Sets[@bonus_set[i]][1],Sets[@bonus_set[i]][2],
Sets[@bonus_set[i]][3],Sets[@bonus_set[i]][4]]
@bonus_set_pieces[i] += weapons.include?(@weapon_id) ? 1 : 0
@bonus_set_pieces[i] += armors.include?(@armor1_id) ? 1 : 0
@bonus_set_pieces[i] += armors.include?(@armor2_id) ? 1 : 0
@bonus_set_pieces[i] += armors.include?(@armor3_id) ? 1 : 0
@bonus_set_pieces[i] += armors.include?(@armor4_id) ? 1 : 0
end
end
end
alias pacman_eq_bonus_atk atk
alias pacman_eq_bonus_def def
alias pacman_eq_bonus_spi spi
alias pacman_eq_bonus_agi agi
alias pacman_eq_bonus_maxhp maxhp
alias pacman_eq_bonus_maxmp maxmp
alias pacman_eq_bonus_cri cri
alias pacman_eq_bonus_eva eva
def atk
default_val = pacman_eq_bonus_atk
final_val = default_val
n = 100
if !@bonus_set.empty?
for j in 0...@bonus_set.size
for i in 0...@bonus_set_pieces[j]
if Set_Bonus[@bonus_set[j]][i] != nil
if Set_Bonus[@bonus_set[j]][i][0] == 1
n +=Set_Bonus[@bonus_set[j]][i][1]
end
end
end
end
final_val *= n
final_val /= 100
else
final_val = default_val
end
return final_val
end
def def
default_val = pacman_eq_bonus_def
final_val = default_val
n = 100
if !@bonus_set.empty?
for j in 0...@bonus_set.size
for i in 0...@bonus_set_pieces[j]
if Set_Bonus[@bonus_set[j]][i] != nil
if Set_Bonus[@bonus_set[j]][i][0] == 2
n +=Set_Bonus[@bonus_set[j]][i][1]
end
end
end
end
final_val *= n
final_val /= 100
else
final_val = default_val
end
return final_val
end
def spi
default_val = pacman_eq_bonus_spi
final_val = default_val
n = 100
if !@bonus_set.empty?
for j in 0...@bonus_set.size
for i in 0...@bonus_set_pieces[j]
if Set_Bonus[@bonus_set[j]][i] != nil
if Set_Bonus[@bonus_set[j]][i][0] == 3
n +=Set_Bonus[@bonus_set[j]][i][1]
end
end
end
end
final_val *= n
final_val /= 100
else
final_val = default_val
end
return final_val
end
def agi
default_val = pacman_eq_bonus_agi
final_val = default_val
n = 100
if !@bonus_set.empty?
for j in 0...@bonus_set.size
for i in 0...@bonus_set_pieces[j]
if Set_Bonus[@bonus_set[j]][i] != nil
if Set_Bonus[@bonus_set[j]][i][0] == 4
n +=Set_Bonus[@bonus_set[j]][i][1]
end
end
end
end
final_val *= n
final_val /= 100
else
final_val = default_val
end
return final_val
end
def maxhp
default_val = pacman_eq_bonus_maxhp
final_val = default_val
n = 100
if @bonus_set
if !@bonus_set.empty?
for j in 0...@bonus_set.size
for i in 0...@bonus_set_pieces[j]
if Set_Bonus[@bonus_set[j]][i] != nil
if Set_Bonus[@bonus_set[j]][i][0] == 5
n += Set_Bonus[@bonus_set[j]][i][1]
end
end
end
end
final_val *= n
final_val /= 100
else
final_val = default_val
end
end
return final_val
end
def maxmp
default_val = pacman_eq_bonus_maxmp
final_val = default_val
n = 100
if @bonus_set
if !@bonus_set.empty?
for j in 0...@bonus_set.size
for i in 0...@bonus_set_pieces[j]
if Set_Bonus[@bonus_set[j]][i] != nil
if Set_Bonus[@bonus_set[j]][i][0] == 6
n +=Set_Bonus[@bonus_set[j]][i][1]
end
end
end
end
final_val *= n
final_val /= 100
else
final_val = default_val
end
end
return final_val
end
def cri
default_val = pacman_eq_bonus_cri
final_val = default_val
n = 100
if !@bonus_set.empty?
for j in 0...@bonus_set.size
for i in 0...@bonus_set_pieces[j]
if Set_Bonus[@bonus_set[j]][i] != nil
if Set_Bonus[@bonus_set[j]][i][0] == 7
n +=Set_Bonus[@bonus_set[j]][i][1]
end
end
end
end
final_val *= n
final_val /= 100
else
final_val = default_val
end
return final_val
end
def eva
default_val = pacman_eq_bonus_eva
final_val = default_val
n = 100
if !@bonus_set.empty?
for j in 0...@bonus_set.size
for i in 0...@bonus_set_pieces[j]
if Set_Bonus[@bonus_set[j]][i] != nil
if Set_Bonus[@bonus_set[j]][i][0] == 8
n +=Set_Bonus[@bonus_set[j]][i][1]
end
end
end
end
final_val *= n
final_val /= 100
else
final_val = default_val
end
return final_val
end
def change_equip(equip_type, item, test = false)
last_item = equips[equip_type]
unless test
return if $game_party.item_number(item) == 0 if item != nil
$game_party.gain_item(last_item, 1)
$game_party.lose_item(item, 1)
end
item_id = item == nil ? 0 : item.id
case equip_type
when 0 # Weapon
@weapon_id = item_id
unless two_hands_legal? # If two hands is not allowed
change_equip(1, nil, test) # Unequip from other hand
end
when 1 # Shield
@armor1_id = item_id
unless two_hands_legal? # If two hands is not allowed
change_equip(0, nil, test) # Unequip from other hand
end
when 2 # Head
@armor2_id = item_id
when 3 # Body
@armor3_id = item_id
when 4 # Accessory
@armor4_id = item_id
end
@bonus_set = []
for i in 1..Sets.size
weapons = [nil,Sets[i][0]]
armors = [Sets[i][1],Sets[i][2],Sets[i][3],Sets[i][4]]
if Sets[i].include?(@weapon_id)
@bonus_set.push(i) if !@bonus_set.include?(i)
end
if Sets[i].include?(@armor4_id)
@bonus_set.push(i) if !@bonus_set.include?(i)
end
if Sets[i].include?(@armor3_id)
@bonus_set.push(i) if !@bonus_set.include?(i)
end
if Sets[i].include?(@armor2_id)
@bonus_set.push(i) if !@bonus_set.include?(i)
end
if Sets[i].include?(@armor1_id)
@bonus_set.push(i) if !@bonus_set.include?(i)
end
end
@bonus_set_pieces = []
for i in 0...@bonus_set.size
@bonus_set_pieces.push(0)
end
if !@bonus_set.empty?
for i in 0...@bonus_set.size
weapons = [nil,Sets[@bonus_set[i]][0]]
armors = [Sets[@bonus_set[i]][1],Sets[@bonus_set[i]][2],
Sets[@bonus_set[i]][3],Sets[@bonus_set[i]][4]]
@bonus_set_pieces[i] += weapons.include?(@weapon_id) ? 1 : 0
@bonus_set_pieces[i] += armors.include?(@armor1_id) ? 1 : 0
@bonus_set_pieces[i] += armors.include?(@armor2_id) ? 1 : 0
@bonus_set_pieces[i] += armors.include?(@armor3_id) ? 1 : 0
@bonus_set_pieces[i] += armors.include?(@armor4_id) ? 1 : 0
end
end
end
end
class Window_Base < Window
def draw_item_name(item, x, y, enabled = true)
if item != nil
is_set = false
set_no = 0
if item.is_a?(RPG::Weapon)
for i in 1..Sets.size
weapons = []
weapons.push(Sets[i][0])
if weapons.include?(item.id)
is_set = true
set_no = i
end
end
end
if item.is_a?(RPG::Armor)
for i in 1..Sets.size
armors = []
armors.push(Sets[i][1])
armors.push(Sets[i][2])
armors.push(Sets[i][3])
armors.push(Sets[i][4])
if armors.include?(item.id)
is_set = true
set_no = i
end
end
end
draw_icon(item.icon_index, x, y, enabled)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
set_word = ""
if is_set then set_word = "[" + Set_Names[set_no] + "]" end
self.contents.font.size = Font.default_size
self.contents.draw_text(x + 24, y, 172, WLH, item.name)
self.contents.font.color = crisis_color
self.contents.font.size = 12
self.contents.draw_text(x + 28, y+12, 172, WLH, set_word)
self.contents.font.color = normal_color
self.contents.font.size = Font.default_size
end
end
end
Credit
- Welfare-Daddy Pacman
- Lettuce
Thanks
- The academy
- Lettuce (original script)
- The cast of That 70's Show (except Ashton Kutcher) for entertaining me while I did this
Support
Just find me here, I'm on for SO long each day... Post here or PM me.
Known Compatibility Issues
This script rewrites def change_equip(equip_type, item, test=false).
If you have any other script that does something with def change_equip (alias or rewrite), it will not work until unless you stick this snippet in that script before the end of the def change_equip method.
@bonus_set = []
for i in 1..Sets.size
weapons = [nil,Sets[i][0]]
armors = [Sets[i][1],Sets[i][2],Sets[i][3],Sets[i][4]]
if Sets[i].include?(@weapon_id)
@bonus_set.push(i) if !@bonus_set.include?(i)
end
if Sets[i].include?(@armor4_id)
@bonus_set.push(i) if !@bonus_set.include?(i)
end
if Sets[i].include?(@armor3_id)
@bonus_set.push(i) if !@bonus_set.include?(i)
end
if Sets[i].include?(@armor2_id)
@bonus_set.push(i) if !@bonus_set.include?(i)
end
if Sets[i].include?(@armor1_id)
@bonus_set.push(i) if !@bonus_set.include?(i)
end
end
@bonus_set_pieces = []
for i in 0...@bonus_set.size
@bonus_set_pieces.push(0)
end
if !@bonus_set.empty?
for i in 0...@bonus_set.size
weapons = [nil,Sets[@bonus_set[i]][0]]
armors = [Sets[@bonus_set[i]][1],Sets[@bonus_set[i]][2],
Sets[@bonus_set[i]][3],Sets[@bonus_set[i]][4]]
@bonus_set_pieces[i] += weapons.include?(@weapon_id) ? 1 : 0
@bonus_set_pieces[i] += armors.include?(@armor1_id) ? 1 : 0
@bonus_set_pieces[i] += armors.include?(@armor2_id) ? 1 : 0
@bonus_set_pieces[i] += armors.include?(@armor3_id) ? 1 : 0
@bonus_set_pieces[i] += armors.include?(@armor4_id) ? 1 : 0
end
Demo
I hardly doubt you'd need one.
Author's Notes
I script because I get bored. Good scripts are made when I get SUPER BORED. I am confident in saying that this is a SUPER BORED script.
Restrictions
Lettuce requests credit for his work, and I also appreciate it. So, credit both of us. He exhibits no problem for usage in commercial projects, and neither do I, but please let me know if you are using this in a commercial project.