Inheritance: BaseMount
Exemplo n.º 1
0
        public void DoSpawn()
        {
            Map map = this.Map;

            if (map != null && Utility.RandomBool())
            {
                this.PlaySound(0x218);//////////

                int    newFollowers = Utility.RandomMinMax(2, 5);
                Mobile focus        = GetRandomTarget(10, false);

                if (focus != null)
                {
                    for (int i = 0; i < newFollowers; ++i)
                    {
                        BaseCreature spawn;

                        switch (Utility.Random(5))
                        {
                        default:
                        case 0: spawn = new WaterElemental(); break;

                        case 1: spawn = new EarthElemental(); break;

                        case 2: spawn = new FireSteed(); break;

                        case 3: spawn = new FireElemental(); break;

                        case 4: spawn = new AirElemental(); break;
                        }

                        spawn.Team = this.Team;

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

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

                            if (validLocation = map.CanFit(x, y, this.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);
                            }
                        }

                        spawn.MoveToWorld(loc, map);
                        spawn.Combatant = focus;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack))
            {
                int hours, minutes;
                Clock.GetTime(Map, Location.X, Location.Y, out hours, out minutes);

                if (hours <= 19)
                {
                    #region Spawn Random Ambush

                    switch (Utility.Random(3))
                    {
                        case 0:
                            {
                                from.SendMessage("*As your gaze scans the horizon, you notice a group of brigands closing in*");

                                #region Define Mobiles To Spawn
                                // I've reserved spawn01-spawn09; however, you can add as many variables as you like as long as they are unique

                                Mobile spawn01 = new Brigand();
                                Mobile spawn02 = new Brigand();
                                Mobile spawn03 = new Brigand();
                                Mobile spawn04 = new Brigand();
                                Mobile spawn05 = new Brigand();
                                Mobile spawn06 = new Brigand();

                                #endregion

                                switch (Utility.Random(2))
                                {
                                    case 1:
                                        {
                                            /// <summary>
                                            /// Don't forget to plug in the spawn variables you add above below:
                                            /// </summary>
                                            spawn01.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map);
                                            spawn02.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map);
                                            spawn03.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map);
                                            spawn04.MoveToWorld(new Point3D(from.X, from.Y + 10, from.Z), from.Map);
                                            spawn05.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map);
                                            spawn06.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map);
                                            break;
                                        }
                                    case 0:
                                        {
                                            switch (Utility.Random(4))
                                            {
                                                case 0: from.SendMessage("*As your gaze scans the horizon, all seems too quiet*"); break;
                                                case 1: from.SendMessage("*As your gaze scans the horizon, you hear breaking branches in the distance*"); break;

                                                // Sometimes a subspawn is the perfect ambiance/ detail to role-playing on a server
                                                case 2: from.SendMessage("*You notice the ground moving beneath your feet*");
                                                    Mobile subspawn01 = new Rat();
                                                    subspawn01.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map); break;

                                                case 3: from.SendMessage("*As your gaze scans the horizon, you feel confident all is well*"); break;
                                            }
                                            break;
                                        }
                                }
                                break;
                            }
                        case 1:
                            {
                                from.SendMessage("*As your gaze scans the horizon, you notice an Ettin patrol nearby*");

                                #region Define Mobiles To Spawn
                                // I've reserved spawn11-spawn19; however, you can add as many variables as you like as long as they are unique

                                Mobile spawn11 = new Ettin();
                                Mobile spawn12 = new Ettin();
                                Mobile spawn13 = new Ettin();
                                Mobile spawn14 = new Ettin();
                                Mobile spawn15 = new Ettin();
                                Mobile spawn16 = new Ettin();

                                #endregion

                                switch (Utility.Random(2))
                                {
                                    case 1:
                                        {
                                            /// <summary>
                                            /// Don't forget to plug in the spawn variables you add above below:
                                            /// </summary>
                                            spawn11.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map);
                                            spawn12.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map);
                                            spawn13.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map);
                                            spawn14.MoveToWorld(new Point3D(from.X, from.Y + 10, from.Z), from.Map);
                                            spawn15.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map);
                                            spawn16.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map);
                                            break;
                                        }
                                    case 0:
                                        {
                                            switch (Utility.Random(2, 4))
                                            {
                                                case 0: from.SendMessage("*As your gaze scans the horizon, all seems too quiet*"); break;
                                                case 1: from.SendMessage("*As your gaze scans the horizon, you hear breaking branches in the distance*"); break;

                                                // Sometimes a subspawn is the perfect ambiance/ detail to role-playing on a server
                                                case 2: from.SendMessage("*You notice the ground moving beneath your feet*");
                                                    Mobile subspawn11 = new Rat();
                                                    subspawn11.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map); break;

                                                case 3: from.SendMessage("*As your gaze scans the horizon, you feel confident all is well*"); break;
                                            }
                                            break;
                                        }
                                }
                                break;
                            }
                        case 2: // This case makes the Scout Spyglass act like a normal Spyglass
                            {
                                if (hours < 5 || hours > 17)
                                {
                                    from.SendLocalizedMessage(1055040); // You gaze up into the glittering night sky.  With great care, you compose a chart of the most prominent star patterns.
                                }
                                else
                                {
                                    from.SendLocalizedMessage(1055039); // You gaze up into the sky, but it is not dark enough to see any stars.
                                }
                                break;
                            }
                    }

                    #endregion
                }
                else
                {
                    #region Spawn Random Ambush

                    switch (Utility.Random(3))
                    {
                        case 0:
                            {
                                from.SendMessage("*As your gaze scans the horizon, you notice a group of black bears closing in*");

                                #region Define Mobiles To Spawn
                                // I've reserved spawn21-spawn29; however, you can add as many variables as you like as long as they are unique

                                Mobile spawn21 = new BlackBear();
                                Mobile spawn22 = new BlackBear();
                                Mobile spawn23 = new BlackBear();
                                Mobile spawn24 = new BlackBear();
                                Mobile spawn25 = new BlackBear();
                                Mobile spawn26 = new BlackBear();

                                #endregion

                                switch (Utility.Random(2))
                                {
                                    case 1:
                                        {
                                            /// <summary>
                                            /// Don't forget to plug in the spawn variables you add above below:
                                            /// </summary>
                                            spawn21.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map);
                                            spawn22.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map);
                                            spawn23.MoveToWorld(new Point3D(from.X + 20, from.Y, from.Z), from.Map);
                                            spawn24.MoveToWorld(new Point3D(from.X, from.Y + 10, from.Z), from.Map);
                                            spawn25.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map);
                                            spawn26.MoveToWorld(new Point3D(from.X, from.Y + 20, from.Z), from.Map);
                                            break;
                                        }
                                    case 0:
                                        {
                                            switch (Utility.Random(4))
                                            {
                                                case 0: from.SendMessage("*As your gaze scans the horizon, all seems too quiet*"); break;
                                                case 1: from.SendMessage("*As your gaze scans the horizon, you hear breaking branches in the distance*"); break;

                                                // Sometimes a subspawn is the perfect ambiance/ detail to role-playing on a server
                                                case 2: from.SendMessage("*You notice the ground moving beneath your feet*");
                                                    Mobile subspawn21 = new Rat();
                                                    subspawn21.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map); break;

                                                case 3: from.SendMessage("*As your gaze scans the horizon, you feel confident all is well*"); break;
                                            }
                                            break;
                                        }
                                }
                                break;
                            }
                        case 1:
                            {
                                from.SendMessage("*As your gaze scans the horizon, you notice an Fire Gargoyle patrol nearby*");

                                #region Define Mobiles To Spawn
                                // I've reserved spawn31-spawn39; however, you can add as many variables as you like as long as they are unique

                                Mobile spawn31 = new FireGargoyle();
                                Mobile spawn32 = new FireSteed();
                                Mobile spawn33 = new FireGargoyle();
                                Mobile spawn34 = new FireSteed();
                                Mobile spawn35 = new FireGargoyle();
                                Mobile spawn36 = new FireBeetle();

                                #endregion

                                switch (Utility.Random(2))
                                {
                                    case 1:
                                        {
                                            /// <summary>
                                            /// Don't forget to plug in the spawn variables you add above below:
                                            /// </summary>
                                            spawn31.MoveToWorld(new Point3D(from.X + 10, from.Y, from.Z), from.Map);
                                            spawn32.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map);
                                            spawn33.MoveToWorld(new Point3D(from.X + 15, from.Y, from.Z), from.Map);
                                            spawn34.MoveToWorld(new Point3D(from.X, from.Y + 10, from.Z), from.Map);
                                            spawn35.MoveToWorld(new Point3D(from.X, from.Y + 10, from.Z), from.Map);
                                            spawn36.MoveToWorld(new Point3D(from.X, from.Y + 15, from.Z), from.Map);
                                            break;
                                        }
                                    case 0:
                                        {
                                            switch (Utility.Random(4))
                                            {
                                                case 0: from.SendMessage("*As your gaze scans the horizon, all seems too quiet*"); break;
                                                case 1: from.SendMessage("*As your gaze scans the horizon, you hear breaking branches in the distance*"); break;

                                                // Sometimes a subspawn is the perfect ambiance/ detail to role-playing on a server
                                                case 2: from.SendMessage("*You notice the ground moving beneath your feet*");
                                                    Mobile subspawn31 = new Rat();
                                                    subspawn31.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map); break;

                                                case 3: from.SendMessage("*As your gaze scans the horizon, you feel confident all is well*"); break;
                                            }
                                            break;
                                        }
                                }
                                break;
                            }
                        case 2: // This case makes the Scout Spyglass act like a normal Spyglass
                            {
                                if (hours < 5 || hours > 17)
                                {
                                    from.SendLocalizedMessage(1055040); // You gaze up into the glittering night sky.  With great care, you compose a chart of the most prominent star patterns.
                                }
                                else
                                {
                                    from.SendLocalizedMessage(1055039); // You gaze up into the sky, but it is not dark enough to see any stars.
                                }
                                break;
                            }
                    }

                    #endregion
                }

                --this.UsesRemaining;

                if (this.UsesRemaining == 0)
                {
                    this.Delete();
                }
            }
            else
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
        }
        public void SpawnFollowers(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int followers = 0;

            foreach (Mobile m in this.GetMobilesInRange(10))
            {
                if (m is EarthElemental || m is FireElemental || m is AirElemental || m is FireSteed || m is WaterElemental)
                {
                    ++followers;
                }
            }

            if (this.Followers < 9)
            {
                this.PlaySound(0x218);//////////

                int newFollowers = Utility.RandomMinMax(1, 3);

                for (int i = 0; i < newFollowers; ++i)
                {
                    BaseCreature follower;

                    switch (Utility.Random(5))
                    {
                    default:
                    case 0:
                        follower = new WaterElemental();
                        break;

                    case 1:
                        follower = new EarthElemental();
                        break;

                    case 2:
                        follower = new FireSteed();
                        break;

                    case 3:
                        follower = new FireElemental();
                        break;

                    case 4:
                        follower = new AirElemental();
                        break;
                    }

                    follower.Team = this.Team;

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

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

                        if (validLocation = map.CanFit(x, y, this.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);
                        }
                    }

                    follower.MoveToWorld(loc, map);
                    follower.Combatant = target;
                }
            }
        }
Exemplo n.º 4
0
        public void SpawnFollowers(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
                return;

            int followers = 0;

            foreach (Mobile m in this.GetMobilesInRange(10))
            {
                if (m is EarthElemental || m is FireElemental || m is AirElemental || m is FireSteed || m is WaterElemental)
                    ++followers;
            }

            if (this.Followers < 9)
            {
                this.PlaySound(0x218);//////////

                int newFollowers = Utility.RandomMinMax(1, 3);

                for (int i = 0; i < newFollowers; ++i)
                {
                    BaseCreature follower;

                    switch (Utility.Random(5))
                    {
                        default:
                        case 0:
                            follower = new WaterElemental();
                            break;
                        case 1:
                            follower = new EarthElemental();
                            break;
                        case 2:
                            follower = new FireSteed();
                            break;
                        case 3:
                            follower = new FireElemental();
                            break;
                        case 4:
                            follower = new AirElemental();
                            break;
                    }

                    follower.Team = this.Team;

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

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

                        if (validLocation = map.CanFit(x, y, this.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);
                    }

                    follower.MoveToWorld(loc, map);
                    follower.Combatant = target;
                }
            }
        }
Exemplo n.º 5
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);
                }
            }
        }