Пример #1
0
            protected override void OnTick()
            {
                if (m_Item.Deleted)
                {
                    return;
                }

                Mobile spawn;

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

                case 1: spawn = new CursedPirate(); break;
                }

                spawn.MoveToWorld(m_Item.Location, m_Item.Map);

                m_Item.Delete();
            }
Пример #2
0
        public static void SummonPirate(Mobile m, int i_type)
        {
            Map map = m.Map;

            if (map == null)
            {
                return;
            }

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

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

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

            if (!validLocation)
            {
                return;
            }

            BaseCreature spawn;

            switch (i_type)
            {
            default: return;

            case 0:
            {
                m.SendMessage("You have summoned a cursed pirate!");

                spawn = new CursedPirate();
                break;
            }

            case 1:
            {
                m.SendMessage("Uh oh, you have summoned the cursed pirate king");

                spawn = new CursedPirateKing();
                break;
            }
            }

            spawn.FightMode = FightMode.Closest;

            spawn.MoveToWorld(loc, map);
            spawn.Combatant = m;
        }