#==============================================================================
# ** Glitchfinder's Randomized Stats on Level Up (Alternate)
#------------------------------------------------------------------------------
# This script is meant to help randomize an actor's stats upon
# levelling up.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# * Instructions
# - - - - - - - - - - - - - - - - - - - - - - - - - -
# Place this script above Main, and below the default scripts. (I
# realize this is obvious to most, but some people don't get it.)
#
# To modify the basic starting stats of a character, you must edit
# the Actor_Stats array in the Stats module, using the following
# rules:
#
# Line 1 is the stats of the first actor in the database. (Ralph
# is the default) Line 2 is the second actor (Ulrika), etc.
#
# The statistics are in order on each line, where the first entry
# is maximum HP, entry 2 is maximum Mana, entry 3 is Attack, entry
# 4 isDefense, entry 5 is Spirit, and entry 6 is Agility.
#
# To modify the variation of an actor's statistics upon changing
# levels, you must edit the Stat_Change_Variance and the
# Min_Stat_Change arrays in the Stats module, using the rules above
# as well as the following rules:
#
# The value in each entry in the Min_Stat_Change array is the
# minimum amount that a stat may change.
#
# The value in each entry in the Stat_Change_Variance array is
# the maximum that the new stat may exceed the minimum change by.
#
# To find the maximum amount that a specific stat may change on
# levelling up or down, simply add the stat's value in the
# Stat_Change_Variance array to the stat's value in the
# Min_Stat_Change array.
#
# If you modify the default actors within the game, you must also
# modify this script, so that the actors will all have their
# correct stats. If you add actors, you must add new lines to this
# scrips, and vice-versa if you delete actors.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# * Advice
# - - - - - - - - - - - - - - - - - - - - - - - - - -
# Do not make the values in the Min_Stat_Change or the
# Min_Stat_Change arrays too high. This can result in a game
# becoming too easy for the player, due to stats that are too high.
# For most stats, 0, 1, or 2 should be more than enough for a
# minimum, and 3 should be the highest variance. (Although HP
# should be significantly higher.
#
# Edit the default values that I have placed in this script.
# Although it may be difficult to properly balance a character, it
# is certain that at least some of the characters will be
# unbalanced if they are using the default values I placed within
# the Stat_Change_Variance array.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# * Usage
# - - - - - - - - - - - - - - - - - - - - - - - - - -
# This script may be used in any commercial or non-commercial
# project.
#
# Please credit Glitchfinder if you use this script.
#==============================================================================
#==============================================================================
# ** Stats
#------------------------------------------------------------------------------
# This module handles actors' stats and their changes. Its used
# within the Game_Actor class.
#==============================================================================
module Stats
#--------------------------------------------------------------------------
# * Store Actor Stats
#--------------------------------------------------------------------------
Actor_Stats = [
466, 70, 17, 17, 21, 23,
594, 70, 22, 16, 11, 20,
391, 98, 12, 17, 20, 15,
275, 107, 14, 13, 42, 16,
466, 70, 13, 19, 15, 13,
444, 59, 16, 12, 15, 23,
523, 63, 17, 14, 15, 21,
362, 56, 13, 12, 15, 27
]
#--------------------------------------------------------------------------
# * Store Actor Stat Change Variance
#--------------------------------------------------------------------------
Stat_Change_Variance = [
18, 7, 6, 6, 8, 9,
17, 6, 4, 4, 6, 4,
13, 6, 4, 6, 5, 5,
14, 9, 5, 4, 6, 6,
15, 7, 4, 4, 4, 8,
16, 5, 6, 3, 6, 9,
18, 5, 6, 4, 8, 7,
13, 7, 4, 4, 6, 8
]
#--------------------------------------------------------------------------
# * Store Actor Stat Change Minimums
#--------------------------------------------------------------------------
Min_Stat_Change = [
60, 8, 0, 0, 1, 1,
75, 5, 0, 0, 0, 0,
33, 6, 0, 0, 0, 0,
37, 6, 0, 0, 0, 0,
40, 4, 0, 0, 0, 1,
48, 3, 0, 0, 0, 1,
80, 3, 0, 0, 1, 0,
24, 4, 0, 0, 0, 1
]
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles actors. Its used within the Game_Actors class
# ($game_actors) and referenced by the Game_Party class ($game_party).
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Get Basic Maximum HP
#--------------------------------------------------------------------------
def base_maxhp
n = (4 * @actor_id) + ((2 * (@actor_id - 2)) - 2)
return Stats::Actor_Stats[n.to_i].to_i
end
#--------------------------------------------------------------------------
# * Get basic Maximum MP
#--------------------------------------------------------------------------
def base_maxmp
n = (4 * @actor_id) + ((2 * (@actor_id - 2)) - 1)
return Stats::Actor_Stats[n.to_i].to_i
end
#--------------------------------------------------------------------------
# * Get Basic Attack
#--------------------------------------------------------------------------
def base_atk
n = (4 * @actor_id) + (2 * (@actor_id - 2))
n = Stats::Actor_Stats[n.to_i].to_i
for item in equips.compact do n += item.atk end
return n
end
#--------------------------------------------------------------------------
# * Get Basic Defense
#--------------------------------------------------------------------------
def base_def
n = (4 * @actor_id) + ((2 * (@actor_id - 2)) + 1)
n = Stats::Actor_Stats[n.to_i].to_i
for item in equips.compact do n += item.def end
return n
end
#--------------------------------------------------------------------------
# * Get Basic Spirit
#--------------------------------------------------------------------------
def base_spi
n = (4 * @actor_id) + ((2 * (@actor_id - 2)) + 2)
n = Stats::Actor_Stats[n.to_i].to_i
for item in equips.compact do n += item.spi end
return n
end
#--------------------------------------------------------------------------
# * Get Basic Agility
#--------------------------------------------------------------------------
def base_agi
n = (4 * @actor_id) + ((2 * (@actor_id - 2)) + 3)
n = Stats::Actor_Stats[n.to_i].to_i
for item in equips.compact do n += item.agi end
return n
end
#--------------------------------------------------------------------------
# * Level Up
#--------------------------------------------------------------------------
def level_up
@level += 1
actor_locator = (4 * @actor_id) + ((2 * (@actor_id - 2)) - 2)
new_hp = rand(Stats::Stat_Change_Variance[actor_locator].to_i)
new_hp = new_hp + Stats::Min_Stat_Change[actor_locator].to_i
new_hp = new_hp + Stats::Actor_Stats[actor_locator].to_i
Stats::Actor_Stats[actor_locator] = new_hp
new_mp = rand(Stats::Stat_Change_Variance[actor_locator + 1].to_i)
new_mp = new_mp + Stats::Min_Stat_Change[actor_locator + 1].to_i
new_mp = new_mp + Stats::Actor_Stats[actor_locator + 1].to_i
Stats::Actor_Stats[actor_locator + 1] = new_mp
new_attack = rand(Stats::Stat_Change_Variance[actor_locator + 2].to_i)
new_attack = new_attack + Stats::Min_Stat_Change[actor_locator + 2].to_i
new_attack = new_attack + Stats::Actor_Stats[actor_locator + 2].to_i
Stats::Actor_Stats[actor_locator + 2] = new_attack
new_defense = rand(Stats::Stat_Change_Variance[actor_locator + 3].to_i)
new_defense = new_defense + Stats::Min_Stat_Change[actor_locator + 3].to_i
new_defense = new_defense + Stats::Actor_Stats[actor_locator + 3].to_i
Stats::Actor_Stats[actor_locator + 3] = new_defense
new_spirit = rand(Stats::Stat_Change_Variance[actor_locator + 4].to_i)
new_spirit = new_spirit + Stats::Min_Stat_Change[actor_locator + 4].to_i
new_spirit = new_spirit + Stats::Actor_Stats[actor_locator + 4].to_i
Stats::Actor_Stats[actor_locator + 4] = new_spirit
new_agility = rand(Stats::Stat_Change_Variance[actor_locator + 5].to_i)
new_agility = new_agility + Stats::Min_Stat_Change[actor_locator + 5].to_i
new_agility = new_agility + Stats::Actor_Stats[actor_locator + 5].to_i
Stats::Actor_Stats[actor_locator + 5] = new_agility
for learning in self.class.learnings
learn_skill(learning.skill_id) if learning.level == @level
end
end
#--------------------------------------------------------------------------
# * Level Down
#--------------------------------------------------------------------------
def level_down
@level -= 1
actor_locator = (4 * @actor_id) + ((2 * (@actor_id - 2)) - 2)
new_hp = rand(Stats::Stat_Change_Variance[actor_locator].to_i)
new_hp = new_hp + Stats::Min_Stat_Change[actor_locator].to_i
new_hp = Stats::Actor_Stats[actor_locator].to_i - new_hp
Stats::Actor_Stats[actor_locator] = new_hp
new_mp = rand(Stats::Stat_Change_Variance[actor_locator + 1].to_i)
new_mp = new_mp + Stats::Min_Stat_Change[actor_locator + 1].to_i
new_mp = Stats::Actor_Stats[actor_locator + 1].to_i - new_mp
Stats::Actor_Stats[actor_locator + 1] = new_mp
new_attack = rand(Stats::Stat_Change_Variance[actor_locator + 2].to_i)
new_attack = new_attack + Stats::Min_Stat_Change[actor_locator + 2].to_i
new_attack = Stats::Actor_Stats[actor_locator + 2].to_i - new_attack
Stats::Actor_Stats[actor_locator + 2] = new_attack
new_defense = rand(Stats::Stat_Change_Variance[actor_locator + 3].to_i)
new_defense = new_defense + Stats::Min_Stat_Change[actor_locator + 3].to_i
new_defense = Stats::Actor_Stats[actor_locator + 3].to_i - new_defense
Stats::Actor_Stats[actor_locator + 3] = new_defense
new_spirit = rand(Stats::Stat_Change_Variance[actor_locator + 4].to_i)
new_spirit = new_spirit + Stats::Min_Stat_Change[actor_locator + 4].to_i
new_spirit = Stats::Actor_Stats[actor_locator + 4].to_i - new_spirit
Stats::Actor_Stats[actor_locator + 4] = new_spirit
new_agility = rand(Stats::Stat_Change_Variance[actor_locator + 5].to_i)
new_agility = new_agility + Stats::Min_Stat_Change[actor_locator + 5].to_i
new_agility = Stats::Actor_Stats[actor_locator + 5].to_i - new_agility
Stats::Actor_Stats[actor_locator + 5] = new_agility
end
end