Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: syldocaine on January 17, 2014, 08:37:20 am

Title: Weapon/Armor HP/SP Plus by Blizzard and Multi Slot Script
Post by: syldocaine on January 17, 2014, 08:37:20 am
Hi guys

I just wanted to ask if there is a way to make Blizzards Weapon/Armor HP/SP Plus Script compatible with GUILLAUME777's Multi-Slot Script.
Atm it can't "see" if there are more slots as the usual ones: weapon_id and armor1_id, armor2_id, armor3_id, armor4_id.

Thx in advance.
Title: Re: Weapon/Armor HP/SP Plus by Blizzard and Multi Slot Script
Post by: KK20 on January 17, 2014, 01:49:50 pm
Try replacing the two methods in the script with this

 alias base_maxhp_hpsp_add_on_later base_maxhp
 def base_maxhp
   return base_maxhp_hpsp_add_on_later unless $game_system.HPSPPLUS
   plus, multi = 0, 1.0
   self.equipments.each{|equip|
     if equip.is_a?(RPG::Weapon)
       result = BlizzCFG.weapon_hp_plus(equip.id)
       result[0] ? (multi *= result[1]) : (plus += result[1])
     else
       result = BlizzCFG.armor_hp_plus(equip.id)
       result[0] ? (multi *= result[1]) : (plus += result[1])
     end
   }
   return (multi * (plus + base_maxhp_hpsp_add_on_later)).to_i
 end
 
 alias base_maxsp_hpsp_add_on_later base_maxsp
 def base_maxsp
   return base_maxsp_hpsp_add_on_later unless $game_system.HPSPPLUS
   plus, multi = 0, 1.0
   self.equipments.each{|equip|
     if equip.is_a?(RPG::Weapon)
       result = BlizzCFG.weapon_sp_plus(equip.id)
       result[0] ? (multi *= result[1]) : (plus += result[1])
     else
       result = BlizzCFG.armor_sp_plus(equip.id)
       result[0] ? (multi *= result[1]) : (plus += result[1])
     end
   }
   return (multi * (plus + base_maxsp_hpsp_add_on_later)).to_i
 end
Title: Re: Weapon/Armor HP/SP Plus by Blizzard and Multi Slot Script
Post by: syldocaine on January 17, 2014, 03:59:42 pm

Thx alot!

There were just two little bugs were it doesnt't recognized the HP/SP of the armors.
I changed
result = BlizzCFG.armor_hp_plus(id) to result = BlizzCFG.armor_hp_plus(equip.id)
and
result = BlizzCFG.armor_sp_plus(id) to result = BlizzCFG.armor_sp_plus(equip.id)

and it all works fine now.

thumps up for you  8)

Title: Re: Weapon/Armor HP/SP Plus by Blizzard and Multi Slot Script
Post by: KK20 on January 17, 2014, 08:13:09 pm
Derp. We programmers love to use copy/paste so much that we forget the minor things like that. Fixed in original post.