Inheritance: BaseCreature
        private void SpawnRandom()
        {
            Point3D loc = Location;
            BaseCreature creature = null;

            switch (Utility.Random(5))
            {
                case 0:
                case 1: creature = new TheCursed(); break;
                case 2: creature = new DreadSpider(); break;
                case 3: creature = new HellHound(); break;
                case 4: creature = new PredatorHellCat(); break;
            }

            Effects.SendLocationParticles(EffectItem.Create(loc, Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
            Effects.PlaySound(loc, Map, 0x1FE);
            creature.MoveToWorld(loc, Map);
        }
Esempio n. 2
0
        public void SummonCritters()
        {
            int    SummonRange;
            Mobile SummonTarget;
            Map    map = this.Map;

            if (map == null)
            {
                return;
            }

            int CritterNum  = Utility.Random(8);
            int newCritters = Utility.RandomMinMax(4, 8);
            int critters    = 0;

            foreach (Mobile m in this.GetMobilesInRange(15))
            {
                if (m is PredatorHellCat || m is FireSteed || m is Nightmare ||
                    m is FireGargoyle || m is HellHound || m is Gargoyle ||
                    m is LavaElemental || m is Efreet)
                {
                    ++critters;
                }
            }

            if (critters < 16)
            {
                for (int i = 0; i < newCritters; ++i)
                {
                    BaseCreature critter;

                    switch (CritterNum)
                    {
                    default:
                    case 0: critter = new PredatorHellCat(); break;

                    case 1: critter = new FireSteed(); break;

                    case 2: critter = new Nightmare(); break;

                    case 3: critter = new FireGargoyle(); break;

                    case 4: critter = new HellHound(); break;

                    case 5: critter = new Gargoyle(); break;

                    case 6: critter = new LavaElemental(); break;

                    case 7: critter = new Efreet(); break;
                    }

                    critter.Team = this.Team;

                    bool    validLocation = false;
                    Point3D loc           = this.Location;

                    for (int j = 0; !validLocation && j < 10; ++j)
                    {
                        int x = X + Utility.Random(8) - 1;
                        int y = Y + Utility.Random(8) - 1;
                        int z = map.GetAverageZ(x, y);

                        if (validLocation = map.CanFit(x, y, Z, 16, false, false))
                        {
                            loc = new Point3D(x, y, this.Z);
                        }
                        else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                        {
                            loc = new Point3D(x, y, z);
                        }
                    }

                    critter.MoveToWorld(loc, map);
                }
            }
        }