Beispiel #1
0
        public static void AddToSpawner(AncientClayVase vase)
        {
            if (Instance == null)
            {
                Instance = new VaseSpawner();
            }

            Instance.AddVase(vase);
        }
Beispiel #2
0
        public void AddVase(AncientClayVase vase)
        {
            if (Vases == null)
            {
                Vases = new List <AncientClayVase>();
            }

            if (!Vases.Contains(vase))
            {
                Vases.Add(vase);
            }
        }
Beispiel #3
0
        public void RemoveVase(AncientClayVase vase)
        {
            if (Vases != null)
            {
                if (Vases.Contains(vase))
                {
                    Vases.Remove(vase);
                }

                if (TreasuresOfDoomEvent.Instance.Running && Vases.Count < VaseCount)
                {
                    Timer.DelayCall(TimeSpan.FromMinutes(Utility.RandomMinMax(MinSpawn, MaxSpawn)), () =>
                    {
                        CreateVases(1);
                    });
                }
            }
        }
Beispiel #4
0
        public void RemoveVase(AncientClayVase vase)
        {
            if (Vases != null)
            {
                if (Vases.Contains(vase))
                {
                    Vases.Remove(vase);
                }

                if (PointsSystem.TreasuresOfDoom.InSeason && Vases.Count < VaseCount)
                {
                    Timer.DelayCall(TimeSpan.FromMinutes(Utility.RandomMinMax(MinSpawn, MaxSpawn)), () =>
                    {
                        CreateVases(1);
                    });
                }
            }
        }
Beispiel #5
0
        public void CreateVases(int count)
        {
            for (int i = 0; i < count; i++)
            {
                AncientClayVase vase = new AncientClayVase(true);
                ItemFlags.SetStealable(vase, true);
                vase.Movable = false;

                vase.Spawner = this;

                AddVase(vase);

                Point3D p = Point3D.Zero;

                do
                {
                    p = Map.Malas.GetRandomSpawnPoint(SpawnRecs);
                }while (p == Point3D.Zero || !Map.Malas.CanSpawnMobile(p));

                vase.OnBeforeSpawn(p, Map.Malas);
                vase.MoveToWorld(p, Map.Malas);
            }
        }