Example #1
0
            public InternalGump2(MysteriousWisp wisp, Item item) : base(40, 40)
            {
                m_Wisp = wisp;
                m_Item = item;

                AddImageTiled(0, 0, 300, 180, 0xA8E);
                AddAlphaRegion(0, 0, 300, 180);
                AddBackground(150, 10, 130, 130, 0xBB8);

                AddHtml(10, 10, 150, 20, "<BASEFONT COLOR=#FFFFFF>CONFIRM PURCHASE:</BASEFONT>", false, false);
                AddHtmlLocalized(10, 30, 140, 20, item.LabelNumber, 0x7FFF, false, false);

                m_Available = m_Wisp.GetCostFor(item) > -1;
                string cost = m_Available ? m_Wisp.GetCostFor(item).ToString() : "No Longer Available";

                AddHtml(10, 100, 140, 20, "<BASEFONT COLOR=#FFFFFF>Despise Crystals:</BASEFONT>", false, false);
                AddHtml(10, 120, 140, 20, "<BASEFONT COLOR=#FFFFFF>" + cost + "</BASEFONT>", false, false);

                Rectangle2D b = ItemBounds.Table[item.ItemID];

                AddItem(210 - b.Width / 2 - b.X, 70 - b.Height / 2 - b.Y, item.ItemID, item.Hue);
                AddItemProperty(item.Serial);

                if (m_Available)
                {
                    AddButton(90, 150, 2128, 2129, 1, GumpButtonType.Reply, 0);
                }

                AddButton(155, 150, 2119, 2120, 0, GumpButtonType.Reply, 0);
            }
Example #2
0
            public static void Resend(MysteriousWisp wisp)
            {
                if (m_Viewers == null || m_Viewers.Count == 0)
                {
                    return;
                }

                List <Mobile> viewers = new List <Mobile>(m_Viewers);
                Type          t       = typeof(Server.Mobiles.MysteriousWisp.InternalGump);

                foreach (Mobile m in viewers)
                {
                    if (m.HasGump(t))
                    {
                        m.CloseGump(t);

                        if (m_Viewers.Contains(m))
                        {
                            m_Viewers.Remove(m);
                        }

                        if (wisp.InRange(m.Location, 5) && wisp.Backpack != null)
                        {
                            m.SendGump(new InternalGump(wisp, m));
                        }
                    }
                }
            }
Example #3
0
            public override void GetChildProperties(ObjectPropertyList list, Item item)
            {
                base.GetChildProperties(list, item);

                MysteriousWisp wisp = RootParent as MysteriousWisp;

                if (wisp == null)
                {
                    return;
                }

                list.Add(1153425, wisp.GetCostFor(item).ToString()); // Price: ~1_AMT~ Despise Crystals
            }
Example #4
0
            public InternalGump(MysteriousWisp wisp, Mobile viewer) : base(40, 40)
            {
                m_Wisp = wisp;
                if (!m_Viewers.Contains(viewer))
                {
                    m_Viewers.Add(viewer);
                }

                AddBackground(0, 0, 320, 404, 0x13BE);
                AddImageTiled(10, 10, 300, 20, 0xA40);
                AddImageTiled(10, 40, 300, 324, 0xA40);
                AddImageTiled(10, 374, 300, 20, 0xA40);
                AddAlphaRegion(10, 10, 300, 384);

                AddHtml(14, 12, 500, 20, "<BASEFONT COLOR=#FFFFFF>Mysterious Wisp Inventory</BASEFONT>", false, false);

                AddButton(10, 374, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
                AddHtmlLocalized(45, 376, 450, 20, 1011012, 0x7FFF, false, false); // CANCEL

                m_Items = new List <Item>(m_Wisp.Backpack.Items);
                int current = 0;

                for (int i = 0; i < m_Items.Count; i++)
                {
                    Item item = m_Items[i];

                    int page = current / 5 + 1;
                    int pos  = current % 5;

                    if (pos == 0)
                    {
                        if (page > 1)
                        {
                            AddButton(200, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, page);
                            AddHtmlLocalized(240, 376, 60, 20, 1043353, 0x7FFF, false, false); // Next
                        }

                        AddPage(page);

                        if (page > 1)
                        {
                            AddButton(100, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, page - 1);
                            AddHtmlLocalized(140, 376, 60, 20, 1011393, 0x7FFF, false, false); // Back
                        }
                    }

                    if (item != null && !item.Deleted)
                    {
                        int x = 14;
                        int y = (pos * 64) + 44;

                        Rectangle2D b = ItemBounds.Table[item.ItemID];

                        AddImageTiledButton(x, y, 0x918, 0x919, i + 1, GumpButtonType.Reply, 0, item.ItemID, item.Hue, 40 - b.Width / 2 - b.X, 30 - b.Height / 2 - b.Y);
                        AddItemProperty(item.Serial);

                        string cost = m_Wisp.GetCostFor(item) > -1 ? m_Wisp.GetCostFor(item).ToString("###,###,###") : "No Longer Available";

                        AddHtmlLocalized(x + 84, y, 250, 60, item.LabelNumber, 0x7FFF, false, false);
                        AddHtml(x + 84, y + 20, 250, 60, "<BASEFONT COLOR=#FFFFFF>" + cost + "</BASEFONT>", false, false);

                        current++;
                    }
                }
            }
Example #5
0
        public static void SetupDespise_OnCommand(CommandEventArgs e)
        {
            if (DespiseController.Instance == null)
            {
                foreach (Region region in Region.Regions)
                {
                    if (region.Name == "Despise" && region.Map == Map.Trammel)
                    {
                        foreach (Sector sector in region.Sectors)
                        {
                            List<Item> list = new List<Item>(sector.Items);

                            foreach (Item item in list)
                            {
                                if (item is XmlSpawner)
                                    ((XmlSpawner)item).DoReset = true;
                            }

                            list.Clear();
                        }
                    }
                }

                CommandEventArgs args = new CommandEventArgs(e.Mobile, null, null, new string[] { @"Data\Monsters\NewDespise" });
                XmlSpawner.Load_OnCommand(args);

                DespiseController controller = new DespiseController();
                controller.MoveToWorld(new Point3D(5571, 626, 30), Map.Trammel);

                DespiseAnkh ankh = new DespiseAnkh(Alignment.Good);
                ankh.MoveToWorld(new Point3D(5474, 525, 79), Map.Trammel);

                ankh = new DespiseAnkh(Alignment.Evil);
                ankh.MoveToWorld(new Point3D(5472, 754, 10), Map.Trammel);

                Moongate gate1 = new Moongate(false);
                Moongate gate2 = new Moongate(false);

                //Gate1
                gate1.MoveToWorld(new Point3D(5475, 735, 5), Map.Trammel);
                gate2.MoveToWorld(new Point3D(5458, 610, 50), Map.Trammel);
                HueGates(gate1, gate2);
                LinkGates(gate1, gate2);

                gate1 = new Moongate(false);
                gate2 = new Moongate(false);

                //Gate2
                gate1.MoveToWorld(new Point3D(5459, 674, 20), Map.Trammel);
                gate2.MoveToWorld(new Point3D(5454, 522, 60), Map.Trammel);
                HueGates(gate1, gate2);
                LinkGates(gate1, gate2);

                gate1 = new Moongate(false);
                gate2 = new Moongate(false);

                //Gate3
                gate1.MoveToWorld(new Point3D(5388, 753, 5), Map.Trammel);
                gate2.MoveToWorld(new Point3D(5387, 628, 30), Map.Trammel);
                HueGates(gate1, gate2);
                LinkGates(gate1, gate2);

                //Teleporters
                IPooledEnumerable eable = Map.Trammel.GetItemsInRange(new Point3D(5588, 631, 30), 2);
                DespiseTeleporter tele = null;

                //Wisp
                MysteriousWisp wisp = new MysteriousWisp();
                wisp.MoveToWorld(new Point3D(1303, 1088, 0), Map.Trammel);

                foreach (Item item in eable)
                {
                    if (item is Teleporter)
                    {
                        Teleporter old = (Teleporter)item;

                        tele = new DespiseTeleporter();
                        tele.PointDest = old.PointDest;
                        tele.MapDest = old.MapDest;
                        tele.MoveToWorld(old.Location, old.Map);

                        old.Delete();
                    }
                }
                eable.Free();

                e.Mobile.SendMessage("Despise Revamped setup! Don't forget to setup mob spawners an activate it!");
            }
            else
                e.Mobile.SendMessage("This has already been setup.");
        }
Example #6
0
 public InternalEntry(MysteriousWisp wisp, Mobile clicker)
     : base(1150143, 3)
 {
     m_Clicker = clicker;
     m_Wisp    = wisp;
 }
            public InternalGump2(MysteriousWisp wisp, Item item)
                : base(40, 40)
            {
                m_Wisp = wisp;
                m_Item = item;

                AddImageTiled(0, 0, 300, 180, 0xA8E);
                AddAlphaRegion(0, 0, 300, 180);
                AddBackground(150, 10, 130, 130, 0xBB8);

                AddHtml(10, 10, 150, 20, "<BASEFONT COLOR=#FFFFFF>CONFIRM PURCHASE:</BASEFONT>", false, false);
                AddHtmlLocalized(10, 30, 140, 20, item.LabelNumber, 0x7FFF, false, false);

                m_Available = m_Wisp.GetCostFor(item) > -1;
                string cost = m_Available ? m_Wisp.GetCostFor(item).ToString() : "No Longer Available";

                AddHtml(10, 100, 140, 20, "<BASEFONT COLOR=#FFFFFF>Despise Crystals:</BASEFONT>", false, false);
                AddHtml(10, 120, 140, 20, "<BASEFONT COLOR=#FFFFFF>"+cost+"</BASEFONT>", false, false);

                Rectangle2D b = ItemBounds.Table[item.ItemID];
                AddItem(210 - b.Width / 2 - b.X, 70 - b.Height / 2 - b.Y, item.ItemID, item.Hue);
                AddItemProperty(item.Serial);

                if (m_Available)
                    AddButton(90, 150, 2128, 2129, 1, GumpButtonType.Reply, 0);

                AddButton(155, 150, 2119, 2120, 0, GumpButtonType.Reply, 0);
            }
            public static void Resend(MysteriousWisp wisp)
            {
                if (m_Viewers == null || m_Viewers.Count == 0)
                    return;

                List<Mobile> viewers = new List<Mobile>(m_Viewers);
                Type t = typeof(Server.Mobiles.MysteriousWisp.InternalGump);

                foreach (Mobile m in viewers)
                {
                    if (m.HasGump(t))
                    {
                        m.CloseGump(t);

                        if (m_Viewers.Contains(m))
                            m_Viewers.Remove(m);

                        if(wisp.InRange(m.Location, 5) && wisp.Backpack != null)
                            m.SendGump(new InternalGump(wisp, m));
                    }
                }
            }
            public InternalGump(MysteriousWisp wisp, Mobile viewer)
                : base(40, 40)
            {
                m_Wisp = wisp;
                if (!m_Viewers.Contains(viewer))
                    m_Viewers.Add(viewer);

                AddBackground(0, 0, 320, 404, 0x13BE);
                AddImageTiled(10, 10, 300, 20, 0xA40);
                AddImageTiled(10, 40, 300, 324, 0xA40);
                AddImageTiled(10, 374, 300, 20, 0xA40);
                AddAlphaRegion(10, 10, 300, 384);

                AddHtml(14, 12, 500, 20, "<BASEFONT COLOR=#FFFFFF>Mysterious Wisp Inventory</BASEFONT>", false, false);

                AddButton(10, 374, 0xFB1, 0xFB2, 0, GumpButtonType.Reply, 0);
                AddHtmlLocalized(45, 376, 450, 20, 1011012, 0x7FFF, false, false); // CANCEL

                m_Items = new List<Item>(m_Wisp.Backpack.Items);
                int current = 0;

                for (int i = 0; i < m_Items.Count; i++)
                {
                    Item item = m_Items[i];

                    int page = current / 5 + 1;
                    int pos = current % 5;

                    if (pos == 0)
                    {
                        if (page > 1)
                        {
                            AddButton(200, 374, 0xFA5, 0xFA7, 0, GumpButtonType.Page, page);
                            AddHtmlLocalized(240, 376, 60, 20, 1043353, 0x7FFF, false, false); // Next
                        }

                        AddPage(page);

                        if (page > 1)
                        {
                            AddButton(100, 374, 0xFAE, 0xFB0, 0, GumpButtonType.Page, page - 1);
                            AddHtmlLocalized(140, 376, 60, 20, 1011393, 0x7FFF, false, false); // Back
                        }
                    }

                    if (item != null && !item.Deleted)
                    {
                        int x = 14;
                        int y = (pos * 64) + 44;

                        Rectangle2D b = ItemBounds.Table[item.ItemID];

                        AddImageTiledButton(x, y, 0x918, 0x919, i + 1, GumpButtonType.Reply, 0, item.ItemID, item.Hue, 40 - b.Width / 2 - b.X, 30 - b.Height / 2 - b.Y);
                        AddItemProperty(item.Serial);

                        string cost = m_Wisp.GetCostFor(item) > -1 ? m_Wisp.GetCostFor(item).ToString("###,###,###") : "No Longer Available";

                        AddHtmlLocalized(x + 84, y, 250, 60, item.LabelNumber, 0x7FFF, false, false);
                        AddHtml(x + 84, y + 20, 250, 60, "<BASEFONT COLOR=#FFFFFF>" + cost + "</BASEFONT>", false, false);

                        current++;
                    }
                }
            }
 public InternalEntry(MysteriousWisp wisp, Mobile clicker)
     : base(1150143, 3)
 {
     m_Clicker = clicker;
     m_Wisp = wisp;
 }
Example #11
0
        public static void SetupDespise_OnCommand(CommandEventArgs e)
        {
            if (DespiseController.Instance == null)
            {
                DespiseController controller = new DespiseController();
                WeakEntityCollection.Add("despise", controller);
                controller.MoveToWorld(new Point3D(5571, 626, 30), Map.Trammel);

                DespiseAnkh ankh = new DespiseAnkh(Alignment.Good);
                WeakEntityCollection.Add("despise", ankh);
                ankh.MoveToWorld(new Point3D(5474, 525, 79), Map.Trammel);

                ankh = new DespiseAnkh(Alignment.Evil);
                WeakEntityCollection.Add("despise", ankh);
                ankh.MoveToWorld(new Point3D(5472, 754, 10), Map.Trammel);

                Moongate gate1 = new Moongate(false);
                Moongate gate2 = new Moongate(false);
                WeakEntityCollection.Add("despise", gate1);
                WeakEntityCollection.Add("despise", gate2);

                //Gate1
                gate1.MoveToWorld(new Point3D(5475, 735, 5), Map.Trammel);
                gate2.MoveToWorld(new Point3D(5458, 610, 50), Map.Trammel);
                HueGates(gate1, gate2);
                LinkGates(gate1, gate2);

                gate1 = new Moongate(false);
                gate2 = new Moongate(false);
                WeakEntityCollection.Add("despise", gate1);
                WeakEntityCollection.Add("despise", gate2);

                //Gate2
                gate1.MoveToWorld(new Point3D(5459, 674, 20), Map.Trammel);
                gate2.MoveToWorld(new Point3D(5454, 522, 60), Map.Trammel);
                HueGates(gate1, gate2);
                LinkGates(gate1, gate2);

                gate1 = new Moongate(false);
                gate2 = new Moongate(false);
                WeakEntityCollection.Add("despise", gate1);
                WeakEntityCollection.Add("despise", gate2);

                //Gate3
                gate1.MoveToWorld(new Point3D(5388, 753, 5), Map.Trammel);
                gate2.MoveToWorld(new Point3D(5387, 628, 30), Map.Trammel);
                HueGates(gate1, gate2);
                LinkGates(gate1, gate2);

                //Teleporters
                IPooledEnumerable eable = Map.Trammel.GetItemsInRange(new Point3D(5588, 631, 30), 2);
                DespiseTeleporter tele = null;

                //Wisp
                MysteriousWisp wisp = new MysteriousWisp();
                WeakEntityCollection.Add("despise", wisp);
                wisp.MoveToWorld(new Point3D(1303, 1088, 0), Map.Trammel);

                foreach (Item item in eable)
                {
                    if (item is Teleporter)
                    {
                        Teleporter old = (Teleporter)item;

                        tele = new DespiseTeleporter();
                        WeakEntityCollection.Add("despise", tele);
                        tele.PointDest = old.PointDest;
                        tele.MapDest = old.MapDest;
                        tele.MoveToWorld(old.Location, old.Map);

                        old.Delete();
                    }
                }
                eable.Free();

                e.Mobile.SendMessage("Despise setup complete");
            }
            else
                e.Mobile.SendMessage("Despise appears to already be setup");
        }