Group: Member
Posts: 66
Type: None
RM Skill: Skilled
Equipment Set Bonus Version 1.4 Author: Lettuce Release Date: 10 July 2008
Introduction In games like Flyff (and WoW?) when a player equips a certain combination of armors, they gain some additional stats/hp/mp whatever. This script mimics that <3
Features -Additional stats when an actor is equipped with armors of the same set -Set Names : You can see if an item belongs to a set -If the actor is equipped with equipments from different sets, all the bonus are added up together
class Window_Status < Window_Base alias show_set_bonus_refresh refresh def refresh show_set_bonus_refresh draw_set_bonus(@actor) end def draw_set_bonus(actor) self.contents.font.color = system_color self.contents.font.size = FontSize_Header self.contents.draw_text(X_position,Y_position,100,WLH,"Set Bonus") self.contents.font.color = normal_color
sets = actor.bonus_set #array with the sets listing set_pieces = actor.bonus_set_pieces # array with pieces number for each set bonus_set = [0,0,0,0,0,0,0,0,0] #different attribute listing for i in 0...sets.size bonus_array = Set_Bonus[sets[i]] #array with bonus pieces = set_pieces[i] #how many pieces for j in 0...pieces bonus_set[bonus_array[j][0]] += bonus_array[j][1] # [att,amount] end end
#bonus_set = Set_Bonus[actor.bonus_set] #array of bonusses #bonus_pieces = actor.bonus_set_pieces #number of pieces y_pos = Y_position + 6 self.contents.font.size = FontSize for i in 1...bonus_set.size y_pos += LineHeight if !(bonus_set[i] <= 0) self.contents.draw_text(X_position,y_pos,100,LineHeight,print_set_bonus([i,bonus_set[i]])) if !(bonus_set[i] <= 0) end end def print_set_bonus(bonus_set) case bonus_set[0] when 1 then word = Vocab::atk when 2 then word = Vocab::def when 3 then word = Vocab::spi when 4 then word = Vocab::agi when 5 then word = Vocab::hp when 6 then word = Vocab::mp when 7 then word = "Critical" when 8 then word = "Evasion" end return word + " " + bonus_set[1].to_s + "%" end end
Compatibility 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), just add this right before the "end" of that 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 end
Wow, that was fast , Thanks. Edit: I only see [armor1, armor2, armor3, armor4], what if I want to add a weapon to the set, or an accessory. Could you make the capacity higher? Also, is it possible to see if an item is a set piece from the info box when you hover over it?
__________________________
Current Project[RC]: Twilight Realm 3DMMORPG w/dx9, and char creation through mysql after I get a server, now C++ scripting Current Project[VX]: Obsidian Trilogy just started 08/12/2008 Current Project[XP&RM2K3]: none
Updated to Version 1.1 Now weapon is included. Setup like this: Sets = { SetID => [Weapon,Armor1,Armor2,Armor3,Armor4] , ....}
PS:weapon must come first
Great, thanks, now I can finally continue my game
__________________________
Current Project[RC]: Twilight Realm 3DMMORPG w/dx9, and char creation through mysql after I get a server, now C++ scripting Current Project[VX]: Obsidian Trilogy just started 08/12/2008 Current Project[XP&RM2K3]: none
I'm not understanding this...whatare the sets, like what do you mean by Sets = { SetID => [Weapon,Armor1,Armor2,Armor3,Armor4] , ....} ?
When you say set Id do you mean like say (according to the crafting script 1 for weapons, so:) 1206 (206 being say a sword of some sort
Like how do i set up sets?
This has nothing to do with the ACS, Sets are like SetID => [weaponID, armor1ID, armor2ID, armor3ID, armor4ID] Sets = { 1 => [1,2,9,15,24], 2 => [1,1,7,14,23], 3 => []} the first number is the set number, the numbers in the brackets goes with the corresponding database number.
__________________________
Current Project[RC]: Twilight Realm 3DMMORPG w/dx9, and char creation through mysql after I get a server, now C++ scripting Current Project[VX]: Obsidian Trilogy just started 08/12/2008 Current Project[XP&RM2K3]: none
wait so.... the numbers are the last or last two digits of the database number? so like 1=> [1]
would be like 1=>[001]?
thats what i am getting when you say that they go with the corasponding database number
Precisely
__________________________
Current Project[RC]: Twilight Realm 3DMMORPG w/dx9, and char creation through mysql after I get a server, now C++ scripting Current Project[VX]: Obsidian Trilogy just started 08/12/2008 Current Project[XP&RM2K3]: none
I was wondering is it possible to have something like this(image), that would show the stats gain/loss from the set equipped.
__________________________
Current Project[RC]: Twilight Realm 3DMMORPG w/dx9, and char creation through mysql after I get a server, now C++ scripting Current Project[VX]: Obsidian Trilogy just started 08/12/2008 Current Project[XP&RM2K3]: none
Current Project[RC]: Twilight Realm 3DMMORPG w/dx9, and char creation through mysql after I get a server, now C++ scripting Current Project[VX]: Obsidian Trilogy just started 08/12/2008 Current Project[XP&RM2K3]: none
class Window_Status < Window_Base alias show_set_bonus_refresh refresh def refresh show_set_bonus_refresh draw_set_bonus(@actor) end def draw_set_bonus(actor) self.contents.font.color = system_color self.contents.font.size = FontSize_Header self.contents.draw_text(X_position,Y_position,100,WLH,"Set Bonus") self.contents.font.color = normal_color bonus_set = Set_Bonus[actor.bonus_set] #array of bonusses bonus_pieces = actor.bonus_set_pieces #number of pieces y_pos = Y_position + 6 self.contents.font.size = FontSize for i in 0...bonus_pieces y_pos += LineHeight if !bonus_set[i].empty? self.contents.draw_text(X_position,y_pos,100,LineHeight,print_set_bonus(bonus_set[i])) if !bonus_set[i].empty? end end def print_set_bonus(bonus_set) case bonus_set[0] when 1 then word = Vocab::atk when 2 then word = Vocab::def when 3 then word = Vocab::spi when 4 then word = Vocab::agi when 5 then word = Vocab::hp when 6 then word = Vocab::mp when 7 then word = Vocab::cri when 8 then word = Vocab::eva end return word + " " + bonus_set[1].to_s + "%" end end
class Window_Status < Window_Base alias show_set_bonus_refresh refresh def refresh show_set_bonus_refresh draw_set_bonus(@actor) end def draw_set_bonus(actor) self.contents.font.color = system_color self.contents.font.size = FontSize_Header self.contents.draw_text(X_position,Y_position,100,WLH,"Set Bonus") self.contents.font.color = normal_color bonus_set = Set_Bonus[actor.bonus_set] #array of bonusses bonus_pieces = actor.bonus_set_pieces #number of pieces y_pos = Y_position + 6 self.contents.font.size = FontSize for i in 0...bonus_pieces y_pos += LineHeight if !bonus_set[i].empty? self.contents.draw_text(X_position,y_pos,100,LineHeight,print_set_bonus(bonus_set[i])) if !bonus_set[i].empty? end end def print_set_bonus(bonus_set) case bonus_set[0] when 1 then word = Vocab::atk when 2 then word = Vocab::def when 3 then word = Vocab::spi when 4 then word = Vocab::agi when 5 then word = Vocab::hp when 6 then word = Vocab::mp when 7 then word = Vocab::cri when 8 then word = Vocab::eva end return word + " " + bonus_set[1].to_s + "%" end end
place it above main ;P
Thanks!, works great.
__________________________
Current Project[RC]: Twilight Realm 3DMMORPG w/dx9, and char creation through mysql after I get a server, now C++ scripting Current Project[VX]: Obsidian Trilogy just started 08/12/2008 Current Project[XP&RM2K3]: none
WARNING!!! ... WARNING!!!... this os a Bio-Hazard.Alert!!! there is a very ugly BUG!!!
It do that you can only have the boni from ONE set if you equp more.
I have no idea what you just said, and no you can have more than one bonus in one set, a set is not 1 piece its more than one.
__________________________
Current Project[RC]: Twilight Realm 3DMMORPG w/dx9, and char creation through mysql after I get a server, now C++ scripting Current Project[VX]: Obsidian Trilogy just started 08/12/2008 Current Project[XP&RM2K3]: none
i mean that if you equip more then one set, you can only get the boni of the set with the higher Number.
Ah, okay. That would be a problem. --- Can you make it so when you have 2 or 3 different sets, the bonuses add up from the other sets?
__________________________
Current Project[RC]: Twilight Realm 3DMMORPG w/dx9, and char creation through mysql after I get a server, now C++ scripting Current Project[VX]: Obsidian Trilogy just started 08/12/2008 Current Project[XP&RM2K3]: none