コード例 #1
0
 public AutokillTimer(WoodlandGuardian owner) : base(TimeSpan.FromMinutes(1.0))
 {
     m_Owner  = owner;
     Priority = TimerPriority.FiveSeconds;
 }
コード例 #2
0
        public void SpawnMobiles(Mobile target)
        {
            Map map = this.Map;

            if (map == null)
            {
                return;
            }

            int red = 0;

            foreach (Mobile m in this.GetMobilesInRange(10))
            {
                if (m is WoodlandProtector || m is WoodlandGuardian)
                {
                    ++red;
                }
            }

            if (red < 5)
            {
                PlaySound(0x51A);

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

                for (int i = 0; i < newblue; ++i)
                {
                    BaseCreature yellow;

                    switch (Utility.Random(2))
                    {
                    default:
                    case 0: yellow = new WoodlandProtector(); break;

                    case 1: yellow = new WoodlandGuardian(); break;
                    }

                    yellow.Team = this.Team;

                    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);
                        }
                    }

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