Lance Amano
Member
Hello here. I'm trying to use this script that allows the creation of items that modify extra in-game parameters such as ATK and PDEF. I did what the directions indicate but there's a syntax error at line 142 and I don't know how to work that around.
There's the script:
There's the script:
Code:
#------------------------------------------------------------------------------
# Extra Parameter Change (ver 1.0) [XP]
#
#==============================================================================
# About
#------------------------------------------------------------------------------
# Title: Extra Parameter Change XP
#
# A script that allows the player to increase or decrease additional
# in game parameters. In version 1.0, these stats include:
# attack (atk) physical defence (pdef) magical defence (mdef)
# evasion (eva)
#
#
# Version: 1.0
# # 1.0 - Initial Release
#
# Date Published: 01 February 2013
# Last Updated : 01 February 2012
# Author: Logan Forrests
# Hosted on: RMRK.net only.
#
# Permissions for use of this script can be found here:
# - [url=http://rmrk.net/index.php/topic,45481.0.html]http://rmrk.net/index.php/topic,45481.0.html[/url]
#
# Redistribution of this script is stricly prohibited with prior permission.
#==============================================================================
# Directions
#------------------------------------------------------------------------------
# Items which are designed to increase or decrease any of these additional
# parameters must be defined under BATTLE_STAT_ITEMS. The ID of the item
# is required and is used to check if the item being used is one that will
# modify the base parameter.
# Follow the example provided in the relevant section to set up items that
# will have the desired effect of modifying these extra parameters.
#
# A maximum bonus can also be set for each extra parameter. By default,
# these values have been set to 999.
#==============================================================================
module LFXP
module STAT_PLUS
#------------------------------------------------------------------------
# * Set which items change these parameters
#------------------------------------------------------------------------
BATTLE_STAT_ITEMS = { #Do Not Remove
# Item ID => {:atk => #, :pdef => #, :mdef => #, :eva => #},
#
# Ex. To make Item ID 35 increase ATK by 5:
# 35 => {:atk => 5, :pdef => 0, :mdef => 0, :eva => 0},
# Insert your items in the space below:
24 => {:atk => 10, :pdef => 0, :mdef => 0, :eva => 0},
25 => {:atk => 0, :pdef => 10, :mdef => 0, :eva => 0},
26 => {:atk => 0, :pdef => 0, :mdef => 10, :eva => 0},
27 => {:atk => 0, :pdef => 0, :mdef => 0, :eva => 10},
} #Do Not Remove
#------------------------------------------------------------------------
# * Maximum bonus attainable for each parameter type
#------------------------------------------------------------------------
MAX_BONUS = { # Do Not Remove
:atk => 999,
:pdef => 999,
:mdef => 999,
:eva => 999,
} #Do Not Remove
end
end
#==============================================================================
# DO NOT EDIT BELOW THIS LINE ::::::::::::::: DO NOT EDIT BELOW THIS LINE #
#==============================================================================
$imported ||= {}
$imported[:lfxp_statplus] = true
#==============================================================================
# ** Game_Battler
#==============================================================================
class Game_Battler
#--------------------------------------------------------------------------
# * Base Class attr_readers for extra stat bonuses
# Prevents errors from no method defined in base class use
#--------------------------------------------------------------------------
def lfxp_sp_atk; 0; end
def lfxp_sp_dpef; 0; end
def lfxp_sp_mdef; 0; end
def lfxp_sp_eva; 0; end
def lfxp_sp_statplus(*args); 0; end
#--------------------------------------------------------------------------
# * Application of Item Effects
# item : item
#--------------------------------------------------------------------------
alias lfxp_statplus_itmeff_gb_lk93 item_effect
def item_effect(item, *args, &block)
#Set effective flag to false (ie. has a change occured in stat)
effective = false
#If item is a stat boost item as defined in LFXP::STAT_PLUS config
boost = LFXP::STAT_PLUS::BATTLE_STAT_ITEMS[item.id]
if boost
boost.each_pair do |s, v|
#Take result of changing the stat
result = lfxp_sp_statplus(s, v)
# if result is true, then stat_changed is true
# once stat_changed is true, it will remain true despite result
if result then effective = true end
end
end
return (lfxp_statplus_itmeff_gb_lk93(item, *args, &block) or effective)
end
end
#==============================================================================
# ** Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias lfxp_statplus_init_ga_aqwq initialize
def initialize(*args, &block)
#Create new varaibles for holding base stat bonus for atk, pdef, mdef, eva
@lfxp_sp_base = [0, 0, 0, 0]
#run original method
lfxp_statplus_init_ga_aqwq(*args, &block)
end
#--------------------------------------------------------------------------
# * Base Class attr_readers for extra stat bonuses
# Prevents errors from no method defined in base class use
#--------------------------------------------------------------------------
def lfxp_sp_atk; @lfxp_sp_base[0]; end #ATK
def lfxp_sp_pdef; @lfxp_sp_base[1]; end #PDEF
def lfxp_sp_mdef; @lfxp_sp_base[2]; end #MDEF
def lfxp_sp_eva; @lfxp_sp_base[3]; end #EVA
#--------------------------------------------------------------------------
# * Stat Plus method
# Increases or decreases appropriate stats
# Returns true if a parameter change occurs, false if not
#--------------------------------------------------------------------------
def lfxp_sp_statplus(stat, value)
#Change the relative value
case stat
when :atk
orig_value = lfxp_sp_atk #original attack
@lfxp_sp_base[0] = [[lfxp_sp_atk + value, 0].max, LFXP::STAT_PLUS::MAX_BONUS[:atk].min
return true if orig_value != lfxp_sp_atk
when :pdef
orig_value = lfxp_sp_pdef #original pdef
@lfxp_sp_base[1] = [[lfxp_sp_pdef + value, 0].max, LFXP::STAT_PLUS::MAX_BONUS[:pdef].min
return true if orig_value != lfxp_sp_pdef
when :mdef
orig_value = lfxp_sp_mdef #original mdef
@lfxp_sp_base[2] = [[lfxp_sp_mdef + value, 0].max, LFXP::STAT_PLUS::MAX_BONUS[:mdef].min
return true if orig_value != lfxp_sp_mdef
when :eva
orig_value = lfxp_sp_eva #original eva
@lfxp_sp_base[3] = [[lfxp_sp_eva + value, 0].max, LFXP::STAT_PLUS::MAX_BONUSeva].min
return true if orig_value != lfxp_sp_eva
end
#In all cases, or when no case
return false #not effective
end
#--------------------------------------------------------------------------
# * Sub class method definitions.
# Also retrieves value from Superclass in case changes are added
# By default, all super values are 0
#--------------------------------------------------------------------------
def base_atk
super + lfxp_sp_atk
end
def base_pdef
super + lfxp_sp_pdef
end
def base_mdef
super + lfxp_sp_mdef
end
def base_eva
super + lfxp_sp_eva
end
end