public override void OnResponse( NetState state, RelayInfo info ) 
      		{ 
			Mobile from = state.Mobile; 

			if ( from == null )
				return;

        		if ( info.ButtonID == 1 )
         		{
				from.SendGump( new CityCitizenGump( m_Stone, from ) );
			}

        		if ( info.ButtonID == 2 )
         		{
				PlayerMobile pm = (PlayerMobile)from;
				pm.City = null;
				pm.CityTitle = null;
				pm.ShowCityTitle = false;

				m_Stone.Citizens.Remove( from );
				from.SendMessage( "You have left the city." );

				foreach ( Mobile m in m_Stone.Citizens )
				{
					m.SendMessage( "CITY MESSAGE: {0} has left the city.", from.Name );
				}
			}
		}
        public override void OnResponse( NetState sender, RelayInfo info )
        {
            if ( info.ButtonID == 1 )
            {
                if ( !RewardSystem.HasAccess( m_From, m_Entry ) )
                    return;

                Item item = m_Entry.Construct();

                if ( item != null )
                {
                    if ( RewardSystem.ConsumeRewardPoint( m_From ) )
                        m_From.AddToBackpack( item );
                    else
                        item.Delete();
                }
            }

            int cur, max;

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

            if ( cur < max )
                m_From.SendGump( new RewardNoticeGump( m_From ) );
        }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            switch(info.ButtonID)
            {
                case 0:
                {

                    break;
                }
                case 1:
                {
                    from.SendGump(new TournamentInfoGump(from, t));
                    break;
                }
                case 2:
                {
                    t.Date = t.Date.AddHours(1);
                    from.SendGump(new TournamentTimeGump(from, t));
                    break;
                }
                case 3:
                {
                    t.Date = t.Date.AddHours(-1);
                    from.SendGump(new TournamentTimeGump(from, t));
                    break;
                }
                case 4:
                {
                    t.Date = t.Date.AddMinutes(1);
                    from.SendGump(new TournamentTimeGump(from, t));
                    break;
                }
                case 5:
                {
                    t.Date = t.Date.AddMinutes(-1);
                    from.SendGump(new TournamentTimeGump(from, t));
                    break;
                }
                case 6:
                {
                    t.Date = t.Date.AddHours(12);
                    from.SendGump(new TournamentTimeGump(from, t));
                    break;
                }
                case 7:
                {
                    t.Date = t.Date.AddMinutes(15);
                    from.SendGump(new TournamentTimeGump(from, t));
                    break;
                }
                case 8:
                {
                    t.Date = t.Date.AddMinutes(-15);
                    from.SendGump(new TournamentTimeGump(from, t));
                    break;
                }
            }
        }
		public override void OnResponse( NetState state, RelayInfo info )
		{
			m_Mobile.SendGump( new PageResponseGump( m_Mobile, m_Name, m_Text ) );

			//m_Mobile.SendMessage( 0x482, "{0} tells you:", m_Name );
			//m_Mobile.SendMessage( 0x482, m_Text );
		}
        public override void OnResponse(NetState state, RelayInfo info)
        {
            string bookName = "";
            try
            {
                for (int x = 0; x < 51; x++)
                {
                    bookName = GetString(info, x + 100);
                    if (!(string.IsNullOrEmpty(bookName)) && bookName.Length > 0) Book.Books[x].Name = bookName;
                    else Book.Books[x].Name = string.Format("Book #{0}", ((int)(x + 1)).ToString());
                }
            }
            catch(Exception e)
            {
                Console.WriteLine("Caught Exception in MasterRunebookGump, during the 'for' loop.");
                Console.WriteLine(e.ToString());
            }
            Mobile from = state.Mobile;
            try
            {

                if (info.ButtonID > 0)
                    from.SendGump(new InternalRunebookGump(from, Book.Books[info.ButtonID - 16], Book, info.ButtonID - 16));
            }
            catch (Exception e)
            {
                Console.WriteLine("Caught Exception in MasterRunebookGump, when sending new InternalRunebookGump.");
                Console.WriteLine(e.ToString());
            }
        }
        public override void OnResponse( NetState sender, RelayInfo info )
        {
            Mobile from = sender.Mobile;
            if ( info.ButtonID == 0 ) // close
                return;
            if ( m_Item1.RootParent != from || m_Item2.RootParent != from )
            {
                from.SendMessage( "The items you wish to combine must be in your backpack." );
                return;
            }

            if ( m_Item1 is IDynamicStackable )
            {
                if ( m_Item1.Amount + m_Item2.Amount > 60000 )
                    from.SendMessage( "You cannot make a single stack of more than 60000 items." );
                else
                    (m_Item1 as IDynamicStackable).AcceptedStack( from, m_Item2 );
                return;
            }
            else
            {
                from.SendMessage( "Error, one of the items is not a dynamic stackable item" );
                return;
            }
        }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (info.ButtonID != m_CorrectChoice)
            {
                if (m_GumpOwner.AntiMacroTimeCheck < (DateTime.Now - TimeSpan.FromHours(24)))
                {
                    m_GumpOwner.AntiMacroFailed = 1;
                    m_GumpOwner.AntiMacroTimeCheck = DateTime.Now;
                }
                else
                    m_GumpOwner.AntiMacroFailed++;

                m_GumpOwner.Kill();

                if (m_GumpOwner.AntiMacroFailed >= 3)
                {
                    m_GumpOwner.SendAsciiMessage("You failed the gump too many times and have been moved to a secure location.");
                    m_GumpOwner.Location = new Point3D(2567, 448, 0);
                    m_GumpOwner.Map = Map.Felucca;
                    m_GumpOwner.AntiMacroFailed = 0;
                }
            }
            else
                m_GumpOwner.AntiMacroFailed = 0;

            //m_GumpOwner.Frozen = false;
            m_GumpOwner.CloseGump(typeof(OldAntiMacroGump));
            m_GumpOwner.AntiMacroGump = false;

            if (m_MacroTimer != null)
            {
                m_MacroTimer.Stop();
                m_MacroTimer = null;
            }
        }
        public override void OnResponse( NetState sender, RelayInfo info )
        {
            Item item = m_Addon as Item;

            if ( item == null || item.Deleted )
                return;

            if ( info.ButtonID == (int) Buttons.Confirm )
            {
                Mobile m = sender.Mobile;
                BaseHouse house = BaseHouse.FindHouseAt( m );

                if ( house != null && house.IsOwner( m ) )
                {
                    if ( m.InRange( item.Location, 2 ) )
                    {
                        Item deed = m_Addon.Deed;

                        if ( deed != null )
                        {
                            m.AddToBackpack( deed );
                            house.Addons.Remove( item );
                            item.Delete();
                        }
                    }
                    else
                        m.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
                }
                else
                    m.SendLocalizedMessage( 1049784 ); // You can only re-deed this decoration if you are the house owner or originally placed the decoration.
            }
        }
        public override void OnResponse(NetState sender, RelayInfo relayInfo)
        {
            int index = relayInfo.ButtonID - 1;

            if (index >= 0 && index < this.m_Names.Length)
            {
                try
                {
                    MethodInfo info = this.m_Property.PropertyType.GetMethod("Parse", new Type[] { typeof(string) });

                    CommandLogging.LogChangeProperty(this.m_Mobile, this.m_Object, this.m_Property.Name, this.m_Names[index]);

                    if (info != null)
                        this.m_Property.SetValue(this.m_Object, info.Invoke(null, new object[] { this.m_Names[index] }), null);
                    else if (this.m_Property.PropertyType == typeof(Enum) || this.m_Property.PropertyType.IsSubclassOf(typeof(Enum)))
                        this.m_Property.SetValue(this.m_Object, Enum.Parse(this.m_Property.PropertyType, this.m_Names[index], false), null);
                }
                catch
                {
                    this.m_Mobile.SendMessage("An exception was caught. The property may not have changed.");
                }
            }

            this.m_Mobile.SendGump(new XmlPropertiesGump(this.m_Mobile, this.m_Object, this.m_Stack, this.m_List, this.m_Page));
        }
Beispiel #10
0
 public override void OnResponse(NetState sender, RelayInfo info)
 {
     if (info.ButtonID == 3)
         m_From.SendGump(new VirtuesVicesGump(m_From, m_Page + 1, X, Y));
     else if (info.ButtonID == 2)
         m_From.SendGump(new VirtuesVicesGump(m_From, m_Page - 1, X, Y));
 }
Beispiel #11
0
		public override void OnResponse( NetState sender, RelayInfo info )
		{
			switch ( info.ButtonID )
			{
				case 0: // back
				{
					m_From.SendGump( new FactionStoneGump( m_From, m_Election.Faction ) );
					break;
				}
				case 1: // vote
				{
					if ( m_Election.State == ElectionState.Election )
						m_From.SendGump( new VoteGump( m_From, m_Election ) );

					break;
				}
				case 2: // campaign
				{
					if ( m_Election.CanBeCandidate( m_From ) )
						m_Election.AddCandidate( m_From );

					break;
				}
			}
		}
Beispiel #12
0
        public static void HeritageTransform(NetState state, PacketReader reader)
        {
            Mobile m = state.Mobile;
			
            if (reader.Size == 5)
            {
                m.SendLocalizedMessage(1073645); // You may try this again later...	
				
                HeritageQuester.RemovePending(m);
            }
            else if (reader.Size == 15)
            { 
                if (HeritageQuester.IsPending(m))
                {
                    HeritageQuester quester = HeritageQuester.Pending(m);
				
                    m.Race = quester.Race;
					
                    m.Hue = reader.ReadUInt16();
                    m.HairItemID = reader.ReadUInt16();
                    m.HairHue = reader.ReadUInt16();
                    m.FacialHairItemID = reader.ReadUInt16();
                    m.FacialHairHue = reader.ReadUInt16();
				
                    HeritageQuester.RemovePending(m);
                    quester.CheckCompleted(m, true); // removes done quests
					
                    if (m.Race == Race.Elf)
                        m.SendLocalizedMessage(1073653); // You are now fully initiated into the Elven culture.
                    else if (m.Race == Race.Human)						
                        m.SendLocalizedMessage(1073654); // You are now fully human.
                }
            }
        }
Beispiel #13
0
		public override Packet GetPacketFor( NetState ns )
		{
			if ( ns.HighSeas )
				return new MultiTargetReqHS( this );
			else
				return new MultiTargetReq( this );
		}
		public override void OnResponse( NetState sender, RelayInfo info )
		{
			int index = info.ButtonID - 1;

			if ( index >= 0 && index < m_SellList.Length )
			{
				HairstylistBuyInfo buyInfo = m_SellList[index];

				try
				{
					object[] origArgs = buyInfo.GumpArgs;
					object[] args = new object[origArgs.Length];

					for ( int i = 0; i < args.Length; ++i )
					{
						if ( origArgs[i] == Price )
							args[i] = 0;
						else if ( origArgs[i] == From )
							args[i] = m_Merc;
						else if ( origArgs[i] == Merc )
							args[i] = m_From;
						else
							args[i] = origArgs[i];
					}

					m_From.SendGump( Activator.CreateInstance( buyInfo.GumpType, args ) as Gump );
				}
				catch {}
			}
		}
		public static void RegisterInvalidAccess( NetState ns )
		{
			if( ns == null || !Enabled )
				return;

			InvalidAccountAccessLog accessLog = FindAccessLog( ns );

			if( accessLog == null )
				m_List.Add( accessLog = new InvalidAccountAccessLog( ns.Address ) );

			accessLog.Counts += 1;
			accessLog.RefreshAccessTime();

			if ( accessLog.Counts >= 3 ) {
				try {
					using ( StreamWriter op = new StreamWriter( "throttle.log", true ) ) {
						op.WriteLine(
							"{0}\t{1}\t{2}",
							DateTime.Now,
							ns,
							accessLog.Counts
						);
					}
				}
				catch {
				}
			}
		}
		public override void OnResponse( NetState sender, RelayInfo info )
		{
			if ( info.ButtonID == 0 )
			{
				m_From.SendLocalizedMessage( 501235, "", 0x35 ); // Help request aborted.
			}
			else
			{
				TextRelay entry = info.GetTextEntry( 0 );
				string text = ( entry == null ? "" : entry.Text.Trim() );

				if ( text.Length == 0 )
				{
					m_From.SendMessage( 0x35, "You must enter a description." );
					m_From.SendGump( new PagePromptGump( m_From, m_Type ) );
				}
				else
				{
					m_From.SendLocalizedMessage( 501234, "", 0x35 ); /* The next available Counselor/Game Master will respond as soon as possible.
																	  * Please check your Journal for messages every few minutes.
																	  */

					PageQueue.Enqueue( new PageEntry( m_From, text, m_Type ) );
				}
			}
		}
Beispiel #17
0
		public override void OnResponse( NetState sender, RelayInfo info )
		{
			if ( info.ButtonID == 1 )
			{
				try
				{
					if ( m_From.AccessLevel >= AccessLevel.GameMaster )
					{
						TextRelay text = info.GetTextEntry( 0 );

						if ( text != null )
						{
							m_Skill.Base = Convert.ToDouble( text.Text );
							CommandLogging.LogChangeProperty( m_From, m_Target, String.Format( "{0}.Base", m_Skill ), m_Skill.Base.ToString() );
						}
					}
					else
					{
						m_From.SendMessage( "You may not change that." );
					}

					m_From.SendGump( new SkillsGump( m_From, m_Target, m_Selected ) );
				}
				catch
				{
					m_From.SendMessage( "Bad format. ###.# expected." );
					m_From.SendGump( new EditSkillGump( m_From, m_Target, m_Skill, m_Selected ) );
				}
			}
			else
			{
				m_From.SendGump( new SkillsGump( m_From, m_Target, m_Selected ) );
			}
		}
Beispiel #18
0
        public override void OnResponse( NetState state, RelayInfo info )
        {
            Mobile from = state.Mobile;

            if ( info.ButtonID == 1 )
            {
                if ( m_crop != null && !m_crop.Deleted )
                {
                    if ( m_crop is WheatCrop )
                        ((WheatCrop)m_crop).UpRoot( m_Owner );
                    else if ( m_crop is CottonCrop )
                        ((CottonCrop)m_crop).UpRoot( m_Owner );
                    else if ( m_crop is CarrotCrop )
                        ((CarrotCrop)m_crop).UpRoot( m_Owner );
                    else if ( m_crop is FlaxCrop )
                        ((FlaxCrop)m_crop).UpRoot( m_Owner );
                    else if ( m_crop is LettuceCrop )
                        ((LettuceCrop)m_crop).UpRoot( m_Owner );
                    else if ( m_crop is OnionCrop )
                        ((OnionCrop)m_crop).UpRoot( m_Owner );
                    else if ( m_crop is GarlicCrop )
                        ((GarlicCrop)m_crop).UpRoot( m_Owner );
                    else if ( m_crop is CabbageCrop )
                        ((CabbageCrop)m_crop).UpRoot( m_Owner );
                    else if ( m_crop is CornCrop )
                        ((CornCrop)m_crop).UpRoot( m_Owner );
                }
            }
        }
Beispiel #19
0
        public override void OnCancel(NetState state)
        {
            m_Mobile.CantWalk = false;

            if (m_Mobile is PlayerMobile)
                ((PlayerMobile)m_Mobile).HasMenu = false;
        }
        public override void OnResponse( NetState state, RelayInfo info )
        {
            Mobile from = state.Mobile;

            if( info.IsSwitched( (int)Buttons.rdoYesJoin ) )
            {
                if( ScavengerSignup.signupEnabled && from is PlayerMobile )
                {
                    ScavengerBasket newBasket = new ScavengerBasket( (PlayerMobile)from );
                    if( !from.Backpack.CheckHold( from, newBasket, false ) )
                    {
                        from.SendMessage( "Your backpack is too full to even consider entering this event!" );
                        newBasket.Delete();
                        return;
                    }

                    from.AddToBackpack( newBasket );
                    ScavengerSignup.ScavengerBaskets.Add( newBasket );
                    from.SendMessage( "You are now entered in the scavenger hunt. Use the supplied basket to gather the scavenger items!" );
                }
                else
                {
                    from.SendMessage( "You have waited too long and signup for the scavenger hunt has ended" );
                }
            }
            else
            {
                from.SendMessage( "You have not been entered into the scavenger hunt event" );
            }
        }
Beispiel #21
0
		public override void SendInfoTo(NetState state, bool sendOplPacket)
		{
			if (state == null || state.Mobile == null || state.Mobile.AccessLevel >= AccessLevel.Counselor)
			{
				base.SendInfoTo(state, sendOplPacket);
			}
		}
        public static void WriteLine(NetState state, string format, params object[] args)
        {
            for (int i = 0; i < args.Length; i++)
                args[i] = Commands.CommandLogging.Format(args[i]);

            WriteLine(state, String.Format(format, args));
        }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile m = sender.Mobile;

            if (info.ButtonID == 1)
            {
                if (m.InRange(m_Healer, 16))
                {
                    if (info.IsSwitched(0) && Banker.Withdraw(m, m_Price))
                    {
                        Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerStateCallback(PaidRes), m);
                        m.Frozen = true;
                    }

                    else
                    {
                        m.Resurrect();
                        m.PlaySound(0x214);
                        m.FixedEffect(0x376A, 10, 16);
                    }
                }
                else
                    m.SendMessage("You have wandered to far off to gain any benefits from the healers practices.");
            }
        }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            if (m_Deed.Deleted || !m_Deed.IsChildOf(sender.Mobile.Backpack))
                return;

            switch (info.ButtonID)
            {
                case (int)Buttons.Exit:
                    return;
                case (int)Buttons.Add:
                    m_Deed.BeginCombine(sender.Mobile);
                    return;
                case (int)Buttons.PlaceInHouse:
                    if (m_Deed.NumOfPartsAdded > 0)
                    {
                        m_Deed.PlaceInHouse(sender.Mobile);
                        return;
                    }
                    else
                        sender.Mobile.SendMessage("You cannot add the pentagram to a house without any parts in the deed.");
                    break;
            }

            sender.Mobile.SendGump(new BloodPentagramPartGump(sender.Mobile, m_Deed));
        }
		public override void OnResponse(NetState state, RelayInfo info)
		{
			if (duel == null)
				return;

			if (info.ButtonID == (int)Buttons.Button1)
			{

				if (duel.Player1.BankBox == null || duel.Player1.BankBox.GetAmount(typeof(Gold), true) < duel.Wager)
				{
					duel.Player1.SendMessage("Challenge canceled, you don't have enough gold in your bank box");
				}
				else if (duel.MaxDex < duel.Player1.Dex)
				{
					duel.Player1.SendMessage("Challenge canceled, you have too high dex for this challenge.");
				}
				else
				{

					duel.Player1.SendGump(new WaitGump(duel));
					duel.Player2.SendGump(new ChallengedGump(duel));
				}


			}
			else if (info.ButtonID == (int)Buttons.Button2)
			{
				duel.Player1.SendMessage("The challenge has been canceled.");

			}

		}
Beispiel #26
0
		public override void OnResponse(NetState state, RelayInfo info)
		{
			Mobile from = state.Mobile;
			
			switch(info.ButtonID)
			{
				default:
				case 0: break;
				case 1: 
					from.SendGump(new StallLeasingGump(from, m_Plot));
					from.SendGump(new BazaarInformationGump(-1, 1150391));
					break;
				case 2: // SEE TOP BIDS
					from.SendGump(new TopBidsGump(from, m_Plot));
					break;
				case 3: // MY STALL LEASE
                    if (m_Plot.IsOwner(from))
                        from.SendGump(new MyStallLeaseGump(from, m_Plot));
                    else
                        from.SendLocalizedMessage(1150685); // You are currently viewing a stall that you are not leasing. In order to set up or modify your stall, please use that stall's sign.
					break;
				case 4: // MY STALL BID
					from.SendGump(new StallBidGump(from, m_Plot));
					break;
				case 5: // MY BID MATCHING
					if(m_Plot.IsOwner(from))
                        from.SendGump(new MatchBidGump(from, m_Plot));
					else
						from.SendLocalizedMessage(1150685); // You are currently viewing a stall that you are not leasing. In order to set up or modify your stall, please use that stall's sign.
					break;
			}
		}
        public static void WriteLine(NetState state, string text)
        {
            LazyInitialize();

            if (!m_Enabled) return;

            try
            {
                Account acct = state.Account as Account;
                string name = acct == null ? "(UNKNOWN)" : acct.Username;
                string accesslevel = acct == null ? "NoAccount" : acct.AccessLevel.ToString();
                string statestr = state == null ? "NULLSTATE" : state.ToString();

                m_Output.WriteLine("{0}: {1}: {2}: {3}", DateTime.Now, statestr, name, text);

                string path = Core.BaseDirectory;

                Commands.CommandLogging.AppendPath(ref path, LogBaseDirectory);
                Commands.CommandLogging.AppendPath(ref path, LogSubDirectory);
                Commands.CommandLogging.AppendPath(ref path, accesslevel);
                path = Path.Combine(path, String.Format("{0}.log", name));

                using (StreamWriter sw = new StreamWriter(path, true))
                    sw.WriteLine("{0}: {1}: {2}", DateTime.Now, statestr, text);
            }
            catch
            {
            }
        }
Beispiel #28
0
		public override void OnResponse( NetState sender, RelayInfo info )
		{
			PlayerMobile pm = sender.Mobile as PlayerMobile;

			if( !IsMember( pm, guild ) )
				return;

			switch( info.ButtonID )
			{
				case 1:
				{
					pm.SendGump( new GuildInfoGump( pm, guild ) );
					break;
				}
				case 2:
				{
					pm.SendGump( new GuildRosterGump( pm, guild ) );
					break;
				}
				case 3:
				{
					pm.SendGump( new GuildDiplomacyGump( pm, guild ) );
					break;
				}
			}
		}
		public override void OnResponse( NetState sender, RelayInfo info )
		{
			int id = info.ButtonID;

			if ( m_PetSummonBall.Deleted || id <= 0 )
				return;

			id --;

			ArrayList pets = GetPetList( m_Mobile );

			if ( id < pets.Count && id >= 0 )
			{
				if ( m_Mobile.BankBox.ConsumeTotal( typeof( Gold ), 75000 ) )
				{
					m_PetSummonBall.UseCharge();
					SufferSkillLoss( (Mobile)pets[id], 10 );
					((Mobile)pets[id]).MoveToWorld( m_Mobile.Location, m_Mobile.Map );
					m_Mobile.SendMessage( "You pay the fee and your pet is returned to you. Your pet has suffered some skills from the travel." );
				}
				else
				{
					m_Mobile.SendMessage( "You need 75,000 gold in your bank to return your pet." );
				}
			}
		}
      		public override void OnResponse( NetState state, RelayInfo info ) 
      		{ 
			Mobile from = state.Mobile; 

			if ( from == null )
				return;

        		if ( info.ButtonID == 0 ) // Close
         		{
				from.SendGump( new CityManagementGump( m_Stone, from ) );
			}

        		if ( info.ButtonID == 1 ) // Previous page
         		{
         			if ( m_ListPage > 0 )
					from.SendGump( new ChangeCitizenTitleGump( m_Stone, m_ListPage - 1, m_List, m_CountList ) );
			}

        		if ( info.ButtonID == 2 ) // Next page
         		{ 
         			if ( (m_ListPage + 1) * 7 < m_List.Count )
					from.SendGump( new ChangeCitizenTitleGump( m_Stone, m_ListPage + 1, m_List, m_CountList ) );
			}

        		if ( info.ButtonID >= 100 && info.ButtonID <= 999 ) // Decline
         		{
				Mobile mob = m_List[ info.ButtonID - 100 ] as Mobile;
				
				from.SendMessage( "Please enter the members new title, You are limited to 25 charactors or less." );
				from.Prompt = new CitizenTitleChangePrompt( m_Stone, mob, from );
			}
		}
Beispiel #31
0
        public override void OnResponse(Server.Network.NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            if (info.ButtonID == 1)
            {
                XmlQuestStatusGump g = new XmlQuestStatusGump(m_Note, m_Note.TitleString);
                from.SendGump(g);
            }
        }
Beispiel #32
0
 public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
 {
     if (info.ButtonID == 2)
     {
         ((Mobile)m_Names[m_Index]).Delete();
         m_Names.RemoveAt(m_Index);
         m_From.SendLocalizedMessage(1010303);                       // deleted object
     }
     m_From.SendGump(new WipeMobsGump(m_From, m_Names, 0));
 }
            public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
            {
                try
                {
                    switch (info.ButtonID)
                    {
                    case (int)Buttons.Rune1:
                        rcnt          += 1;
                        RuneList[rcnt] = 1;
                        tm.SendGump(new GateGump(tm, rcnt, RuneList[1], RuneList[2], RuneList[3], m_GateSpell));
                        break;

                    case (int)Buttons.Rune2:
                        rcnt          += 1;
                        RuneList[rcnt] = 2;
                        tm.SendGump(new GateGump(tm, rcnt, RuneList[1], RuneList[2], RuneList[3], m_GateSpell));
                        break;

                    case (int)Buttons.Rune3:
                        rcnt          += 1;
                        RuneList[rcnt] = 3;
                        tm.SendGump(new GateGump(tm, rcnt, RuneList[1], RuneList[2], RuneList[3], m_GateSpell));
                        break;

                    case (int)Buttons.Rune4:
                        rcnt          += 1;
                        RuneList[rcnt] = 4;
                        tm.SendGump(new GateGump(tm, rcnt, RuneList[1], RuneList[2], RuneList[3], m_GateSpell));
                        break;

                    case (int)Buttons.Rune5:
                        rcnt          += 1;
                        RuneList[rcnt] = 5;
                        tm.SendGump(new GateGump(tm, rcnt, RuneList[1], RuneList[2], RuneList[3], m_GateSpell));
                        break;

                    case (int)Buttons.OkCast:
                        if (rcnt == 3)
                        {
                            m_GateSpell.Runes = (RuneList[1] * 100) + (RuneList[2] * 10) + RuneList[3];
                            m_GateSpell.DoTimer();
                        }
                        else
                        {
                            tm.SendMessage("You must choose 3 runes. You have only selected {0}", rcnt);
                            tm.SendGump(new GateGump(tm, rcnt, 0, 0, 0, m_GateSpell));
                        }
                        break;

                    default:
                        break;
                    }
                }
                catch { }
            }
Beispiel #34
0
 public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
 {
     if (info.ButtonID == 1 && m_Callback != null)
     {
         m_Callback(sender.Mobile, true, m_State);
     }
     else if (m_Callback != null)
     {
         m_Callback(sender.Mobile, false, m_State);
     }
 }
Beispiel #35
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (info.ButtonID >= (int)GumpChoice.SelectPage && info.ButtonID <= (int)GumpChoice.SelectPage + (m_PropertyList.Length / m_OptionsPerPage))
            {
                from.SendGump(new HairStylistConfigGump(m_From, m_HairStylist, m_PropertyList, info.ButtonID - (int)GumpChoice.SelectPage));
            }
            else if (info.ButtonID >= (int)GumpChoice.EditSettings && info.ButtonID <= (int)GumpChoice.EditSettings + m_PropertyList.Length)
            {
                int index = info.ButtonID - (int)GumpChoice.EditSettings;

                PropertyInfo prop = m_PropertyList[index];

                if (prop == null)
                {
                    return;
                }

                CommandPropertyAttribute cpa = GetCPA(prop);
                if (!prop.CanWrite || (cpa != null && from.AccessLevel < cpa.WriteLevel))
                {
                    return;
                }

                Type type = prop.PropertyType;

                if (IsType(type, typeofPoint3D))
                {
                    from.SendGump(new HairStylistSetPoint3DGump(prop, from, m_HairStylist, m_PropertyList, m_Page));
                }

                else if (IsType(type, typeofTimeSpan))
                {
                    from.SendGump(new HairStylistSetTimeSpanGump(prop, from, m_HairStylist, m_PropertyList, m_Page));
                }
                else if (IsCustomEnum(type))
                {
                    from.SendGump(new HairStylistSetCustomEnumGump(prop, from, m_HairStylist, m_PropertyList, GetCustomEnumNames(type), m_Page));
                }
                else if (IsType(type, typeofEnum))
                {
                    from.SendGump(new HairStylistSetListOptionGump(prop, from, m_HairStylist, m_PropertyList, Enum.GetNames(type), GetObjects(Enum.GetValues(type)), m_Page));
                }
                else if (IsType(type, typeofBool))
                {
                    from.SendGump(new HairStylistSetListOptionGump(prop, from, m_HairStylist, m_PropertyList, PropertiesGump.m_BoolNames, PropertiesGump.m_BoolValues, m_Page));
                }
                else if (IsType(type, typeofString) || IsType(type, typeofReal) || IsType(type, typeofNumeric))
                {
                    from.SendGump(new HairStylistSetGump(prop, from, m_HairStylist, m_PropertyList, m_Page));
                }
            }
        }
Beispiel #36
0
            public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
            {
                if (info.ButtonID == 2)
                {
                    m_Items[m_Index].Delete();
                    m_Items.RemoveAt(m_Index);
                    m_From.SendLocalizedMessage(1010303);   // deleted object
                }

                m_From.SendGump(new InternalItemGump(m_From, m_Items, 0));
            }
Beispiel #37
0
            public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
            {
                if (info.ButtonID == 2)
                {
                    foreach (Mobile item in m_Names)
                    {
                        item.Delete();
                    }

                    m_From.SendMessage("Deleted {0} Mobiles.", m_Names.Count);
                }
            }
Beispiel #38
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            switch (info.ButtonID)
            {
            case 0:     // Remove
            {
                if (!SGCore.SGSystemEnabled)
                {
                    from.SendMessage(77, "Crystal & Address removed from the stargate system...");
                    from.CloseGump(typeof(SGGumpActivatorRemoval));

                    int removeIndex = 0;
                    for (int i = 0; i < SGCore.SGList.Count; i++)
                    {
                        SGEntry sge = (SGEntry)SGCore.SGList[i];
                        {
                            if (sge.SGFacetCode == m_sgactivatordevice.SGAFacetNumber && sge.SGAddressCode1 == m_sgactivatordevice.SGAAddressCode1 && sge.SGAddressCode2 == m_sgactivatordevice.SGAAddressCode2 && sge.SGAddressCode3 == m_sgactivatordevice.SGAAddressCode3 && sge.SGAddressCode4 == m_sgactivatordevice.SGAAddressCode4 && sge.SGAddressCode5 == m_sgactivatordevice.SGAAddressCode5)
                            {
                                // this gate
                                removeIndex = i;
                            }
                        }
                    }
                    // Remove Address Entry
                    SGEntry sgeToBeRemoved = (SGEntry)SGCore.SGList[removeIndex];
                    SGCore.SGList.Remove(sgeToBeRemoved);

                    // ***************************************************
                    // * Force a Rebuild of Entire Shard Stargate System *
                    // ***************************************************

                    // Trigger Save to Update Stargate XML File (With Your Removed Gate OUT)
                    SGCore.SGTriggerSave();
                    // Trigger Load to Put Shards Stargates Back (With Your Removed Gate OUT)
                    SGCore.SGTriggerLoad();
                }
                else
                {
                    from.SendMessage(77, "OPERATION ABORTED !!! Stargate System Still ACTIVE, Gates can only be removed IF the stargate system is DISABLED.");
                    from.SendMessage(77, "Use [SGAdmin option to DISABLE the system 1st");
                }
            }
            break;

            case 1:     // Exit
            {
                from.SendMessage(77, "Exit Crystal Device Admin, This Device Remains In The System.");
            }
            break;
            }
        }
Beispiel #39
0
            public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
            {
                if (info.ButtonID == 2)
                {
                    foreach (Item item in m_Items)
                    {
                        item.Delete();
                    }

                    m_From.SendMessage("Deleted all items.");
                }
            }
 public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
 {
     if (info.ButtonID == 1)
     {
         m_ToPlayer.AddToBackpack(m_AContract);
         m_ToPlayer.SendMessage("The contract of service has been completed. A copy has been placed in your backpack.");
     }
     if (info.ButtonID == 2)
     {
         m_AContract.Delete();
         m_From.SendMessage(m_ToPlayer.Name + " has denied your contract.");
     }
 }
Beispiel #41
0
 public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
 {
     if (info.ButtonID == 2)
     {
         if (!m_Pet.Deleted && m_Pet.Controlled && m_From == m_Pet.ControlMaster && m_From.CheckAlive() /*&& m_Pet.CheckControlChance( m_From )*/)
         {
             if (m_Pet.Map == m_From.Map && m_Pet.InRange(m_From, 14))
             {
                 m_Pet.ControlTarget = null;
                 m_Pet.ControlOrder  = OrderType.Release;
             }
         }
     }
 }
Beispiel #42
0
            public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
            {
                if (m_Deed == null || m_Deed.Deleted)
                {
                    return;
                }

                int buttonId = info.ButtonID;

                if (buttonId == 100 || buttonId == 101)
                {
                    m_Deed.m_East = (buttonId == 100);
                    m_Deed.SendTarget(sender.Mobile);
                }
            }
Beispiel #43
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            if (info.ButtonID == 2)
            {
                bool okay = info.IsSwitched(1);

                if (okay)
                {
                    m_Spell.AcceptBodyGuard(m_Protectee);
                }
                else
                {
                    m_Spell.DeclineBodyGuard(m_Protectee);
                }
            }
        }
Beispiel #44
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile from = m_From;

            if (info.ButtonID == 66)
            {
                from.CloseGump(typeof(EmoteMiniGump));
                from.CloseGump(typeof(EmoteGump));
                from.SendGump(new EmoteMiniGump(from, 1));
            }
            else if (info.ButtonID > 0)
            {
                new ESound(from, info.ButtonID);
                from.CloseGump(typeof(EmoteGump));
                from.SendGump(new EmoteGump(from));
            }
        }
Beispiel #45
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            int botaoID = info.ButtonID;

            if (botaoID == -1)
            {
                //jogador.SendMessage( "botao ok");

                if (totalParaGastar() == 0)
                {
                    aplicarValores();
                    teleportarParaCidade();
                }
                else
                {
                    jogador.SendMessage("Nao foram distribuidos todos os pontos.");
                    jogador.SendGump(new EscolhaPericiasGump(jogador, valoresPericia, inicio));
                }
            }
            //botao de paginacao
            else if (botaoID < 1000)
            {
                //jogador.SendMessage( "botao de paginacao");
                jogador.SendGump(new EscolhaPericiasGump(jogador, valoresPericia, botaoID));
            }
            //botao de subir skill
            else if (botaoID < 2000)
            {
                int indiceSkill = botaoID - 1000;
                //jogador.SendMessage( "subir pericia {0}", pericias[indiceSkill].Name);

                subirPericia(indiceSkill);

                jogador.SendGump(new EscolhaPericiasGump(jogador, valoresPericia, inicio));
            }
            else if (botaoID >= 2000)
            {
                int indiceSkill = botaoID - 2000;
                //jogador.SendMessage( "descer pericia {0}", pericias[indiceSkill].Name);

                descerPericia(indiceSkill);

                jogador.SendGump(new EscolhaPericiasGump(jogador, valoresPericia, inicio));
            }
        }
Beispiel #46
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            int botaoID = info.ButtonID;

            if (botaoID == -1)
            {
            }
            else if (botaoID >= 1000)
            {
                string             chave             = (string)chaves[botaoID - 1000];
                EditarPropriedades editarPropriedade = new EditarPropriedades(jogador, chave);
                jogador.SendGump(editarPropriedade);
            }
            else
            {
                jogador.SendGump(new VerPropriedades(jogador, 0));
            }
        }
            public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
            {
                Mobile from = sender.Mobile;

                switch (info.ButtonID)
                {
                case 101:
                { // spin
                    Container pack = from.Backpack;

                    if (pack != null && pack.ConsumeTotal(typeof(Gold), 500))
                    {
                        from.SendGump(new SlotMachineGump(from, m_From, 1));
                    }
                    else
                    {
                        from.SendGump(new SlotMachineGump(from, m_From, 2));
                    }

                    break;
                }

                case 102:
                { // help
                    from.CloseGump(typeof(HelpStatsGump));
                    from.SendGump(new HelpStatsGump(m_From));
                    from.SendGump(new SlotMachineGump(from, m_From, 0));
                    break;
                }

                case 103:
                { // stats
                    from.CloseGump(typeof(SlotsStatsGump));
                    from.SendGump(new SlotsStatsGump(m_From));
                    from.SendGump(new SlotMachineGump(from, m_From, 0));
                    break;
                }

                case 666:
                { // quit
                    break;
                }
                }
            } // OnResponse
Beispiel #48
0
        //protected override void OnAutoRefresh()
        //{
        //    User.CloseGump(typeof(gumpfaim));
        //    User.SendGump(new gumpfaim(User, this.X, this.Y));
        //    base.OnAutoRefresh();
        //}

        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            if (info == null || sender == null || sender.Mobile == null)
            {
                return;
            }

            if (info.ButtonID == 1)
            {
                PlayerMobile from = null;

                if (sender.Mobile is PlayerMobile)
                {
                    from = (PlayerMobile)sender.Mobile;
                    from.CloseGump(typeof(gumpfaim));
                    from.SendGump(new gumpfaim(from, this.X, this.Y));
                }
            }
        }
Beispiel #49
0
            public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
            {
                if (info.ButtonID == 2)
                {
                    foreach (Mobile item in m_Mobiles)
                    {
                        if (item is BaseCreature && !((BaseCreature)item).IsStabled)
                        {
                            item.Delete();
                        }
                        else
                        {
                            item.Delete();
                        }
                    }

                    m_From.SendMessage("Deleted non-stabled mobiles.");
                }
            }
Beispiel #50
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            if (m_Token.Deleted || !m_Token.IsChildOf(sender.Mobile.Backpack))
            {
                return;
            }

            int idx = info.ButtonID - 100;

            if (idx >= 0 && idx < Earrings.Length)
            {
                EarringEntry entry = Earrings[idx];

                Item earrings = (Item)Activator.CreateInstance(entry.Type);

                sender.Mobile.PlaceInBackpack(earrings);

                m_Token.Delete();
            }
        }
Beispiel #51
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            PlayerMobile From = from as PlayerMobile;

            From.CloseGump(typeof(BinfoGump));

            if (info.ButtonID == 1)
            {
                From.CloseGump(typeof(BinfoGump));
                return;
            }
            if (info.ButtonID == 2)
            {
                From.Target = new BCaptureTarget();
                From.SendMessage("Please target the same creature to take its picture!");
                return;
            }
        }
Beispiel #52
0
        public override void OnResponse(Server.Network.NetState state, RelayInfo info)
        {
            if (m_Quester == null)
            {
                return;
            }

            if (info.ButtonID == 1)
            {
                Mobile m = state.Mobile;

                if (HeritageQuester.Check(m))
                {
                    HeritageQuester.AddPending(m, m_Quester);
                    Timer.DelayCall(TimeSpan.FromMinutes(1), new TimerStateCallback(CloseHeritageGump), m);

                    state.Mobile.Send(new HeritagePacket(m.Female, (short)(m_Quester.Race.RaceID + 1)));
                }
            }
        }
Beispiel #53
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            if (info.ButtonID == 2)
            {
                bool okay = info.IsSwitched(1);

                if (okay)
                {
                    m_Spell.AcceptBodyGuard(m_Protectee, m_Spell);
                }
                else
                {
                    m_Spell.DeclineBodyGuard(m_Protectee);
                }

                /*if ( okay )
                 *      JusticeVirtue.OnVirtueAccepted( m_Protector, m_Protectee );
                 * else
                 *      JusticeVirtue.OnVirtueRejected( m_Protector, m_Protectee );*/
            }
        }
Beispiel #54
0
            public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
            {
                if (info.ButtonID == 0)
                {
                    return;
                }
                else if (info.ButtonID == 1)
                {
                    m_State[17] = false;
                }
                else
                {
                    m_State[17] = true;
                }

                foreach (TextRelay text in info.TextEntries)
                {
                    m_State[text.EntryID < 2 ? text.EntryID : text.EntryID + 7] = text.Text;
                }

                // Reset checks
                for (int x = 2; x <= 8; x++)
                {
                    m_State[x] = false;
                }

                foreach (int check in info.Switches)
                {
                    m_State[check + 2] = true; // Offset by 2 in the state object
                }
                if (Verify(sender.Mobile, m_State))
                {
                    BoundingBoxPicker.Begin(sender.Mobile, new BoundingBoxCallback(AddonGenerator.PickerCallback), m_State);
                }
                else
                {
                    sender.Mobile.SendMessage(0x40, "Please review the generation parameters, some are invalid.");
                    sender.Mobile.SendGump(new InternalGump(sender.Mobile, m_State));
                }
            }
Beispiel #55
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            switch (info.ButtonID)
            {
            case (int)Buttons.Armor:
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Resource:

                m_Player.SendGump(new SetResourceGump(m_Player));
                break;

            case (int)Buttons.Hue:
                m_Player.Target = new Kullipicker();
                m_Player.SendMessage("What do you want to color?");
                m_Player.SendGump(new GMToolGump(m_Player));
                break;
                //case (int)Buttons.Stats:
                //m_Player.SendGump( new SetStatsGump( m_Player ) );
                //break;
            }
        }
Beispiel #56
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile  from = sender.Mobile;
            Account acct = (Account)from.Account;

            switch (info.ButtonID)
            {
            case 0:
                string tudo = (string)info.GetTextEntry((int)Buttons.TextEntry1).Text;

                Console.WriteLine("");
                Console.WriteLine("{0} From Account {1} Sent a suggestion", from.Name, acct.Username);    //from.Name of account send a suggestion
                Console.WriteLine("");

                if (!Directory.Exists("suggestion"))     //create directory
                {
                    Directory.CreateDirectory("suggestion");
                }

                using (StreamWriter op = new StreamWriter("suggestion/suggestion.txt", true))
                {
                    op.WriteLine("");
                    op.WriteLine("Name Of Character: {0}, Account:{1}", from.Name, acct.Username);
                    op.WriteLine("Message: {0}", tudo);
                    op.WriteLine("");
                }


                from.SendMessage("Thanks for your suggestion!");    //thanks to send your suggestion

                break;

            case 1:
                from.CloseGump(typeof(Suggestion));
                break;
            }
        }
Beispiel #57
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            switch (info.ButtonID)
            {
            case (int)Buttons.ExitMenu:
                m_Player.CloseGump(typeof(SetResourceGump));
                m_Player.SendGump(new GMToolGump(m_Player));
                break;

            default:
                break;

            case (int)Buttons.Iron:

                m_Player.Target = new ChangeMaterial(CraftResource.Iron);
                break;

            case (int)Buttons.DullCopper:

                m_Player.Target = new ChangeMaterial(CraftResource.DullCopper);
                break;

            case (int)Buttons.Shadow:

                m_Player.Target = new ChangeMaterial(CraftResource.ShadowIron);
                break;

            case (int)Buttons.Copper:

                m_Player.Target = new ChangeMaterial(CraftResource.Copper);
                break;

            case (int)Buttons.Bronze:

                m_Player.Target = new ChangeMaterial(CraftResource.Bronze);
                break;

            case (int)Buttons.Gold:

                m_Player.Target = new ChangeMaterial(CraftResource.Gold);
                break;

            case (int)Buttons.Agapite:

                m_Player.Target = new ChangeMaterial(CraftResource.Agapite);
                break;

            case (int)Buttons.Verite:

                m_Player.Target = new ChangeMaterial(CraftResource.Verite);
                break;

            case (int)Buttons.Valorite:

                m_Player.Target = new ChangeMaterial(CraftResource.Valorite);
                break;

            case (int)Buttons.Spined:

                m_Player.Target = new ChangeMaterial(CraftResource.SpinedLeather);
                break;

            case (int)Buttons.Horned:

                m_Player.Target = new ChangeMaterial(CraftResource.HornedLeather);
                break;

            case (int)Buttons.Barbed:

                m_Player.Target = new ChangeMaterial(CraftResource.BarbedLeather);
                break;
            }

            if (info.ButtonID != (int)Buttons.ExitMenu)
            {
                m_Player.SendMessage("Select the item(s). Press ESC to abort.");
                m_Player.SendGump(new SetResourceGump(m_Player));
            }
        }
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (from.AccessLevel < AccessLevel.Administrator)
            {
                return;
            }

            TextRelay d = info.GetTextEntry(0);
            TextRelay h = info.GetTextEntry(1);
            TextRelay m = info.GetTextEntry(2);
            TextRelay s = info.GetTextEntry(3);

            TimeSpan duration;
            bool     shouldSet;

            string fromString = from.ToString();

            switch (info.ButtonID)
            {
            case 0:
            {
                for (int i = 0; i < m_List.Count; ++i)
                {
                    Account a = (Account)m_List[i];

                    a.SetUnspecifiedBan(from);
                }

                from.SendMessage("Duration unspecified.");
                return;
            }

            case 1:                     // infinite
            {
                duration  = TimeSpan.MaxValue;
                shouldSet = true;
                break;
            }

            case 2:                     // From D:H:M:S
            {
                if (d != null && h != null && m != null && s != null)
                {
                    try
                    {
                        duration  = new TimeSpan(Utility.ToInt32(d.Text), Utility.ToInt32(h.Text), Utility.ToInt32(m.Text), Utility.ToInt32(s.Text));
                        shouldSet = true;

                        break;
                    }
                    catch
                    {
                    }
                }

                duration  = TimeSpan.Zero;
                shouldSet = false;

                break;
            }

            case 3:                     // From D
            {
                if (d != null)
                {
                    try
                    {
                        duration  = TimeSpan.FromDays(Utility.ToDouble(d.Text));
                        shouldSet = true;

                        break;
                    }
                    catch
                    {
                    }
                }

                duration  = TimeSpan.Zero;
                shouldSet = false;

                break;
            }

            case 4:                     // From H
            {
                if (h != null)
                {
                    try
                    {
                        duration  = TimeSpan.FromHours(Utility.ToDouble(h.Text));
                        shouldSet = true;

                        break;
                    }
                    catch
                    {
                    }
                }

                duration  = TimeSpan.Zero;
                shouldSet = false;

                break;
            }

            case 5:                     // From M
            {
                if (m != null)
                {
                    try
                    {
                        duration  = TimeSpan.FromMinutes(Utility.ToDouble(m.Text));
                        shouldSet = true;

                        break;
                    }
                    catch
                    {
                    }
                }

                duration  = TimeSpan.Zero;
                shouldSet = false;

                break;
            }

            case 6:                     // From S
            {
                if (s != null)
                {
                    try
                    {
                        duration  = TimeSpan.FromSeconds(Utility.ToDouble(s.Text));
                        shouldSet = true;

                        break;
                    }
                    catch
                    {
                    }
                }

                duration  = TimeSpan.Zero;
                shouldSet = false;

                break;
            }

            default: return;
            }

            if (shouldSet)
            {
                for (int i = 0; i < m_List.Count; ++i)
                {
                    Account a = (Account)m_List[i];

                    a.SetBanTags(from, DateTime.Now, duration);
                }

                if (duration == TimeSpan.MaxValue)
                {
                    from.SendMessage("Duration is infinite.");
                }
                else
                {
                    from.SendMessage("Duration is {0}.", duration);
                }
            }
            else
            {
                from.SendMessage("Values improperly formatted.");
                from.SendGump(new BanDurationGump(m_List));
            }
        }
Beispiel #59
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;
            }
            }
        }
Beispiel #60
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Container pack = m_Player.Backpack;

            if (pack == null)
            {
                m_Player.SendMessage("You don't have a backpack.");
                return;
            }



            switch (info.ButtonID)
            {
            case (int)Buttons.ExitMenu:
                m_Player.CloseGump(typeof(ArmorAddingGump));
                m_Player.SendGump(new GMToolGump(m_Player));
                break;

            default:
                break;

            case (int)Buttons.Ringmail:

                m_Player.AddToBackpack(new BagOfRingmail());
                m_Player.SendMessage("The bag with armor is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Chainmail:

                m_Player.AddToBackpack(new BagOfChainmail());
                m_Player.SendMessage("The bag with armor is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Platemail:

                m_Player.AddToBackpack(new BagOfPlatemail());
                m_Player.SendMessage("The bag with armor is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Leather:

                m_Player.AddToBackpack(new BagOfLeatherArmor());
                m_Player.SendMessage("The bag with armor is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Studded:

                m_Player.AddToBackpack(new BagOfStuddedArmor());
                m_Player.SendMessage("The bag with armor is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Bone:

                m_Player.AddToBackpack(new BagOfBoneArmor());
                m_Player.SendMessage("The bag with armor is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Norse:

                m_Player.AddToBackpack(new NorseHelm());
                m_Player.SendMessage("The helmet is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Bascinet:

                m_Player.AddToBackpack(new Bascinet());
                m_Player.SendMessage("The helmet is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Orc:

                m_Player.AddToBackpack(new OrcHelm());
                m_Player.SendMessage("The helmet is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Helmet:

                m_Player.AddToBackpack(new Helmet());
                m_Player.SendMessage("The helmet is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Dragon:

                m_Player.AddToBackpack(new DragonHelm());
                m_Player.SendMessage("The helmet is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Close:

                m_Player.AddToBackpack(new CloseHelm());
                m_Player.SendMessage("The helmet is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Daemon:

                m_Player.AddToBackpack(new DaemonHelm());
                m_Player.SendMessage("The helmet is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Bronze:

                m_Player.AddToBackpack(new BronzeShield());
                m_Player.SendMessage("The shield is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Heater:

                m_Player.AddToBackpack(new HeaterShield());
                m_Player.SendMessage("The shield is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Buckler:

                m_Player.AddToBackpack(new Buckler());
                m_Player.SendMessage("The shield is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Kite:

                m_Player.AddToBackpack(new MetalKiteShield());
                m_Player.SendMessage("The shield is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.TearKite:

                m_Player.AddToBackpack(new WoodenKiteShield());
                m_Player.SendMessage("The shield is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Metal:

                m_Player.AddToBackpack(new MetalShield());
                m_Player.SendMessage("The shield is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Wooden:

                m_Player.AddToBackpack(new WoodenShield());
                m_Player.SendMessage("The shield is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Order:

                m_Player.AddToBackpack(new OrderShield());
                m_Player.SendMessage("The shield is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;

            case (int)Buttons.Chaos:

                m_Player.AddToBackpack(new ChaosShield());
                m_Player.SendMessage("The shield is now in your back pack.");
                m_Player.SendGump(new ArmorAddingGump(m_Player));
                break;
            }
        }