public CollectionTransferPetGump( CollectionController collection, BaseCreature pet )
            : base(50, 50)
        {
            m_Collection = collection;
            m_Pet = pet;

            AddBackground( 0, 0, 270, 120, 0x13BE );
            AddHtmlLocalized( 10, 10, 250, 75, 1073105, true, false ); // <div align=center>Are you sure you wish to transfer this pet away, with no possibility of recovery?</div>
            AddHtmlLocalized( 55, 90, 75, 20, 1011011, false, false ); // CONTINUE
            AddButton( 20, 90, 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 170, 90, 75, 20, 1011012, false, false ); // CANCEL
            AddButton( 135, 90, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 );

            m_ExpireTimer = Timer.DelayCall( TimeSpan.FromSeconds( 30.0 ), new TimerStateCallback( Expire_Callback ), pet.ControlMaster );
        }
Exemplo n.º 2
0
        public CollectionTransferPetGump(CollectionController collection, BaseCreature pet)
            : base(50, 50)
        {
            m_Collection = collection;
            m_Pet        = pet;

            AddBackground(0, 0, 270, 120, 0x13BE);
            AddHtmlLocalized(10, 10, 250, 75, 1073105, true, false);               // <div align=center>Are you sure you wish to transfer this pet away, with no possibility of recovery?</div>
            AddHtmlLocalized(55, 90, 75, 20, 1011011, false, false);               // CONTINUE
            AddButton(20, 90, 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0);
            AddHtmlLocalized(170, 90, 75, 20, 1011012, false, false);              // CANCEL
            AddButton(135, 90, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);

            m_ExpireTimer = Timer.DelayCall(TimeSpan.FromSeconds(30.0), new TimerStateCallback(Expire_Callback), pet.ControlMaster);
        }
Exemplo n.º 3
0
        public CollectionConfirmReward(CollectionController collection, IRewardEntry entry, Mobile from, int hue)
            : base(120, 50)
        {
            m_Collection = collection;
            m_Entry      = entry;
            m_Hue        = hue;
            m_From       = from;

            AddPage(0);

            Closable = false;
            AddImageTiled(0, 0, 348, 262, 0xA8E);
            AddAlphaRegion(0, 0, 348, 262);
            AddImage(0, 15, 0x27A8);
            AddImageTiled(0, 30, 17, 200, 0x27A7);
            AddImage(0, 230, 0x27AA);
            AddImage(15, 0, 0x280C);
            AddImageTiled(30, 0, 300, 17, 0x280A);
            AddImage(315, 0, 0x280E);
            AddImage(15, 244, 0x280C);
            AddImageTiled(30, 244, 300, 17, 0x280A);
            AddImage(315, 244, 0x280E);
            AddImage(330, 15, 0x27A8);
            AddImageTiled(330, 30, 17, 200, 0x27A7);
            AddImage(330, 230, 0x27AA);
            AddImage(333, 2, 0x2716);
            AddImage(333, 248, 0x2716);
            AddImage(2, 248, 0x2716);
            AddImage(2, 2, 0x2716);
            AddItem(130, 120, entry.Tile, hue);

            if (entry.Cliloc != -1)
            {
                AddTooltip(entry.Cliloc);
            }

            AddHtmlLocalized(25, 22, 200, 20, 1074974, 0x7D00, false, false);               // Confirm Selection
            AddImage(25, 40, 0xBBF);
            AddHtmlLocalized(25, 55, 300, 120, 1074975, 0xFFFFFF, false, false);            // Are you sure you wish to select this?
            AddRadio(25, 175, 0x25F8, 0x25FB, true, 1);
            AddRadio(25, 210, 0x25F8, 0x25FB, false, 0);
            AddHtmlLocalized(60, 180, 280, 20, 1074976, 0xFFFFFF, false, false);               // Yes
            AddHtmlLocalized(60, 215, 280, 20, 1074977, 0xFFFFFF, false, false);               // No
            AddButton(265, 220, 0xF7, 0xF8, 7, GumpButtonType.Reply, 0);
        }
Exemplo n.º 4
0
        public CollectionConfirmReward( CollectionController collection, IRewardEntry entry, Mobile from, int hue )
            : base(120, 50)
        {
            m_Collection = collection;
            m_Entry = entry;
            m_Hue = hue;
            m_From = from;

            AddPage( 0 );

            Closable = false;
            AddImageTiled( 0, 0, 348, 262, 0xA8E );
            AddAlphaRegion( 0, 0, 348, 262 );
            AddImage( 0, 15, 0x27A8 );
            AddImageTiled( 0, 30, 17, 200, 0x27A7 );
            AddImage( 0, 230, 0x27AA );
            AddImage( 15, 0, 0x280C );
            AddImageTiled( 30, 0, 300, 17, 0x280A );
            AddImage( 315, 0, 0x280E );
            AddImage( 15, 244, 0x280C );
            AddImageTiled( 30, 244, 300, 17, 0x280A );
            AddImage( 315, 244, 0x280E );
            AddImage( 330, 15, 0x27A8 );
            AddImageTiled( 330, 30, 17, 200, 0x27A7 );
            AddImage( 330, 230, 0x27AA );
            AddImage( 333, 2, 0x2716 );
            AddImage( 333, 248, 0x2716 );
            AddImage( 2, 248, 0x2716 );
            AddImage( 2, 2, 0x2716 );
            AddItem( 130, 120, entry.Tile, hue );

            if ( entry.Cliloc != -1 )
                AddTooltip( entry.Cliloc );

            AddHtmlLocalized( 25, 22, 200, 20, 1074974, 0x7D00, false, false ); // Confirm Selection
            AddImage( 25, 40, 0xBBF );
            AddHtmlLocalized( 25, 55, 300, 120, 1074975, 0xFFFFFF, false, false ); // Are you sure you wish to select this?
            AddRadio( 25, 175, 0x25F8, 0x25FB, true, 1 );
            AddRadio( 25, 210, 0x25F8, 0x25FB, false, 0 );
            AddHtmlLocalized( 60, 180, 280, 20, 1074976, 0xFFFFFF, false, false ); // Yes
            AddHtmlLocalized( 60, 215, 280, 20, 1074977, 0xFFFFFF, false, false ); // No
            AddButton( 265, 220, 0xF7, 0xF8, 7, GumpButtonType.Reply, 0 );
        }
Exemplo n.º 5
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                DonationEntry entry = m_Collection.Donations[m_EntryIndex];

                if (!(targeted is Item) || !((Item)targeted).IsChildOf(from.Backpack) || targeted.GetType() != entry.Type)
                {
                    from.SendLocalizedMessage(1073390);                       // The item you selected to donate is not of the type you picked.
                }
                else if (targeted is TreasureMap && !CollectionController.CheckTreasureMap((TreasureMap)targeted, entry.Award))
                {
                    from.SendLocalizedMessage(1073390);                       // The item you selected to donate is not of the type you picked.
                }
                else
                {
                    ((Item)targeted).Delete();

                    m_Collection.Award(from, (int)entry.Award);
                }

                from.SendGump(new CollectionDonateGump(m_Collection, from));
            }
Exemplo n.º 6
0
 public AmountPrompt(CollectionController collection, int entryindex)
     : base(collection)
 {
     m_Collection = collection;
     m_EntryIndex = entryindex;
 }
Exemplo n.º 7
0
        public CollectionDonateGump(CollectionController collection, Mobile from)
            : base(250, 50)
        {
            if (from.Backpack == null)
            {
                return;
            }

            m_Collection = collection;
            m_From       = from;

            // Chequeamos la tabla de la colección
            if (!m_Collection.Table.Contains(from))
            {
                m_Collection.Table.Add(from, (Misc.TestCenter.Enabled ? 5000000 : 0));
            }

            GetMax(m_Collection.Donations);

            BuildHeader();

            AddPage(1);
            StartPage();

            int page = 1;

            int offset = 150;
            int next   = 0;

            for (int i = 0; i < m_Collection.Donations.Length; i++)
            {
                DonationEntry entry = m_Collection.Donations[i] as DonationEntry;

                int height = Math.Max(entry.Height, 20);

                if (offset + next >= 310)
                {
                    EndPage(page, false);

                    page++;
                    AddPage(page);
                    StartPage();

                    offset = 150;
                    next   = 0;
                }

                // ******* Build Entry *******
                int amount = 0;

                if (entry.Type == typeof(TreasureMap))
                {
                    List <TreasureMap> maps = from.Backpack.FindItemsByType <TreasureMap>();

                    for (int j = 0; j < maps.Count; j++)
                    {
                        if (CollectionController.CheckTreasureMap(maps[j], entry.Award))
                        {
                            amount++;
                        }
                    }
                }
                else
                {
                    amount = GetTotalAmountByType(from, entry.Type);
                }

                if (amount > 0)
                {
                    int yOffset = offset + (int)(height / 2) - 5;

                    AddButton(35, yOffset, 0x837, 0x838, i + 300, GumpButtonType.Reply, 0);
                    AddHtml(245, yOffset - 4, 60, 20, String.Format("<BODY><BASEFONT COLOR=\"#448844\"><DIV ALIGN=\"RIGHT\">{0}</DIV></BASEFONT></BODY>", amount), false, false);
                }

                int y = offset - entry.Y;

                if (entry.Height < 20)
                {
                    y += (20 - entry.Height) / 2;
                }

                string award;
                if (entry.Type == typeof(BankCheck))
                {
                    award = "1";
                }
                else if (entry.Award > 0 && entry.Award < 1)
                {
                    award = String.Format("1 per {0}", (int)(1 / entry.Award));
                }
                else
                {
                    award = entry.Award.ToString();
                }

                if (entry.Name != null)
                {
                    AddItem(55 - entry.X + m_Max / 2 - entry.Width / 2, y, entry.Tile, entry.Hue);
                    AddLabel(65 + m_Max, offset + (int)(height / 2) - 18, 0x63, entry.Name.ToString());
                    AddLabel(65 + m_Max, offset + (int)(height / 2) - 2, 0x64, award);
                }
                else
                {
                    AddItem(55 - entry.X + m_Max / 2 - entry.Width / 2, y, entry.Tile, entry.Hue);
                    AddTooltip(entry.Cliloc);
                    AddLabel(65 + m_Max, offset + (int)(height / 2) - 10, 0x64, award);
                    AddTooltip(entry.Cliloc);
                }
                // ***** End Build Entry *****

                offset += 10 + height;

                if (i < m_Collection.Donations.Length)
                {
                    next = Math.Max(m_Collection.Donations[i].Height, 20);
                }
                else
                {
                    next = 0;
                }
            }

            EndPage(page, true);
        }
Exemplo n.º 8
0
 public DonationTarget(CollectionController collection, int entryindex)
     : base(-1, false, TargetFlags.None)
 {
     m_Collection = collection;
     m_EntryIndex = entryindex;
 }
Exemplo n.º 9
0
        public CollectionRewardGump(CollectionController collection, Mobile from)
            : base(250, 50)
        {
            m_Collection = collection;
            m_From       = from;

            m_Points = (int)m_Collection.Table[from];

            GetMax(m_Collection.Rewards);

            PlayerMobile pm = (PlayerMobile)from;

            BuildHeader();

            int page = 1;

            int offset = 110;
            int next   = 0;

            AddPage(page);
            StartPage();

            for (int i = 0; i < m_Collection.Rewards.Length; i++)
            {
                RewardEntry entry = m_Collection.Rewards[i] as RewardEntry;

                if (!entry.IsEligibleBy(from))
                {
                    continue;
                }

                int min = entry.Name != null ? 30 : 20;

                if (i < m_Collection.Rewards.Length)
                {
                    next = Math.Max(m_Collection.Rewards[i].Height, min);
                }
                else
                {
                    next = 0;
                }

                int height = Math.Max(entry.Height, 20);

                if (offset + next >= 310)
                {
                    EndPage(page, false);

                    page++;
                    AddPage(page);
                    StartPage();

                    offset = 110;
                    next   = 0;
                }

                // ******* Build Entry *******
                int  price   = entry.GetPrice(from);
                bool enabled = m_Points >= price;

                if (enabled)
                {
                    AddButton(35, offset + (int)(height / 2) - 5, 0x837, 0x838, i + 100, GumpButtonType.Reply, 0);

                    if (entry.Cliloc != -1)
                    {
                        AddTooltip(entry.Cliloc);
                    }
                }

                int y = offset - entry.Y;

                if (entry.Height < min)
                {
                    y += (min - entry.Height) / 2;
                }

                if (entry.Name != null)
                {
                    AddItem(55 - entry.X + m_Max / 2 - entry.Width / 2, y, entry.Tile, enabled ? entry.Hue : 995);
                    AddLabel(65 + m_Max, offset + (int)(height / 2) - 18, (enabled ? 0x64 : 0x21) - 1, entry.Name.ToString());
                    AddLabel(65 + m_Max, offset + (int)(height / 2) - 2, (enabled ? 0x64 : 0x21), price.ToString());
                }
                else
                {
                    AddItem(55 - entry.X + m_Max / 2 - entry.Width / 2, y, entry.Tile, enabled ? entry.Hue : 995);
                    AddTooltip(entry.Cliloc);
                    AddLabel(65 + m_Max, offset + (int)(height / 2) - 10, enabled ? 0x64 : 0x21, price.ToString());
                    AddTooltip(entry.Cliloc);
                }

                // ***** End Build Entry *****

                offset += 5 + height;

                if (entry.Name != null)
                {
                    offset += 5;
                }
            }

            EndPage(page, true);
        }
Exemplo n.º 10
0
 public AmountPrompt( CollectionController collection, int entryindex )
     : base(collection)
 {
     m_Collection = collection;
     m_EntryIndex = entryindex;
 }
Exemplo n.º 11
0
 public DonationTarget( CollectionController collection, int entryindex )
     : base(-1, false, TargetFlags.None)
 {
     m_Collection = collection;
     m_EntryIndex = entryindex;
 }
Exemplo n.º 12
0
        public CollectionDonateGump( CollectionController collection, Mobile from )
            : base(250, 50)
        {
            if ( from.Backpack == null )
                return;

            m_Collection = collection;
            m_From = from;

            // Chequeamos la tabla de la colección
            if ( !m_Collection.Table.Contains( from ) )
                m_Collection.Table.Add( from, ( Misc.TestCenter.Enabled ? 5000000 : 0 ) );

            GetMax( m_Collection.Donations );

            BuildHeader();

            AddPage( 1 );
            StartPage();

            int page = 1;

            int offset = 150;
            int next = 0;

            for ( int i = 0; i < m_Collection.Donations.Length; i++ )
            {
                DonationEntry entry = m_Collection.Donations[i] as DonationEntry;

                int height = Math.Max( entry.Height, 20 );

                if ( offset + next >= 310 )
                {
                    EndPage( page, false );

                    page++;
                    AddPage( page );
                    StartPage();

                    offset = 150;
                    next = 0;
                }

                // ******* Build Entry *******
                int amount = 0;

                if ( entry.Type == typeof( TreasureMap ) )
                {
                    List<TreasureMap> maps = from.Backpack.FindItemsByType<TreasureMap>();

                    for ( int j = 0; j < maps.Count; j++ )
                        if ( CollectionController.CheckTreasureMap( maps[j], entry.Award ) )
                            amount++;
                }
                else
                {
                    amount = GetTotalAmountByType( from, entry.Type );
                }

                if ( amount > 0 )
                {
                    int yOffset = offset + (int) ( height / 2 ) - 5;

                    AddButton( 35, yOffset, 0x837, 0x838, i + 300, GumpButtonType.Reply, 0 );
                    AddHtml( 245, yOffset - 4, 60, 20, String.Format( "<BODY><BASEFONT COLOR=\"#448844\"><DIV ALIGN=\"RIGHT\">{0}</DIV></BASEFONT></BODY>", amount ), false, false );
                }

                int y = offset - entry.Y;

                if ( entry.Height < 20 )
                    y += ( 20 - entry.Height ) / 2;

                string award;
                if ( entry.Type == typeof( BankCheck ) )
                    award = "1";
                else if ( entry.Award > 0 && entry.Award < 1 )
                    award = String.Format( "1 per {0}", (int) ( 1 / entry.Award ) );
                else
                    award = entry.Award.ToString();

                if ( entry.Name != null )
                {
                    AddItem( 55 - entry.X + m_Max / 2 - entry.Width / 2, y, entry.Tile, entry.Hue );
                    AddLabel( 65 + m_Max, offset + (int) ( height / 2 ) - 18, 0x63, entry.Name.ToString() );
                    AddLabel( 65 + m_Max, offset + (int) ( height / 2 ) - 2, 0x64, award );
                }
                else
                {
                    AddItem( 55 - entry.X + m_Max / 2 - entry.Width / 2, y, entry.Tile, entry.Hue );
                    AddTooltip( entry.Cliloc );
                    AddLabel( 65 + m_Max, offset + (int) ( height / 2 ) - 10, 0x64, award );
                    AddTooltip( entry.Cliloc );
                }
                // ***** End Build Entry *****

                offset += 10 + height;

                if ( i < m_Collection.Donations.Length )
                    next = Math.Max( m_Collection.Donations[i].Height, 20 );
                else
                    next = 0;
            }

            EndPage( page, true );
        }
Exemplo n.º 13
0
        public CollectionSelectHueGump(CollectionController collection, IRewardEntry entry, Mobile from)
            : base(250, 50)
        {
            m_Collection = collection;
            m_Entry      = entry;
            m_From       = from;

            m_Points = (int)m_Collection.Table[from];

            // Cabecera
            AddPage(0);

            AddImage(0, 0, 0x1F40);
            AddImageTiled(20, 37, 300, 308, 0x1F42);
            AddImage(20, 325, 0x1F43);
            AddImage(35, 8, 0x39);
            AddImageTiled(65, 8, 257, 10, 0x3A);
            AddImage(290, 8, 0x3B);
            AddImage(32, 33, 0x2635);
            AddImageTiled(70, 55, 230, 2, 0x23C5);
            AddHtmlLocalized(70, 35, 270, 20, 1072835, 0x1, false, false);               // Community Collection

            AddButton(50, 335, 0x15E3, 0x15E7, -1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(75, 335, 100, 20, 1072842, 0x1, false, false);               // Rewards
            // Fin Cabecera

            int  page      = 1;
            bool shouldadd = true;
            int  y         = 130;

            if (m_Entry.Type.IsSubclassOf(typeof(Item)))
            {
                Item i = Activator.CreateInstance(m_Entry.Type) as Item;
                m_ItemID = i.ItemID;
                i.Delete();
            }

            for (int i = 0; i < m_Entry.Hues.Length; i++)
            {
                if (shouldadd)
                {
                    AddPage(page);
                    StartPage();
                    shouldadd = false;
                }

                int hue = entry.Hues[i];

                AddButton(35, y, 0x837, 0x838, i + 1, GumpButtonType.Reply, 0);

                AddItem(55, y - 5, m_ItemID, hue);
                AddTooltip(entry.Cliloc);

                if (i == m_Entry.Hues.Length - 1)
                {
                    EndPage(page, true);
                }
                else if (y >= 290)
                {
                    y         = 130;
                    shouldadd = true;
                    EndPage(page, false);
                    page++;
                }
                else
                {
                    y += 40;
                }
            }
        }
Exemplo n.º 14
0
        public CollectionSelectHueGump( CollectionController collection, IRewardEntry entry, Mobile from )
            : base(250, 50)
        {
            m_Collection = collection;
            m_Entry = entry;
            m_From = from;

            m_Points = (int) m_Collection.Table[from];

            // Cabecera
            AddPage( 0 );

            AddImage( 0, 0, 0x1F40 );
            AddImageTiled( 20, 37, 300, 308, 0x1F42 );
            AddImage( 20, 325, 0x1F43 );
            AddImage( 35, 8, 0x39 );
            AddImageTiled( 65, 8, 257, 10, 0x3A );
            AddImage( 290, 8, 0x3B );
            AddImage( 32, 33, 0x2635 );
            AddImageTiled( 70, 55, 230, 2, 0x23C5 );
            AddHtmlLocalized( 70, 35, 270, 20, 1072835, 0x1, false, false ); // Community Collection

            AddButton( 50, 335, 0x15E3, 0x15E7, -1, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 75, 335, 100, 20, 1072842, 0x1, false, false ); // Rewards
            // Fin Cabecera

            int page = 1;
            bool shouldadd = true;
            int y = 130;

            if ( m_Entry.Type.IsSubclassOf( typeof( Item ) ) )
            {
                Item i = Activator.CreateInstance( m_Entry.Type ) as Item;
                m_ItemID = i.ItemID;
                i.Delete();
            }

            for ( int i = 0; i < m_Entry.Hues.Length; i++ )
            {
                if ( shouldadd )
                {
                    AddPage( page );
                    StartPage();
                    shouldadd = false;
                }

                int hue = entry.Hues[i];

                AddButton( 35, y, 0x837, 0x838, i + 1, GumpButtonType.Reply, 0 );

                AddItem( 55, y - 5, m_ItemID, hue );
                AddTooltip( entry.Cliloc );

                if ( i == m_Entry.Hues.Length - 1 )
                {
                    EndPage( page, true );
                }
                else if ( y >= 290 )
                {
                    y = 130;
                    shouldadd = true;
                    EndPage( page, false );
                    page++;
                }
                else
                {
                    y += 40;
                }
            }
        }
Exemplo n.º 15
0
        public CollectionRewardGump( CollectionController collection, Mobile from )
            : base(250, 50)
        {
            m_Collection = collection;
            m_From = from;

            m_Points = (int) m_Collection.Table[from];

            GetMax( m_Collection.Rewards );

            PlayerMobile pm = (PlayerMobile) from;

            BuildHeader();

            int page = 1;

            int offset = 110;
            int next = 0;

            AddPage( page );
            StartPage();

            for ( int i = 0; i < m_Collection.Rewards.Length; i++ )
            {
                RewardEntry entry = m_Collection.Rewards[i] as RewardEntry;

                if ( !entry.IsEligibleBy( from ) )
                    continue;

                int min = entry.Name != null ? 30 : 20;

                if ( i < m_Collection.Rewards.Length )
                    next = Math.Max( m_Collection.Rewards[i].Height, min );
                else
                    next = 0;

                int height = Math.Max( entry.Height, 20 );

                if ( offset + next >= 310 )
                {
                    EndPage( page, false );

                    page++;
                    AddPage( page );
                    StartPage();

                    offset = 110;
                    next = 0;
                }

                // ******* Build Entry *******
                int price = entry.GetPrice( from );
                bool enabled = m_Points >= price;

                if ( enabled )
                {
                    AddButton( 35, offset + (int) ( height / 2 ) - 5, 0x837, 0x838, i + 100, GumpButtonType.Reply, 0 );

                    if ( entry.Cliloc != -1 )
                        AddTooltip( entry.Cliloc );
                }

                int y = offset - entry.Y;

                if ( entry.Height < min )
                    y += ( min - entry.Height ) / 2;

                if ( entry.Name != null )
                {
                    AddItem( 55 - entry.X + m_Max / 2 - entry.Width / 2, y, entry.Tile, enabled ? entry.Hue : 995 );
                    AddLabel( 65 + m_Max, offset + (int) ( height / 2 ) - 18, ( enabled ? 0x64 : 0x21 ) - 1, entry.Name.ToString() );
                    AddLabel( 65 + m_Max, offset + (int) ( height / 2 ) - 2, ( enabled ? 0x64 : 0x21 ), price.ToString() );
                }
                else
                {
                    AddItem( 55 - entry.X + m_Max / 2 - entry.Width / 2, y, entry.Tile, enabled ? entry.Hue : 995 );
                    AddTooltip( entry.Cliloc );
                    AddLabel( 65 + m_Max, offset + (int) ( height / 2 ) - 10, enabled ? 0x64 : 0x21, price.ToString() );
                    AddTooltip( entry.Cliloc );
                }

                // ***** End Build Entry *****

                offset += 5 + height;

                if ( entry.Name != null )
                    offset += 5;
            }

            EndPage( page, true );
        }