Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- # XAS - Respawn Control
- # Version: 1.00
- # Author : LiTTleDRAgo
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- #==============================================================================
- # ** Game_Map
- #------------------------------------------------------------------------------
- # This class handles the map. It includes scrolling and passable determining
- # functions. Refer to "$game_map" for the instance of this class.
- #==============================================================================
- class Game_Map
- RESPAWN_MAP_LIMIT = 3
- # After go to other maps X times, enemies in the oldest map will respawn
- alias respawn_control_setup setup
- def setup(*args)
- respawn_control_setup(*args)
- e = $game_temp.instance_variable_get(:@e3x504)
- e = $game_temp.instance_variable_set(:@e3x504,Hash.new{|h,k|h[k]=[]}) if !e
- @events.values.each {|event| event.erase if e[@map_id].include?(event.id)}
- $game_temp.instance_variable_get(:@e3x504).shift if e.size>RESPAWN_MAP_LIMIT
- end
- end
- #==============================================================================
- # ** Game_Event
- #------------------------------------------------------------------------------
- # This class deals with events. It handles functions including event page
- # switching via condition determinants, and running parallel process events.
- # It's used within the Game_Map class.
- #==============================================================================
- class Game_Event < Game_Character
- #--------------------------------------------------------------------------
- # ● Defeated Effect
- #--------------------------------------------------------------------------
- alias defeated_respawn_control_effect defeated_effect
- def defeated_effect
- defeated_respawn_control_effect
- return if !self.battler.is_a?(Game_Enemy)
- unless self.tool_id > 0 or self.battler.e_item
- $game_temp.instance_variable_get(:@e3x504)[$game_map.map_id] << @id
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement