So I picked up this script by Zetu a while back. It allows you to set a weapon with a notetag that identifies the weapon as "Mainhand Only". This is to prevent the useage of weapons as dual-wield that were not intended to be.
Example, a character can build a Tank role or a Damage role. As a Tank, she uses a Polehammer and a Shield. As a DPS role, she equips a Claw (which unlocks her Dual Wield 2nd Weapon Slot) and another Claw. While the 1st Claw is equipped, she could equip a Polehammer in the 2nd Weapon Slot, resulting in a Claw+Polehammer combination that is not intended, as Polehammer+Claw would be an invalid equip loadout. The Polehammer in this example is set to Mainhand Only.
Here is the script, it's extrememly short:
#There was no header for this so I'll write one. This script was written#by Zetu. Weapons can be notetagged with <mainhand> or <offhand> to prevent#unintentional weapon combinations when Dual Wield is active.class RPG::EquipItem < RPG::BaseItem def offhandrating self.note.scan(/<offhand\s*exaust[:]*\s*(\d*)>/){return $1.to_f} return 1.0 end def mainhand return true unless self.is_a?(RPG::Weapon) self.note.scan(/<mainhand>/){return true} self.note.scan(/<offhand>/){return false} return true end def offhand return true unless self.is_a?(RPG::Weapon) self.note.scan(/<offhand>/){return true} self.note.scan(/<mainhand>/){return false} return true endendclass Window_EquipItem < Window_ItemList alias :zsnipi :include? def include?(item) return false unless zsnipi item return true if item.nil? return false if !item.mainhand and @slot_id == 0 return false if !item.offhand and @slot_id == 1 return true endendclass Game_Actor < Game_Battler def param_plus(param_id) sum = 0 for i in 0...equips.size next if (equip=equips).nil? rating = (i==1 and equip.is_a? RPG::Weapon) ? equip.offhandrating : 1.0 sum += (equip.params[param_id]*rating).to_i end return sum endendclass NilClass def id 0 endendThe problem with this script, is that it breaks items and events that attempt to increase your parameters, even in a fresh project with no other scripts installed. In a fresh project with only this script, the default item 9 "Life Up" which raises MaxHP by 50, does absolutely nothing. The same goes for Events. If an Event attempts to increase an actor's parameters, it does absolutely nothing.
What is it about this script that is breaking stuff? Is there a way to fix this?
Example, a character can build a Tank role or a Damage role. As a Tank, she uses a Polehammer and a Shield. As a DPS role, she equips a Claw (which unlocks her Dual Wield 2nd Weapon Slot) and another Claw. While the 1st Claw is equipped, she could equip a Polehammer in the 2nd Weapon Slot, resulting in a Claw+Polehammer combination that is not intended, as Polehammer+Claw would be an invalid equip loadout. The Polehammer in this example is set to Mainhand Only.
Here is the script, it's extrememly short:
#There was no header for this so I'll write one. This script was written#by Zetu. Weapons can be notetagged with <mainhand> or <offhand> to prevent#unintentional weapon combinations when Dual Wield is active.class RPG::EquipItem < RPG::BaseItem def offhandrating self.note.scan(/<offhand\s*exaust[:]*\s*(\d*)>/){return $1.to_f} return 1.0 end def mainhand return true unless self.is_a?(RPG::Weapon) self.note.scan(/<mainhand>/){return true} self.note.scan(/<offhand>/){return false} return true end def offhand return true unless self.is_a?(RPG::Weapon) self.note.scan(/<offhand>/){return true} self.note.scan(/<mainhand>/){return false} return true endendclass Window_EquipItem < Window_ItemList alias :zsnipi :include? def include?(item) return false unless zsnipi item return true if item.nil? return false if !item.mainhand and @slot_id == 0 return false if !item.offhand and @slot_id == 1 return true endendclass Game_Actor < Game_Battler def param_plus(param_id) sum = 0 for i in 0...equips.size next if (equip=equips).nil? rating = (i==1 and equip.is_a? RPG::Weapon) ? equip.offhandrating : 1.0 sum += (equip.params[param_id]*rating).to_i end return sum endendclass NilClass def id 0 endendThe problem with this script, is that it breaks items and events that attempt to increase your parameters, even in a fresh project with no other scripts installed. In a fresh project with only this script, the default item 9 "Life Up" which raises MaxHP by 50, does absolutely nothing. The same goes for Events. If an Event attempts to increase an actor's parameters, it does absolutely nothing.
What is it about this script that is breaking stuff? Is there a way to fix this?