Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Movable Level Cap (1.0)
- # 21/10/12
- # By Pacman
- # This script simply allows you to change the level max of actors. Actors start
- # the game with the level max you set in the database, but this can be altered
- # in-game with a simple script call.
- #
- # Script Call:
- # change_max_level(id[, n])
- # Changes the level maximum of actor with ID id to n. If n is omitted, it
- # will set it to the actor's default level maximum. If n is less than 1, it
- # will be set to 1.
- #
- #===============================================================================
- #==============================================================================
- # ** Game_Actor
- #------------------------------------------------------------------------------
- # This class handles actors. It is used within the Game_Actors class
- # ($game_actors) and is also referenced from the Game_Party class ($game_party).
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :max_level
- #--------------------------------------------------------------------------
- # * Get maximum level
- #--------------------------------------------------------------------------
- def max_level(*args)
- @max_level || actor.max_level
- end
- end
- #==============================================================================
- # ** Game_Interpreter
- #------------------------------------------------------------------------------
- # An interpreter for executing event commands. This class is used within the
- # Game_Map, Game_Troop, and Game_Event classes.
- #==============================================================================
- class Game_Interpreter
- #--------------------------------------------------------------------------
- # * Change actor's level cap
- # id : ID of actor whose level is changing
- # n : new level cap (must be larger than 0)
- #--------------------------------------------------------------------------
- def change_max_level(id, n = nil)
- n ||= $game_actors[id].actor.max_level
- $game_actors[id].max_level = [n, 1].max
- end
- end
- ($pac ||= {})[:movable_lvl_cap] = 1.0
- #===============================================================================
- #
- # END OF SCRIPT
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement