Esempio n. 1
1
 public override void OnDoubleClick(Mobile from)
 {
     if ((!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this)) && from.AccessLevel == AccessLevel.Player)
     {
         from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
         return;
     }
     m_TimeOut = DateTime.Now - m_LastBuild;
     if (m_UpdateTimer < m_TimeOut || itemarray == null)
         BuildArrayList(from);
     else if (turboslotsarray != null)
     {
         foreach (TurboSlot t in turboslotsarray)
         {
             if ((t == null || t.Deleted) )
             {
                 BuildArrayList(from);
                 break;
             }
         }
     }
     if (turboslotsarray != null)
     {
         from.CloseGump(typeof(TurboSlotsStatGump));
         from.SendGump(new TurboSlotsStatGump(from, turboslotsarray));
     }
 }
Esempio n. 2
0
        public HousePlacementCategoryGump(Mobile from)
            : base(50, 50)
        {
            this.m_From = from;

            from.CloseGump(typeof(HousePlacementCategoryGump));
            from.CloseGump(typeof(HousePlacementListGump));

            this.AddPage(0);

            this.AddBackground(0, 0, 270, 145, 5054);

            this.AddImageTiled(10, 10, 250, 125, 2624);
            this.AddAlphaRegion(10, 10, 250, 125);

            this.AddHtmlLocalized(10, 10, 250, 20, 1060239, LabelColor, false, false); // <CENTER>HOUSE PLACEMENT TOOL</CENTER>

            this.AddButton(10, 110, 4017, 4019, 0, GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(45, 110, 150, 20, 3000363, LabelColor, false, false); // Close

            this.AddButton(10, 40, 4005, 4007, 1, GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(45, 40, 200, 20, 1060390, LabelColor, false, false); // Classic Houses

            this.AddButton(10, 60, 4005, 4007, 2, GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(45, 60, 200, 20, 1060391, LabelColor, false, false); // 2-Story Customizable Houses

            this.AddButton(10, 80, 4005, 4007, 3, GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(45, 80, 200, 20, 1060392, LabelColor, false, false); // 3-Story Customizable Houses
        }
Esempio n. 3
0
        public RulesetGump(Mobile from, Ruleset ruleset, RulesetLayout page, DuelContext duelContext, bool readOnly)
            : base(readOnly ? 310 : 50, 50)
        {
            this.m_From = from;
            this.m_Ruleset = ruleset;
            this.m_Page = page;
            this.m_DuelContext = duelContext;
            this.m_ReadOnly = readOnly;

            this.Dragable = !readOnly;

            from.CloseGump(typeof(RulesetGump));
            from.CloseGump(typeof(DuelContextGump));
            from.CloseGump(typeof(ParticipantGump));

            RulesetLayout depthCounter = page;
            int depth = 0;

            while (depthCounter != null)
            {
                ++depth;
                depthCounter = depthCounter.Parent;
            }

            int count = page.Children.Length + page.Options.Length;

            this.AddPage(0);

            int height = 35 + 10 + 2 + (count * 22) + 2 + 30;

            this.AddBackground(0, 0, 260, height, 9250);
            this.AddBackground(10, 10, 240, height - 20, 0xDAC);

            this.AddHtml(35, 25, 190, 20, this.Center(page.Title), false, false);

            int x = 35;
            int y = 47;

            for (int i = 0; i < page.Children.Length; ++i)
            {
                this.AddGoldenButton(x, y, 1 + i);
                this.AddHtml(x + 25, y, 250, 22, page.Children[i].Title, false, false);

                y += 22;
            }

            for (int i = 0; i < page.Options.Length; ++i)
            {
                bool enabled = ruleset.Options[page.Offset + i];

                if (readOnly)
                    this.AddImage(x, y, enabled ? 0xD3 : 0xD2);
                else
                    this.AddCheck(x, y, 0xD2, 0xD3, enabled, i);

                this.AddHtml(x + 25, y, 250, 22, page.Options[i], false, false);

                y += 22;
            }
        }
Esempio n. 4
0
        public ImbuingGump(Mobile from)
            : base(520, 340)
        {
            Mobile m = from;
            PlayerMobile pm = from as PlayerMobile;

            from.CloseGump(typeof(ImbuingGumpB));
            from.CloseGump(typeof(ImbuingGumpC));

            ImbuingContext context = Imbuing.GetContext(pm);

            context.Imbue_ModVal = 0;
            context.ImbMenu_Cat = 0;

            AddPage(0);
            AddBackground(0, 0, 540, 340, 5054);

            AddImageTiled(10, 10, 520, 25, 2624);

            AddImageTiled(10, 35, 520, 10, 5124);
            AddAlphaRegion(10, 35, 520, 10);

            AddImageTiled(10, 45, 520, 245, 2624);

            AddImageTiled(10, 290, 520, 10, 5124);
            AddAlphaRegion(10, 290, 520, 10);

            AddImageTiled(10, 300, 520, 20, 2624);

            AddImageTiled(10, 320, 520, 10, 2624);
            AddAlphaRegion(10, 320, 520, 10);

            AddHtmlLocalized(10, 14, 520, 16, 1079588, LabelColor, false, false); //<CENTER>IMBUING MENU</CENTER>

            AddButton(25, 66, 4017, 4018, 10005, GumpButtonType.Reply, 0);
            AddHtmlLocalized(66, 68, 430, 18, 1080423, LabelColor, false, false); //IMBUE ITEM: Adds or modifies a magic item property on the targeted item.<BR>UNRAVEL ITEM: Extracts one or more magical ingredients from an item. The targeted item is DESTROYED in the process.<BR>REIMBUE LAST: Reimbues the last item with the last property/intensity<BR>REIMBUE ITEM: Auto targets the last imbued item

            AddButton(25, 95, 4017, 4018, 10006, GumpButtonType.Reply, 0);
            AddHtmlLocalized(66, 97, 430, 18, 1113622, LabelColor, false, false); //Reimbue Last - Repeats the last imbuing attempt

            AddButton(25, 124, 4017, 4018, 10007, GumpButtonType.Reply, 0);
            AddHtmlLocalized(66, 126, 430, 18, 1113571, LabelColor, false, false); //Imbue Last Item - Auto targets the last imbued item

            AddButton(25, 153, 4017, 4018, 10008, GumpButtonType.Reply, 0);
            AddHtmlLocalized(66, 155, 430, 18, 1114274, LabelColor, false, false); //Imbue Last Property - Imbues a new item with the last property

            AddButton(25, 184, 4017, 4018, 10010, GumpButtonType.Reply, 0);
            AddHtmlLocalized(66, 186, 430, 18, 1080431, LabelColor, false, false); //Unravel Item - Extracts magical ingredients from an item, destroying it

            AddButton(25, 213, 4017, 4018, 10011, GumpButtonType.Reply, 0);
            AddHtmlLocalized(66, 215, 430, 18, 1114275, LabelColor, false, false); //Unravel Container - Unravels all items in a container

            //AddButton(25, 242, 4017, 4018, 10012, GumpButtonType.Reply, 0);
            //AddHtml(66, 244, 430, 18, "<BASEFONT COLOR=#FFFFFF>Soul Reinforcement - Fortify a cursed artifact", false, false);

            AddButton(19, 300, 4017, 4018, 10002, GumpButtonType.Reply, 0);
            AddHtmlLocalized(58, 300, 50, 16, 1006045, FontColor, false, false); //CANCEL
        }
Esempio n. 5
0
        public CraftGumpItem( Mobile from, CraftSystem craftSystem, CraftItem craftItem, BaseTool tool )
            : base(40, 40)
        {
            m_From = from;
            m_CraftSystem = craftSystem;
            m_CraftItem = craftItem;
            m_Tool = tool;

            from.CloseGump( typeof( CraftGump ) );
            from.CloseGump( typeof( CraftGumpItem ) );

            AddPage( 0 );
            AddBackground( 0, 0, 530, 417, 5054 );
            AddImageTiled( 10, 10, 510, 22, 2624 );
            AddImageTiled( 10, 37, 150, 148, 2624 );
            AddImageTiled( 165, 37, 355, 90, 2624 );
            AddImageTiled( 10, 190, 155, 22, 2624 );
            AddImageTiled( 10, 217, 150, 53, 2624 );
            AddImageTiled( 165, 132, 355, 80, 2624 );
            AddImageTiled( 10, 275, 155, 22, 2624 );
            AddImageTiled( 10, 302, 150, 53, 2624 );
            AddImageTiled( 165, 217, 355, 80, 2624 );
            AddImageTiled( 10, 360, 155, 22, 2624 );
            AddImageTiled( 165, 302, 355, 80, 2624 );
            AddImageTiled( 10, 387, 510, 22, 2624 );
            AddAlphaRegion( 10, 10, 510, 399 );

            AddHtmlLocalized( 170, 40, 150, 20, 1044053, LabelColor, false, false ); // ITEM
            AddHtmlLocalized( 10, 192, 150, 22, 1044054, LabelColor, false, false ); // <CENTER>SKILLS</CENTER>
            AddHtmlLocalized( 10, 277, 150, 22, 1044055, LabelColor, false, false ); // <CENTER>MATERIALS</CENTER>
            AddHtmlLocalized( 10, 362, 150, 22, 1044056, LabelColor, false, false ); // <CENTER>OTHER</CENTER>

            if ( craftSystem.GumpTitleNumber > 0 )
                AddHtmlLocalized( 10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false );
            else
                AddHtml( 10, 12, 510, 20, craftSystem.GumpTitleString, false, false );

            AddButton( 15, 387, 4014, 4016, 0, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 50, 390, 150, 18, 1044150, LabelColor, false, false ); // BACK

            AddButton( 270, 387, 4005, 4007, 1, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 305, 390, 150, 18, 1044151, LabelColor, false, false ); // MAKE NOW

            if ( craftItem.NameNumber > 0 )
                AddHtmlLocalized( 330, 40, 180, 18, craftItem.NameNumber, LabelColor, false, false );
            else
                AddLabel( 330, 40, LabelHue, craftItem.NameString );

            if ( craftItem.UseAllRes )
                AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1048176, LabelColor, false, false ); // Makes as many as possible at once

            DrawItem();
            DrawSkill();
            DrawRessource();

            if( craftItem.RequiresSE )
                AddHtmlLocalized( 170, 302 + (m_OtherCount++ * 20), 310, 18, 1063363, LabelColor, false, false ); //* Requires the "Samurai Empire" expansion
        }
		public override void OnDoubleClick(Mobile from)
		{
			if (from != null && from is PlayerMobile)
			{
				from.CloseGump(typeof(DuelPlayerInfoGump));
				from.CloseGump(typeof(DuelScoreBoardGump));
				from.SendGump(new DuelScoreBoardGump());
			}
		}
Esempio n. 7
0
		public override void OnDoubleClick(Mobile m)
		{
			if (!m.InRange(GetWorldLocation(), 2) || ValorRewardController.Instance == null)
			{
				return;
			}
			m.CloseGump(typeof(ValorBoardGump));
			m.CloseGump(typeof(ValorBoardGumpBritish));
			m.CloseGump(typeof(ValorBoardGumpSide));
			m.SendGump(new ValorBoardGumpBritish());
			m.SendGump(new ValorBoardGump(ValorRewardController.Instance, 0, null, null, null, false));
			m.SendGump(new ValorBoardGumpSide(m, m, ValorRewardController.Instance));
		}
 public override void OnDoubleClick(Mobile from)
 {
     if (from.Backpack == null || !IsChildOf(from.Backpack))
     {
         from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
     }
     else
     {
         from.CloseGump(typeof(LayeredSpellbookTicketHueGump));
         from.CloseGump(typeof(LayeredSpellbookTicketNameGump));
         from.SendGump(new LayeredSpellbookTicketHueGump(from, this));
     }
 }
Esempio n. 9
0
        public ParticipantGump(Mobile from, DuelContext context, Participant p)
            : base(50, 50)
        {
            this.m_From = from;
            this.m_Context = context;
            this.m_Participant = p;

            from.CloseGump(typeof(RulesetGump));
            from.CloseGump(typeof(DuelContextGump));
            from.CloseGump(typeof(ParticipantGump));

            int count = p.Players.Length;

            if (count < 4)
                count = 4;

            this.AddPage(0);

            int height = 35 + 10 + 22 + 22 + 30 + 22 + 2 + (count * 22) + 2 + 30;

            this.AddBackground(0, 0, 300, height, 9250);
            this.AddBackground(10, 10, 280, height - 20, 0xDAC);

            this.AddButton(240, 25, 0xFB1, 0xFB3, 3, GumpButtonType.Reply, 0);

            //AddButton( 223, 54, 0x265A, 0x265A, 4, GumpButtonType.Reply, 0 );

            this.AddHtml(35, 25, 230, 20, this.Center("Participant Setup"), false, false);

            int x = 35;
            int y = 47;

            this.AddHtml(x, y, 200, 20, String.Format("Team Size: {0}", p.Players.Length), false, false);
            y += 22;

            this.AddGoldenButtonLabeled(x + 20, y, 1, "Increase");
            y += 22;
            this.AddGoldenButtonLabeled(x + 20, y, 2, "Decrease");
            y += 30;

            this.AddHtml(35, y, 230, 20, this.Center("Players"), false, false);
            y += 22;

            for (int i = 0; i < p.Players.Length; ++i)
            {
                DuelPlayer pl = p.Players[i];

                this.AddGoldenButtonLabeled(x, y, 5 + i, String.Format("{0}: {1}", 1 + i, pl == null ? "Empty" : pl.Mobile.Name));
                y += 22;
            }
        }
Esempio n. 10
0
		public SmallBODAcceptGump( Mobile from, SmallBOD deed ) : base( 50, 50 )
		{
			m_From = from;
			m_Deed = deed;

			m_From.CloseGump( typeof( LargeBODAcceptGump ) );
			m_From.CloseGump( typeof( SmallBODAcceptGump ) );

			AddPage( 0 );

			AddBackground( 25, 10, 430, 264, 5054 );

			AddImageTiled( 33, 20, 413, 245, 2624 );
			AddAlphaRegion( 33, 20, 413, 245 );

			AddImage( 20, 5, 10460 );
			AddImage( 430, 5, 10460 );
			AddImage( 20, 249, 10460 );
			AddImage( 430, 249, 10460 );

			AddHtmlLocalized( 190, 25, 120, 20, 1045133, 0x7FFF, false, false ); // A bulk order
			AddHtmlLocalized( 40, 48, 350, 20, 1045135, 0x7FFF, false, false ); // Ah!  Thanks for the goods!  Would you help me out?

			AddHtmlLocalized( 40, 72, 210, 20, 1045138, 0x7FFF, false, false ); // Amount to make:
			AddLabel( 250, 72, 1152, deed.AmountMax.ToString() );

			AddHtmlLocalized( 40, 96, 120, 20, 1045136, 0x7FFF, false, false ); // Item requested:
			AddItem( 385, 96, deed.Graphic );
			AddHtmlLocalized( 40, 120, 210, 20, deed.Number, 0xFFFFFF, false, false );

			if ( deed.RequireExceptional || deed.Material != BulkMaterialType.None )
			{
				AddHtmlLocalized( 40, 144, 210, 20, 1045140, 0x7FFF, false, false ); // Special requirements to meet:

				if ( deed.RequireExceptional )
					AddHtmlLocalized( 40, 168, 350, 20, 1045141, 0x7FFF, false, false ); // All items must be exceptional.

				if ( deed.Material != BulkMaterialType.None )
					AddHtmlLocalized( 40, deed.RequireExceptional ? 192 : 168, 350, 20, GetMaterialNumberFor( deed.Material ), 0x7FFF, false, false ); // All items must be made with x material.
			}

			AddHtmlLocalized( 40, 216, 350, 20, 1045139, 0x7FFF, false, false ); // Do you want to accept this order?

			AddButton( 100, 240, 4005, 4007, 1, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 135, 240, 120, 20, 1006044, 0x7FFF, false, false ); // Ok

			AddButton( 275, 240, 4005, 4007, 0, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 310, 240, 120, 20, 1011012, 0x7FFF, false, false ); // CANCEL
		}
Esempio n. 11
0
			public InternalGump( Mobile from, HairRestylingDeed deed ) : base( 50, 50 )
			{
				m_From = from;
				m_Deed = deed;

				from.CloseGump( typeof( InternalGump ) );

				AddBackground( 100, 10, 400, 385, 0xA28 );

				AddHtmlLocalized( 100, 25, 400, 35, 1013008, false, false );
				AddButton( 175, 340, 0xFA5, 0xFA7, 0x0, GumpButtonType.Reply, 0 ); // CANCEL

				AddHtmlLocalized( 210, 342, 90, 35, 1011012, false, false );// <CENTER>HAIRSTYLE SELECTION MENU</center>

				int[][] RacialData = (from.Race == Race.Human) ? HumanArray : ElvenArray;

				for(int i=1; i<RacialData.Length; i++)
				{
					AddHtmlLocalized( LayoutArray[i][2], LayoutArray[i][3], (i==1) ? 125 : 80, (i==1) ? 70 : 35, (m_From.Female) ? RacialData[i][0] : RacialData[i][1], false, false );
					if ( LayoutArray[i][4] != 0 )
					{
						AddBackground( LayoutArray[i][0], LayoutArray[i][1], 50, 50, 0xA3C );
						AddImage( LayoutArray[i][4], LayoutArray[i][5], (m_From.Female) ? RacialData[i][4] : RacialData[i][5] );
					}
					AddButton( LayoutArray[i][6], LayoutArray[i][7], 0xFA5, 0xFA7, i, GumpButtonType.Reply, 0 );
				}
			}
Esempio n. 12
0
        public override bool OnMoveOver( Mobile m )
        {
            if(m_refresh) {
                m.PlaySound( 0x214 );
                m.FixedEffect( 0x376A, 10, 16 );

                m.Resurrect();

                m.Hits = m.HitsMax;
                m.Stam = m.Dex;
                m.Mana = m.Int;
            } else {
                if ( !m.Alive && m.Map != null && m.Map.CanFit( m.Location, 16, false, false ) )
                {
                    m.PlaySound( 0x214 );
                    m.FixedEffect( 0x376A, 10, 16 );

                    m.CloseGump( typeof( ResurrectGump ) );
                    m.SendGump( new ResurrectGump( m ) );
                }
                else
                {
                    m.SendLocalizedMessage( 502391 ); // Thou can not be resurrected there!
                }
            }

            return false;
        }
Esempio n. 13
0
		public PasswordGump(Mobile from)
			: base(50, 40)
		{
			m_From = from;

			from.CloseGump(typeof(PasswordGump));

			AddPage(0);
			AddBackground(0, 0, 480, 220, 5054);
			AddImageTiled(10, 10, 460, 200, 2624);
			AddAlphaRegion(10, 10, 460, 200);

			//x,y,width,height
			StringBuilder sb = new StringBuilder();
			sb.Append("Enter the account name for which you want to send a reset password.");
			sb.Append("  If this account has been activated (with a verified email address),");
			sb.Append(" a new password will be sent to the email address.");

			AddHtml(20, 20, 440, 100, sb.ToString(), true, true);

			AddLabelCropped(20, 140, 150, 20, LabelHue, "Account Name");
			AddTextField(160, 140, 100, 20, 0, "");

			AddButtonLabeled(160, 170, 1, "OK");

		}
Esempio n. 14
0
 private static void SendMessage(Mobile m)
 {
     Account acct = (Account)m.Account;
     m.CloseGump(typeof(MotDGump));
     m.SendGump(new MotDGump(m, LastMessage));
     acct.SetTag("MotD", "true");
 }
Esempio n. 15
0
			public ClaimListGump(AnimalTrainer trainer, Mobile from, List<BaseCreature> list)
				: base(50, 50)
			{
				m_Trainer = trainer;
				m_From = from;
				m_List = list;

				from.CloseGump(typeof(ClaimListGump));

				AddPage(0);

				AddBackground(0, 0, 325, 50 + (list.Count * 20), 9250);
				AddAlphaRegion(5, 5, 315, 40 + (list.Count * 20));

				AddHtml(
					15, 15, 275, 20, "<BASEFONT COLOR=#FFFFFF>Select a pet to retrieve from the stables:</BASEFONT>", false, false);

				for (int i = 0; i < list.Count; ++i)
				{
					BaseCreature pet = list[i];

					if (pet == null || pet.Deleted)
					{
						continue;
					}

					AddButton(15, 39 + (i * 20), 10006, 10006, i + 1, GumpButtonType.Reply, 0);
					AddHtml(
						32, 35 + (i * 20), 275, 18, String.Format("<BASEFONT COLOR=#C0C0EE>{0}</BASEFONT>", pet.Name), false, false);
				}
			}
Esempio n. 16
0
        public QueryMakersMarkGump(int quality, Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool)
            : base(100, 200)
        {
            from.CloseGump(typeof(QueryMakersMarkGump));

            this.m_Quality = quality;
            this.m_From = from;
            this.m_CraftItem = craftItem;
            this.m_CraftSystem = craftSystem;
            this.m_TypeRes = typeRes;
            this.m_Tool = tool;

            this.AddPage(0);

            this.AddBackground(0, 0, 220, 170, 5054);
            this.AddBackground(10, 10, 200, 150, 3000);

            this.AddHtmlLocalized(20, 20, 180, 80, 1018317, false, false); // Do you wish to place your maker's mark on this item?

            this.AddHtmlLocalized(55, 100, 140, 25, 1011011, false, false); // CONTINUE
            this.AddButton(20, 100, 4005, 4007, 1, GumpButtonType.Reply, 0);

            this.AddHtmlLocalized(55, 125, 140, 25, 1011012, false, false); // CANCEL
            this.AddButton(20, 125, 4005, 4007, 0, GumpButtonType.Reply, 0);
        }
Esempio n. 17
0
		public static void Resurrect(Mobile m, Item item)
		{
			if (m.Alive)
			{
				return;
			}

			if (!m.InRange(item.GetWorldLocation(), ResurrectRange))
			{
				m.SendLocalizedMessage(500446); // That is too far away.
			}
			else if (m.Map != null && m.Map.CanFit(m.Location, 16, false, false))
			{
				m.CloseGump(typeof(ResurrectGump));

				/*PlayerMobile pres = m as PlayerMobile;

				if (pres.MurderBounty > 0)
					m.SendGump( new ResurrectGump( m, m, pres.MurderBounty ) );
				else*/
				m.SendGump(new ResurrectGump(m, ResurrectMessage.VirtueShrine));
			}
			else
			{
				m.SendLocalizedMessage(502391); // Thou can not be resurrected there!
			}
		}
Esempio n. 18
0
        public static void ApplyHungerStatMod(Mobile m)
        {
            if (m is PlayerMobile && m.AccessLevel == AccessLevel.Player)
            {
                m.CloseGump(typeof(HungerGump));
                m.SendGump(new HungerGump(m));
            }

            int HungerModStr = 0;

            if (m.Hunger == 0)
                HungerModStr = 0;
            else if (m.Hunger < 4)
                HungerModStr = 1;
            else if (m.Hunger < 8)
                HungerModStr = 2;
            else if (m.Hunger < 12)
                HungerModStr = 3;
            else if (m.Hunger < 16)
                HungerModStr = 4;
            else if (m.Hunger <= 20)
                HungerModStr = 5;

            m.AddStatMod(new StatMod(StatType.Str, "HungerModStr", HungerModStr, TimeSpan.Zero));
        }
Esempio n. 19
0
        public PetResurrectGump(Mobile from, BaseCreature pet, double hitsScalar) : base(50, 50)
        {
            from.CloseGump(typeof (PetResurrectGump));

            m_Pet = pet;
            m_HitsScalar = hitsScalar;

            AddPage(0);

            AddBackground(10, 10, 265, 140, 0x242C);

            AddItem(205, 40, 0x4);
            AddItem(227, 40, 0x5);

            AddItem(180, 78, 0xCAE);
            AddItem(195, 90, 0xCAD);
            AddItem(218, 95, 0xCB0);

            AddHtmlLocalized(30, 30, 150, 75, 1049665, false, false);
                // <div align=center>Wilt thou sanctify the resurrection of:</div>
            AddHtml(30, 70, 150, 25, String.Format("<div align=CENTER>{0}</div>", pet.Name), true, false);

            AddButton(40, 105, 0x81A, 0x81B, 0x1, GumpButtonType.Reply, 0); // Okay
            AddButton(110, 105, 0x819, 0x818, 0x2, GumpButtonType.Reply, 0); // Cancel
        }
Esempio n. 20
0
		public bool UseGate( Mobile m )
		{
			if ( m.Criminal )
			{
				m.SendLocalizedMessage( 1005561, "", 0x22 ); // Thou'rt a criminal and cannot escape so easily.
				return false;
			}
			else if ( SpellHelper.CheckCombat( m ) )
			{
				m.SendLocalizedMessage( 1005564, "", 0x22 ); // Wouldst thou flee during the heat of battle??
				return false;
			}
			else if ( m.Spell != null )
			{
				m.SendLocalizedMessage( 1049616 ); // You are too busy to do that at the moment.
				return false;
			}
			else
			{
				m.CloseGump( typeof( MoongateGump ) );
				m.SendGump( new MoongateGump( m, this ) );

				if ( !m.Hidden || m.AccessLevel == AccessLevel.Player )
					Effects.PlaySound( m.Location, m.Map, 0x20E );

				return true;
			}
		}
Esempio n. 21
0
        public RewardConfirmGump(Mobile from, RewardEntry entry)
            : base(0, 0)
        {
            this.m_From = from;
            this.m_Entry = entry;

            from.CloseGump(typeof(RewardConfirmGump));

            this.AddPage(0);

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

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

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

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

            this.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.

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

            this.AddButton(295, 265, 4017, 4019, 0, GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(330, 266, 150, 35, 1006045, false, false); // Cancel
        }
Esempio n. 22
0
        public ShowartGump(Mobile from, int index) : base(50, 40)
        {
            from.CloseGump(typeof(ShowartGump));

            int start = index;

            m_From = from;
            m_newstart = index;

            AddPage(0);

            AddBackground(0, 0, 522, 475, 9270);
            AddBackground(11, 35, 500, 430, 3000);


            AddLabelCropped(32, 13, 150, 20, 1152, "Haazen's ShowartGump");
            AddBackground(355, 13, 60, 20, 3000);
            AddTextEntry(360, 13, 60, 20, 10, 20, "");
            AddButton(425, 13, 0x15E2, 0x15E6, 3, GumpButtonType.Reply, 0);

            AddButton(465, 14, 0x15E3, 0x15E7, 1, GumpButtonType.Reply, 0);
            AddButton(482, 14, 0x15E1, 0x15E5, 2, GumpButtonType.Reply, 0);


            AddDetails(start);
        }
Esempio n. 23
0
        public override void OnDoubleClick(Mobile from)
        {
            base.OnDoubleClick(from);
            from.CloseGump(typeof(XmlQuestStatusGump));

            from.SendGump(new XmlQuestStatusGump(this, this.TitleString));
        }
Esempio n. 24
0
			public PetBallTarget( Mobile from, PetSkillBall ball ) :  base ( 3, false, TargetFlags.None )
			{
				m_Ball = ball;
				m_From = from;
				m_From.CloseGump( typeof( PetBallGump ) );
				from.SendMessage("Select a pet to modify their skills.");
			}
Esempio n. 25
0
        public SelectStyleGump(Mobile owner, BoardGameControlItem controlitem) : base(450, 80)
        {
            Closable = false;

            owner.CloseGump(typeof(SelectStyleGump));

            _ControlItem = controlitem;

            if (_ControlItem.Players.IndexOf(owner) == -1)
            {
                return;
            }

            AddPage(0);
            AddBackground(0, 0, Width, Height, 0x1400);

            AddLabel(20, 60, 1152,
                "# of players (" + _ControlItem.MinPlayers + "-" + _ControlItem.MaxPlayers + "):");

            int minplayers = Math.Max(_ControlItem.MinPlayers, _ControlItem.Players.Count);

            if (_ControlItem.MaxPlayers != _ControlItem.MinPlayers && !_ControlItem.SettingsReady)
            {
                AddLabel(20, 40, 1172, "Pick the number of players");
                AddTextField(150, 60, 30, 20, 0, _ControlItem.CurrentMaxPlayers.ToString(CultureInfo.InvariantCulture));
                AddButton(182, 62, 0x4B9, 0x4BA, 500, GumpButtonType.Reply, 0);
            }
            else
            {
                AddLabel(150, 60, 1152, _ControlItem.CurrentMaxPlayers.ToString(CultureInfo.InvariantCulture));
            }


            //AddButton( Width - 15, 0, 3, 4, 0, GumpButtonType.Reply, 0 );	
        }
Esempio n. 26
0
		public SmallBODGump( Mobile from, SmallBOD deed ) : base( 25, 25 )
		{
			m_From = from;
			m_Deed = deed;

			m_From.CloseGump( typeof( LargeBODGump ) );
			m_From.CloseGump( typeof( SmallBODGump ) );

			AddPage( 0 );

			AddBackground( 50, 10, 455, 260, 5054 );
			AddImageTiled( 58, 20, 438, 241, 2624 );
			AddAlphaRegion( 58, 20, 438, 241 );

			AddImage( 45, 5, 10460 );
			AddImage( 480, 5, 10460 );
			AddImage( 45, 245, 10460 );
			AddImage( 480, 245, 10460 );

			AddHtmlLocalized( 225, 25, 120, 20, 1045133, 0x7FFF, false, false ); // A bulk order

			AddHtmlLocalized( 75, 48, 250, 20, 1045138, 0x7FFF, false, false ); // Amount to make:
			AddLabel( 275, 48, 1152, deed.AmountMax.ToString() );

			AddHtmlLocalized( 275, 76, 200, 20, 1045153, 0x7FFF, false, false ); // Amount finished:
			AddHtmlLocalized( 75, 72, 120, 20, 1045136, 0x7FFF, false, false ); // Item requested:

			AddItem( 410, 72, deed.Graphic );

			AddHtmlLocalized( 75, 96, 210, 20, deed.Number, 0x7FFF, false, false );
			AddLabel( 275, 96, 0x480, deed.AmountCur.ToString() );

			if ( deed.RequireExceptional || deed.Material != BulkMaterialType.None )
				AddHtmlLocalized( 75, 120, 200, 20, 1045140, 0x7FFF, false, false ); // Special requirements to meet:

			if ( deed.RequireExceptional )
				AddHtmlLocalized( 75, 144, 300, 20, 1045141, 0x7FFF, false, false ); // All items must be exceptional.

			if ( deed.Material != BulkMaterialType.None )
				AddHtmlLocalized( 75, deed.RequireExceptional ? 168 : 144, 300, 20, GetMaterialNumberFor( deed.Material ), 0x7FFF, false, false ); // All items must be made with x material.

			AddButton( 125, 192, 4005, 4007, 2, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 160, 192, 300, 20, 1045154, 0x7FFF, false, false ); // Combine this deed with the item requested.

			AddButton( 125, 216, 4005, 4007, 1, GumpButtonType.Reply, 0 );
			AddHtmlLocalized( 160, 216, 120, 20, 1011441, 0x7FFF, false, false ); // EXIT
		}
Esempio n. 27
0
            public FindPlayerVendorsGump(Mobile from, ArrayList list, int page) : base(50, 40)
            {
                from.CloseGump(typeof(FindPlayerVendorsGump));
                int pvs = 0;
                m_Page = page;
                m_From = from;
                int pageCount = 0;
                m_List = list;

                AddPage(0);
                AddBackground(0, 0, 645, 325, 3500);
                AddBlackAlpha(20, 20, 604, 277);

                if (m_List == null)
                {
                    return;
                }
                else
                {
                    pvs = list.Count;
                    if (list.Count % 12 == 0)
                    {
                        pageCount = (list.Count / 12);
                    }
                    else
                    {
                        pageCount = (list.Count / 12) + 1;
                    }
                }

                AddLabelCropped(32, 20, 100, 20, 1152, "Shop Name");
                AddLabelCropped(250, 20, 120, 20, 1152, "Owner");
                AddLabelCropped(415, 20, 120, 20, 1152, "Location");
                AddLabel(27, 298, 32, String.Format("Ultima Online - Player Vendors                    There are {0} vendors in the world.", pvs));

                if (page > 1)
                    AddButton(573, 22, 0x15E3, 0x15E7, 1, GumpButtonType.Reply, 0);
                else
                    AddImage(573, 22, 0x25EA);

                if (pageCount > page)
                    AddButton(590, 22, 0x15E1, 0x15E5, 2, GumpButtonType.Reply, 0);
                else
                    AddImage(590, 22, 0x25E6);

                if (m_List.Count == 0)
                    AddLabel(180, 115, 1152, ".....::: There are no Vendors in world :::.....");

                if (page == pageCount)
                {
                    for (int i = (page * 12) - 12; i < pvs; ++i)
                        AddDetails(i);
                }
                else
                {
                    for (int i = (page * 12) - 12; i < page * 12; ++i)
                        AddDetails(i);
                }
            }
Esempio n. 28
0
 public override void OnDoubleClick(Mobile from)
 {
     base.OnDoubleClick(from);
     if (!(from is PlayerMobile))
         return;
     from.CloseGump(typeof(EasterRewardsUI));
     from.SendGump(new EasterRewardsUI(from as PlayerMobile));
 }
Esempio n. 29
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( m_TeamInfo != null && m_TeamInfo.Game != null )
			{
				from.CloseGump( typeof( CTFBoardGump ) );
				from.SendGump( new CTFBoardGump( from, m_TeamInfo.Game ) );
			}
		}
Esempio n. 30
0
		public override void OnMovement( Mobile m, Point3D oldLocation )
		{
			if ( m is PlayerMobile )
			{
				if ( !Utility.InRange( m.Location, this.Location, 1 ) && Utility.InRange( oldLocation, this.Location, 1 ) )
					m.CloseGump( typeof( MoongateGump ) );
			}
		}
Esempio n. 31
0
        public override void OnRemoved(IEntity parent)
        {
            Mobile m = null;

            if (parent is Item item)
            {
                m = item.RootParent as Mobile;
            }
            else if (parent is Mobile mobile)
            {
                m = mobile;
            }

            m?.CloseGump <PromotionalTokenGump>();
        }
Esempio n. 32
0
        public LargeBODAcceptGump(Mobile from, LargeBOD deed)
            : base(50, 50)
        {
            m_From = from;
            m_Deed = deed;

            m_From.CloseGump(typeof(LargeBODAcceptGump));
            m_From.CloseGump(typeof(SmallBODAcceptGump));

            LargeBulkEntry[] entries = deed.Entries;

            bool enlarge = deed.RequireExceptional || deed.Material != BulkMaterialType.None;

            AddPage(0);

            AddBackground(25, 10, 430, (enlarge ? 240 : 168) + (entries.Length * 24), 5054);

            AddImageTiled(33, 20, 413, (enlarge ? 221 : 149) + (entries.Length * 24), 2624);
            AddAlphaRegion(33, 20, 413, (enlarge ? 221 : 149) + (entries.Length * 24));

            AddImage(20, 5, 10460);
            AddImage(430, 5, 10460);
            AddImage(20, (enlarge ? 225 : 153) + (entries.Length * 24), 10460);
            AddImage(430, (enlarge ? 225 : 153) + (entries.Length * 24), 10460);

            AddHtmlLocalized(40, 48, 350, 20, 1045135, 0xFFFFFF, false, false);               // Ah!  Thanks for the goods!  Would you help me out?
            AddHtmlLocalized(40, 72, 210, 20, 1045138, 0xFFFFFF, false, false);               // Amount to make:
            AddLabel(250, 72, 1152, deed.AmountMax.ToString());

            AddHtmlLocalized(40, (enlarge ? 192 : 120) + (entries.Length * 24), 350, 20, 1045139, 0xFFFFFF, false, false);                   // Do you want to accept this order?

            AddHtmlLocalized(135, (enlarge ? 216 : 144) + (entries.Length * 24), 120, 20, 1006044, 0xFFFFFF, false, false);                  // OK
            AddHtmlLocalized(310, (enlarge ? 216 : 144) + (entries.Length * 24), 120, 20, 1011012, 0xFFFFFF, false, false);                  // CANCEL

            AddButton(100, (enlarge ? 216 : 144) + (entries.Length * 24), 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddButton(275, (enlarge ? 216 : 144) + (entries.Length * 24), 4005, 4007, 0, GumpButtonType.Reply, 0);

            AddHtmlLocalized(180, 25, 120, 20, 1045134, 0xFFFFFF, false, false);              // A large bulk order
            AddHtmlLocalized(40, 96, 120, 20, 1045137, 0xFFFFFF, false, false);               // Items requested:

            int y = 120 + entries.Length * 24;

            if (enlarge)
            {
                int krobjects = 2;

                AddHtmlLocalized(40, y, 210, 20, 1045140, 0xFFFFFF, false, false);                   // Special requirements to meet:
                y += 24;

                if (deed.RequireExceptional)
                {
                    AddHtmlLocalized(40, y, 350, 20, 1045141, 0xFFFFFF, false, false);                       // All items must be exceptional.
                    y += 24;
                    krobjects--;
                }

                if (deed.Material != BulkMaterialType.None)
                {
                    AddHtmlLocalized(40, y, 350, 20, GetMaterialNumberFor(deed.Material), 0xFFFFFF, false, false);                         // All items must be made with x material.
                    y += 24;
                    krobjects--;
                }

                while (krobjects > 0)
                {
                    AddKRHtmlLocalized(0, 0, 0, 0, -1, false, false);
                    krobjects--;
                }
            }
            else
            {
                AddKRHtmlLocalized(0, 0, 0, 0, -1, false, false);
                AddKRHtmlLocalized(0, 0, 0, 0, -1, false, false);
                AddKRHtmlLocalized(0, 0, 0, 0, -1, false, false);
            }

            AddKRHtmlLocalized(0, 0, 0, 0, -1, false, false);

            y = 120;

            for (int i = 0; i < entries.Length; ++i, y += 24)
            {
                AddHtmlLocalized(40, y, 210, 20, entries[i].Details.Number, 0xFFFFFF, false, false);
            }
        }
Esempio n. 33
0
        public bool UseGate(Mobile m)
        {
            if (!PGSystem.Running)
            {
                m.SendMessage("The Public Gate System is not active.  Please page a GM for assistance.");
                return(false);
            }

            if (m.Criminal)
            {
                m.SendLocalizedMessage(1005561, "", 0x22);                   // Thou'rt a criminal and cannot escape so easily.
                return(false);
            }
            else if (Server.Spells.SpellHelper.CheckCombat(m))
            {
                m.SendLocalizedMessage(1005564, "", 0x22);                   // Wouldst thou flee during the heat of battle??
                return(false);
            }
            else if (m.Spell != null)
            {
                m.SendLocalizedMessage(1049616);                   // You are too busy to do that at the moment.
                return(false);
            }
            else
            {
                int  page  = 0;
                bool found = false;
                for (int i = 0; i < PGSystem.CategoryList.Count && !found; i++)
                {
                    PGCategory PGC = PGSystem.CategoryList[i];
                    if (PGC != null && PGC.Locations != null && PGC.Locations.Count > 0 &&
                        (PGC.GetFlag(EntryFlag.StaffOnly) && m.AccessLevel > AccessLevel.Player) ||
                        (!PGC.GetFlag(EntryFlag.StaffOnly) && ((!PGC.GetFlag(EntryFlag.Reds) && m.Kills < 5) || PGC.GetFlag(EntryFlag.Reds))) ||
                        (m.AccessLevel > AccessLevel.Player))
                    {
                        for (int j = 0; j < PGC.Locations.Count && !found; j++)
                        {
                            PGLocation PGL = PGC.Locations[j];
                            if (PGL != null && (PGL.GetFlag(EntryFlag.StaffOnly) && m.AccessLevel > AccessLevel.Player) ||
                                (!PGL.GetFlag(EntryFlag.StaffOnly) && ((!PGL.GetFlag(EntryFlag.Reds) && m.Kills < 5) || PGL.GetFlag(EntryFlag.Reds))) ||
                                (m.AccessLevel > AccessLevel.Player))
                            {
                                if (PGL.Location == this.Location && PGL.Map == this.Map)
                                {
                                    page  = i;
                                    found = true;
                                }
                            }
                        }
                    }
                }

                m.CloseGump(typeof(WTPGump));
                m.SendGump(new WTPGump(m, page, this));

                if (!m.Hidden || m.AccessLevel == AccessLevel.Player)
                {
                    Effects.PlaySound(m.Location, m.Map, 0x20E);
                }

                return(true);
            }
        }
Esempio n. 34
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            from.CloseGump(typeof(ResurrectGump));

            if (ResurrectMessage.SilverSapling == m_Msg && 1 == info.ButtonID)
            {
                PlayerMobile pm = from as PlayerMobile;
                if (null != pm && pm.Region.IsPartOf("Abyss"))
                {
                    pm.Location = pm.SSSeedLocation;
                    pm.Map      = pm.SSSeedMap;
                    if (null != pm.Corpse)
                    {
                        pm.Corpse.Location = pm.Location;
                        pm.Corpse.Map      = pm.Map;
                    }
                    pm.Resurrect();
                }
                return;
            }

            if (info.ButtonID == 1 || info.ButtonID == 2)
            {
                if (from.Map == null || !from.Map.CanFit(from.Location, 16, false, false))
                {
                    from.SendLocalizedMessage(502391); // Thou can not be resurrected there!
                    return;
                }

                if (m_Price > 0)
                {
                    if (info.IsSwitched(1))
                    {
                        if (Banker.Withdraw(from, m_Price))
                        {
                            from.SendLocalizedMessage(1060398, m_Price.ToString());                 // ~1_AMOUNT~ gold has been withdrawn from your bank box.
                            from.SendLocalizedMessage(1060022, Banker.GetBalance(from).ToString()); // You have ~1_AMOUNT~ gold in cash remaining in your bank box.
                        }
                        else
                        {
                            from.SendLocalizedMessage(1060020); // Unfortunately, you do not have enough cash in your bank to cover the cost of the healing.
                            return;
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1060019); // You decide against paying the healer, and thus remain dead.
                        return;
                    }
                }

                from.PlaySound(0x214);
                from.FixedEffect(0x376A, 10, 16);

                from.Resurrect();

                if (m_Healer != null && from != m_Healer)
                {
                    VirtueLevel level = VirtueHelper.GetLevel(m_Healer, VirtueName.Compassion);

                    switch (level)
                    {
                    case VirtueLevel.Seeker:
                        from.Hits = AOS.Scale(from.HitsMax, 20);
                        break;

                    case VirtueLevel.Follower:
                        from.Hits = AOS.Scale(from.HitsMax, 40);
                        break;

                    case VirtueLevel.Knight:
                        from.Hits = AOS.Scale(from.HitsMax, 80);
                        break;
                    }
                }

                if (m_FromSacrifice && from is PlayerMobile)
                {
                    ((PlayerMobile)from).AvailableResurrects -= 1;

                    Container pack   = from.Backpack;
                    Container corpse = from.Corpse;

                    if (pack != null && corpse != null)
                    {
                        List <Item> items = new List <Item>(corpse.Items);

                        for (int i = 0; i < items.Count; ++i)
                        {
                            Item item = items[i];

                            if (item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Movable)
                            {
                                pack.DropItem(item);
                            }
                        }
                    }
                }

                if (m_Healer != from && m_Healer is PlayerMobile && from is PlayerMobile)
                {
                    SpiritualityVirtue.OnHeal(m_Healer, 50);
                }

                if (from.Fame > 0)
                {
                    int amount = from.Fame / 10;

                    Misc.Titles.AwardFame(from, -amount, true);
                }

                if (!Core.AOS && from.ShortTermMurders >= 5)
                {
                    double loss = (100.0 - (4.0 + (from.ShortTermMurders / 5.0))) / 100.0; // 5 to 15% loss

                    if (loss < 0.85)
                    {
                        loss = 0.85;
                    }
                    else if (loss > 0.95)
                    {
                        loss = 0.95;
                    }

                    if (from.RawStr * loss > 10)
                    {
                        from.RawStr = (int)(from.RawStr * loss);
                    }
                    if (from.RawInt * loss > 10)
                    {
                        from.RawInt = (int)(from.RawInt * loss);
                    }
                    if (from.RawDex * loss > 10)
                    {
                        from.RawDex = (int)(from.RawDex * loss);
                    }

                    for (int s = 0; s < from.Skills.Length; s++)
                    {
                        if (from.Skills[s].Base * loss > 35)
                        {
                            from.Skills[s].Base *= loss;
                        }
                    }
                }

                if (from.Alive && m_HitsScalar > 0)
                {
                    from.Hits = (int)(from.HitsMax * m_HitsScalar);
                }

                if (m_Callback != null)
                {
                    m_Callback(from);
                }
            }
        }
Esempio n. 35
0
        public ViewHousesGump(Mobile from, List <BaseHouse> list, BaseHouse sel) : base(50, 40)
        {
            m_From      = from;
            m_List      = list;
            m_Selection = sel;

            from.CloseGump(typeof(ViewHousesGump));

            AddPage(0);

            AddBackground(0, 0, 240, 360, 5054);
            AddBlackAlpha(10, 10, 220, 340);

            if (sel == null || sel.Deleted)
            {
                m_Selection = null;

                AddHtml(35, 15, 120, 20, Color("House Type", White), false, false);

                if (list.Count == 0)
                {
                    AddHtml(35, 40, 160, 40, Color("There were no houses found for that player.", White), false, false);
                }

                AddImage(190, 17, 0x25EA);
                AddImage(207, 17, 0x25E6);

                int page = 0;

                for (int i = 0; i < list.Count; ++i)
                {
                    if ((i % 15) == 0)
                    {
                        if (page > 0)
                        {
                            AddButton(207, 17, 0x15E1, 0x15E5, 0, GumpButtonType.Page, page + 1);
                        }

                        AddPage(++page);

                        if (page > 1)
                        {
                            AddButton(190, 17, 0x15E3, 0x15E7, 0, GumpButtonType.Page, page - 1);
                        }
                    }

                    object name = FindHouseName(list[i]);

                    AddHtml(15, 40 + ((i % 15) * 20), 20, 20, Color(string.Format("{0}.", i + 1), White), false, false);

                    if (name is int)
                    {
                        AddHtmlLocalized(35, 40 + ((i % 15) * 20), 160, 20, (int)name, White16, false, false);
                    }
                    else if (name is string)
                    {
                        AddHtml(35, 40 + ((i % 15) * 20), 160, 20, Color((string)name, White), false, false);
                    }

                    AddButton(198, 39 + ((i % 15) * 20), 4005, 4007, i + 1, GumpButtonType.Reply, 0);
                }
            }
            else
            {
                string houseName, owner, location;
                Map    map = sel.Map;

                houseName = (sel.Sign == null) ? "An Unnamed House" : sel.Sign.GetName();
                owner     = (sel.Owner == null) ? "nobody" : sel.Owner.Name;

                int  xLong = 0, yLat = 0, xMins = 0, yMins = 0;
                bool xEast = false, ySouth = false;

                bool valid = Sextant.Format(sel.Location, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth);

                if (valid)
                {
                    location = string.Format("{0} {1}'{2}, {3} {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W");
                }
                else
                {
                    location = "unknown";
                }

                AddHtml(10, 15, 220, 20, Color(Center("House Properties"), White), false, false);

                AddHtml(15, 40, 210, 20, Color("Facet:", White), false, false);
                AddHtml(15, 40, 210, 20, Color(Right(map == null ? "(null)" : map.Name), White), false, false);

                AddHtml(15, 60, 210, 20, Color("Location:", White), false, false);
                AddHtml(15, 60, 210, 20, Color(Right(sel.Location.ToString()), White), false, false);

                AddHtml(15, 80, 210, 20, Color("Sextant:", White), false, false);
                AddHtml(15, 80, 210, 20, Color(Right(location), White), false, false);

                AddHtml(15, 100, 210, 20, Color("Owner:", White), false, false);
                AddHtml(15, 100, 210, 20, Color(Right(owner), White), false, false);

                AddHtml(15, 120, 210, 20, Color("Name:", White), false, false);
                AddHtml(15, 120, 210, 20, Color(Right(houseName), White), false, false);

                AddHtml(15, 140, 210, 20, Color("Friends:", White), false, false);
                AddHtml(15, 140, 210, 20, Color(Right(sel.Friends.Count.ToString()), White), false, false);

                AddHtml(15, 160, 210, 20, Color("Co-Owners:", White), false, false);
                AddHtml(15, 160, 210, 20, Color(Right(sel.CoOwners.Count.ToString()), White), false, false);

                AddHtml(15, 180, 210, 20, Color("Bans:", White), false, false);
                AddHtml(15, 180, 210, 20, Color(Right(sel.Bans.Count.ToString()), White), false, false);

                AddHtml(15, 200, 210, 20, Color("Decays:", White), false, false);
                AddHtml(15, 200, 210, 20, Color(Right(sel.CanDecay ? "Yes" : "No"), White), false, false);

                AddHtml(15, 220, 210, 20, Color("Decay Level:", White), false, false);
                AddHtml(15, 220, 210, 20, Color(Right(sel.DecayLevel.ToString()), White), false, false);

                AddButton(15, 245, 4005, 4007, 1, GumpButtonType.Reply, 0);
                AddHtml(50, 245, 120, 20, Color("Go to house", White), false, false);

                AddButton(15, 265, 4005, 4007, 2, GumpButtonType.Reply, 0);
                AddHtml(50, 265, 120, 20, Color("Open house menu", White), false, false);

                AddButton(15, 285, 4005, 4007, 3, GumpButtonType.Reply, 0);
                AddHtml(50, 285, 120, 20, Color("Demolish house", White), false, false);

                AddButton(15, 305, 4005, 4007, 4, GumpButtonType.Reply, 0);
                AddHtml(50, 305, 120, 20, Color("Refresh house", White), false, false);
            }
        }
        public PlayerBBGump(Mobile from, BaseHouse house, BasePlayerBB board, int page) : base(50, 10)
        {
            from.CloseGump <PlayerBBGump>();;

            m_Page  = page;
            m_From  = from;
            m_House = house;
            m_Board = board;

            AddPage(0);

            AddImage(30, 30, 5400);

            AddButton(393, 145, 2084, 2084, 4, GumpButtonType.Reply, 0);              // Scroll up
            AddButton(390, 371, 2085, 2085, 5, GumpButtonType.Reply, 0);              // Scroll down

            AddButton(32, 183, 5412, 5413, 1, GumpButtonType.Reply, 0);               // Post message

            if (house.IsOwner(from))
            {
                AddButton(63, 90, 5601, 5605, 2, GumpButtonType.Reply, 0);
                AddHtmlLocalized(81, 89, 230, 20, 1062400, LabelColor, false, false);                   // Set title

                AddButton(63, 109, 5601, 5605, 3, GumpButtonType.Reply, 0);
                AddHtmlLocalized(81, 108, 230, 20, 1062401, LabelColor, false, false);                   // Post greeting
            }

            string title = board.Title;

            if (title != null)
            {
                AddHtml(183, 68, 180, 23, title, false, false);
            }

            AddHtmlLocalized(385, 89, 60, 20, 1062409, LabelColor, false, false);               // Post

            AddLabel(440, 89, LabelHue, page.ToString());
            AddLabel(455, 89, LabelHue, "/");
            AddLabel(470, 89, LabelHue, board.Messages.Count.ToString());

            PlayerBBMessage message = board.Greeting;

            if (page >= 1 && page <= board.Messages.Count)
            {
                message = (PlayerBBMessage)board.Messages[page - 1];
            }

            AddImageTiled(150, 220, 240, 1, 2700);                             // Separator

            AddHtmlLocalized(150, 180, 100, 20, 1062405, 16715, false, false); // Posted On:
            AddHtmlLocalized(150, 200, 100, 20, 1062406, 16715, false, false); // Posted By:

            if (message != null)
            {
                AddHtml(255, 180, 150, 20, message.Time.ToString("yyyy-MM-dd HH:mm:ss"), false, false);

                Mobile poster = message.Poster;
                string name   = poster == null ? null : poster.Name;

                if (name == null || (name = name.Trim()).Length == 0)
                {
                    name = "Someone";
                }

                AddHtml(255, 200, 150, 20, name, false, false);

                string body = message.Message;

                if (body == null)
                {
                    body = "";
                }

                AddHtml(150, 240, 250, 100, body, false, false);

                if (message != board.Greeting && house.IsOwner(from))
                {
                    AddButton(130, 395, 1209, 1210, 6, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(150, 393, 150, 20, 1062410, LabelColor, false, false);                       // Banish Poster

                    AddButton(310, 395, 1209, 1210, 7, GumpButtonType.Reply, 0);
                    AddHtmlLocalized(330, 393, 150, 20, 1062411, LabelColor, false, false);                       // Delete Message
                }

                if (from.AccessLevel >= AccessLevel.GameMaster)
                {
                    AddButton(135, 242, 1209, 1210, 8, GumpButtonType.Reply, 0);                       // Post props
                }
            }
        }
Esempio n. 37
0
 public override void OnDoubleClick(Mobile from)
 {
     from.CloseGump(typeof(HolidayTreeChoiceGump));
     from.SendGump(new HolidayTreeChoiceGump(from, this));
 }
Esempio n. 38
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile m = sender.Mobile;

            TextRelays = CreateList(info.TextEntries);


            bool[] switches = new bool[4]
            {
                info.IsSwitched(21),
                info.IsSwitched(23),
                info.IsSwitched(25),
                info.IsSwitched(27)
            };

            switch (info.ButtonID)
            {
            case 0: break;

            case 1: m.SendGump(new ToolbarEdit(p_Info, this.p_Expanded, AnalyzeEntries(), Skin + 1, Columns, Rows, Font, switches)); break;

            case 2: m.SendGump(new ToolbarEdit(p_Info, this.p_Expanded, AnalyzeEntries(), Skin - 1, Columns, Rows, Font, switches)); break;

            case 3: m.SendGump(new ToolbarEdit(p_Info, this.p_Expanded, AnalyzeEntries(), Skin, Columns, Rows + 1, Font, switches)); break;

            case 4: m.SendGump(new ToolbarEdit(p_Info, this.p_Expanded, AnalyzeEntries(), Skin, Columns, Rows - 1, Font, switches)); break;

            case 5: m.SendGump(new ToolbarEdit(p_Info, this.p_Expanded, AnalyzeEntries(), Skin, Columns + 1, Rows, Font, switches)); break;

            case 6: m.SendGump(new ToolbarEdit(p_Info, this.p_Expanded, AnalyzeEntries(), Skin, Columns - 1, Rows, Font, switches)); break;

            //case 7:
            //m.SendGump( new ToolbarEdit( p_Info, this.p_Expanded, AnalyzeEntries(), Skin, Columns, Rows, Font, switches ));
            //m.SendMessage( 32, "The Marker utility is not an active feature yet; please be patient." );
            //goto case 0;
            case 9:                             // Default
                List <string> toolbarinfo = ToolbarInfo.DefaultEntries((int)m.AccessLevel);
                CombineEntries(toolbarinfo);
                toolbarinfo.AddRange(AnalyzeEntries(toolbarinfo.Count));
                m.SendGump(new ToolbarEdit(p_Info, this.p_Expanded, toolbarinfo, Skin, Columns, Rows, Font, switches));
                break;

            case 10:                            // Okay
                goto case 12;

            case 11:                            // Cancel
                goto case 0;

            case 12:                            // Apply
                Account     acc   = m.Account as Account;
                ToolbarInfo infos = null;
                for (int i = 0; i < ToolbarHelper.Infos.Info.Count; i++)
                {
                    if (ToolbarHelper.Infos.Info[i].Account == acc.Username)
                    {
                        infos = ToolbarHelper.Infos.Info[i];
                    }
                }
                if (infos == null)
                {
                    infos = ToolbarInfo.CreateNew(m, acc);
                }
                List <int> dims = new List <int>();
                dims.Add(Columns);
                dims.Add(Rows);

                infos.SetAttributes(acc.Username, dims, AnalyzeEntries(), Skin, infos.Points, Font, switches);

                if (info.ButtonID == 12)
                {
                    m.SendGump(new ToolbarEdit(infos, this.p_Expanded));
                }
                m.CloseGump(typeof(Toolbar));
                m.SendGump(new Toolbar(infos));
                break;

            case 18: m.SendGump(new ToolbarEdit(p_Info, this.p_Expanded, AnalyzeEntries(), Skin, Columns, Rows, Font + 1, switches)); break;

            case 19: m.SendGump(new ToolbarEdit(p_Info, this.p_Expanded, AnalyzeEntries(), Skin, Columns, Rows, Font - 1, switches)); break;

            case 20:
                m.SendGump(new ToolbarEdit(p_Info, this.p_Expanded, AnalyzeEntries(), Skin, Columns, Rows, Font, switches));
                m.SendMessage(2101, "Phantom mode turns the toolbar semi-transparent.");
                break;

            case 22:
                m.SendGump(new ToolbarEdit(p_Info, this.p_Expanded, AnalyzeEntries(), Skin, Columns, Rows, Font, switches));
                m.SendMessage(2101, "Stealth mode makes the toolbar automatically minimize when you click a button.");
                break;

            case 24:
                m.SendGump(new ToolbarEdit(p_Info, this.p_Expanded, AnalyzeEntries(), Skin, Columns, Rows, Font, switches));
                m.SendMessage(2101, "Reverse mode puts the minimize bar above the toolbar instead of below.");
                break;

            case 26:
                m.SendGump(new ToolbarEdit(p_Info, this.p_Expanded, AnalyzeEntries(), Skin, Columns, Rows, Font, switches));
                m.SendMessage(2101, "Lock mode disables closing the toolbar with right-click.");
                break;

            case 28:                            // Expand
                m.SendGump(new ToolbarEdit(p_Info, !this.p_Expanded, AnalyzeEntries(), Skin, Columns, Rows, Font, switches));
                m.SendMessage(2101, "Expanded view {0}activated.", this.p_Expanded ? "de" : "");
                break;
            }
        }
Esempio n. 39
0
 private void FailedPurchase(Mobile from)
 {
     from.SendMessage("You don't have enough to purchase that!");
     from.CloseGump(typeof(VIPStore));
     from.SendGump(new VIPStore(from));
 }
Esempio n. 40
0
        public static void MyHelpAdmin_OnCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;

            from.CloseGump(typeof(SpeechGump));
            if (!from.HasGump(typeof(SpeechGump)))
            {
                string sText = ""
                               + "If this is the first time you started this server, or you want to do an overall refresh, run the command below...<br><br>"

                               + "[buildworld - This will decorate and spawn the world, along with generating gardens and stealable artifacts.<br><br>"

                               + "This does not alter any players or their belongings. Once you do this, then the world is ready for the players. There is a unique name system implemented that will force players to have a unique name. There are also 3 task managers in Lord British's castle. One runs every hour, another runs every 3 hours, and the other runs once per day.<br><br>"

                               + "Every hour, the task manager will change the appearances of the shrines. It will also remove any dungeon chests that have been opened. Lastly, it will delete the hidden traps/chests so they may then respawn in random locations again. This is done with a region spawner.<br><br>"

                               + "Every 3 hours, the task manager will replant the gardens in the world and mix up the hostile and mystical creatures that roam the land.<br><br>"

                               + "Every day, the task manager will delete the wandering healers, sea creatures, and tavern patrons. This is so the sea creatures and healers can respawn in new random locations. The tavern patrons change to new characters to give the illusion that new patrons arrived at the tavern.<br><br>"

                               + "The server allows players to macro the gathering of resources, and crafting of items. If you want to disallow this behavior, then set the AllowMacroResources to false in MyServerSettings.cs and restart the server. Players will then be presented with a captcha after randomly determined times. This captcha, that they have to respond to, will help avoid unattended macroing.<br><br>"

                               + "<br><br>"

                               + "There is a message of the day you can make use of. You simply need to edit the News.txt file in the Info folder whenever you want to notify players of anything. You can view the message of the day by typing...<br><br>"
                               + "[motd"

                               + "<br><br>"

                               + "There is a logging system built into the game that tracks where a player goes, what they kill, when they die, what traps they spring, and some other minor activities. They can turn this option off for more privacy. The town criers will use these logs to shout out various things that the players are doing in the game. One can talk to a town crier and learn about all the events. The logs are kept in the Info folder.<br><br>"

                               + "<br><br>"

                               + "There is a MyServerSettings.cs file that allows you to change some parameters of how difficult the game is. The gold monsters and containers drop is cut down to 25%, but can be changed in this file. Also, each dungeon has a difficulty level set here. Some dungeons are harder than others, but the loot is better. Be wary when changing these settings as these have been tested to work well for solo players, which is what this server was designed around.<br><br>"

                               + "<br><br>"

                               + "The game will save if you log out in an inn, tavern, home, etc. If you plan to run this in a multi-player fashion, you may want to disable this feature. To do this, find the MyServerSettings.cs file and change the SaveOnCharacterLogout to false. Either way, the game saves itself every 30 minutes.<br><br>"

                               + "<br><br>"

                               + "Here are some other commands that may interest you...<br><br>"

                               + "[adddoor - Opens the window for you to add a door.<br><br>"
                               + "[addongen - Lets you make an addon and deed for something you created in the game.<br><br>"
                               + "[addtobank - Lets you add an item to many players' bank boxes at once.<br><br>"
                               + "[addtrap - Opens the window for you to add a trap. Make sure you are standing in the spot where you want the trap before selecting one.<br><br>"
                               + "[admin - Opens the window for general server administration.<br><br>"
                               + "[findboat - Lets you find all the boats in the world.<br><br>"
                               + "[go - Opens a menu of quick locations you can travel to.<br><br>"
                               + "[scan - Quickly cycle through the players logged in and teleport to them.<br><br>"
                               + "[searchimage - Allows you to find images in UO and then add them to the world.<br><br>"
                               + "[staex - Allows you to export items into a decoration file.<br><br>"
                               + "[townhouses - Lets you build in-game player housing, and also find all the houses built in the world.<br><br>"

                               + "<br><br>"

                               + "This server is set to give players 1,000 skill points to spend. This helps for solo play and lets the player round out a decent character...while still staying within the bounds of mastering a class. Their mana, stamina, and hit points are double the associated ability...this also helps with the solo play aspect. Rejuvenation type potions, skills, and magics have been modified to accommodate these changes."

                               + "";

                from.SendGump(new SpeechGump("Help For Admins", sText));
            }
        }
Esempio n. 41
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_House.Deleted)
            {
                return;
            }

            Mobile from = sender.Mobile;

            bool isOwner   = m_House.IsOwner(from);
            bool isCoOwner = isOwner || m_House.IsCoOwner(from);
            bool isFriend  = isCoOwner || m_House.IsFriend(from);

            if (!isFriend || !from.Alive)
            {
                return;
            }

            Item sign = m_House.Sign;

            if (sign == null || from.Map != sign.Map || !from.InRange(sign.GetWorldLocation(), 18))
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 1:                     // Rename sign
            {
                from.Prompt = new RenamePrompt(m_House);
                from.SendLocalizedMessage(501302);                                 // What dost thou wish the sign to say?

                break;
            }

            case 2:                     // List of co-owners
            {
                from.CloseGump(typeof(HouseGump));
                from.CloseGump(typeof(HouseListGump));
                from.CloseGump(typeof(HouseRemoveGump));
                from.SendGump(new HouseListGump(1011275, m_House.CoOwners, m_House));

                break;
            }

            case 3:                     // Add co-owner
            {
                if (isOwner)
                {
                    from.SendLocalizedMessage(501328);                                     // Target the person you wish to name a co-owner of your household.
                    from.Target = new CoOwnerTarget(true, m_House);
                }
                else
                {
                    from.SendLocalizedMessage(501327);                                     // Only the house owner may add Co-owners.
                }

                break;
            }

            case 4:                     // Remove co-owner
            {
                if (isOwner)
                {
                    from.CloseGump(typeof(HouseGump));
                    from.CloseGump(typeof(HouseListGump));
                    from.CloseGump(typeof(HouseRemoveGump));
                    from.SendGump(new HouseRemoveGump(1011274, m_House.CoOwners, m_House));
                }
                else
                {
                    from.SendLocalizedMessage(501329);                                     // Only the house owner may remove co-owners.
                }

                break;
            }

            case 5:                     // Clear co-owners
            {
                if (isOwner)
                {
                    if (m_House.CoOwners != null)
                    {
                        m_House.CoOwners.Clear();
                    }

                    from.SendLocalizedMessage(501333);                                     // All co-owners have been removed from this house.
                }
                else
                {
                    from.SendLocalizedMessage(501330);                                     // Only the house owner may remove co-owners.
                }

                break;
            }

            case 6:                     // List friends
            {
                from.CloseGump(typeof(HouseGump));
                from.CloseGump(typeof(HouseListGump));
                from.CloseGump(typeof(HouseRemoveGump));
                from.SendGump(new HouseListGump(1011273, m_House.Friends, m_House));

                break;
            }

            case 7:                     // Add friend
            {
                if (isCoOwner)
                {
                    from.SendLocalizedMessage(501317);                                     // Target the person you wish to name a friend of your household.
                    from.Target = new HouseFriendTarget(true, m_House);
                }
                else
                {
                    from.SendLocalizedMessage(501316);                                     // Only the house owner may add friends.
                }

                break;
            }

            case 8:                     // Remove friend
            {
                if (isCoOwner)
                {
                    from.CloseGump(typeof(HouseGump));
                    from.CloseGump(typeof(HouseListGump));
                    from.CloseGump(typeof(HouseRemoveGump));
                    from.SendGump(new HouseRemoveGump(1011272, m_House.Friends, m_House));
                }
                else
                {
                    from.SendLocalizedMessage(501318);                                     // Only the house owner may remove friends.
                }

                break;
            }

            case 9:                     // Clear friends
            {
                if (isCoOwner)
                {
                    if (m_House.Friends != null)
                    {
                        m_House.Friends.Clear();
                    }

                    from.SendLocalizedMessage(501332);                                     // All friends have been removed from this house.
                }
                else
                {
                    from.SendLocalizedMessage(501319);                                     // Only the house owner may remove friends.
                }

                break;
            }

            case 10:                               // Ban
            {
                from.SendLocalizedMessage(501325); // Target the individual to ban from this house.
                from.Target = new HouseBanTarget(true, m_House);

                break;
            }

            case 11:                               // Eject
            {
                from.SendLocalizedMessage(501326); // Target the individual to eject from this house.
                from.Target = new HouseKickTarget(m_House);

                break;
            }

            case 12:                     // List bans
            {
                from.CloseGump(typeof(HouseGump));
                from.CloseGump(typeof(HouseListGump));
                from.CloseGump(typeof(HouseRemoveGump));
                from.SendGump(new HouseListGump(1011271, m_House.Bans, m_House));

                break;
            }

            case 13:                     // Remove ban
            {
                from.CloseGump(typeof(HouseGump));
                from.CloseGump(typeof(HouseListGump));
                from.CloseGump(typeof(HouseRemoveGump));
                from.SendGump(new HouseRemoveGump(1011269, m_House.Bans, m_House));

                break;
            }

            case 14:                     // Transfer ownership
            {
                if (isOwner)
                {
                    from.SendLocalizedMessage(501309);                                     // Target the person to whom you wish to give this house.
                    from.Target = new HouseOwnerTarget(m_House);
                }
                else
                {
                    from.SendLocalizedMessage(501310);                                     // Only the house owner may do this.
                }

                break;
            }

            case 15:                     // Demolish house
            {
                if (isOwner)
                {
                    if (m_House.FindGuildstone() != null)
                    {
                        from.SendLocalizedMessage(501389);                                         // You cannot redeed a house with a guildstone inside.
                    }
                    else
                    {
                        from.CloseGump(typeof(HouseDemolishGump));
                        from.SendGump(new HouseDemolishGump(from, m_House));
                    }
                }
                else
                {
                    from.SendLocalizedMessage(501320);                                     // Only the house owner may do this.
                }

                break;
            }

            case 16:                     // Change locks
            {
                //if ( m_House.Public )
                //{
                //from.SendLocalizedMessage( 501669 );// Public houses are always unlocked.
                //}
                //else
                {
                    if (isOwner)
                    {
                        m_House.RemoveKeys(from);
                        m_House.ChangeLocks(from);

                        from.SendLocalizedMessage(501306);                                         // The locks on your front door have been changed, and new master keys have been placed in your bank and your backpack.
                    }
                    else
                    {
                        from.SendLocalizedMessage(501303);                                         // Only the house owner may change the house locks.
                    }
                }

                break;
            }

            case 17:                     // Declare public/private
            {
                if (isOwner)
                {
                    if (m_House.Public && m_House.FindPlayerVendor() != null)
                    {
                        from.SendLocalizedMessage(501887);                                         // You have vendors working out of this building. It cannot be declared private until there are no vendors in place.
                        break;
                    }

                    if (m_House.Public && m_House.FindTownshipNPC() != null)
                    {
                        from.SendMessage("You have a township npc in this building.  It cannot be declared private.");
                        break;
                    }

                    /*if ( !m_House.Public && m_House.LockBoxCount > 0 )
                     * {
                     *      from.SendMessage( "You have LockBoxes in this building. It cannot be made public until they are removed." );
                     *      break;
                     * }*/

                    m_House.Public = !m_House.Public;

                    if (!m_House.Public)
                    {
                        m_House.RemoveKeys(from);
                        m_House.ChangeLocks(from);
                        from.SendLocalizedMessage(501888);                                         // This house is now private.
                        from.SendLocalizedMessage(501306);                                         // The locks on your front door have been changed, and new master keys have been placed in your bank and your backpack.
                    }
                    else
                    {
                        //m_House.RemoveKeys( from );
                        //m_House.RemoveLocks();
                        from.SendLocalizedMessage(501886);                                        //This house is now public. Friends of the house my now have vendors working out of this building.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(501307);                                     // Only the house owner may do this.
                }

                break;
            }

            case 18:                     // Change type
            {
                if (isOwner)
                {
                    if (m_House.Public && info.Switches.Length > 0)
                    {
                        int index = info.Switches[0] - 1;

                        if (index >= 0 && index < 53)
                        {
                            m_House.ChangeSignType(2980 + (index * 2));
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(501307);                                     // Only the house owner may do this.
                }

                break;
            }
            }
        }
Esempio n. 42
0
        public HouseGump(Mobile from, BaseHouse house)
            : base(20, 30)
        {
            if (house.Deleted)
            {
                return;
            }

            m_House = house;

            from.CloseGump(typeof(HouseGump));
            from.CloseGump(typeof(HouseListGump));
            from.CloseGump(typeof(HouseRemoveGump));

            bool isOwner   = m_House.IsOwner(from);
            bool isCoOwner = isOwner || m_House.IsCoOwner(from);
            bool isFriend  = isCoOwner || m_House.IsFriend(from);

            AddPage(0);

            if (isFriend)
            {
                AddBackground(0, 0, 420, 430, 5054);
                AddBackground(10, 10, 400, 410, 3000);
            }

            AddImage(130, 0, 100);

            if (m_House.Sign != null)
            {
                ArrayList lines = Wrap(m_House.Sign.Name);

                if (lines != null)
                {
                    for (int i = 0, y = (101 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14)
                    {
                        string s = (string)lines[i];

                        AddLabel(130 + ((143 - (s.Length * 8)) / 2), y, 0, s);
                    }
                }
            }

            if (!isFriend)
            {
                return;
            }

            AddHtmlLocalized(55, 103, 75, 20, 1011233, false, false);             // INFO
            AddButton(20, 103, 4005, 4007, 0, GumpButtonType.Page, 1);

            AddHtmlLocalized(170, 103, 75, 20, 1011234, false, false);             // FRIENDS
            AddButton(135, 103, 4005, 4007, 0, GumpButtonType.Page, 2);

            AddHtmlLocalized(295, 103, 75, 20, 1011235, false, false);             // OPTIONS
            AddButton(260, 103, 4005, 4007, 0, GumpButtonType.Page, 3);

            AddHtmlLocalized(295, 390, 75, 20, 1011441, false, false);              // EXIT
            AddButton(260, 390, 4005, 4007, 0, GumpButtonType.Reply, 0);

            AddHtmlLocalized(55, 390, 200, 20, 1011236, false, false);             // Change this house's name!
            AddButton(20, 390, 4005, 4007, 1, GumpButtonType.Reply, 0);

            // Info page
            AddPage(1);

            //const int fieldStartC = 260;	// Center
            const int fieldStartN = 120;                               // Near
            const int fieldStartF = 320;                               // Far

            AddHtmlLocalized(20, 135, 100, 20, 1011242, false, false); // Owned by:
            AddHtml(fieldStartN, 135, 100, 20, GetOwnerName(), false, false);

            // Angel Island House decay display - owner only.
            if (from.Account == m_House.Owner.Account || from.AccessLevel >= AccessLevel.GameMaster)
            {
                if (m_House.TownshipRestrictedRefresh)
                {                       // replace the entire "Decay Time" line
                    AddLabel(20, 155, 0x20, @"** NON TOWNSHIP HOUSE - WILL NOT REFRESH! **");
                }
                else
                {
                    AddHtml(20, 155, 100, 20, "Decay Time:", false, false);                     //time until decay
                    TimeSpan decay = m_House.StructureDecayTime - DateTime.Now;
                    int      days  = decay.Days;
                    double   hours = decay.Hours;
                    hours += ((double)decay.Minutes) / 60;
                    string decaystring = string.Format("{0} days, {1:0.0} hours", days, hours);
                    AddHtml(fieldStartN, 155, 300, 20, decaystring, false, false);
                }
            }

            int vstep = 175 - 20;

            AddHtml(20, vstep += 20, 275, 20, "Number of locked down items:", false, false);             // Number of locked down items:
            AddHtml(fieldStartF, vstep, 64, 20, String.Format("{0}/{1}", m_House.LockDownCount.ToString(), m_House.MaxLockDowns.ToString()), false, false);

            //AddHtmlLocalized(20, vstep += 20, 275, 20, 1011238, false, false); // Maximum locked down items:
            //AddHtml(320, vstep, 50, 20, m_House.MaxLockDowns.ToString(), false, false);

            AddHtml(20, vstep += 20, 275, 20, "Number of secure containers:", false, false);             // Number of secure containers:
            AddHtml(fieldStartF, vstep, 64, 20, String.Format("{0}/{1}", m_House.SecureCount.ToString(), m_House.MaxSecures.ToString()), false, false);

            //AddHtmlLocalized(20, vstep += 20, 275, 20, 1011240, false, false); // Maximum number of secure containers:
            //AddHtml(320, vstep, 50, 20, m_House.MaxSecures.ToString(), false, false);

            //if ( true /*!m_House.Public*/ )	// Public houses don't get LockBoxes.
            /*{*/
            AddHtml(20, vstep += 20, 275, 20, "Number of lockboxes:", false, false);
            AddHtml(fieldStartF, vstep, 64, 20, String.Format("{0}/{1}", m_House.LockBoxCount.ToString(), m_House.MaxLockBoxes.ToString()), false, false);

            //AddHtml(20, vstep += 20, 275, 20, "Maximum Number of LockBoxes:", false, false);
            //AddHtml(320, vstep, 50, 20, m_House.MaxLockBoxes.ToString(), false, false);

            AddHtml(20, vstep += 20, 275, 20, "Storage tax credits:", false, false);
            AddHtml(fieldStartF, vstep, 50, 20, m_House.StorageTaxCredits.ToString(), false, false);

            //AddHtmlLocalized( 20, 320, 400, 20, 1018032, false, false ); // This house is properly placed.
            //AddHtmlLocalized( 20, 340, 400, 20, 1018035, false, false ); // This house is of modern design.

            if (m_House.Public == true)
            {
                AddHtmlLocalized(20, vstep += 20, 275, 20, 1011241, false, false);                 // Number of visits this building has had
                AddHtml(fieldStartF, vstep, 50, 20, m_House.Visits.ToString(), false, false);
            }

            AddHtml(20, vstep += 20, 275, 20, "Barkeepers allowed:", false, false);
            AddHtml(fieldStartF, vstep, 50, 20, m_House.MaximumBarkeepCount.ToString(), false, false);

            if (m_House is Server.Multis.StaticHousing.StaticHouse)
            {
                Server.Multis.StaticHousing.StaticHouse sh = m_House as Server.Multis.StaticHousing.StaticHouse;
                //AddHtml(20, vstep += 20, 275, 20, "------------------", false, false);
                AddHtml(20, vstep += 20, 275, 20, "House designed by:", false, false);
                AddHtml(fieldStartF, vstep, 275, 20, sh.OriginalOwnerName, false, false);
                AddHtml(20, vstep += 20, 275, 20, "Designer license:", false, false);
                AddHtml(fieldStartF, vstep, 275, 20, "DL" + ((int)sh.OriginalOwnerSerial).ToString(), false, false);
                AddHtml(20, vstep += 20, 275, 20, "Version:", false, false);
                AddHtml(fieldStartF, vstep, 275, 20, sh.BlueprintVersion.ToString(), false, false);
                AddHtml(20, vstep += 20, 275, 20, "Last revision:", false, false);
                AddHtml(fieldStartF, vstep, 275, 20, sh.RevisionDate.ToShortDateString(), false, false);
            }

            /*}
             * else
             * {
             *      AddHtmlLocalized( 20, 260, 400, 20, 1018032, false, false ); // This house is properly placed.
             *      AddHtmlLocalized( 20, 280, 400, 20, 1018035, false, false ); // This house is of modern design.
             *
             *      // TODO: Validate exact placement
             *      AddHtmlLocalized( 20, 305, 275, 20, 1011241, false, false ); // Number of visits this building has had
             *      AddHtml( 320, 305, 50, 20, m_House.Visits.ToString(), false, false );
             * }*/

            // Friends page
            AddPage(2);

            AddHtmlLocalized(45, 130, 150, 20, 1011266, false, false);             // List of co-owners
            AddButton(20, 130, 2714, 2715, 2, GumpButtonType.Reply, 0);

            AddHtmlLocalized(45, 150, 150, 20, 1011267, false, false);             // Add a co-owner
            AddButton(20, 150, 2714, 2715, 3, GumpButtonType.Reply, 0);

            AddHtmlLocalized(45, 170, 150, 20, 1018036, false, false);             // Remove a co-owner
            AddButton(20, 170, 2714, 2715, 4, GumpButtonType.Reply, 0);

            AddHtmlLocalized(45, 190, 150, 20, 1011268, false, false);             // Clear co-owner list
            AddButton(20, 190, 2714, 2715, 5, GumpButtonType.Reply, 0);

            AddHtmlLocalized(225, 130, 155, 20, 1011243, false, false);             // List of Friends
            AddButton(200, 130, 2714, 2715, 6, GumpButtonType.Reply, 0);

            AddHtmlLocalized(225, 150, 155, 20, 1011244, false, false);             // Add a Friend
            AddButton(200, 150, 2714, 2715, 7, GumpButtonType.Reply, 0);

            AddHtmlLocalized(225, 170, 155, 20, 1018037, false, false);             // Remove a Friend
            AddButton(200, 170, 2714, 2715, 8, GumpButtonType.Reply, 0);

            AddHtmlLocalized(225, 190, 155, 20, 1011245, false, false);             // Clear Friends list
            AddButton(200, 190, 2714, 2715, 9, GumpButtonType.Reply, 0);

            AddHtmlLocalized(120, 215, 280, 20, 1011258, false, false);             // Ban someone from the house
            AddButton(95, 215, 2714, 2715, 10, GumpButtonType.Reply, 0);

            AddHtmlLocalized(120, 235, 280, 20, 1011259, false, false);             // Eject someone from the house
            AddButton(95, 235, 2714, 2715, 11, GumpButtonType.Reply, 0);

            AddHtmlLocalized(120, 255, 280, 20, 1011260, false, false);             // View a list of banned people
            AddButton(95, 255, 2714, 2715, 12, GumpButtonType.Reply, 0);

            AddHtmlLocalized(120, 275, 280, 20, 1011261, false, false);             // Lift a ban
            AddButton(95, 275, 2714, 2715, 13, GumpButtonType.Reply, 0);

            // Options page
            AddPage(3);

            if (m_House.GetFlag(BaseHouse.ImplFlags.ManagedDemolishion) == true)
            {
                DateTime ok_demo = m_House.BuiltOn + TimeSpan.FromDays(7.0);
                string   sx;
                sx = string.Format("You cannot transfer this house until: {0} ", ok_demo.ToShortDateString());
                AddHtml(45, 150, 355, 30, sx, false, false);                 // Transfer ownership of the house
                sx = string.Format("You cannot demolish this house until: {0}", ok_demo.ToShortDateString());
                AddHtml(45, 180, 355, 30, sx, false, false);                 // Demolish house and get deed back
            }
            else
            {
                AddHtmlLocalized(45, 150, 355, 30, 1011248, false, false);                 // Transfer ownership of the house
                AddButton(20, 150, 2714, 2715, 14, GumpButtonType.Reply, 0);

                AddHtmlLocalized(45, 180, 355, 30, 1011249, false, false);                 // Demolish house and get deed back
                AddButton(20, 180, 2714, 2715, 15, GumpButtonType.Reply, 0);
            }

            AddHtmlLocalized(45, 210, 355, 30, 1011247, false, false);             // Change the house locks
            AddButton(20, 210, 2714, 2715, 16, GumpButtonType.Reply, 0);

            if (!m_House.Public)
            {
                //AddHtmlLocalized( 45, 210, 355, 30, 1011247, false, false ); // Change the house locks
                //AddButton( 20, 210, 2714, 2715, 16, GumpButtonType.Reply, 0 );

                //AddHtmlLocalized( 45, 240, 350, 90, 1011253, false, false ); // Declare this building to be public. This will make your front door unlockable.
                AddHtml(45, 240, 350, 90, "Declare this building to be public.", false, false);                 // Declare this building to be public.
                AddButton(20, 240, 2714, 2715, 17, GumpButtonType.Reply, 0);
            }
            else
            {
                //AddHtmlLocalized( 45, 280, 350, 30, 1011250, false, false ); // Change the sign type
                AddHtmlLocalized(45, 210 + 30, 350, 30, 1011250, false, false);                 // Change the sign type
                AddButton(20, 210 + 30, 2714, 2715, 0, GumpButtonType.Page, 4);

                AddHtmlLocalized(45, 240 + 30, 350, 30, 1011252, false, false);                 // Declare this building to be private.
                AddButton(20, 240 + 30, 2714, 2715, 17, GumpButtonType.Reply, 0);

                // Change the sign type
                AddPage(4);

                for (int i = 0; i < 24; ++i)
                {
                    AddRadio(53 + ((i / 4) * 50), 137 + ((i % 4) * 35), 210, 211, false, i + 1);
                    AddItem(60 + ((i / 4) * 50), 130 + ((i % 4) * 35), 2980 + (i * 2));
                }

                AddHtmlLocalized(200, 305, 129, 20, 1011254, false, false);                 // Guild sign choices
                AddButton(350, 305, 252, 253, 0, GumpButtonType.Page, 5);

                AddHtmlLocalized(200, 340, 355, 30, 1011277, false, false);                 // Okay that is fine.
                AddButton(350, 340, 4005, 4007, 18, GumpButtonType.Reply, 0);

                AddPage(5);

                for (int i = 0; i < 29; ++i)
                {
                    AddRadio(53 + ((i / 5) * 50), 137 + ((i % 5) * 35), 210, 211, false, i + 25);
                    AddItem(60 + ((i / 5) * 50), 130 + ((i % 5) * 35), 3028 + (i * 2));
                }

                AddHtmlLocalized(200, 305, 129, 20, 1011255, false, false);                 // Shop sign choices
                AddButton(350, 305, 250, 251, 0, GumpButtonType.Page, 4);

                AddHtmlLocalized(200, 340, 355, 30, 1011277, false, false);                 // Okay that is fine.
                AddButton(350, 340, 4005, 4007, 18, GumpButtonType.Reply, 0);
            }
        }
Esempio n. 43
0
        public static bool BuyItem(Mobile buyer, MarketEntry entry)
        {
            if (buyer == null || !buyer.Alive)
            {
                buyer.SendMessage("You cannot purchase a market order while knocked out.");
            }
            else if (buyer == entry.Seller)
            {
                buyer.SendMessage("You cannot purchase something from yourself.");
            }
            else
            {
                IEntity entity = World.FindEntity(entry.ObjectSerial);

                if (entity == null || IsSold(entry))
                {
                    buyer.SendMessage("The order has expired.");
                }
                else
                {
                    Type[]    coinTypes      = new Type[] { Curr.typeofCopper, Curr.typeofSilver, Curr.typeofGold };
                    int[]     compressedCost = Curr.Compress(entry.Cost, 0, 0);
                    Container cont           = buyer.FindBankNoCreate();

                    if (cont != null && cont.ConsumeTotal(coinTypes, compressedCost) == -1)
                    {
                        if (entity is Item)
                        {
                            Item item = (Item)entity;
                            cont = buyer.Backpack;

                            if (cont != null && !cont.TryDropItem(buyer, item, false))
                            {
                                item.MoveToWorld(buyer.Location, buyer.Map);
                            }

                            CloseOrder(entry);

                            if (buyer.HasGump(typeof(MarketGump)))
                            {
                                buyer.CloseGump(typeof(MarketGump));
                                buyer.SendGump(new MarketGump(entry.Category, 0));
                            }

                            return(true);
                        }
                        else if (entity is Mobile)
                        {
                            Mobile mob = (Mobile)entity;
                            mob.Direction = (Direction)Utility.Random(8);
                            mob.MoveToWorld(buyer.Location, buyer.Map);
                            mob.PlaySound(mob.GetIdleSound());

                            if (mob is BaseCreature)
                            {
                                ((BaseCreature)mob).SetControlMaster(buyer);
                            }

                            CloseOrder(entry);

                            if (buyer.HasGump(typeof(MarketGump)))
                            {
                                buyer.CloseGump(typeof(MarketGump));
                                buyer.SendGump(new MarketGump(entry.Category, 0));
                            }

                            return(true);
                        }
                    }
                    else
                    {
                        buyer.SendMessage("You cannot afford that item.");
                    }
                }
            }

            return(false);
        }
Esempio n. 44
0
 protected override void OnTarget(Mobile from, object o)
 {
     if (!(o is PlayerMobile) || o == null)
     {
         from.SendMessage("Invalid target, must be a player.");
     }
     else
     {
         Mobile   t  = (Mobile)o;
         NetState ns = t.NetState;
         if (t.Deleted || t.Map == Map.Internal)
         {
             from.SendMessage("Invalid target, must be an online player.");
         }
         else if (t.AccessLevel != AccessLevel.Player)
         {
             from.SendMessage("Invalid target, not AccessLevel.Player.");
         }
         else if (ns == null)
         {
             from.SendMessage("Invalid target, this player is either disconnected or logging out.");
         }
         else
         {
             Account acct = t.Account as Account;
             if (acct != null)
             {
                 string   s_LastAFKCheck = acct.GetTag("LastAFKCheck");
                 DateTime LastAFKCheck   = DateTime.Now.Subtract(TimeSpan.FromHours(5));
                 if (s_LastAFKCheck != null)
                 {
                     try
                     {
                         LastAFKCheck = DateTime.Parse(s_LastAFKCheck);
                     }
                     catch { };
                 }
                 else
                 {
                     LastAFKCheck = DateTime.Now.Subtract(TimeSpan.FromHours(5));
                 }
                 if (DateTime.Now - LastAFKCheck > TimeSpan.FromHours(4) || tForce)
                 {
                     t.CloseGump(typeof(AFKCheckGump));
                     t.SendGump(new AFKCheckGump(from, t, 0, MaxRetries, 0, MaxSeconds, null, tKick, tJail, MoveToLoc, MoveToMap, WebSite, null));
                     from.SendMessage(1150, "AFK check gump sent to {0}.", t.Name);
                     CommandLogging.WriteLine(from, "{0} {1} Issuing AFK Check to: {2} ", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(t));
                     acct.SetTag("LastAFKCheck", DateTime.Now.ToString());
                     acct.SetTag("LastAFKCheckBy", from.Name);
                 }
                 else
                 {
                     from.SendMessage(36, "Last AFKCheck under 4 hours.");
                     from.SendMessage(36, "Use FORCE option.");
                     from.SendGump(new AFKInfoGump(t));
                 }
             }
             else
             {
                 from.SendMessage("Invalid target, Account property = null!");
             }
         }
     }
 }
Esempio n. 45
0
 public MyAuctionGump(Mobile m, AuctionGumpCallback callback) : base(50, 50)
 {
     m_Callback = callback;
     m.CloseGump(typeof(MyAuctionGump));
     MakeGump();
 }
Esempio n. 46
0
        public ChangeHairstyleGump(Mobile from, Mobile vendor, int price, bool facialHair, ChangeHairstyleEntry[] entries)
            : base(50, 50)
        {
            /* Gump structure is not totally OSI accurate. Anyway it looks fine! :) */

            m_From       = from;
            m_Vendor     = vendor;
            m_Price      = price;
            m_FacialHair = facialHair;
            m_Entries    = entries;

            from.CloseGump(typeof(HairstylistBuyGump));
            from.CloseGump(typeof(ChangeHairHueGump));
            from.CloseGump(typeof(ChangeHairstyleGump));

            int tableWidth   = (m_FacialHair ? 2 : 3);
            int tableHeight  = ((entries.Length + tableWidth - (m_FacialHair ? 1 : 2)) / tableWidth);
            int offsetWidth  = 123;
            int offsetHeight = (m_FacialHair ? 70 : 65);

            AddPage(0);

            AddBackground(0, 0, 81 + (tableWidth * offsetWidth), 105 + (tableHeight * offsetHeight), 2600);

            AddButton(45, 45 + (tableHeight * offsetHeight), 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(77, 45 + (tableHeight * offsetHeight), 90, 35, 1006044, false, false);                 // Ok

            AddButton(81 + (tableWidth * offsetWidth) - 120, 45 + (tableHeight * offsetHeight), 4005, 4007, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(81 + (tableWidth * offsetWidth) - 88, 45 + (tableHeight * offsetHeight), 90, 35, 1006045, false, false);                   // Cancel

            if (!facialHair)
            {
                AddHtmlLocalized(50, 15, 350, 20, 1018353, false, false);                   // <center>New Hairstyle</center>
            }
            else
            {
                AddHtmlLocalized(55, 15, 200, 20, 1018354, false, false);                   // <center>New Beard</center>
            }
            for (int i = 0; i < entries.Length; ++i)
            {
                int xTable = i % tableWidth;
                int yTable = i / tableWidth;

                if (entries[i].GumpID != 0)
                {
                    AddRadio(40 + (xTable * offsetWidth), 70 + (yTable * offsetHeight), 208, 209, false, i);
                    AddBackground(87 + (xTable * offsetWidth), 50 + (yTable * offsetHeight), 50, 50, 2620);
                    AddImage(87 + (xTable * offsetWidth) + entries[i].X, 50 + (yTable * offsetHeight) + entries[i].Y, entries[i].GumpID);
                }
                else
                {
                    int number = facialHair
                                                ? 1075521  // Clean Shaven
                                                : 1078149; // Bald (You will lose your hair color.)

                    if (xTable == 0)
                    {
                        AddRadio(40 + offsetWidth, 240, 208, 209, false, i);
                        AddHtmlLocalized(60 + offsetWidth, 240, 120, 35, number, false, false);
                    }
                    else
                    {
                        AddRadio(40 + (xTable * offsetWidth), 70 + (yTable * offsetHeight), 208, 209, false, i);
                        AddHtmlLocalized(60 + (xTable * offsetWidth), 70 + (yTable * offsetHeight), 120, 35, number, false, false);
                    }
                }
            }
        }
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            bool   CanBeUsed    = SGCore.SGSystemEnabled;
            bool   BeingUsed    = false;
            bool   Energy       = false;
            bool   HideAdd      = SGCore.SGSystemHideGate;
            string DiscoverName = "NooneYet"; // Just a temp filler (Avoid a null string)

            // Get value contained in the text input box
            string sgplatname = GetString(info, 21);

            switch (info.ButtonID)
            {
            case 1:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                sgaddonid = sgaddonid - 1;
                if (sgaddonid <= 1)
                {
                    sgaddonid = 1;
                }
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 2:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                sgaddonid = sgaddonid + 1;
                if (sgaddonid >= SGCore.SGAddonStyles)
                {
                    sgaddonid = SGCore.SGAddonStyles;
                }
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 3:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                if (sgdir == "East")
                {
                    sgdir = "S";
                }
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 4:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                if (sgdir == "South")
                {
                    sgdir = "E";
                }
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 5:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                addcode1 = addcode1 - 1;
                if (addcode1 <= 1)
                {
                    addcode1 = 1;
                }
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 6:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                addcode1 = addcode1 + 1;
                if (addcode1 >= 5)
                {
                    addcode1 = 5;
                }
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 7:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                addcode2 = addcode2 - 1;
                if (addcode2 <= 1)
                {
                    addcode2 = 1;
                }
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 8:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                addcode2 = addcode2 + 1;
                if (addcode2 >= 5)
                {
                    addcode2 = 5;
                }
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 9:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                addcode3 = addcode3 - 1;
                if (addcode3 <= 1)
                {
                    addcode3 = 1;
                }
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 10:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                addcode3 = addcode3 + 1;
                if (addcode3 >= 5)
                {
                    addcode3 = 5;
                }
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 11:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                addcode4 = addcode4 - 1;
                if (addcode4 <= 1)
                {
                    addcode4 = 1;
                }
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 12:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                addcode4 = addcode4 + 1;
                if (addcode4 >= 5)
                {
                    addcode4 = 5;
                }
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 13:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                addcode5 = addcode5 - 1;
                if (addcode5 <= 1)
                {
                    addcode5 = 1;
                }
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 14:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                addcode5 = addcode5 + 1;
                if (addcode5 >= 5)
                {
                    addcode5 = 5;
                }
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 15:
            {
                from.CloseGump(typeof(SGGumpAdministrator));

                bool dupedgate = false;

                // Check which map the person adding a gate is actually on
                string whichmap = Convert.ToString(from.Map);
                if (whichmap == "Felucca")
                {
                    facetid = 1;
                }
                if (whichmap == "Trammel")
                {
                    facetid = 2;
                }
                if (whichmap == "Ilshenar")
                {
                    facetid = 3;
                }
                if (whichmap == "Malas")
                {
                    facetid = 4;
                }
                if (whichmap == "Tokuno")
                {
                    facetid = 5;
                }

                // Check for duplicated addresses in the array
                for (int i = 0; i < SGCore.SGList.Count; i++)
                {
                    SGEntry sge = (SGEntry)SGCore.SGList[i];
                    {
                        if (sge.SGFacetCode == facetid && sge.SGAddressCode1 == addcode1 && sge.SGAddressCode2 == addcode2 && sge.SGAddressCode3 == addcode3 && sge.SGAddressCode4 == addcode4 && sge.SGAddressCode5 == addcode5)
                        {
                            dupedgate = true;
                        }
                    }
                }

                if (!dupedgate)
                {
                    if (sgdir == "South" && sgaddonid == 1)
                    {
                        sgdir = "S";
                        Item SGASouth = new SGLocationAddon1South();
                        SGASouth.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map);
                    }
                    if (sgdir == "East" && sgaddonid == 1)
                    {
                        sgdir = "E";
                        Item SGAEast = new SGLocationAddon1East();
                        SGAEast.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map);
                    }

                    if (sgdir == "South" && sgaddonid == 2)
                    {
                        sgdir = "S";
                        Item SGASouth = new SGLocationAddon2South();
                        SGASouth.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map);
                    }
                    if (sgdir == "East" && sgaddonid == 2)
                    {
                        sgdir = "E";
                        Item SGAEast = new SGLocationAddon2East();
                        SGAEast.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map);
                    }

                    if (sgdir == "South" && sgaddonid == 3)
                    {
                        sgdir = "S";
                        Item SGASouth = new SGLocationAddon3South();
                        SGASouth.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map);
                    }
                    if (sgdir == "East" && sgaddonid == 3)
                    {
                        sgdir = "E";
                        Item SGAEast = new SGLocationAddon3East();
                        SGAEast.MoveToWorld(new Point3D(from.X, from.Y, from.Z), from.Map);
                    }

                    Item SGACrystal = new SGActivatorDevice(from.X, from.Y, from.Z, sgdir, sgaddonid, CanBeUsed, BeingUsed, Energy, HideAdd, DiscoverName, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5);
                    SGACrystal.MoveToWorld(new Point3D(from.X + 2, from.Y - 2, from.Z), from.Map);

                    // Add facet symbol to world for this stargate control crystal
                    if (facetid == 1)
                    {
                        Item sgFIDsym = new SGFacetSymbol1(); sgFIDsym.MoveToWorld(new Point3D(from.Location.X + 1, from.Location.Y - 2, from.Location.Z), from.Map);
                    }
                    if (facetid == 2)
                    {
                        Item sgFIDsym = new SGFacetSymbol2(); sgFIDsym.MoveToWorld(new Point3D(from.Location.X + 1, from.Location.Y - 2, from.Location.Z), from.Map);
                    }
                    if (facetid == 3)
                    {
                        Item sgFIDsym = new SGFacetSymbol3(); sgFIDsym.MoveToWorld(new Point3D(from.Location.X + 1, from.Location.Y - 2, from.Location.Z), from.Map);
                    }
                    if (facetid == 4)
                    {
                        Item sgFIDsym = new SGFacetSymbol4(); sgFIDsym.MoveToWorld(new Point3D(from.Location.X + 1, from.Location.Y - 2, from.Location.Z), from.Map);
                    }
                    if (facetid == 5)
                    {
                        Item sgFIDsym = new SGFacetSymbol5(); sgFIDsym.MoveToWorld(new Point3D(from.Location.X + 1, from.Location.Y - 2, from.Location.Z), from.Map);
                    }

                    // Add 1st CODE symbol to the world
                    if (addcode1 == 1)
                    {
                        Item sgAC1sym = new SGAddressSymbol1(); sgAC1sym.MoveToWorld(new Point3D(from.Location.X - 2, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode1 == 2)
                    {
                        Item sgAC1sym = new SGAddressSymbol2(); sgAC1sym.MoveToWorld(new Point3D(from.Location.X - 2, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode1 == 3)
                    {
                        Item sgAC1sym = new SGAddressSymbol3(); sgAC1sym.MoveToWorld(new Point3D(from.Location.X - 2, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode1 == 4)
                    {
                        Item sgAC1sym = new SGAddressSymbol4(); sgAC1sym.MoveToWorld(new Point3D(from.Location.X - 2, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode1 == 5)
                    {
                        Item sgAC1sym = new SGAddressSymbol5(); sgAC1sym.MoveToWorld(new Point3D(from.Location.X - 2, from.Location.Y + 2, from.Location.Z), from.Map);
                    }

                    // Add 2nd CODE symbol to the world
                    if (addcode2 == 1)
                    {
                        Item sgAC2sym = new SGAddressSymbol1(); sgAC2sym.MoveToWorld(new Point3D(from.Location.X - 1, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode2 == 2)
                    {
                        Item sgAC2sym = new SGAddressSymbol2(); sgAC2sym.MoveToWorld(new Point3D(from.Location.X - 1, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode2 == 3)
                    {
                        Item sgAC2sym = new SGAddressSymbol3(); sgAC2sym.MoveToWorld(new Point3D(from.Location.X - 1, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode2 == 4)
                    {
                        Item sgAC2sym = new SGAddressSymbol4(); sgAC2sym.MoveToWorld(new Point3D(from.Location.X - 1, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode2 == 5)
                    {
                        Item sgAC2sym = new SGAddressSymbol5(); sgAC2sym.MoveToWorld(new Point3D(from.Location.X - 1, from.Location.Y + 2, from.Location.Z), from.Map);
                    }

                    // Add 3rd CODE symbol to the world
                    if (addcode3 == 1)
                    {
                        Item sgAC3sym = new SGAddressSymbol1(); sgAC3sym.MoveToWorld(new Point3D(from.Location.X, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode3 == 2)
                    {
                        Item sgAC3sym = new SGAddressSymbol2(); sgAC3sym.MoveToWorld(new Point3D(from.Location.X, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode3 == 3)
                    {
                        Item sgAC3sym = new SGAddressSymbol3(); sgAC3sym.MoveToWorld(new Point3D(from.Location.X, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode3 == 4)
                    {
                        Item sgAC3sym = new SGAddressSymbol4(); sgAC3sym.MoveToWorld(new Point3D(from.Location.X, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode3 == 5)
                    {
                        Item sgAC3sym = new SGAddressSymbol5(); sgAC3sym.MoveToWorld(new Point3D(from.Location.X, from.Location.Y + 2, from.Location.Z), from.Map);
                    }

                    // Add 4th CODE symbol to the world
                    if (addcode4 == 1)
                    {
                        Item sgAC4sym = new SGAddressSymbol1(); sgAC4sym.MoveToWorld(new Point3D(from.Location.X + 1, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode4 == 2)
                    {
                        Item sgAC4sym = new SGAddressSymbol2(); sgAC4sym.MoveToWorld(new Point3D(from.Location.X + 1, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode4 == 3)
                    {
                        Item sgAC4sym = new SGAddressSymbol3(); sgAC4sym.MoveToWorld(new Point3D(from.Location.X + 1, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode4 == 4)
                    {
                        Item sgAC4sym = new SGAddressSymbol4(); sgAC4sym.MoveToWorld(new Point3D(from.Location.X + 1, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode4 == 5)
                    {
                        Item sgAC4sym = new SGAddressSymbol5(); sgAC4sym.MoveToWorld(new Point3D(from.Location.X + 1, from.Location.Y + 2, from.Location.Z), from.Map);
                    }

                    // Add 5th CODE symbol to the world
                    if (addcode5 == 1)
                    {
                        Item sgAC5sym = new SGAddressSymbol1(); sgAC5sym.MoveToWorld(new Point3D(from.Location.X + 2, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode5 == 2)
                    {
                        Item sgAC5sym = new SGAddressSymbol2(); sgAC5sym.MoveToWorld(new Point3D(from.Location.X + 2, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode5 == 3)
                    {
                        Item sgAC5sym = new SGAddressSymbol3(); sgAC5sym.MoveToWorld(new Point3D(from.Location.X + 2, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode5 == 4)
                    {
                        Item sgAC5sym = new SGAddressSymbol4(); sgAC5sym.MoveToWorld(new Point3D(from.Location.X + 2, from.Location.Y + 2, from.Location.Z), from.Map);
                    }
                    if (addcode5 == 5)
                    {
                        Item sgAC5sym = new SGAddressSymbol5(); sgAC5sym.MoveToWorld(new Point3D(from.Location.X + 2, from.Location.Y + 2, from.Location.Z), from.Map);
                    }

                    SGCore.SGList.Add(new SGEntry(from.X, from.Y, from.Z, sgdir, sgaddonid, SGCore.SGSystemEnabled, false, false, SGCore.SGSystemHideGate, "Nobody", sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
                    from.Z = from.Z + 5;
                    from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));

                    if (!SGCore.SGSystemEnabled)
                    {
                        for (int i = 0; i < SGCore.SGList.Count; i++)
                        {
                            SGEntry sge = (SGEntry)SGCore.SGList[i];
                            {
                                sge.SGCanBeUsed = false;
                                sge.SGBeingUsed = false;
                                sge.SGEnergy    = false;
                            }
                        }
                        // Hue Control Crystals To DISABLED
                        ArrayList SGADevice = new ArrayList();
                        foreach (Item item in World.Items.Values)
                        {
                            if (item is SGActivatorDevice)
                            {
                                SGADevice.Add(item);
                            }
                        }

                        foreach (Item item in SGADevice)
                        {
                            (item).Hue = 39;
                        }
                    }
                    else if (SGCore.SGSystemEnabled)
                    {
                        for (int i = 0; i < SGCore.SGList.Count; i++)
                        {
                            SGEntry sge = (SGEntry)SGCore.SGList[i];
                            {
                                sge.SGCanBeUsed = true;
                                sge.SGBeingUsed = false;
                                sge.SGEnergy    = false;
                            }
                        }
                        // Hue Control Crystals To ENABLED
                        ArrayList SGADevice = new ArrayList();
                        foreach (Item item in World.Items.Values)
                        {
                            if (item is SGActivatorDevice)
                            {
                                SGADevice.Add(item);
                            }
                        }

                        foreach (Item item in SGADevice)
                        {
                            (item).Hue = 2963;
                        }
                    }
                }
                else
                {
                    // duped gate address
                    from.SendMessage(88, "ABORTED !!!, This gate address is already used on this facet, Try a different address for your gate.");
                    from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
                }
            }
            break;

            case 16:
            {
                from.CloseGump(typeof(SGGumpAdministrator));

                if (!SGCore.SGSystemEnabled)
                {
                    SGCore.SGSystemEnabled = true;
                    from.SendMessage(77, "Stargate System enabled.");
                    for (int i = 0; i < SGCore.SGList.Count; i++)
                    {
                        SGEntry sge = (SGEntry)SGCore.SGList[i];
                        {
                            sge.SGCanBeUsed = true;
                            sge.SGBeingUsed = false;
                            sge.SGEnergy    = false;
                        }
                    }
                    // Hue Control Crystals To NORMAL
                    ArrayList SGADevice = new ArrayList();
                    foreach (Item item in World.Items.Values)
                    {
                        if (item is SGActivatorDevice)
                        {
                            SGADevice.Add(item);
                        }
                    }

                    foreach (Item item in SGADevice)
                    {
                        (item).Hue = 2963;
                    }
                }
                else
                {
                    SGCore.SGSystemEnabled = false;
                    from.SendMessage(77, "Stargate System disabled, any open gates will close down after they are used.");
                    for (int i = 0; i < SGCore.SGList.Count; i++)
                    {
                        SGEntry sge = (SGEntry)SGCore.SGList[i];
                        {
                            sge.SGCanBeUsed = false;
                            sge.SGBeingUsed = false;
                            sge.SGEnergy    = false;
                        }
                    }
                    // Hue Control Crystals To DISABLED
                    ArrayList SGADevice = new ArrayList();
                    foreach (Item item in World.Items.Values)
                    {
                        if (item is SGActivatorDevice)
                        {
                            SGADevice.Add(item);
                        }
                    }

                    foreach (Item item in SGADevice)
                    {
                        (item).Hue = 39;
                    }
                }
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 17:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                from.SendMessage(77, "Saving XML File, Overwriting old XML file...");
                SGCore.SGTriggerSave();
                from.SendMessage(77, "Save Done.");
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 18:
            {
                from.CloseGump(typeof(SGGumpAdministrator));
                SGCore.SGTriggerLoad();
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 19:
            {
                from.SendMessage(77, "Exit Stargate Admin");
                from.CloseGump(typeof(SGGumpAdministrator));
            }
            break;

            case 20:
            {
                from.SendMessage(77, "Administrator Help & Information Option Selected...");
                from.CloseGump(typeof(SGGumpAdministratorInfo));
                from.SendGump(new SGGumpAdministratorInfo());

                from.CloseGump(typeof(SGGumpAdministrator));
                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;

            case 21:
            {
                from.CloseGump(typeof(SGGumpAdministrator));

                from.SendMessage(77, "Generate HTML Address File...");
                SGCore.SGGenHTML();
                from.SendMessage(77, "Done.");

                from.SendGump(new SGGumpAdministrator(from, sggatecounter, sgaddonid, sgdir, sgplatname, facetid, addcode1, addcode2, addcode3, addcode4, addcode5));
            }
            break;
            }
        }
Esempio n. 48
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            if (m_Book.Deleted || !from.InRange(m_Book.GetWorldLocation(), (Core.ML ? 3 : 1)) || !Multis.DesignContext.Check(from))
            {
                m_Book.Openers.Remove(from);
                return;
            }

            int buttonID = info.ButtonID;

            if (buttonID == 1)              // Rename book
            {
                if (!m_Book.IsLockedDown || from.AccessLevel >= AccessLevel.GameMaster)
                {
                    from.SendLocalizedMessage(502414);                       // Please enter a title for the runebook:
                    from.Prompt = new InternalPrompt(m_Book);
                }
                else
                {
                    m_Book.Openers.Remove(from);

                    from.SendLocalizedMessage(502413, null, 0x35);                       // That cannot be done while the book is locked down.
                }
            }
            else
            {
                buttonID -= 2;

                int index = buttonID / 6;
                int type  = buttonID % 6;

                if (index >= 0 && index < m_Book.Entries.Count)
                {
                    RunebookEntry e = (RunebookEntry)m_Book.Entries[index];

                    switch (type)
                    {
                    case 0:                             // Use charges
                    {
                        if (m_Book.CurCharges <= 0 && from.AccessLevel == AccessLevel.Player)
                        {
                            from.CloseGump(typeof(RunebookGump));
                            from.SendGump(new RunebookGump(from, m_Book));

                            from.SendLocalizedMessage(502412);                                               // There are no charges left on that item.
                        }
                        else
                        {
                            int  xLong = 0, yLat = 0;
                            int  xMins = 0, yMins = 0;
                            bool xEast = false, ySouth = false;

                            if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth))
                            {
                                string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W");
                                from.SendMessage(location);
                            }

                            m_Book.OnTravel();
                            new RecallSpell(from, m_Book, e, m_Book).Cast();

                            m_Book.Openers.Remove(from);
                        }

                        break;
                    }

                    case 1:                             // Drop rune
                    {
                        if (!m_Book.IsLockedDown || from.AccessLevel >= AccessLevel.GameMaster)
                        {
                            m_Book.DropRune(from, e, index);

                            from.CloseGump(typeof(RunebookGump));
                            from.SendGump(new RunebookGump(from, m_Book));
                        }
                        else
                        {
                            m_Book.Openers.Remove(from);

                            from.SendLocalizedMessage(502413, null, 0x35);                                               // That cannot be done while the book is locked down.
                        }

                        break;
                    }

                    case 2:                             // Set default
                    {
                        if (m_Book.CheckAccess(from))
                        {
                            m_Book.Default = e;

                            from.CloseGump(typeof(RunebookGump));
                            from.SendGump(new RunebookGump(from, m_Book));

                            from.SendLocalizedMessage(502417);                                               // New default location set.
                        }

                        break;
                    }

                    case 3:                             // Recall
                    {
                        if (HasSpell(from, 31) || from.AccessLevel > AccessLevel.Player)
                        {
                            int  xLong = 0, yLat = 0;
                            int  xMins = 0, yMins = 0;
                            bool xEast = false, ySouth = false;

                            if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth))
                            {
                                string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W");
                                from.SendMessage(location);
                            }

                            m_Book.OnTravel();
                            new RecallSpell(from, null, e, null).Cast();
                        }
                        else
                        {
                            from.SendLocalizedMessage(500015);                                               // You do not have that spell!
                        }

                        m_Book.Openers.Remove(from);

                        break;
                    }

                    case 4:                             // Gate
                    {
                        if (HasSpell(from, 51) || from.AccessLevel > AccessLevel.Player)
                        {
                            int  xLong = 0, yLat = 0;
                            int  xMins = 0, yMins = 0;
                            bool xEast = false, ySouth = false;

                            if (Sextant.Format(e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth))
                            {
                                string location = String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W");
                                from.SendMessage(location);
                            }

                            m_Book.OnTravel();
                            new GateTravelSpell(from, null, e).Cast();
                        }
                        else
                        {
                            from.SendLocalizedMessage(500015);                                               // You do not have that spell!
                        }

                        m_Book.Openers.Remove(from);

                        break;
                    }
                    }
                }
                else
                {
                    m_Book.Openers.Remove(from);
                }
            }
        }
Esempio n. 49
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            if (m_Book.Deleted || !from.InRange(m_Book.GetWorldLocation(), 1) || !Multis.DesignContext.Check(from))
            {
                return;
            }

            int buttonID = info.ButtonID;

            if (buttonID == 1)               // Add to Ledger
            {
                if (m_Book.Movable)
                {
                    from.SendMessage("What would you like to investigate?");
                    from.Target = new AddEntryTarget(m_Book);
                }
                else
                {
                    from.SendLocalizedMessage(502413);                       // That cannot be done while the book is locked down.
                }
            }
            else
            {
                buttonID -= 2;

                int index = buttonID / 6;
                int type  = buttonID % 6;

                if (index >= 0 && index < m_Book.Entries.Count)
                {
                    LedgerEntry e      = (LedgerEntry)m_Book.Entries[index];
                    Mobile      target = ((LedgerEntry)m_Book.Entries[index]).Mob;

                    switch (type)
                    {
                    case 0:                             // track (from index view)
                    {
                        if ((DateTime.Now - m_Book.m_LastUse) < UseDelay)
                        {
                            from.SendMessage("You must wait before using this again");
                        }
                        else
                        {
                            if (m_Book.Movable)
                            {
                                //set the last time the book was used!
                                m_Book.m_LastUse = DateTime.Now;

                                from.CloseGump(typeof(BountyLedgerGump));
                                //from.SendGump( new BountyLedgerGump( from, m_Book ) );

                                double Forensics   = from.Skills[SkillName.Forensics].Base;
                                double Tracking    = from.Skills[SkillName.Tracking].Base;
                                double Hiding      = target.Skills[SkillName.Hiding].Base;
                                double Stealth     = target.Skills[SkillName.Stealth].Base;
                                double fromskill   = (Forensics + Tracking) / 2;
                                double targetskill = (Hiding + Stealth) / 2;

                                bool success = false;


                                //if ( fromskill >= targetskill )
                                //	success = true;
                                if (targetskill <= 0)
                                {
                                    targetskill = 0.01;
                                }
                                double chance       = (fromskill + 20) / (targetskill * 2);
                                double randomdouble = Utility.RandomDouble();

                                if (from.CanSee(target))
                                {
                                    chance = 1;
                                }

                                if (target.AccessLevel > AccessLevel.Player)
                                {
                                    chance = 0;
                                }

                                //debug message
                                if (from.AccessLevel > AccessLevel.Player)
                                {
                                    from.SendMessage("Your chance to track {0} is {1:0.00} ({2:0.00})", target.Name, chance, randomdouble);
                                }

                                if (chance > randomdouble)
                                {
                                    success = true;
                                }

                                int area = 3 * (int)fromskill;

                                if (success)
                                {
                                    if (from.InRange(target, area))
                                    {
                                        from.SendMessage("You are now hunting {0}!", target.Name);
                                        from.QuestArrow = new SkillHandlers.TrackArrow(from, target, area);
                                    }
                                    else
                                    {
                                        from.SendMessage("You don't believe {0} is in this area.", target.Name);
                                    }
                                }
                                else
                                {
                                    from.SendMessage("You are not intuitive enough to find them.");
                                }
                            }
                            else
                            {
                                from.SendLocalizedMessage(502413);                                           // That cannot be done while the book is locked down.
                            }
                        }

                        break;
                    }

                    case 1:                             // remove
                    {
                        if (m_Book.Movable)
                        {
                            m_Book.RemoveEntry(from, e, index);
                        }
                        else
                        {
                            from.SendMessage("That item is inaccessible.");
                        }

                        break;
                    }

/*		this was the page-by-page view "track" button, and it was redundant.-smerX
 *
 *                                              case 2: // track
 *                                              {
 *                                                      if ( m_Book.Movable )
 *                                                      {
 *                                                              m_Book.Default = e;
 *
 *                                                              from.CloseGump( typeof( BountyLedgerGump ) );
 *                                                              from.SendGump( new BountyLedgerGump( from, m_Book ) );
 *
 *                                                              double Forensics = from.Skills[SkillName.Forensics].Base;
 *                                                              double Tracking = from.Skills[SkillName.Tracking].Base;
 *                                                              double Hiding = target.Skills[SkillName.Hiding].Base;
 *                                                              double Stealth = target.Skills[SkillName.Stealth].Base;
 *                                                              double fromskill = (Forensics + Tracking)/2;
 *                                                              double targetskill = (Hiding + Stealth)/2;
 *
 *                                                              bool succeded = false;
 *
 *                                                              if ( fromskill > targetskill + 10 )
 *                                                                      succeded = true;
 *
 *                                                              int area = 3 * (int)fromskill;
 *
 *                                                              if ( succeded )
 *                                                              {
 *                                                                      from.SendMessage( "You are now hunting {0}!", target.Name );
 *                                                                      from.QuestArrow = new SkillHandlers.TrackArrow( from, target, area );
 *                                                              }
 *                                                              else
 *                                                              {
 *                                                                      from.SendMessage( "You are not intuative enough to find them." );
 *                                                              }
 *
 *
 *                                                      }
 *                                                      else
 *                                                      {
 *                                                              from.SendLocalizedMessage( 502413 ); // That cannot be done while the book is locked down.
 *                                                      }
 *
 *                                                      break;
 *                                              }
 */                 default:
                    {
                        break;
                    }
                    }
                }
            }
        }
Esempio n. 50
0
        private CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page) : base(40, 40)
        {
            m_From        = from;
            m_CraftSystem = craftSystem;
            m_Tool        = tool;
            m_Page        = page;

            CraftContext context = craftSystem.GetContext(from);

            from.CloseGump(typeof(CraftGump));
            from.CloseGump(typeof(CraftGumpItem));

            AddPage(0);

            AddBackground(0, 0, 530, 437, 5054);
            AddImageTiled(10, 10, 510, 22, 2624);              //
            AddImageTiled(10, 292, 150, 45, 2624);             //
            AddImageTiled(165, 292, 355, 45, 2624);
            AddImageTiled(10, 342, 510, 85, 2624);
            AddImageTiled(10, 37, 200, 250, 2624);
            AddImageTiled(215, 37, 305, 250, 2624);
            AddAlphaRegion(10, 10, 510, 417);

            if (craftSystem.GumpTitleNumber > 0)
            {
                AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false);
            }

            else
            {
                AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false);
            }

            AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor, false, false);               // <CENTER>CATEGORIES</CENTER>
            AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor, false, false);              // <CENTER>SELECTIONS</CENTER>
            AddHtmlLocalized(10, 302, 150, 25, 1044012, LabelColor, false, false);              // <CENTER>NOTICES</CENTER>

            int textHue        = 2499;
            int highlightColor = 2599;

            //Guide
            AddButton(10, 0, 2094, 2095, 1000, GumpButtonType.Reply, 0);
            AddLabel(35, 5, textHue, "Guide");

            #region Left Side Button Controls

            //Smelt Mode
            if (craftSystem.Recycle)
            {
                AddButton(15, 342, 4005, 4007, GetButtonID(6, 9), GumpButtonType.Reply, 0);

                switch (context.RecycleOption)
                {
                case CraftRecycleOption.RecycleItem: AddLabel(50, 345, textHue, "Recycle Mode: Single Item"); break;

                case CraftRecycleOption.RecycleAllNonExceptional: AddLabel(50, 345, textHue, "Recycle Mode: All Non-Exceptional"); break;

                case CraftRecycleOption.RecycleAll: AddLabel(50, 345, textHue, "Recycle Mode: All"); break;
                }
            }

            //Smelt Button
            if (craftSystem.Recycle)
            {
                AddButton(15, 362, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0);

                if (context.RecycleOption == CraftRecycleOption.RecycleItem)
                {
                    AddLabel(50, 365, textHue, "Recycle Item");
                }
                else
                {
                    AddLabel(50, 365, textHue, "Recyle Items (Select Type)");
                }
            }

            //Repair Button
            if (craftSystem.Repair)
            {
                AddButton(15, 382, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0);
                AddLabel(50, 385, textHue, "Repair Item");
            }

            //Exit Button
            AddButton(15, 402, 4017, 4019, 0, GumpButtonType.Reply, 0);
            AddLabel(50, 405, textHue, "Exit");

            #endregion

            #region Right Side Button Controls

            //Material Selection
            if (craftSystem.CraftSubRes.Init)
            {
                string nameString = craftSystem.CraftSubRes.NameString;
                int    nameNumber = craftSystem.CraftSubRes.NameNumber;

                int resIndex = (context == null ? -1 : context.LastResourceIndex);

                Type resourceType = craftSystem.CraftSubRes.ResType;

                if (resIndex > -1)
                {
                    CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex);

                    nameString   = subResource.NameString;
                    nameNumber   = subResource.NameNumber;
                    resourceType = subResource.ItemType;
                }

                int resourceCount = 0;

                if (from.Backpack != null)
                {
                    Item[] items = from.Backpack.FindItemsByType(resourceType, true);

                    for (int i = 0; i < items.Length; ++i)
                    {
                        resourceCount += items[i].Amount;
                    }
                }

                AddButton(270, 342, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0);
                AddLabel(305, 345, textHue, nameString + " (" + resourceCount + " Available)");
            }

            // Highlight Skillgain
            AddButton(270, 362, 4005, 4007, GetButtonID(6, 10), GumpButtonType.Reply, 0);

            if (context.HighlightSkillGainItems)
            {
                AddLabel(305, 365, highlightColor, "Highlight Skillgain Items");
            }
            else
            {
                AddLabel(305, 365, textHue, "Do Not Highlight Skillgain Items");
            }

            // Mark Button
            if (craftSystem.MarkOption)
            {
                AddButton(270, 382, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0);

                if (context == null)
                {
                    AddLabel(305, 385, textHue, "Do Not Mark");
                }

                else
                {
                    switch (context.MarkOption)
                    {
                    case CraftMarkOption.DoNotMark: AddLabel(305, 385, textHue, "Do Not Mark"); break;

                    case CraftMarkOption.MarkItem: AddLabel(305, 385, textHue, "Mark Item");  break;

                    case CraftMarkOption.PromptForMark: AddLabel(305, 385, textHue, "Prompt For Mark"); break;
                    }
                }
            }

            //Make Last
            AddButton(270, 402, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0);
            AddLabel(305, 405, textHue, "Make Last Item");

            #endregion

            if (notice is int && (int)notice > 0)
            {
                AddHtmlLocalized(170, 295, 350, 40, (int)notice, LabelColor, false, false);
            }

            else if (notice is string)
            {
                AddHtml(170, 295, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false);
            }

            CreateGroupList();

            if (page == CraftPage.PickResource)
            {
                CreateResList(false, from);
            }

            else if (page == CraftPage.PickResource2)
            {
                CreateResList(true, from);
            }

            else if (context != null && context.LastGroupIndex > -1)
            {
                CreateItemList(context.LastGroupIndex);
            }
        }
Esempio n. 51
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            base.OnSpeech(e);

            Mobile from = e.Mobile;
            Item   sign = m_House.Sign;

            bool isOwner   = m_House.IsOwner(from);
            bool isCoOwner = isOwner || m_House.IsCoOwner(from);
            bool isFriend  = isCoOwner || m_House.IsFriend(from);

            if (!isFriend)
            {
                return;
            }

            if (!from.Alive)
            {
                return;
            }

            if (Core.ML && Insensitive.Equals(e.Speech, "I wish to resize my house"))
            {
                if (from.Map != sign.Map || !from.InRange(sign, 0))
                {
                    from.SendLocalizedMessage(500295); // you are too far away to do that.
                }
                else if (DateTime.UtcNow <= m_House.BuiltOn.AddHours(1))
                {
                    from.SendLocalizedMessage(1080178); // You must wait one hour between each house demolition.
                }
                else if (isOwner)
                {
                    from.CloseGump(typeof(ConfirmHouseResize));
                    from.CloseGump(typeof(HouseGumpAOS));
                    from.SendGump(new ConfirmHouseResize(from, m_House));
                }
                else
                {
                    from.SendLocalizedMessage(501320); // Only the house owner may do
                }
            }

            if (!m_House.IsInside(from) || !m_House.IsActive)
            {
                return;
            }

            else if (e.HasKeyword(0x33)) // remove thyself
            {
                if (isFriend)
                {
                    from.SendLocalizedMessage(501326); // Target the individual to eject from this house.
                    from.Target = new HouseKickTarget(m_House);
                }
                else
                {
                    from.SendLocalizedMessage(502094); // You must be in your house to do this.
                }
            }
            else if (e.HasKeyword(0x34)) // I ban thee
            {
                if (!isFriend)
                {
                    from.SendLocalizedMessage(502094); // You must be in your house to do this.
                }
                else if (!m_House.Public && m_House.IsAosRules)
                {
                    from.SendLocalizedMessage(1062521); // You cannot ban someone from a private house.  Revoke their access instead.
                }
                else
                {
                    from.SendLocalizedMessage(501325); // Target the individual to ban from this house.
                    from.Target = new HouseBanTarget(true, m_House);
                }
            }
            else if (e.HasKeyword(0x23)) // I wish to lock this down
            {
                if (isCoOwner)
                {
                    from.SendLocalizedMessage(502097); // Lock what down?
                    from.Target = new LockdownTarget(false, m_House);
                }
                else if (isFriend)
                {
                    from.SendLocalizedMessage(1010587); // You are not a co-owner of this house.
                }
                else
                {
                    from.SendLocalizedMessage(502094); // You must be in your house to do this.
                }
            }
            else if (e.HasKeyword(0x24)) // I wish to release this
            {
                if (isCoOwner)
                {
                    from.SendLocalizedMessage(502100); // Choose the item you wish to release
                    from.Target = new LockdownTarget(true, m_House);
                }
                else if (isFriend)
                {
                    from.SendLocalizedMessage(1010587); // You are not a co-owner of this house.
                }
                else
                {
                    from.SendLocalizedMessage(502094); // You must be in your house to do this.
                }
            }
            else if (e.HasKeyword(0x25)) // I wish to secure this
            {
                if (isOwner)
                {
                    from.SendLocalizedMessage(502103); // Choose the item you wish to secure
                    from.Target = new SecureTarget(false, m_House);
                }
                else
                {
                    from.SendLocalizedMessage(502094); // You must be in your house to do this.
                }
            }
            else if (e.HasKeyword(0x26)) // I wish to unsecure this
            {
                if (isOwner)
                {
                    from.SendLocalizedMessage(502106); // Choose the item you wish to unsecure
                    from.Target = new SecureTarget(true, m_House);
                }
                else
                {
                    from.SendLocalizedMessage(502094); // You must be in your house to do this.
                }
            }
            else if (e.HasKeyword(0x27)) // I wish to place a strongbox
            {
                if (isOwner)
                {
                    from.SendLocalizedMessage(502109); // Owners do not get a strongbox of their own.
                }
                else if (isCoOwner)
                {
                    m_House.AddStrongBox(from);
                }
                else if (isFriend)
                {
                    from.SendLocalizedMessage(1010587); // You are not a co-owner of this house.
                }
                else
                {
                    from.SendLocalizedMessage(502094); // You must be in your house to do this.
                }
            }
            else if (e.HasKeyword(0x28)) // trash barrel
            {
                if (isCoOwner)
                {
                    m_House.AddTrashBarrel(from);
                }
                else if (isFriend)
                {
                    from.SendLocalizedMessage(1010587); // You are not a co-owner of this house.
                }
                else
                {
                    from.SendLocalizedMessage(502094); // You must be in your house to do this.
                }
            }
        }
Esempio n. 52
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile m_Player = ( Mobile )sender.Mobile;

            if (m_Player == null)
            {
                return;
            }

            switch (info.ButtonID)
            {
            case 0:
            {
                ForumCore.Threads.Sort(new DateSort());
                m_Player.CloseGump(typeof(ForumGump));
                m_Player.SendGump(new ForumGump(m_Player, 0));
                break;
            }

            case 1:
            {
                if (m_NewThread)
                {
                    TextRelay topic = info.GetTextEntry(2);
                    TextRelay post  = info.GetTextEntry(3);

                    int[] switches = info.Switches;

                    bool staff        = false;
                    bool sticky       = false;
                    bool announcement = false;

                    for (int i = 0; i < switches.Length; i++)
                    {
                        if (switches[i] == 4)
                        {
                            staff = true;
                        }
                        if (switches[i] == 5)
                        {
                            sticky = true;
                        }
                        if (switches[i] == 6)
                        {
                            announcement = true;
                        }
                    }

                    if (sticky && announcement)
                    {
                        m_Player.SendMessage("Since you checked both sticky and announcement, this post was changed to sticky by default!");
                        announcement = false;
                    }

                    if (topic.Text.Length < ForumCore.MinPostCharactersCount)
                    {
                        m_Player.SendMessage("The subject of the post must be more then {0} characters in length.", ForumCore.MinPostCharactersCount.ToString());
                        m_Player.SendGump(this);
                        break;
                    }

                    if (post.Text.Length < ForumCore.MinPostCharactersCount)
                    {
                        m_Player.SendMessage("The content of the post must be more then {0} characters in length.", ForumCore.MinPostCharactersCount.ToString());
                        m_Player.SendGump(this);
                        break;
                    }

                    if (post.Text.Length > ForumCore.MaxPostCharactersCount)
                    {
                        m_Player.SendMessage("The content of the post must be less then {0} characters in length.", ForumCore.MaxPostCharactersCount.ToString());
                        m_Player.SendGump(new PostGump(m_Player, post.Text));
                        break;
                    }

                    ThreadType type;

                    if (sticky)
                    {
                        type = ThreadType.Sticky;
                    }
                    else if (announcement)
                    {
                        type = ThreadType.Announcement;
                    }
                    else
                    {
                        type = ThreadType.RegularThread;
                    }

                    PostEntry   pe = new PostEntry(m_Player, m_Player.Serial, post.Text, DateTime.Now);
                    ThreadEntry te = new ThreadEntry(topic.Text, pe, m_Player, DateTime.Now, ForumCore.ThreadNumber, type);

                    if (staff)
                    {
                        te.StaffMessage = true;
                    }

                    te.LastPostTime = DateTime.Now;

                    ForumCore.Threads.Add(te);
                    ForumCore.UpdatePlayerStatistics(m_Player);

                    ForumCore.Threads.Sort(new DateSort());
                    m_Player.CloseGump(typeof(ForumGump));
                    m_Player.SendGump(new ForumGump(m_Player, 0));
                }
                else
                {
                    TextRelay post = info.GetTextEntry(3);
                    PostEntry pe   = new PostEntry(m_Player, m_Player.Serial, post.Text, DateTime.Now);

                    m_ThreadEntry.AddPost(pe);
                    m_ThreadEntry.LastPostTime = DateTime.Now;
                    ForumCore.UpdatePlayerStatistics(m_Player);

                    ForumCore.Threads.Sort(new DateSort());
                    m_Player.CloseGump(typeof(ForumGump));
                    m_Player.SendGump(new ForumGump(m_Player, 0));
                }

                break;
            }

            case 7:
            {
                if (m_NewThread)
                {
                    TextRelay topic = info.GetTextEntry(2);

                    if (topic.Text.Length < ForumCore.MinPostCharactersCount)
                    {
                        m_Player.SendMessage("The subject of the post must be more then {0} characters in length.", ForumCore.MinPostCharactersCount.ToString());
                        m_Player.SendGump(this);
                        break;
                    }
                    m_Topic    = topic.Text;
                    m_Switches = info.Switches;
                }

                m_Player.Prompt = new LongPostLinesPrompt(this, m_Player);
                break;
            }
            }
        }
Esempio n. 53
0
        public FacetGump(Mobile owner)
            : base(10, 10)
        {
            owner.CloseGump(typeof(FacetGump));

            int gumpX = 0;
            int gumpY = 0;

            // bool initialState = false;

            m_Owner = owner;

            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            AddPage(0);

            gumpX = 0;
            gumpY = 0;
            AddBackground(gumpX, gumpY, 150, 150, 0xA3C);

            gumpX = 30;
            gumpY = 10;
            AddLabel(gumpX, gumpY, 965, "Felucca");

            gumpX = 30;
            gumpY = 30;
            AddLabel(gumpX, gumpY, 965, "Trammel");

            gumpX = 30;
            gumpY = 50;
            AddLabel(gumpX, gumpY, 965, "Ilshenar");

            gumpX = 30;
            gumpY = 70;
            AddLabel(gumpX, gumpY, 965, "Malas");

            gumpX = 30;
            gumpY = 90;
            AddLabel(gumpX, gumpY, 965, "Tokuno");

            gumpX = 30;
            gumpY = 110;
            AddLabel(gumpX, gumpY, 965, "TerMur");

            gumpX = 10;
            gumpY = 10;
            AddButton(gumpX, gumpY, 0xA9A, 0xA9A, 1, GumpButtonType.Reply, 0);

            gumpX = 10;
            gumpY = 30;
            AddButton(gumpX, gumpY, 0xA9A, 0xA9A, 2, GumpButtonType.Reply, 0);

            gumpX = 10;
            gumpY = 50;
            AddButton(gumpX, gumpY, 0xA9A, 0xA9A, 3, GumpButtonType.Reply, 0);

            gumpX = 10;
            gumpY = 70;
            AddButton(gumpX, gumpY, 0xA9A, 0xA9A, 4, GumpButtonType.Reply, 0);

            gumpX = 10;
            gumpY = 90;
            AddButton(gumpX, gumpY, 0xA9A, 0xA9A, 5, GumpButtonType.Reply, 0);

            gumpX = 10;
            gumpY = 110;
            AddButton(gumpX, gumpY, 0xA9A, 0xA9A, 6, GumpButtonType.Reply, 0);
        }
Esempio n. 54
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (!from.Alive)
                {
                    from.SendLocalizedMessage(500331);                       // The spirits of the dead are not the province of animal lore.
                }
                else if (targeted is HenchmanMonster || targeted is HenchmanWizard || targeted is HenchmanFighter || targeted is HenchmanArcher)
                {
                    from.SendLocalizedMessage(500329);                       // That's not an animal!
                }
                else if (targeted is BaseCreature)
                {
                    BaseCreature c = (BaseCreature)targeted;

                    SlayerEntry skipTypeA = SlayerGroup.GetEntryByName(SlayerName.SlimyScourge);
                    SlayerEntry skipTypeB = SlayerGroup.GetEntryByName(SlayerName.ElementalBan);
                    SlayerEntry skipTypeC = SlayerGroup.GetEntryByName(SlayerName.Repond);
                    SlayerEntry skipTypeD = SlayerGroup.GetEntryByName(SlayerName.Silver);
                    SlayerEntry skipTypeE = SlayerGroup.GetEntryByName(SlayerName.GiantKiller);
                    SlayerEntry skipTypeF = SlayerGroup.GetEntryByName(SlayerName.GolemDestruction);

                    if (!c.IsDeadPet)
                    {
                        if (!skipTypeA.Slays(c) && !skipTypeB.Slays(c) && !skipTypeC.Slays(c) && !skipTypeD.Slays(c) && !skipTypeE.Slays(c) && !skipTypeF.Slays(c))
                        {
                            if (c.ControlMaster == from)
                            {
                                from.CloseGump(typeof(AnimalLoreGump));
                                from.SendGump(new AnimalLoreGump(c, 0));
                            }
                            else if ((!c.Controlled || !c.Tamable) && from.Skills[SkillName.AnimalLore].Value < 100.0)
                            {
                                from.SendLocalizedMessage(1049674);                                   // At your skill level, you can only lore tamed creatures.
                            }
                            else if (!c.Tamable && from.Skills[SkillName.AnimalLore].Value < 110.0)
                            {
                                from.SendLocalizedMessage(1049675);                                   // At your skill level, you can only lore tamed or tameable creatures.
                            }
                            else if (!from.CheckTargetSkill(SkillName.AnimalLore, c, 0.0, 120.0))
                            {
                                from.SendLocalizedMessage(500334);                                   // You can't think of anything you know offhand.
                            }
                            else
                            {
                                from.CloseGump(typeof(AnimalLoreGump));
                                from.SendGump(new AnimalLoreGump(c, 0));
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(500329);                               // That's not an animal!
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500331);                           // The spirits of the dead are not the province of animal lore.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500329);                       // That's not an animal!
                }
            }
Esempio n. 55
0
        public ItemStoneGump(Mobile from, ItemStone stone, ItemStoneGroup[] usergroup, ItemStoneGroup selected) : base(155, 50)
        {
            m_Mobile = from;
            m_Stone  = stone;

            if (usergroup != null)
            {
                m_Groups = usergroup;
            }

            m_Selected = selected;

            m_Mobile.CloseGump(typeof(ItemStoneGump));

            AddPage(0);

            int headerSpace = 65;
            int bodySpace   = (m_Groups.Length * 25);

            if (selected != null)
            {
                bodySpace += (selected.Items.Length * 20);
            }

            int footerSpace = 110;

            int totalHeight = headerSpace + bodySpace + footerSpace;

            AddBackground(0, 0, 330, totalHeight, 5054);

            AddImageTiled(10, 10, 310, 20, 2624);
            AddAlphaRegion(10, 10, 310, 20);

            AddHtml(10, 10, 310, 20, "<BASEFONT COLOR=\"#FFFFFF\"><CENTER>Mythik Item Menu</CENTER></BASEFONT>", false, false);

            AddImageTiled(10, 35, 310, 20, 2624);
            AddAlphaRegion(10, 35, 310, 20);

            AddHtml(195, 35, 60, 20, "<BASEFONT COLOR=\"#FFFFFF\"><CENTER>Amount</CENTER></BASEFONT>", false, false);
            AddHtml(260, 35, 60, 20, "<BASEFONT COLOR=\"#FFFFFF\"><CENTER>Price</CENTER></BASEFONT>", false, false);

            AddImageTiled(10, 60, 180, bodySpace, 2624);
            AddAlphaRegion(10, 60, 180, bodySpace);

            AddImageTiled(195, 60, 60, bodySpace, 2624);
            AddAlphaRegion(195, 60, 60, bodySpace);

            AddImageTiled(260, 60, 60, bodySpace, 2624);
            AddAlphaRegion(260, 60, 60, bodySpace);

            AddImageTiled(10, headerSpace + bodySpace, 310, 75, 2624);
            AddAlphaRegion(10, headerSpace + bodySpace, 310, 75);

            AddImageTiled(10, headerSpace + bodySpace + 80, 180, 20, 2624);
            AddAlphaRegion(10, headerSpace + bodySpace + 80, 180, 20);

            AddImageTiled(195, headerSpace + bodySpace + 80, 125, 20, 2624);
            AddAlphaRegion(195, headerSpace + bodySpace + 80, 125, 20);

            int y = 65;

            for (int i = 0; i < m_Groups.Length; ++i)
            {
                ItemStoneGroup group = m_Groups[i];

                if (group != selected)
                {
                    AddButton(15, y + 2, 0x15E1, 0x15E5, GetButtonID(0, i), GumpButtonType.Reply, 0);
                }
                else
                {
                    AddLabel(15, y, 0x1153, "*");
                }

                AddHtml(35, y, 180, 25, String.Format("<BASEFONT COLOR=\"#FFFFFF\">{0}</BASEFONT>", group.Name), false, false);

                if (group == selected)
                {
                    for (int j = 0; j < group.Items.Length; ++j)
                    {
                        y += 20;

                        ItemStoneInfo info = group.Items[j];

                        AddLabel(40, y, 0x481, info.Name);
                        TextEntry(200, y, 50, 20, j, info.Amount.ToString());
                        AddLabel(265, y, 0x481, String.Format("{0}", info.Price + m_Stone.Markup));
                    }
                }

                y += 25;
            }

            int price = GetCost();
            int tax   = GetTax(price);
            int total = price + tax;

            AddHtml(200, headerSpace + bodySpace, 110, 20, String.Format("<BASEFONT COLOR=\"#FFFFFF\">Cost: {0}</CENTER></BASEFONT>", price), false, false);
            AddHtml(200, headerSpace + bodySpace + 20, 110, 20, String.Format("<BASEFONT COLOR=\"#FFFFFF\">Tax: {0}</CENTER></BASEFONT>", tax), false, false);
            AddHtml(200, headerSpace + bodySpace + 55, 110, 20, String.Format("<BASEFONT COLOR=\"#FFFFFF\">Total: {0}</CENTER></BASEFONT>", total), false, false);

            AddHtml(15, headerSpace + bodySpace + 80, 170, 20, String.Format("<BASEFONT COLOR=\"#FFFFFF\">Tax: {0}%    Markup: +{1}</BASEFONT>", m_Stone.Tax, m_Stone.Markup), false, false);

            AddHtml(230, headerSpace + bodySpace + 80, 70, 20, "<BASEFONT COLOR=\"#FFFFFF\"><CENTER>Purchase</CENTER></BASEFONT>", false, false);
            AddButton(300, headerSpace + bodySpace + 82, 0x15E1, 0x15E5, GetButtonID(0, 100), GumpButtonType.Reply, 0);

            AddHtml(35, headerSpace + bodySpace, 155, 20, "<BASEFONT COLOR=\"#FFFFFF\">50 Reagents</BASEFONT>", false, false);
            AddButton(15, headerSpace + bodySpace + 2, 0x15E1, 0x15E5, GetButtonID(0, 101), GumpButtonType.Reply, 0);

            AddHtml(35, headerSpace + bodySpace + 20, 155, 20, "<BASEFONT COLOR=\"#FFFFFF\">100 Reagents</BASEFONT>", false, false);
            AddButton(15, headerSpace + bodySpace + 22, 0x15E1, 0x15E5, GetButtonID(0, 102), GumpButtonType.Reply, 0);
        }
Esempio n. 56
0
        //--------------------------------------------------------------------------------------------------------------
        public override void OnResponse(NetState state, RelayInfo info)           //Function for GumpButtonType.Reply Buttons
        {
            Mobile       from   = state.Mobile;
            PlayerMobile pm     = from as PlayerMobile;
            PlayerModule module = pm.PlayerModule;             //This is a null check.

            Item ET = from.Backpack.FindItemByType(typeof(ExpToken));

            //string nofunds = "You do not have enough gold pieces in your backpack.";
            string notokens = "You do not have enough experience tokens in your backpack.";
            string given    = "Your reward item has been placed in your backpack.";

            switch (info.ButtonID)
            {
            case 0:                     //Cancel
            {
                from.SendMessage("You stop viewing your level information");
                break;
            }

            case 1:                    //Quick Stats Menu
            {
                from.SendMessage("You Open your quick status.");
                from.CloseGump(typeof(EasyLevelGump));
                from.SendGump(new LevelStatusGump(from));
                break;
            }

            case 4:                     //Skill point reward gump
            {
                from.SendGump(new SkillPointRewardGump(from));
                from.SendMessage("You open the skill point reward system...");
                break;
            }

            case 5:                     //Brazier Bottom
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount1))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new BrazierBottom());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 6:                     //Brazier No Bottom
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount2))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new BrazierNoBottom());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 7:                     //Curtain South
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount2))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new CurtainWhiteRight());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 8:                     //Curtain East
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount2))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new CurtainWhiteLeft());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 9:                     //Candle stub
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount2))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new CandleStub());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 10:                     //no boot Skeleton
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount3))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new NoBootSkeleton());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 11:                     //Boot Skeleton
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount4))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new BootsSkeleton());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 12:                     //Meaty Skeleton
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount5))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new MeatySkeleton());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 13:                     //Guillotine
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount6))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new Guillotine());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 14:                     //Open Maiden
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount6))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new OpenIronMaiden());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 15:                     //Closed Maiden
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount6))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new ClosedIronMaiden());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 16:                     //Skull Spikes
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount6))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new SkullSpikes());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 17:                     //Dragon Silk shirt
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount7))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new DragonSilkShirt());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 18:                     //Cloak of Magician
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount7))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new CloakOfTheMagician());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 19:                     //Spider Silk Pants
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount7))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new SpiderSilkPants());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 20:                     //Orc Skin Shoes
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount7))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new OrcSkinShoes());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 21:                     //wizards hat intel
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount7))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new WizardsHatOfIntelligence());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 22:                     //shroud of magician
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount7))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new ShroudOfTheMagician());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 23:                     //serpent fang earrings
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount7))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new SerpentFangEarrings());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 24:                     //Brace of Leaders
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount7))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new BraceletOfLeaders());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 25:                     //warriors ring o luck
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount7))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new WarriorsRingOfLuck());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 26:                     //Pickaxe of the Ages
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount8))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new PickaxeOfTheAges());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }

            case 27:                     //gloves of the shadows
            {
                if (ET != null)
                {
                    if (from.Backpack.ConsumeTotal(typeof(ExpToken), m_Amount8))
                    {
                        from.SendMessage("{0}", given);
                        from.AddToBackpack(new GlovesOfTheShadows());
                    }
                    else
                    {
                        from.SendMessage(47, "{0}", notokens);
                    }
                }
                else
                {
                    from.SendMessage(47, "{0}", notokens);
                }
                break;
            }
            }
        }
Esempio n. 57
0
        public MobFactionsRewardGump(Mobile from, int page) : base(20, 30)
        {
            from.CloseGump(typeof(MobFactionsRewardGump));

            // determine the gump size based on the number of rewards

            Rewards = XmlMobFactionsRewards.RewardsList;

            viewpage = page;

            int height = maxItemsPerPage * y_inc + 120;
            int width  = x_factionoffset + 180;

            /*
             * if(Rewards != null && Rewards.Count > 0)
             * {
             *  height = Rewards.Count*y_inc + 120;
             * }
             */

            AddBackground(0, 0, width, height, 0xDAC);

            AddHtml(30, 20, 350, 50, "Rewards Available for Purchase with Mob Faction Credits", false, false);

            AddLabel(440, 20, 0, String.Format("Available Credits: {0}", XmlMobFactions.GetCredits(from)));

            //AddButton( 30, height - 35, 0xFB7, 0xFB9, 0, GumpButtonType.Reply, 0 );
            //AddLabel( 70, height - 35, 0, "Close" );

            // put the page buttons in the lower right corner
            if (Rewards != null && Rewards.Count > 0)
            {
                AddLabel(width - 165, height - 35, 0, String.Format("Page: {0}/{1}", viewpage + 1, (int)(Rewards.Count / maxItemsPerPage) + 1));

                // page up and down buttons
                AddButton(width - 55, height - 35, 0x15E0, 0x15E4, 13, GumpButtonType.Reply, 0);
                AddButton(width - 35, height - 35, 0x15E2, 0x15E6, 12, GumpButtonType.Reply, 0);
            }


            AddLabel(70, 50, 40, "Reward");
            AddLabel(x_creditoffset, 50, 40, "Credits");

            AddLabel(x_factionoffset, 50, 40, "Minimum Required Faction");

            // display the items with their selection buttons
            if (Rewards != null)
            {
                int y = 50;
                for (int i = 0; i < Rewards.Count; i++)
                {
                    if ((int)(i / maxItemsPerPage) != viewpage)
                    {
                        continue;
                    }

                    XmlMobFactionsRewards r = Rewards[i] as XmlMobFactionsRewards;
                    if (r == null)
                    {
                        continue;
                    }

                    y += y_inc;

                    int texthue = 0;

                    bool meetsrequirement = true;

                    // display the item
                    if (r.RequiredFaction != XmlMobFactions.GroupTypes.End_Unused)
                    {
                        if (XmlMobFactions.GetFactionLevel(from, r.RequiredFaction) > r.MinFaction)
                        {
                            meetsrequirement = true;
                        }
                        else
                        {
                            meetsrequirement = false;
                            texthue          = 33;
                        }

                        // display the faction requirement
                        AddLabel(x_factionoffset, y + 3, texthue, r.RequiredFaction.ToString());
                        AddLabel(x_factionoffset + 110, y + 3, texthue, r.MinFaction.ToString());
                    }

                    // display the name
                    AddLabel(70, y + 3, texthue, r.Name);

                    // display the cost
                    AddLabel(x_creditoffset, y + 3, texthue, r.Cost.ToString());

                    // display the item
                    if (r.ItemID > 0)
                    {
                        AddItem(x_creditoffset + 60, y, r.ItemID);
                    }

                    if (meetsrequirement)
                    {
                        // add the selection button
                        AddButton(30, y, 0xFA5, 0xFA7, 1000 + i, GumpButtonType.Reply, 0);
                    }
                }
            }
        }
Esempio n. 58
0
        public void EndHeal()
        {
            StopHeal();

            int  healerNumber = -1, patientNumber = -1;
            bool playSound   = true;
            bool checkSkills = false;

            SkillName primarySkill   = GetPrimarySkill(m_Healer, m_Patient);
            SkillName secondarySkill = GetSecondarySkill(m_Healer, m_Patient);

            BaseCreature petPatient = m_Patient as BaseCreature;

            if (!m_Healer.Alive)
            {
                healerNumber  = 500962; // You were unable to finish your work before you died.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Healer.InRange(m_Patient, Bandage.Range))
            {
                healerNumber  = 500963; // You did not stay close enough to heal your target.
                patientNumber = -1;
                playSound     = false;
            }
            else if (!m_Patient.Alive || (petPatient != null && petPatient.IsDeadPet))
            {
                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 68.0) / 50.0) - (m_Slips * 0.02);

                if (((checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble()) ||
                    (Engines.VvV.ViceVsVirtueSystem.Enabled && petPatient is Engines.VvV.VvVMount && petPatient.ControlMaster == m_Healer))
                {
                    if (m_Patient.Map == null || !m_Patient.Map.CanFit(m_Patient.Location, 16, false, false))
                    {
                        healerNumber  = 501042; // Target can not be resurrected at that location.
                        patientNumber = 502391; // Thou can not be resurrected there!
                    }
                    else if (m_Patient.Region != null && m_Patient.Region.IsPartOf("Khaldun"))
                    {
                        healerNumber  = 1010395; // The veil of death in this area is too strong and resists thy efforts to restore life.
                        patientNumber = -1;
                    }
                    else
                    {
                        healerNumber  = 500965; // You are able to resurrect your patient.
                        patientNumber = -1;

                        m_Patient.PlaySound(0x214);
                        m_Patient.FixedEffect(0x376A, 10, 16);

                        if (petPatient != null && petPatient.IsDeadPet)
                        {
                            Mobile master = petPatient.ControlMaster;

                            if (master != null && m_Healer == master)
                            {
                                petPatient.ResurrectPet();

                                for (int i = 0; i < petPatient.Skills.Length; ++i)
                                {
                                    petPatient.Skills[i].Base -= 0.1;
                                }
                            }
                            else if (master != null && master.InRange(petPatient, 3))
                            {
                                healerNumber = 1049658; // The owner has been asked to sanctify the resurrection.

                                master.CloseGump(typeof(PetResurrectGump));
                                master.SendGump(new PetResurrectGump(m_Healer, petPatient));
                            }
                            else
                            {
                                bool found = false;

                                List <Mobile> friends = petPatient.Friends;

                                for (int i = 0; friends != null && i < friends.Count; ++i)
                                {
                                    Mobile friend = friends[i];

                                    if (friend.InRange(petPatient, 3))
                                    {
                                        healerNumber = 1049658; // The owner has been asked to sanctify the resurrection.

                                        friend.CloseGump(typeof(PetResurrectGump));
                                        friend.SendGump(new PetResurrectGump(m_Healer, petPatient));

                                        found = true;
                                        break;
                                    }
                                }

                                if (!found)
                                {
                                    healerNumber = 1049659; // Neither the owner or friends of the pet are nearby to sanctify the resurrection.
                                }
                            }
                        }
                        else
                        {
                            m_Patient.CloseGump(typeof(ResurrectGump));
                            m_Patient.SendGump(new ResurrectGump(m_Patient, m_Healer));
                        }
                    }
                }
                else
                {
                    if (petPatient != null && petPatient.IsDeadPet)
                    {
                        healerNumber = 503256; // You fail to resurrect the creature.
                    }
                    else
                    {
                        healerNumber = 500966; // You are unable to resurrect your patient.
                    }

                    patientNumber = -1;
                }
            }
            else if (m_Patient.Poisoned)
            {
                m_Healer.SendLocalizedMessage(500969); // You finish applying the bandages.

                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;
                double chance  = ((healing - 30.0) / 50.0) - (m_Patient.Poison.RealLevel * 0.1) - (m_Slips * 0.02);

                if ((checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble())
                {
                    if (m_Patient.CurePoison(m_Healer))
                    {
                        healerNumber  = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons.
                        patientNumber = 1010059;                                // You have been cured of all poisons.
                    }
                    else
                    {
                        healerNumber  = -1;
                        patientNumber = -1;
                    }
                }
                else
                {
                    healerNumber  = 1010060; // You have failed to cure your target!
                    patientNumber = -1;
                }
            }
            else if (BleedAttack.IsBleeding(m_Patient))
            {
                healerNumber  = 1060088; // You bind the wound and stop the bleeding
                patientNumber = 1060167; // The bleeding wounds have healed, you are no longer bleeding!

                BleedAttack.EndBleed(m_Patient, false);
            }
            else if (MortalStrike.IsWounded(m_Patient))
            {
                healerNumber  = (m_Healer == m_Patient ? 1005000 : 1010398);
                patientNumber = -1;
                playSound     = false;
            }
            else if (m_Patient.Hits == m_Patient.HitsMax)
            {
                healerNumber  = 500967; // You heal what little damage your patient had.
                patientNumber = -1;
            }
            else
            {
                checkSkills   = true;
                patientNumber = -1;

                double healing = m_Healer.Skills[primarySkill].Value;
                double anatomy = m_Healer.Skills[secondarySkill].Value;

                FirstAidBelt belt = m_Healer.FindItemOnLayer(Layer.Waist) as FirstAidBelt;

                if (belt != null)
                {
                    m_HealingBonus += belt.HealingBonus;
                }

                Item item = m_Healer.FindItemOnLayer(Layer.TwoHanded);

                if (item is Asclepius || item is GargishAsclepius)
                {
                    m_HealingBonus += 15;
                }

                if (m_HealingBonus > 0)
                {
                    healing += m_HealingBonus;
                }

                double chance = ((healing + 10.0) / 100.0) - (m_Slips * 0.02);

                if (chance > Utility.RandomDouble())
                {
                    healerNumber = 500969; // You finish applying the bandages.

                    double min = (anatomy / 8.0) + (healing / 5.0) + 4.0;
                    double max = (anatomy / 6.0) + (healing / 2.5) + 4.0;

                    double toHeal = min + (Utility.RandomDouble() * (max - min));

                    if (m_Patient.Body.IsMonster || m_Patient.Body.IsAnimal)
                    {
                        toHeal += m_Patient.HitsMax / 100;
                    }

                    toHeal -= toHeal * m_Slips * 0.35; // TODO: Verify algorithm

                    if (Engines.CityLoyalty.CityLoyaltySystem.HasTradeDeal(m_Healer, Engines.CityLoyalty.TradeDeal.GuildOfHealers))
                    {
                        toHeal += (int)Math.Ceiling(toHeal * 0.05);
                    }

                    if (m_HealedPoisonOrBleed > 0)
                    {
                        toHeal /= m_HealedPoisonOrBleed;
                    }

                    if (SearingWounds.IsUnderEffects(m_Patient))
                    {
                        toHeal /= 2;
                        m_Patient.SendLocalizedMessage(1151178); // The cauterized wound resists some of your healing.
                    }

                    if (toHeal < 1)
                    {
                        toHeal       = 1;
                        healerNumber = 500968; // You apply the bandages, but they barely help.
                    }
                    else if (m_Patient != m_Healer && m_Patient is PlayerMobile && m_Healer is PlayerMobile)
                    {
                        SpiritualityVirtue.OnHeal(m_Healer, Math.Min((int)toHeal, m_Patient.HitsMax - m_Patient.Hits));
                    }

                    m_Patient.Heal((int)toHeal, m_Healer, false);
                }
                else
                {
                    healerNumber = 500968; // You apply the bandages, but they barely help.
                    playSound    = false;
                }
            }

            if (healerNumber != -1)
            {
                m_Healer.SendLocalizedMessage(healerNumber);
            }

            if (patientNumber != -1)
            {
                m_Patient.SendLocalizedMessage(patientNumber);
            }

            if (playSound)
            {
                m_Patient.PlaySound(0x57);
            }

            if (checkSkills)
            {
                m_Healer.CheckSkill(secondarySkill, 0.0, 120.0);
                m_Healer.CheckSkill(primarySkill, 0.0, 120.0);
            }

            if (m_Patient is PlayerMobile)
            {
                BuffInfo.RemoveBuff(m_Healer, BuffIcon.Healing);
            }
            else
            {
                BuffInfo.RemoveBuff(m_Healer, BuffIcon.Veterinary);
            }
        }
Esempio n. 59
0
        private CraftGump(Mobile from, CraftSystem craftSystem, BaseTool tool, object notice, CraftPage page)
            : base(40, 40)
        {
            this.m_From        = from;
            this.m_CraftSystem = craftSystem;
            this.m_Tool        = tool;
            this.m_Page        = page;

            CraftContext context = craftSystem.GetContext(from);

            from.CloseGump(typeof(CraftGump));
            from.CloseGump(typeof(CraftGumpItem));

            this.AddPage(0);

            this.AddBackground(0, 0, 550, 587, 5054);
            this.AddImageTiled(10, 10, 530, 22, 2624);   //Section for Gump Heading
            this.AddImageTiled(10, 375, 132, 45, 2624);  //Section for Notices
            this.AddImageTiled(146, 375, 395, 45, 2624); //Section across from Notices
            this.AddImageTiled(10, 422, 530, 155, 2624); //Section where Exit is
            this.AddImageTiled(10, 37, 200, 335, 2624);  //Section for Categories
            this.AddImageTiled(215, 37, 325, 335, 2624); //Section for Sublisted Items
            this.AddAlphaRegion(10, 10, 530, 567);

            if (craftSystem.GumpTitleNumber > 0)
            {
                this.AddHtmlLocalized(10, 12, 510, 20, craftSystem.GumpTitleNumber, LabelColor, false, false);
            }
            else
            {
                this.AddHtml(10, 12, 510, 20, craftSystem.GumpTitleString, false, false);
            }

            this.AddHtmlLocalized(10, 37, 200, 22, 1044010, LabelColor, false, false);  // <CENTER>CATEGORIES</CENTER>
            this.AddHtmlLocalized(215, 37, 305, 22, 1044011, LabelColor, false, false); // <CENTER>SELECTIONS</CENTER>
            this.AddHtmlLocalized(10, 385, 150, 25, 1044012, LabelColor, false, false); // <CENTER>NOTICES</CENTER>

            this.AddButton(15, 542, 4017, 4019, 0, GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(50, 545, 150, 18, 1011441, LabelColor, false, false); // EXIT

            this.AddButton(270, 542, 4005, 4007, GetButtonID(6, 2), GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(305, 545, 150, 18, 1044013, LabelColor, false, false); // MAKE LAST

            this.AddButton(270, 522, 4005, 4007, GetButtonID(6, 10), GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(305, 525, 150, 18, 1112533 + (context == null ? 0 : (int)context.QuestOption), LabelColor, false, false); // QUEST ITEM

            this.AddButton(115, 542, 4017, 4019, GetButtonID(6, 11), GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(150, 545, 150, 18, 1112698, LabelColor, false, false); // CANCEL MAKE

            // Mark option
            if (craftSystem.MarkOption)
            {
                this.AddButton(270, 462, 4005, 4007, GetButtonID(6, 6), GumpButtonType.Reply, 0);
                this.AddHtmlLocalized(305, 465, 150, 18, 1044017 + (context == null ? 0 : (int)context.MarkOption), LabelColor, false, false); // MARK ITEM
            }
            // ****************************************

            // Resmelt option
            if (craftSystem.Resmelt)
            {
                this.AddButton(15, 442, 4005, 4007, GetButtonID(6, 1), GumpButtonType.Reply, 0);
                this.AddHtmlLocalized(50, 445, 150, 18, 1044259, LabelColor, false, false); // SMELT ITEM
            }
            // ****************************************

            // Repair option
            if (craftSystem.Repair)
            {
                this.AddButton(270, 442, 4005, 4007, GetButtonID(6, 5), GumpButtonType.Reply, 0);
                this.AddHtmlLocalized(305, 445, 150, 18, 1044260, LabelColor, false, false); // REPAIR ITEM
            }
            // ****************************************

            // Enhance option
            if (craftSystem.CanEnhance)
            {
                this.AddButton(270, 482, 4005, 4007, GetButtonID(6, 8), GumpButtonType.Reply, 0);
                this.AddHtmlLocalized(305, 485, 150, 18, 1061001, LabelColor, false, false); // ENHANCE ITEM
            }
            // ****************************************

            // Alter option
            if (craftSystem.CanAlter)
            {
                this.AddButton(270, 502, 4005, 4007, GetButtonID(6, 9), GumpButtonType.Reply, 0);
                this.AddHtmlLocalized(304, 505, 1152, 18, 1094726, LabelColor, false, false);                 // ALTER ITEM
            }
            // ****************************************

            if (notice is int && (int)notice > 0)
            {
                this.AddHtmlLocalized(170, 377, 350, 40, (int)notice, LabelColor, false, false);
            }
            else if (notice is string)
            {
                this.AddHtml(170, 377, 350, 40, String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice), false, false);
            }

            // If the system has more than one resource
            if (craftSystem.CraftSubRes.Init)
            {
                string nameString = craftSystem.CraftSubRes.NameString;
                int    nameNumber = craftSystem.CraftSubRes.NameNumber;

                int resIndex = (context == null ? -1 : context.LastResourceIndex);

                Type resourceType = craftSystem.CraftSubRes.ResType;

                if (resIndex > -1)
                {
                    CraftSubRes subResource = craftSystem.CraftSubRes.GetAt(resIndex);

                    nameString   = subResource.NameString;
                    nameNumber   = subResource.NameNumber;
                    resourceType = subResource.ItemType;
                }

                int resourceCount = 0;

                if (from.Backpack != null)
                {
                    Item[] items = from.Backpack.FindItemsByType(resourceType, true);

                    for (int i = 0; i < items.Length; ++i)
                    {
                        resourceCount += items[i].Amount;
                    }
                }

                this.AddButton(15, 462, 4005, 4007, GetButtonID(6, 0), GumpButtonType.Reply, 0);

                if (nameNumber > 0)
                {
                    this.AddHtmlLocalized(50, 465, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false);
                }
                else
                {
                    this.AddLabel(50, 465, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount));
                }
            }
            // ****************************************

            // For dragon scales
            if (craftSystem.CraftSubRes2.Init)
            {
                string nameString = craftSystem.CraftSubRes2.NameString;
                int    nameNumber = craftSystem.CraftSubRes2.NameNumber;

                int resIndex = (context == null ? -1 : context.LastResourceIndex2);

                Type resourceType = craftSystem.CraftSubRes2.ResType;

                if (resIndex > -1)
                {
                    CraftSubRes subResource = craftSystem.CraftSubRes2.GetAt(resIndex);

                    nameString   = subResource.NameString;
                    nameNumber   = subResource.NameNumber;
                    resourceType = subResource.ItemType;
                }

                int resourceCount = 0;

                if (from.Backpack != null)
                {
                    Item[] items = from.Backpack.FindItemsByType(resourceType, true);

                    for (int i = 0; i < items.Length; ++i)
                    {
                        resourceCount += items[i].Amount;
                    }
                }

                this.AddButton(15, 482, 4005, 4007, GetButtonID(6, 7), GumpButtonType.Reply, 0);

                if (nameNumber > 0)
                {
                    this.AddHtmlLocalized(50, 485, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false);
                }
                else
                {
                    this.AddLabel(50, 485, LabelHue, String.Format("{0} ({1} Available)", nameString, resourceCount));
                }
            }
            // ****************************************

            this.CreateGroupList();

            if (page == CraftPage.PickResource)
            {
                this.CreateResList(false, from);
            }
            else if (page == CraftPage.PickResource2)
            {
                this.CreateResList(true, from);
            }
            else if (context != null && context.LastGroupIndex > -1)
            {
                this.CreateItemList(context.LastGroupIndex);
            }
        }
Esempio n. 60
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            if (Book.Deleted || !from.InRange(Book.GetWorldLocation(), 3) || !Multis.DesignContext.Check(from))
            {
                Book.Openers.Remove(from);
                return;
            }

            int buttonID = info.ButtonID;

            if (buttonID == 0) // Close
            {
                Book.Openers.Remove(from);
            }
            else if (buttonID == 1) // Rename book
            {
                if (Book.CheckAccess(from) && Book.Movable != false)
                {
                    from.Prompt = new InternalPrompt(Book);
                }
                else
                {
                    Book.Openers.Remove(from);

                    from.SendLocalizedMessage(502413); // That cannot be done while the book is locked down.
                }
            }
            else
            {
                int index = buttonID % 25;
                int type  = buttonID / 25;

                if (type == 0 || type == 1)
                {
                    index = buttonID - 10;
                }

                if (Book.Entries.ElementAtOrDefault(index) != null)
                {
                    if (index >= 0 && index < Book.Entries.Count)
                    {
                        RunebookEntry e = Book.Entries[index];

                        switch (type)
                        {
                        case 0:
                        case 1:     // Use charges
                        {
                            if (Book.CurCharges <= 0)
                            {
                                from.CloseGump(typeof(RunebookGump));
                                from.SendGump(new RunebookGump(from, Book));

                                from.SendLocalizedMessage(502412);         // There are no charges left on that item.
                            }
                            else
                            {
                                SendLocationMessage(e, from);

                                Book.OnTravel();
                                new RecallSpell(from, Book, e, Book).Cast();

                                Book.Openers.Remove(from);
                            }

                            break;
                        }

                        case 8:     // Drop rune
                        {
                            if (Book.CheckAccess(from) && Book.Movable != false)
                            {
                                Book.DropRune(from, e, index);

                                from.CloseGump(typeof(RunebookGump));
                                from.SendGump(new RunebookGump(from, Book));
                            }
                            else
                            {
                                Book.Openers.Remove(from);

                                from.SendLocalizedMessage(502413);         // That cannot be done while the book is locked down.
                            }

                            break;
                        }

                        case 12:     // Set default
                        {
                            if (Book.CheckAccess(from))
                            {
                                Book.Default = e;

                                from.CloseGump(typeof(RunebookGump));
                                from.SendGump(new RunebookGump(from, Book));

                                from.SendLocalizedMessage(502417, "", 0x35);         // New default location set.

                                Book.Openers.Remove(from);
                            }
                            else
                            {
                                from.SendLocalizedMessage(502413);         // That cannot be done while the book is locked down.
                            }

                            break;
                        }

                        case 2:     // Recall
                        {
                            if (HasSpell(from, 31))
                            {
                                SendLocationMessage(e, from);

                                Book.OnTravel();
                                new RecallSpell(from, null, e, null).Cast();
                            }
                            else
                            {
                                from.SendLocalizedMessage(500015);         // You do not have that spell!
                            }

                            Book.Openers.Remove(from);

                            break;
                        }

                        case 4:     // Gate
                        {
                            if (HasSpell(from, 51))
                            {
                                SendLocationMessage(e, from);

                                Book.OnTravel();
                                new GateTravelSpell(from, null, e).Cast();
                            }
                            else
                            {
                                from.SendLocalizedMessage(500015);         // You do not have that spell!
                            }

                            Book.Openers.Remove(from);

                            break;
                        }

                        case 3:     // Sacred Journey
                        {
                            if (HasSpell(from, 209))
                            {
                                SendLocationMessage(e, from);

                                Book.OnTravel();
                                new SacredJourneySpell(from, null, e, null).Cast();
                            }
                            else
                            {
                                from.SendLocalizedMessage(500015);         // You do not have that spell!
                            }

                            Book.Openers.Remove(from);

                            break;
                        }

                        default:
                            break;
                        }
                    }
                    else
                    {
                        Book.Openers.Remove(from);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502423); // This place in the book is empty.
                    Book.Openers.Remove(from);
                }
            }
        }