Example #1
0
        public void SpawnOrcLord(Mobile target)
        {
            var map = target.Map;

            if (map == null)
            {
                return;
            }

            var eable = GetMobilesInRange <OrcishLord>(10);
            var count = 0;

            foreach (var m in eable)
            {
                if (++count == 10)
                {
                    break;
                }
            }

            if (count < 10)
            {
                BaseCreature orc = new SpawnedOrcishLord {
                    Team = Team
                };

                orc.MoveToWorld(map.GetRandomNearbyLocation(target.Location), map);
                orc.Combatant = target;
            }

            eable.Free();
        }
Example #2
0
        public void SpawnOrcLord(Mobile target)
        {
            Map map = target.Map;

            if (map == null)
            {
                return;
            }

            int orcs = 0;
            IPooledEnumerable eable = GetMobilesInRange(10);

            foreach (Mobile m in eable)
            {
                if (m is OrcishLord)
                {
                    ++orcs;
                }
            }

            eable.Free();

            if (orcs < 10)
            {
                BaseCreature orc = new SpawnedOrcishLord
                {
                    Team = Team
                };

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

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

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

                orc.MoveToWorld(loc, map);

                orc.Combatant = target;
            }
        }
Example #3
0
        public void SpawnOrcLord(Mobile target)
        {
            var map = target.Map;

            if (map == null)
            {
                return;
            }

            var orcs = 0;

            foreach (var m in GetMobilesInRange(10))
            {
                if (m is OrcishLord)
                {
                    ++orcs;
                }
            }

            if (orcs < 10)
            {
                BaseCreature orc = new SpawnedOrcishLord();

                orc.Team = Team;

                var loc           = target.Location;
                var validLocation = false;

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

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

                orc.MoveToWorld(loc, map);

                orc.Combatant = target;
            }
        }
Example #4
0
        public void SpawnOrcLord(Mobile target)
        {
            Map map = target.Map;

            if (map == null)
            {
                return;
            }

            IPooledEnumerable <OrcishLord> eable = GetMobilesInRange <OrcishLord>(10);

            if (eable.Count() < 10)
            {
                BaseCreature orc = new SpawnedOrcishLord {
                    Team = Team
                };

                orc.MoveToWorld(map.GetRandomNearbyLocation(target.Location), map);
                orc.Combatant = target;
            }

            eable.Free();
        }
Example #5
0
        public void SpawnOrcLord(Mobile target)
        {
            Map map = target.Map;

            if (map == null)
                return;

            int orcs = 0;

            foreach (Mobile m in this.GetMobilesInRange(10))
            {
                if (m is OrcishLord)
                    ++orcs;
            }

            if (orcs < 10)
            {
                BaseCreature orc = new SpawnedOrcishLord();

                orc.Team = this.Team;

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

                for (int j = 0; !validLocation && j < 10; ++j)
                {
                    int x = target.X + Utility.Random(3) - 1;
                    int y = target.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);
                }

                orc.MoveToWorld(loc, map);

                orc.Combatant = target;
            }
        }