Ejemplo n.º 1
0
        public static void SetupRewardTables()
        {
            RewardCategory betaTest = new RewardCategory("Beta Tester Rewards", "BetaTester");
            // Misc rewards should be modified to whatever additional rewards program we want to add.
            RewardCategory miscReward = new RewardCategory("Miscellaneous Rewards", "Miscellaneous");

            m_Categories = new RewardCategory[]
            {
                betaTest,
                miscReward
            };

            m_Lists = new RewardList[]
            {
                new RewardList(1, new RewardEntry[]
                {
                    new RewardEntry(betaTest, "Decorative Statue (East)", typeof(DecorativeStatue1E)),
                    new RewardEntry(betaTest, "Decorative Statue (South)", typeof(DecorativeStatue1S)),
                    new RewardEntry(betaTest, "Decorative Statue (East)", typeof(DecorativeStatue2E)),
                    new RewardEntry(betaTest, "Decorative Statue (South)", typeof(DecorativeStatue2S))
                }),
                new RewardList(2, new RewardEntry[]
                {
                    // These are only for testing, whenever new rewards are added, these will be modified.
                    new RewardEntry(miscReward, "Item #1", typeof(Blocker)),
                    new RewardEntry(miscReward, "Item #2", typeof(Blocker)),
                    new RewardEntry(miscReward, "Item #3", typeof(Blocker)),
                    new RewardEntry(miscReward, "Item #4", typeof(Blocker))
                }),
            };
        }
Ejemplo n.º 2
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            int buttonID = info.ButtonID - 1;

            if (buttonID == 0)
            {
                m_From.CloseGump(typeof(RewardChoiceGump));
            }
            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));
                    }
                }
            }
        }
Ejemplo n.º 3
0
		public RewardEntry( RewardCategory category, string name, Type itemType, params object[] args )
		{
			m_Category = category;
			m_ItemType = itemType;
			m_NameString = name;
			m_Args = args;
			category.Entries.Add( this );
		}
Ejemplo n.º 4
0
 public RewardEntry(RewardCategory category, string name, Type itemType, params object[] args)
 {
     m_Category   = category;
     m_ItemType   = itemType;
     m_NameString = name;
     m_Args       = args;
     category.Entries.Add(this);
 }
Ejemplo n.º 5
0
		private void RenderCategory( RewardCategory category, int index )
		{
			AddPage( 1 );

			ArrayList entries = category.Entries;

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

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

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

				DrawItem( entry, 250 + ((i/4) * 250), 50 + ((i % 4) * 50) );
			}
		}
Ejemplo n.º 6
0
        public static bool HasAccess(Mobile mob, RewardCategory list)
        {
            if (list == null)
            {
                return(false);
            }

            Account acct = mob.Account as Account;

            if (acct == null)
            {
                return(false);
            }

            if (list.XmlString != null && list.XmlString == m_RewardType)
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 7
0
        private void RenderCategory(RewardCategory category, int index)
        {
            AddPage(1);

            ArrayList entries = category.Entries;

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

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

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

                DrawItem(entry, 250 + ((i / 4) * 250), 50 + ((i % 4) * 50));
            }
        }
Ejemplo n.º 8
0
		public static void SetupRewardTables()
		{
			RewardCategory betaTest = new RewardCategory( "Beta Tester Rewards", "BetaTester" );
			// Misc rewards should be modified to whatever additional rewards program we want to add.
			RewardCategory miscReward = new RewardCategory( "Miscellaneous Rewards", "Miscellaneous" );

			m_Categories = new RewardCategory[]
				{
					betaTest,
					miscReward
				};

			m_Lists = new RewardList[]
			{
				new RewardList( 1, new RewardEntry[]
				{
					new RewardEntry( betaTest, "Decorative Statue (East)", typeof( DecorativeStatue1E ) ),
					new RewardEntry( betaTest, "Decorative Statue (South)", typeof( DecorativeStatue1S ) ),
					new RewardEntry( betaTest, "Decorative Statue (East)", typeof( DecorativeStatue2E ) ),
					new RewardEntry( betaTest, "Decorative Statue (South)", typeof( DecorativeStatue2S ) )
				} ),
				new RewardList( 2, new RewardEntry[]
				{
					// These are only for testing, whenever new rewards are added, these will be modified.
					new RewardEntry( miscReward, "Item #1", typeof( Blocker ) ),
					new RewardEntry( miscReward, "Item #2", typeof( Blocker ) ),
					new RewardEntry( miscReward, "Item #3", typeof( Blocker ) ),
					new RewardEntry( miscReward, "Item #4", typeof( Blocker ) )
				} ),
			};
		}
Ejemplo n.º 9
0
		public static bool HasAccess( Mobile mob, RewardCategory list )
		{
			if ( list == null )
				return false;

			Account acct = mob.Account as Account;

			if ( acct == null )
				return false;
			
			if ( list.XmlString != null && list.XmlString == m_RewardType )
				return true;
			
			return false;
		}