Пример #1
0
        public void SpawnLeatherWolf2s(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
                return;

            int newLeatherWolf2s = Utility.RandomMinMax(1, 2);

            for (int i = 0; i < newLeatherWolf2s; ++i)
            {
                LeatherWolf2 LeatherWolf2 = new LeatherWolf2();

                LeatherWolf2.Team = this.Team;
                LeatherWolf2.FightMode = FightMode.Closest;

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

                for (int j = 0; !validLocation && j < 10; ++j)
                {
                    int x = X + Utility.Random(3) - 1;
                    int y = 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, Z);
                    else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                        loc = new Point3D(x, y, z);
                }

                LeatherWolf2.MoveToWorld(loc, map);
                LeatherWolf2.Combatant = target;
            }
        }
Пример #2
0
        public void SpawnLeatherWolf2s(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int newLeatherWolf2s = Utility.RandomMinMax(1, 2);

            for (int i = 0; i < newLeatherWolf2s; ++i)
            {
                LeatherWolf2 LeatherWolf2 = new LeatherWolf2();

                LeatherWolf2.Team      = this.Team;
                LeatherWolf2.FightMode = FightMode.Closest;

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

                for (int j = 0; !validLocation && j < 10; ++j)
                {
                    int x = X + Utility.Random(3) - 1;
                    int y = 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, Z);
                    }
                    else if (validLocation = map.CanFit(x, y, z, 16, false, false))
                    {
                        loc = new Point3D(x, y, z);
                    }
                }

                LeatherWolf2.MoveToWorld(loc, map);
                LeatherWolf2.Combatant = target;
            }
        }