Beispiel #1
0
        private void GiveFreeTicket(Mobile from, BaseLottoTicket ticket)
        {
            if (from == null)
            {
                return;
            }

            Item   item = null;
            string name = "";

            switch (ticket.Type)
            {
            default:
            case TicketType.GoldenTicket: item = new GoldenTicket(from, false); name = "Golden Ticket"; break;

            case TicketType.CrazedCrafting: item = new CrazedCrafting(from, false); name = "Crazed Crafting"; break;

            case TicketType.SkiesTheLimit: item = new SkiesTheLimit(from, false); name = "Skies the Limit"; break;
            }

            if (item != null)
            {
                from.SendMessage("You have recived your free {0} ticket.", name);
                if (from.Backpack != null)
                {
                    from.Backpack.DropItem(item);
                }
                else
                {
                    from.BankBox.DropItem(item);
                }
            }
            ticket.FreeTicket = false;
        }
        private void CrazedCrafting()
        {
            int yStart = 75;

            AddImage(70, yStart - 10, 0x589);
            AddImage(210, yStart - 10, 0x589);
            AddImage(350, yStart - 10, 0x589);

            CrazedCrafting ticket = null;

            if (m_Ticket is CrazedCrafting)
            {
                ticket = (CrazedCrafting)m_Ticket;
            }

            if (ticket != null)
            {
                if (m_Ticket.Scratch1 == 0)
                {
                    AddButton(79, yStart, 0x15C3, 0x15C4, 1, GumpButtonType.Reply, 0);
                }
                else if (m_Ticket.Scratch1 == 2)
                {
                    AddHtml(71, yStart + 20, 80, 20, String.Format("<Basefont Size=6 Color=#FFFF00><Center>Free</Center></Basefont>"), false, false);
                }
                else
                {
                    bool wildCard = false;
                    foreach (int num in ticket.WildCards)
                    {
                        if (m_Ticket.Scratch1 == num)
                        {
                            AddImage(80, yStart, num, 2);
                            wildCard = true;
                        }
                    }

                    if (!wildCard)
                    {
                        string value = String.Format("{0:##,###,###}", ticket.Scratch1);
                        AddHtml(71, yStart + 20, 80, 20, String.Format("<Basefont Size=6 Color=#FFFF00><Center>{0}</Center></Basefont>", value), false, false);
                        AddImage(80, yStart, 0x15AA, 1);
                    }
                }

                if (m_Ticket.Scratch2 == 0)
                {
                    AddButton(219, yStart, 0x15C3, 0x15C4, 2, GumpButtonType.Reply, 0);
                }
                else if (m_Ticket.Scratch2 == 2)
                {
                    AddHtml(211, yStart + 20, 80, 20, String.Format("<Basefont Size=6 Color=#FFFF00><Center>Free</Center></Basefont>"), false, false);
                }
                else
                {
                    bool wildCard = false;
                    foreach (int num in ticket.WildCards)
                    {
                        if (m_Ticket.Scratch2 == num)
                        {
                            AddImage(220, yStart, num, 2);
                            wildCard = true;
                        }
                    }

                    if (!wildCard)
                    {
                        string value = String.Format("{0:##,###,###}", ticket.Scratch2);
                        AddHtml(211, yStart + 20, 80, 20, String.Format("<Basefont Size=6 Color=#FFFF00><Center>{0}</Center></Basefont>", value), false, false);
                        AddImage(220, yStart, 0x15AA, 1);
                    }
                }

                if (m_Ticket.Scratch3 == 0)
                {
                    AddButton(359, yStart, 0x15C3, 0x15C4, 3, GumpButtonType.Reply, 0);
                }
                else if (m_Ticket.Scratch3 == 2)
                {
                    AddHtml(351, yStart + 20, 80, 20, String.Format("<Basefont Size=6 Color=#FFFF00><Center>Free</Center></Basefont>"), false, false);
                }
                else
                {
                    bool wildCard = false;
                    foreach (int num in ticket.WildCards)
                    {
                        if (m_Ticket.Scratch3 == num)
                        {
                            AddImage(360, yStart, num, 2);
                            wildCard = true;
                        }
                    }

                    if (!wildCard)
                    {
                        string value = String.Format("{0:##,###,###}", ticket.Scratch3);
                        AddHtml(351, yStart + 20, 80, 20, String.Format("<Basefont Size=6 Color=#FFFF00><Center>{0}</Center></Basefont>", value), false, false);
                        AddImage(360, yStart, 0x15AA, 1);
                    }
                }
            }
            else
            {
                AddHtml(110, yStart, 80, 20, "<Basefont Size=6 Color=#FFFF00><Center>Void</Center></Basefont>", false, false);
                AddHtml(250, yStart, 80, 20, "<Basefont Size=6 Color=#FFFF00><Center>Void</Center></Basefont>", false, false);
                AddHtml(250, yStart, 80, 20, "<Basefont Size=6 Color=#FFFF00><Center>Void</Center></Basefont>", false, false);
            }
        }