public override void Load(bool startup) { Command.Register(new CmdReloadEffects()); Command.Register(new CmdEffect()); Command.Register(new CmdSpawner()); rnd = new Random(); LoadEffects(); DefineEffectsAll(); playerEffects = PlayerExtList.Load("extra/playereffects.txt"); OnPlayerMoveEvent.Register(OnPlayerMove, Priority.Low); OnPlayerFinishConnectingEvent.Register(OnPlayerFinishConnecting, Priority.Low); OnLevelLoadedEvent.Register(OnLevelLoaded, Priority.Low); OnLevelUnloadEvent.Register(OnLevelUnload, Priority.Low); OnLevelDeletedEvent.Register(OnLevelDeleted, Priority.Low); OnLevelCopiedEvent.Register(OnLevelCopied, Priority.Low); OnLevelRenamedEvent.Register(OnLevelRenamed, Priority.Low); SpawnersFile.cache = new ThreadSafeCache(); if (!Directory.Exists(SpawnersFile.spawnerDirectory)) { Directory.CreateDirectory(SpawnersFile.spawnerDirectory); } Level[] levels = LevelInfo.Loaded.Items; foreach (Level level in levels) { SpawnersFile.Load(level); } spawnerAccum = 0; ActivateSpawners(); }
static void OnLevelLoaded(Level lvl) { SpawnersFile.Load(lvl); }