private void SpawnRandomPirate() { if (Pirates == null) { return; } int row = Utility.Random(8); Point3D ranPnt = SpawnPoints[Utility.Random(SpawnPoints.Length)]; ConvertOffset(ref ranPnt); int a = row % 2 == 0 ? 0 : 3; int startX = ranPnt.X + a; int x = startX + ((row / 2) * 9); ShadowguardPirate pirate = new ShadowguardPirate(); pirate.MoveToWorld(new Point3D(x, ranPnt.Y, ranPnt.Z), Map.TerMur); Pirates.Add(pirate); }
public override void OnCreatureKilled(BaseCreature bc) { if (!(bc is ShadowguardPirate) || Pirates == null) { return; } if (Pirates.Contains(bc)) { Pirates.Remove(bc); } if (Pirates.Count <= 0) { Wave++; Pirates.Clear(); int toSpawn = Math.Max(3, PartySize() * 3); if (Wave < 4) { for (int i = 0; i < toSpawn; i++) { SpawnRandomPirate(); } } else if (Wave == 4) { var pirate = new ShantyThePirate(); Point3D p = SpawnPoints[Utility.Random(SpawnPoints.Length)]; ConvertOffset(ref p); pirate.MoveToWorld(p, Map.TerMur); Pirates.Add(pirate); } else { CompleteEncounter(); } } }