public RewardConfirmGump( Mobile from, RewardEntry entry )
            : base(0, 0)
        {
            m_From = from;
            m_Entry = entry;

            from.CloseGump( typeof( RewardConfirmGump ) );

            AddPage( 0 );

            AddBackground( 10, 10, 500, 300, 2600 );

            AddHtmlLocalized( 30, 55, 300, 35, 1006000, false, false ); // You have selected:

            if ( entry.NameString != null )
                AddHtml( 335, 55, 150, 35, entry.NameString, false, false );
            else
                AddHtmlLocalized( 335, 55, 150, 35, entry.Name, false, false );

            AddHtmlLocalized( 30, 95, 300, 35, 1006001, false, false ); // This will be assigned to this character:
            AddLabel( 335, 95, 0, from.Name );

            AddHtmlLocalized( 35, 160, 450, 90, 1006002, true, true ); // Are you sure you wish to select this reward for this character?  You will not be able to transfer this reward to another character on another shard.  Click 'ok' below to confirm your selection or 'cancel' to go back to the selection screen.

            AddButton( 60, 265, 4005, 4007, 1, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 95, 266, 150, 35, 1006044, false, false ); // Ok

            AddButton( 295, 265, 4017, 4019, 0, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 330, 266, 150, 35, 1006045, false, false ); // Cancel
        }
Esempio n. 2
0
    public static bool HasAccess(Mobile mob, RewardEntry entry)
    {
      if (Core.Expansion < entry.RequiredExpansion)
        return false;

      return HasAccess(mob, entry.List, out TimeSpan _);
    }
Esempio n. 3
0
        public RewardConfirmGump(Mobile from, RewardEntry entry)
            : base(0, 0)
        {
            m_From  = from;
            m_Entry = entry;

            from.CloseGump(typeof(RewardConfirmGump));


            AddPage(0);

            AddBackground(10, 10, 500, 300, 0x6DB);

            AddHtmlLocalized(30, 55, 300, 35, 1006000, 0x43FF, false, false); // You have selected:

            if (entry.NameString != null)
            {
                AddHtml(335, 55, 150, 35, string.Format("<BASEFONT COLOR=#ffff84>{0}</BASEFONT>", entry.NameString), false, false);
            }
            else
            {
                AddHtmlLocalized(335, 55, 150, 35, entry.Name, 0x7FF0, false, false);
            }

            AddHtmlLocalized(30, 95, 300, 35, 1006001, 0x43FF, false, false); // This will be assigned to this character:
            AddLabel(335, 95, 0x37, from.Name);

            AddHtmlLocalized(35, 160, 450, 90, 1006002, 0x0, true, true); // Are you sure you wish to select this reward for this character?  You will not be able to transfer this reward to another character on another shard.  Click 'ok' below to confirm your selection or 'cancel' to go back to the selection screen.

            AddButton(60, 265, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(95, 266, 150, 35, 1006044, 0x7FFF, false, false); // OK

            AddButton(295, 265, 0xFB1, 0xFB3, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(330, 266, 150, 35, 1006045, 0x7FFF, false, false); // Cancel
        }
Esempio n. 4
0
        private void RenderCategory(RewardCategory category, int index)
        {
            AddPage(2 + index);

            List <RewardEntry> entries = category.Entries;

            for (int i = 0; i < entries.Count; ++i)
            {
                RewardEntry entry = entries[i];

                if (!RewardSystem.HasAccess(m_From, entry))
                {
                    break;
                }

                AddButton(55 + ((i / 12) * 250), 80 + ((i % 12) * 25), 5540, 5541, GetButtonID(index, i), GumpButtonType.Reply, 0);

                if (entry.NameString != null)
                {
                    AddHtml(80 + ((i / 12) * 250), 80 + ((i % 12) * 25), 250, 20, entry.NameString, false, false);
                }
                else
                {
                    AddHtmlLocalized(80 + ((i / 12) * 250), 80 + ((i % 12) * 25), 250, 20, entry.Name, false, false);
                }
            }
        }
Esempio n. 5
0
        public RewardConfirmGump(Mobile from, RewardEntry entry)
            : base(0, 0)
        {
            m_From  = from;
            m_Entry = entry;

            from.CloseGump <RewardConfirmGump>();

            AddPage(0);

            AddBackground(10, 10, 500, 300, 2600);

            AddHtmlLocalized(30, 55, 300, 35, 1006000, false, false);              // You have selected:
            AddHtmlLocalized(30, 95, 300, 35, 1006001, false, false);              // This will be assigned to this character:
            AddHtmlLocalized(35, 160, 450, 90, 1006002, true, true);               // Are you sure you wish to select this reward for this character?  You will not be able to transfer this reward to another character on another shard.  Click 'ok' below to confirm your selection or 'cancel' to go back to the selection screen.

            AddLabel(335, 95, 0, from.Name);

            AddHtmlLocalized(95, 266, 150, 35, 1006044, false, false);               // Ok
            AddHtmlLocalized(330, 266, 150, 35, 1006045, false, false);              // Cancel

            AddButton(295, 265, 4017, 4019, 0, GumpButtonType.Reply, 0);
            AddButton(60, 265, 4005, 4007, 1, GumpButtonType.Reply, 0);

            if (entry.NameString != null)
            {
                AddHtml(335, 55, 150, 35, entry.NameString, false, false);
            }
            else
            {
                AddHtmlLocalized(335, 55, 150, 35, entry.Name, false, false);
            }
        }
Esempio n. 6
0
		public RewardList( TimeSpan interval, int index, RewardEntry[] entries )
		{
			m_Age = TimeSpan.FromDays( interval.TotalDays * index );
			m_Entries = entries;

			for ( int i = 0; i < entries.Length; ++i )
				entries[i].List = this;
		}
Esempio n. 7
0
        public static bool HasAccess(Mobile mob, RewardEntry entry)
        {
            if (Core.Expansion < entry.RequiredExpansion)
            {
                return(false);
            }

            return(HasAccess(mob, entry.List, out TimeSpan ts));
        }
Esempio n. 8
0
		public RewardList( TimeSpan interval, TimeSpan gametime, RewardEntry[] entries )
		{
			m_Age = interval;
			m_GameTime = gametime;
			m_Entries = entries;

			for ( int i = 0; i < entries.Length; ++i )
				entries[i].List = this;
		}
Esempio n. 9
0
        private void RenderCategory(RewardCategory category, int index)
        {
            //bool twopages = false;
            int num_pages = 1;

            AddPage(2 + index);

            ArrayList entries = category.Entries;

            for (int idx = 0; idx < entries.Count; ++idx)
            {
                //int i = twopages ? idx - 24 : idx;
                int i = num_pages > 1 ? idx - (24 * (num_pages - 1)) : idx;


                RewardEntry entry = (RewardEntry)entries[idx];

                if (!RewardSystem.HasAccess(m_From, entry))
                {
                    break;
                }

                AddButton(55 + ((i / 12) * 250), 80 + ((i % 12) * 25), 5540, 5541, GetButtonID(index, idx), GumpButtonType.Reply, 0);

                if (entry.NameString != null)
                {
                    AddHtml(80 + ((i / 12) * 250), 80 + ((i % 12) * 25), 250, 20, entry.NameString, false, false);
                }
                else
                {
                    AddHtmlLocalized(80 + ((i / 12) * 250), 80 + ((i % 12) * 25), 250, 20, entry.Name, false, false);
                }

                if (i == 23)
                {
                    AddButton(315, 415, 0xFA5, 0xFA7, 0, GumpButtonType.Page, 7 + index + (num_pages - 1) + (index > 1 ? 2 : 0));
                    AddHtmlLocalized(350, 415, 200, 20, 1011066, false, false);

                    AddPage(7 + index + (num_pages - 1) + (index > 1 ? 2 : 0));

                    AddButton(190, 415, 0xFAE, 0xFB0, 0, GumpButtonType.Page, num_pages == 1 ? index + 2 : 5 + index + num_pages);
                    AddHtmlLocalized(225, 415, 200, 20, 1011067, false, false);

                    //twopages = true;
                    num_pages++;
                }



                //if (num_pages > 1) //(idx == entries.Count - 1 && num_pages > 1) // twopages )
                //{
                //    AddButton(270, 415, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 2 + index);
                //    AddHtmlLocalized(305, 415, 200, 20, 1011067, false, false);
                //}
            }
        }
Esempio n. 10
0
		public static bool HasAccess( Mobile mob, RewardEntry entry )
		{
			if ( mob == null || mob.Expansion < entry.RequiredExpansion )
			{
				return false;
			}

			TimeSpan tsAge, tsGameTime;
			return HasAccess( mob, entry.List, out tsAge, out tsGameTime );
		}
Esempio n. 11
0
		public static bool HasAccess( Mobile mob, RewardEntry entry )
		{
			if ( Core.Expansion < entry.RequiredExpansion )
			{
				return false;
			}

			TimeSpan ts;
			return HasAccess( mob, entry.List, out ts );
		}
Esempio n. 12
0
        public static bool HasAccess(Mobile mob, RewardEntry entry)
        {
            if (mob == null || mob.Expansion < entry.RequiredExpansion)
            {
                return(false);
            }

            TimeSpan tsAge, tsGameTime;

            return(HasAccess(mob, entry.List, out tsAge, out tsGameTime));
        }
Esempio n. 13
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            int buttonID = info.ButtonID - 1;

            if (buttonID == 0)
            {
                RewardSystem.ComputeRewardInfo(m_From, out int cur, out int max);

                if (cur < max)
                {
                    m_From.SendGump(new RewardNoticeGump(m_From));
                }
            }
            else if (info.ButtonID == 1000)
            {
                m_From.SendGump(new RewardChoiceGump(m_From, m_CategoryIndex, m_Page + 1));
            }
            else if (info.ButtonID == 1001)
            {
                m_From.SendGump(new RewardChoiceGump(m_From, m_CategoryIndex, m_Page - 1));
            }
            else if (buttonID >= 19999)
            {
                m_From.SendGump(new RewardChoiceGump(m_From, buttonID - 19999, 0));
            }
            else
            {
                --buttonID;

                int type  = (buttonID % 20);
                int index = (buttonID / 20);

                RewardCategory[] categories = RewardSystem.Categories;

                if (type >= 0 && type < categories.Length)
                {
                    RewardCategory category = categories[type];

                    if (index >= 0 && index < category.Entries.Count)
                    {
                        RewardEntry entry = category.Entries[index];

                        if (!RewardSystem.HasAccess(m_From, entry))
                        {
                            return;
                        }

                        m_From.SendGump(new RewardConfirmGump(m_From, entry));
                    }
                }
            }
        }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (((sender.Mobile.Region is CustomRegion) && (((CustomRegion)sender.Mobile.Region).Controller.CannotTakeRewards)) || sender.Mobile.Region is GameRegion)
            {
                return;
            }

            int buttonID = info.ButtonID - 1;

            if (buttonID == 0)
            {
                int cur, max;

                RewardSystem.ComputeRewardInfo(m_From, out cur, out max);

                if (cur < max)
                {
                    m_From.SendGump(new RewardNoticeGump(m_From));
                }
            }
            else
            {
                --buttonID;

                int type  = (buttonID % 20);
                int index = (buttonID / 20);

                RewardCategory[] categories = RewardSystem.Categories;

                if (type >= 0 && type < categories.Length)
                {
                    RewardCategory category = categories[type];

                    if (index >= 0 && index < category.Entries.Count)
                    {
                        RewardEntry entry = category.Entries[index];

                        if (!RewardSystem.HasAccess(m_From, entry))
                        {
                            return;
                        }

                        m_From.SendGump(new RewardConfirmGump(m_From, entry));
                    }
                }
            }
        }
Esempio n. 15
0
        private void RenderCategory(RewardCategory category, int index, ref int page)
        {
            AddPage(page);

            List <RewardEntry> entries = category.Entries;

            #region Veteran Rewards
            int i = 0;

            for (int j = 0; j < entries.Count; ++j)
            {
                RewardEntry entry = entries[j];

                if (!RewardSystem.HasAccess(m_From, entry))
                {
                    continue;
                }

                if (i == 24)
                {
                    AddButton(305, 415, 0xFA5, 0xFA7, 0, GumpButtonType.Page, ++page);
                    AddHtmlLocalized(340, 415, 200, 20, 1011066, false, false);                       // Next page

                    AddPage(page);

                    AddButton(270, 415, 0xFAE, 0xFB0, 0, GumpButtonType.Page, page - 1);
                    AddHtmlLocalized(185, 415, 200, 20, 1011067, false, false);                       // Previous page

                    i = 0;
                }

                AddButton(55 + ((i / 12) * 250), 80 + ((i % 12) * 25), 5540, 5541, GetButtonID(index, j), GumpButtonType.Reply, 0);

                if (entry.NameString != null)
                {
                    AddHtml(80 + ((i / 12) * 250), 80 + ((i % 12) * 25), 250, 20, entry.NameString, false, false);
                }
                else
                {
                    AddHtmlLocalized(80 + ((i / 12) * 250), 80 + ((i % 12) * 25), 250, 20, entry.Name, false, false);
                }
                ++i;
            }

            page += 1;
            #endregion
        }
Esempio n. 16
0
        private void RenderCategory(RewardCategory category)
        {
            List <RewardEntry> entries = category.Entries;

            Dictionary <int, RewardEntry> l = new Dictionary <int, RewardEntry>();

            for (int j = 0; j < entries.Count; ++j)
            {
                RewardEntry entry = entries[j];

                if (!RewardSystem.HasAccess(m_From, entry))
                {
                    continue;
                }

                l[j] = entry;
            }

            int rewardcount = l.Count;

            if ((m_Page + 1) * 60 < rewardcount)
            {
                AddButton(554, 10, 0x15E1, 0x15E5, 1000, GumpButtonType.Reply, 0); // Next Page Button
            }
            if (m_Page > 0)
            {
                AddButton(554, 10, 0x15E3, 0x15E7, 1001, GumpButtonType.Reply, 0); // Previous Page Button
            }
            for (int i = 0, index = m_Page * 60; i < 60 && index < rewardcount; ++i, ++index)
            {
                var         item  = l.ElementAt(index);
                RewardEntry entry = item.Value;

                if (entry.NameString != null)
                {
                    AddHtml(50 + ((i / 20) * 250), 200 + ((i % 20) * 18), 200, 18, entry.NameString, false, false);
                }
                else
                {
                    AddHtmlLocalized(50 + ((i / 20) * 250), 200 + ((i % 20) * 18), 200, 18, entry.Name, 0x7FFF, false, false);
                }

                AddButton(30 + ((i / 20) * 250), 200 + ((i % 20) * 18), 0x845, 0x846, GetButtonID(m_CategoryIndex, item.Key), GumpButtonType.Reply, 0);
            }
        }
Esempio n. 17
0
        public override void OnResponse(GameClient sender, RelayInfo info)
        {
            int buttonID = info.ButtonID - 1;

            if (buttonID == 0)
            {
                int cur, max;

                RewardSystem.ComputeRewardInfo(m_From, out cur, out max);

                if (cur < max)
                {
                    m_From.SendGump(new RewardNoticeGump(m_From));
                }
            }
            else
            {
                --buttonID;

                int type  = (buttonID % 20);
                int index = (buttonID / 20);

                RewardCategory[] categories = RewardSystem.Categories;

                if (type >= 0 && type < categories.Length)
                {
                    RewardCategory category = categories[type];

                    if (index >= 0 && index < category.Entries.Count)
                    {
                        RewardEntry entry = (RewardEntry)category.Entries[index];

                        if (!RewardSystem.HasAccess(m_From, entry))
                        {
                            return;
                        }

                        m_From.SendGump(new RewardConfirmGump(m_From, entry));
                    }
                }
            }
        }
Esempio n. 18
0
 public static bool HasAccess( Mobile mob, RewardEntry entry )
 {
     TimeSpan ts;
     return HasAccess( mob, entry.List, out ts );
 }
Esempio n. 19
0
 public static bool HasAccess(Mobile mob, RewardEntry entry) =>
 Core.Expansion >= entry.RequiredExpansion && HasAccess(mob, entry.List, out var _);
Esempio n. 20
0
        public static bool HasAccess(Mobile mob, RewardEntry entry)
        {
            TimeSpan ts;

            return(HasAccess(mob, entry.List, out ts));
        }
Esempio n. 21
0
		public RewardList( int index, RewardEntry[] entries ) : this( TimeSpan.FromTicks( RewardSystem.RewardInterval.Ticks * index ), TimeSpan.FromTicks( RewardSystem.RewardGameTimeInterval.Ticks * index ), entries )
		{
		}
		public static bool HasAccess( Mobile mob, RewardEntry entry )
		{
			TimeSpan tsAge, tsGameTime;
			return HasAccess( mob, entry.List, out tsAge, out tsGameTime );
		}