Ejemplo n.º 1
0
        public DuelBeltGump(DuelBelt belt)
            : base(0, 0)
        {
            m_Belt = belt;

            AddPage(0);
            AddBackground(150, 60, 350, 358, 2600);
            AddHtml(230, 75, 200, 20, "Belt Color Selection Menu", false, false);
            AddHtml(235, 380, 300, 20, "Dye my belt this color!", false, false);
            AddButton(200, 380, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);		// dye belt

            for (int i = 0; i < m_BeltGumpHues.Length; ++i)
            {
                BeltGumpEntry entry = m_BeltGumpHues[i];
                //AddLabel(275, 115 + (i * 18), entry.m_hue, "*****");
                AddHtml(275, 115 + (i * 23), 150, 20, String.Format("<BASEFONT COLOR={0}>{1}</BASEFONT>", entry.m_htmlhue, entry.m_name), false, false);
                AddRadio(235, 115 + (i * 23), 210, 211, false, i + 10);
            }
        }
        public static void Payout()
        {
            LastPayout = DateTime.Now;

            for (int i = 0; i < 7; i++)
            {
                List<DuelData> list = m_DuelDataListArray[i];
                int money = m_PrizeMoneyArray[i];

                list.Sort();
                int moneyone = (int)(money * 250);
                int moneytwo = (int)(money * 187.5);
                int moneythree = (int)(money * 87.5);

                int count = list.Count;

                switch (count)
                {
                    case 0: break;
                    case 1:
                        Mobile first = (Mobile)((DuelData)list[0]).Part;
                        if (first != null && first.Backpack != null)
                        {
                            first.Backpack.DropItem(new BankCheck(moneyone));
                            DuelBelt belt = (DuelBelt)m_ItemArray[i];
                            string str = "";

                            switch (i)
                            {
                                case 0: str = "Normal Duel Champion"; break;
                                case 1: str = "Normal Mage Champion"; break;
                                case 2: str = "True Mage Champion"; break;
                                case 3: str = "Ultimate Mage Champion"; break;
                                case 4: str = "Normal Dex Champion"; break;
                                case 5: str = "True Dex Champion"; break;
                                case 6: str = "Ultimate Dex Champion"; break;
                            }
                            DateTime date = DateTime.Now - TimeSpan.FromDays(5.0);
                            string finalstr = String.Format(str + ": {0:MMMM}, {1}", date, date.Year);

                            if (belt != null)
                                belt.Delete();

                            belt = new DuelBelt();
                            belt.MobileLock = first;
                            belt.BeltName = finalstr;
                            first.Backpack.DropItem(belt);
                            m_ItemArray[i] = (Item)belt;
                        }
                        break;

                    case 2:
                        Mobile second = (Mobile)((DuelData)list[1]).Part;
                        if (second != null && second.Backpack != null)
                            second.Backpack.DropItem(new BankCheck(moneytwo));
                        goto case 1;

                    default:
                        Mobile third = (Mobile)((DuelData)list[2]).Part;
                        if (third != null && third.Backpack != null)
                            third.Backpack.DropItem(new BankCheck(moneythree));
                        goto case 2;
                }
                m_DuelDataListArray[i].Clear();
                m_DuelDataDictionaryArray[i].Clear();
                m_PrizeMoneyArray[i] = 0;
            }
        }