#by你最珍贵 class Game_Map unless method_defined?(:war_event_initialize) alias_method(:war_event_initialize, :initialize) alias_method(:war_event_setup, :setup) end def initialize war_event_initialize @save_events = {} end def setup(map_id) war_event_save war_event_setup(map_id) war_event_load end def war_event_save return if @map_id == 0 @save_events[@map_id] = @events end def war_event_load return if @map_id == 0 events = @save_events[@map_id] @events = events if events end def war_event_clear(id = 0) @save_events.clear if id == 0 @save_events[id] = nil if id > 0 end end
#by你最珍贵
class Game_Map
unless method_defined?(:war_event_initialize)
alias_method(:war_event_initialize, :initialize)
alias_method(:war_event_setup, :setup)
end
def initialize
war_event_initialize
@save_events = {}
end
def setup(map_id)
war_event_save
war_event_setup(map_id)
war_event_load
end
def war_event_save
return if @map_id == 0
@save_events[@map_id] = @events
end
def war_event_load
return if @map_id == 0
events = @save_events[@map_id]
@events = events if events
end
def war_event_clear(id = 0)
@save_events.clear if id == 0
@save_events[id] = nil if id > 0
end
end
变换场景NPC位置不变 |