Sobeman459
Member
I have a viriable for every character in my database(just player characters). How would i increase said variable by one when each character levels up?
#Game_variable modifier on level up
#By Gerkrt,gerrtunk
module Wep
Level_up = true # If the variable is modified when actors levelup
Level_down = false # When they level down, the variable also.
Game_variables = [] # Don't touch this
Game_variables[1] = 1 # Game_variables[Actor id number in database] = game variable
# id to modify
end
class Game_Actor
#--------------------------------------------------------------------------
# * Change EXP
# exp : new EXP
#--------------------------------------------------------------------------
def exp=(exp)
@exp = [[exp, 9999999].min, 0].max
# Level up
while @exp >= @exp_list[@level+1] and @exp_list[@level+1] > 0
@level += 1
if Wep::Game_variables[@actor_id] != nil and Wep::Level_up
$game_variables[Wep::Game_variables[@actor_id]] +=1
end
# Learn skill
for j in $data_classes[@class_id].learnings
if j.level == @level
learn_skill(j.skill_id)
end
end
end
# Level down
while @exp < @exp_list[@level]
@level -= 1
if Wep::Game_variables[@actor_id] != nil and Wep::Level_down
$game_variables[Wep::Game_variables[@actor_id]] -=1
end
end
# Correction if exceeding current max HP and max SP
@hp = [@hp, self.maxhp].min
@sp = [@sp, self.maxsp].min
end
end
$game_party.actors[0-3].level >= ?