Example #1
0
 public DelayTimer(Mobile from, PortalItem gate, int range)
     : base(TimeSpan.FromSeconds(1.0))
 {
     m_From = from;
     m_Gate = gate;
     m_Range = range;
 }
Example #2
0
        public PortalConfirmGump(Mobile from, PortalItem gate)
            : base(gate.EraAOS ? 110 : 20, gate.EraAOS ? 100 : 30)
        {
            m_From = from;
            m_Gate = gate;

            if (gate.EraAOS)
            {
                Closable = false;

                AddPage(0);

                AddBackground(0, 0, 420, 280, 5054);

                AddImageTiled(10, 10, 400, 20, 2624);
                AddAlphaRegion(10, 10, 400, 20);

                AddHtmlLocalized(10, 10, 400, 20, 1062051, 30720, false, false); // Gate Warning

                AddImageTiled(10, 40, 400, 200, 2624);
                AddAlphaRegion(10, 40, 400, 200);

                if (from.Map != Map.Felucca && gate.TargetMap == Map.Felucca && gate.ShowFeluccaWarning)
                {
                    AddHtmlLocalized(10, 40, 400, 200, 1062050, 32512, false, true);
                    // This Gate goes to Felucca... Continue to enter the gate, Cancel to stay here
                }
                else
                {
                    AddHtmlLocalized(10, 40, 400, 200, 1062049, 32512, false, true);
                    // Dost thou wish to step into the moongate? Continue to enter the gate, Cancel to stay here
                }

                AddImageTiled(10, 250, 400, 20, 2624);
                AddAlphaRegion(10, 250, 400, 20);

                AddButton(10, 250, 4005, 4007, 1, GumpButtonType.Reply, 0);
                AddHtmlLocalized(40, 250, 170, 20, 1011036, 32767, false, false); // OKAY

                AddButton(210, 250, 4005, 4007, 0, GumpButtonType.Reply, 0);
                AddHtmlLocalized(240, 250, 170, 20, 1011012, 32767, false, false); // CANCEL
            }
            else
            {
                AddPage(0);

                AddBackground(0, 0, 420, 400, 5054);
                AddBackground(10, 10, 400, 380, 3000);

                AddHtml(
                    20,
                    40,
                    380,
                    60,
                    @"Dost thou wish to step into the moongate? Continue to enter the gate, Cancel to stay here",
                    false,
                    false);

                AddHtmlLocalized(55, 110, 290, 20, 1011012, false, false); // CANCEL
                AddButton(20, 110, 4005, 4007, 0, GumpButtonType.Reply, 0);

                AddHtmlLocalized(55, 140, 290, 40, 1011011, false, false); // CONTINUE
                AddButton(20, 140, 4005, 4007, 1, GumpButtonType.Reply, 0);
            }
        }
Example #3
0
        public bool SpawnPortal()
        {
            bool success = false;
            bool CanFit = false;
            Map map = Map.Felucca;
            int count = 0;

            if (PortalItem != null)
            {
                return true;
            }
            while (!CanFit)
            {
                int x = Utility.Random(0, 5072);
                int y = Utility.Random(0, 4072);
                int z = map.GetAverageZ(x, y);
                CanFit = map.CanSpawnMobile(new Point3D(x, y, z));
                Region region = Region.Find(new Point3D(x, y, z), map);

                if (CanFit && !(region is HouseRegion || region is GuardedRegion))
                {
                    PortalEntrance = new Point3D(x, y, z);
                    PortalItem = new PortalItem(DungeonEntrance, DungeonMap) {_PortalSerial = UID};
                    PortalItem.MoveToWorld(PortalEntrance, map);

                    PortalItem2 = new PortalItem(PortalEntrance, map);
                    PortalItem2.MoveToWorld(DungeonEntrance, DungeonMap);

                    Anim1 = new FireElemental
                    {
                        CantWalk = true,
                        Blessed = true,
                        Direction = Direction.Mask,
                        IgnoreMobiles = true,
                        Name = ""
                    };
                    Anim2 = new FireElemental
                    {
                        CantWalk = true,
                        Blessed = true,
                        Direction = Direction.Mask,
                        IgnoreMobiles = true,
                        Name = "a mysterious gate"
                    };

                    Anim1.MoveToWorld(PortalEntrance, map);
                    Anim2.MoveToWorld(PortalEntrance, map);
                    success = true;
                }
                else
                {
                    CanFit = false;
                }
                count++;
                if (count >= 10000)
                {
                    break;
                }
            }

            return success;
        }