16

« **on:** December 15, 2018, 04:41:41 AM »
A very simple version:

`#==============================================================================`

# Job-based Level Up Stats Ver 1.0

# By KK20 Dec 14 18

#------------------------------------------------------------------------------

# Purpose:

# Allows actors to gain bonus stats based on their class/job upon leveling up.

# For example, a Warrior gains more STR and Max HP while Mages gain more INT

# and Max MP.

#

# Instructions:

# Place below default scripts but above Main (the usual). The lower the better.

# Configure the stat bonuses below (instructions provided there).

#

#==============================================================================

module JobLevelUp

def self.level_up_stats(id)

case id

#-------------------------------------------------------------------------

# Configure:

#

# when CLASS_ID

# [MAX_HP, MAX_SP, STR, DEX, AGI, INT]

#

# where CLASS_ID is the database index of the class and each stat in the

# array indicates how much that stat will increase per level up.

#-------------------------------------------------------------------------

when 1 # Fighter

[7, 2, 5, 2, 3, 2]

when 2 # Lancer

[8, 3, 4, 3, 2, 3]

when 3 # Warrior

[10, 1, 7, 1, 4, 1]

when 4 # Thief

[4, 3, 2, 6, 6, 4]

else # Classes not defined will use this default value

[3, 3, 3, 3, 3, 3]

end

end

end

class Game_Actor

alias job_level_up_stats_level level=

def level=(val)

start_level = @level

job_level_up_stats_level(val)

level_difference = @level - start_level

stat_array = JobLevelUp.level_up_stats(self.class_id)

self.maxhp += stat_array[0] * level_difference

self.maxsp += stat_array[1] * level_difference

self.str += stat_array[2] * level_difference

self.dex += stat_array[3] * level_difference

self.agi += stat_array[4] * level_difference

self.int += stat_array[5] * level_difference

end

alias job_level_up_stats_exp exp=

def exp=(val)

start_level = @level

job_level_up_stats_exp(val)

level_difference = @level - start_level

stat_array = JobLevelUp.level_up_stats(self.class_id)

self.maxhp += stat_array[0] * level_difference

self.maxsp += stat_array[1] * level_difference

self.str += stat_array[2] * level_difference

self.dex += stat_array[3] * level_difference

self.agi += stat_array[4] * level_difference

self.int += stat_array[5] * level_difference

end

end