public void StartInvasion() { ThisRegion = new InvasionRegion(this); if (spawntype == InvasionSpawnType.None) RandomSpawn(); if (Players == null) Players = new ArrayList(); if (Spawn == null) Spawn = new ArrayList(); WaveTimer = new InvasionWaveTimer(this); inprogress = true; DoSpawn(InvasionConfig.WaveAmount); }
public void EndInvasion() { WaveTimer.Stop(); for (int i = 0; i < Spawn.Count; ++i) { Mobile m = (Mobile)Spawn[i]; Spawn.Remove(m); m.Delete(); } for (int i = 0; i < Players.Count; ++i) { PlayerMobile pm = (PlayerMobile)Players[i]; Players.Remove(pm); BankBox bank = (BankBox)pm.BankBox; bank.DropItem(new BankCheck(InvasionConfig.Reward)); } Killed = 0; inprogress = false; ThisRegion.Unregister(); ThisRegion = null; }