08-07-2017, 10:05 PM
Hey it's an issue which is troubling me for quite a time but I never had the motivation to fix it.
Now I'm trying but I think I need some help.
I'm using the following script to have HP and SP stats on Equipment.
And now I want to show these HP/SP + values in another window which displays stats from Equipment.
Is ist even possible at all?
Now I'm trying but I think I need some help.
I'm using the following script to have HP and SP stats on Equipment.
Code:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Weapon/Armor HP/SP Plus by Blizzard
# Version: 2.1b
# Type: Weapon/Armor Attribute Alteration
# Date: 18.8.2006
# Date v1.01b: 12.3.2007
# Date v2.0: 15.5.2007
# Date v2.0b: 30.7.2007
# Date v2.1b: 11.6.2009
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Compatibility:
#
# 95% compatible with SDK v1.x. 50% compatible with SDK v2.x. May cause
# slight incompatibility issues with CBS-es, but can be made compatible
# easily. Can cause imcompatibility issues with other weapon/armor changing
# scripts and custom equipments scripts.
#
#
# Features:
#
# - uses static (i.e. 500 HP more) or dynamic (i.e. 30% HP more) increasements
# - easy to set up
# - does NOT change any rxdata files
# - this script comes UNDER SDK SCRIPTS if you use any
#
# new in v2.0:
# - completely overworked and changed code for better compatibility
#
# new in v2.0b:
# - fixed a bug that appeared because of a typing mistake
#
# new in v2.1b:
# - improve coding
#
#
# Instructions:
#
# - Explanation:
#
# This script will add the option for Weapons/Armors to have HP/SP pluses
# while equipped just like the usual STR, DEX, INT etc. pluses.
#
# - Configuration
#
# Find the phrase saying "START" (CTRL+F) to find the database parts. Use the
# following template to configure your database:
#
# when ID then return [EXPR, VAL]
#
# ID - Weapon/Armor ID in the normal database
# EXPR - set to false if you want "static" increasement or true if you want
# "dynamic" increasement
# VAL - if you use static increasement, set this value to any integer you
# want (i.e. 100, -500, 831 etc.) to increase the HP/SP, otherwise set
# it to any decimal value of the final HP/SP (i.e. 1.2 = 20% more,
# 2.3 = 130% more, 0.7 = 30% less)
#
# VAL can be a signed integer (static increasement) OR a decimal number
# greater than 0 (dynamic increasement). Change MAX_HP and MAX_SP to
# different values if you use another max HP and/or max SP limit than 9999.
#
#
# Side Note:
#
# It took more to write the instructions than to write and test script
# itself.
#
#
# If you find any bugs, please report them here:
# http://forum.chaos-project.com
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
MAX_HP = 999999999 # change if needed, 9999 is standard
MAX_SP = 999999999 # change if needed, 9999 is standard
#==============================================================================
# module BlizzCFG
#==============================================================================
module BlizzCFG
def self.weapon_hp_plus(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Weapon HP plus Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 1 then return [false, 100] # Test
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Weapon SP plus Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
else
return [false, 16]
end
end
def self.armor_hp_plus(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Armor HP plus Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 1 then return [false, 843] # Test
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Armor HP plus Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
else
return [false, 28]
end
end
def self.armor_sp_plus(id)
case id
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Armor SP plus Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
when 1 then return [false, 843] # Test
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Armor SP plus Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
else
return [false, 16]
end
end
end
#==============================================================================
# Game_Battler
#==============================================================================
class Game_Battler
alias maxsp_hpsp_add_on_later maxsp
def maxsp
val = [MAX_SP, maxsp_hpsp_add_on_later].min
@sp = val if @sp > val
return val
end
end
#==============================================================================
# Game_Actor
#==============================================================================
class Game_Actor
alias maxhp_hpsp_add_on_later maxhp
def maxhp
# return maxhp_hpsp_add_on_later unless $game_system.HPSPPLUS
val = [MAX_HP, maxhp_hpsp_add_on_later].min
@hp = val if @hp > val
return val
end
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
end
And now I want to show these HP/SP + values in another window which displays stats from Equipment.
Is ist even possible at all?