public Mobile SpawnCaptain(MinorBarrierCrystal crystal) { try { Mobile m = Activator.CreateInstance(m_SpawnList.GetRandomCaptain()) as Mobile; m.OnBeforeSpawn(crystal.Location, crystal.Map); m.MoveToWorld(crystal.Location, crystal.Map); m.OnAfterSpawn(); return m; } catch { } return null; }
public ArrayList SpawnMinions(int amount, MinorBarrierCrystal crystal) { ArrayList list = new ArrayList(); for (int i = 0; i < amount; i++) { try { Mobile m = Activator.CreateInstance(m_SpawnList.GetRandomMinion()) as Mobile; m.OnBeforeSpawn(crystal.Location, crystal.Map); m.MoveToWorld(crystal.Location, crystal.Map); m.OnAfterSpawn(); list.Add(m); } catch { } } return list; }
/// <summary> /// Triggers the Spawner's spawn methods for the minor barrier crystal /// Spawns the minor crystal's leader and a set amount of minions /// </summary> /// <param name="crystal">MinorBarrierCrystal to spawn to</param> public void MinorCrystalSpawn(MinorBarrierCrystal crystal) { ArrayList minions = CSpawner.SpawnMinions(1, crystal); if (!Leaders.ContainsKey(crystal)) Leaders.Add(crystal, CSpawner.SpawnCaptain(crystal)); else Leaders[crystal] = CSpawner.SpawnCaptain(crystal); m_Mobiles.AddRange(minions); m_Mobiles.Add(Leaders[crystal]); }
public RelockTimer(MinorBarrierCrystal crystal) : base(TimeSpan.FromSeconds(10.0), TimeSpan.FromSeconds(10.0)) { m_Crystal = crystal; Priority = TimerPriority.FiveSeconds; }