HasKeyword() public method

public HasKeyword ( int keyword ) : bool
keyword int
return bool
Esempio n. 1
0
		public override void OnSpeech( SpeechEventArgs e )
		{
			Mobile from = e.Mobile;
            if (XmlScript.HasTrigger(this, TriggerName.onSpeech) && UberScriptTriggers.Trigger(this, e.Mobile, TriggerName.onSpeech, null, e.Speech))
            {
                return;
            }

			if ( !e.Handled && from is PlayerMobile && from.InRange( this.Location, 2 ) && WasNamed( e.Speech ) )
			{
				PlayerMobile pm = (PlayerMobile)from;

				if ( e.HasKeyword( 0x0004 ) ) // *join* | *member*
				{
					if ( pm.NpcGuild == this.NpcGuild )
						SayTo( from, 501047 ); // Thou art already a member of our guild.
					else if ( pm.NpcGuild != NpcGuild.None )
						SayTo( from, 501046 ); // Thou must resign from thy other guild first.
                    else if (pm.Young || pm.GameTime < JoinGameAge || (pm.CreationTime + JoinAge) > DateTime.UtcNow)
                    {
                        SayTo(from, 501048); // You are too young to join my guild...
                        if (pm.GameTime < JoinGameAge)
                        {
                            pm.LocalOverheadMessage(MessageType.Regular, 38, false, "Your gametime (" + pm.GameTime + ") must reach " + JoinGameAge + " before you can join.");
                        }
                        else if ((pm.CreationTime + JoinAge) > DateTime.UtcNow)
                        {
                            pm.LocalOverheadMessage(MessageType.Regular, 38, false, "You must wait 7 days after creating your character to join. That will be at " + (pm.CreationTime + JoinAge) + " server time." );
                        }
                    }
                    else if (CheckCustomReqs(pm))
                        SayPriceTo(from);

					e.Handled = true;
				}
				else if ( e.HasKeyword( 0x0005 ) ) // *resign* | *quit*
				{
					if ( pm.NpcGuild != this.NpcGuild )
					{
						SayTo( from, 501052 ); // Thou dost not belong to my guild!
					}
					else if ( (pm.NpcGuildJoinTime + QuitAge) > DateTime.UtcNow || (pm.NpcGuildGameTime + QuitGameAge) > pm.GameTime )
					{
						SayTo( from, 501053 ); // You just joined my guild! You must wait a week to resign.
					}
					else
					{
						SayTo( from, 501054 ); // I accept thy resignation.
						pm.NpcGuild = NpcGuild.None;
					}

					e.Handled = true;
				}
			}

			base.OnSpeech( e );
		}
Esempio n. 2
0
		public override void OnSpeech( SpeechEventArgs e )
		{
			Mobile from = e.Mobile;

			if ( !e.Handled && from is PlayerMobile && from.InRange( this.Location, 2 ) && WasNamed( e.Speech ) )
			{
				PlayerMobile pm = (PlayerMobile)from;

				if ( e.HasKeyword( 0x0004 ) ) // *join* | *member*
				{
					if ( pm.NpcGuild == this.NpcGuild )
						SayTo( from, 501047 ); // Thou art already a member of our guild.
					else if ( pm.NpcGuild != NpcGuild.None )
						SayTo( from, 501046 ); // Thou must resign from thy other guild first.
					else if ( pm.GameTime < JoinGameAge || (pm.CreationTime + JoinAge) > DateTime.UtcNow )
						SayTo( from, 501048 ); // You are too young to join my guild...
					else if ( CheckCustomReqs( pm ) )
						SayPriceTo( from );

					e.Handled = true;
				}
				else if ( e.HasKeyword( 0x0005 ) ) // *resign* | *quit*
				{
					if ( pm.NpcGuild != this.NpcGuild )
					{
						SayTo( from, 501052 ); // Thou dost not belong to my guild!
					}
					else if ( (pm.NpcGuildJoinTime + QuitAge) > DateTime.UtcNow || (pm.NpcGuildGameTime + QuitGameAge) > pm.GameTime )
					{
						SayTo( from, 501053 ); // You just joined my guild! You must wait a week to resign.
					}
					else
					{
						SayTo( from, 501054 ); // I accept thy resignation.
						pm.NpcGuild = NpcGuild.None;
					}

					e.Handled = true;
				}
			}

			base.OnSpeech( e );
		}
Esempio n. 3
0
		public override void OnSpeech( SpeechEventArgs e )
		{
			if ( !e.Handled && e.Mobile.Alive && e.HasKeyword( 0x38 ) ) // *appraise*
			{
				PublicOverheadMessage( MessageType.Regular, 0x3B2, 500608 ); // Which deed would you like appraised?
				e.Mobile.BeginTarget( 12, false, TargetFlags.None, new TargetCallback( Appraise_OnTarget ) );
				e.Handled = true;
			}

			base.OnSpeech( e );
		}
		public override void OnSpeech( SpeechEventArgs e )
		{
			Mobile from = e.Mobile;

			if ( !e.Handled && from is PlayerMobile && from.InRange( this.Location, 4 ))
			{
				if ( e.HasKeyword( 0x0004 ) ) // *join*
				{
					SayPriceTo( from );

					e.Handled = true;
				}
			}

			base.OnSpeech( e );
		}
Esempio n. 5
0
		public override void OnSpeech( SpeechEventArgs e )
		{
			Mobile from = e.Mobile;

			if ( !e.Handled && from is PlayerMobile && from.InRange( this.Location, 2 ) && e.HasKeyword( 0x1F ) ) // *disguise*
			{
				PlayerMobile pm = (PlayerMobile)from;

				if ( pm.NpcGuild == NpcGuild.ThievesGuild )
					SayTo( from, 501839 ); // That particular item costs 700 gold pieces.
				else
					SayTo( from, 501838 ); // I don't know what you're talking about.

				e.Handled = true;
			}

			base.OnSpeech( e );
		}
Esempio n. 6
0
		public override void OnSpeech( SpeechEventArgs e )
		{
			if ( m_NewsTimer == null && e.HasKeyword( 0x30 ) && e.Mobile.Alive && InRange( e.Mobile, 12 ) ) // *news*
			{
				Direction = GetDirectionTo( e.Mobile );

				TownCrierEntry tce = GetRandomEntry();

				if ( tce == null )
				{
					PublicOverheadMessage( MessageType.Regular, 0x3B2, 1005643 ); // I have no news at this time.
				}
				else
				{
					m_NewsTimer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 3.0 ), new TimerStateCallback( ShoutNews_Callback ), new object[]{ tce, 0 } );

					PublicOverheadMessage( MessageType.Regular, 0x3B2, 502978 ); // Some of the latest news!
				}
			}
		}
		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.Now  <= 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 this.
				}
			}

			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.
				}
			}
		}
		public override void OnSpeech( SpeechEventArgs e )
		{
			Mobile from = e.Mobile;

			if ( e.Handled || !from.Alive || from.GetDistanceToSqrt( this ) > 3 )
				return;

			if ( e.HasKeyword( 0x3C ) || (e.HasKeyword( 0x171 ) && WasNamed( e.Speech ))  ) // vendor buy, *buy*
			{
				if ( IsOwner( from ) )
				{
					SayTo( from, 503212 ); // You own this shop, just take what you want.
				}
				else if ( House == null || !House.IsBanned( from ) )
				{
					from.SendLocalizedMessage( 503213 ); // Select the item you wish to buy.
					from.Target = new PVBuyTarget();

					e.Handled = true;
				}
			} 
			else if ( e.HasKeyword( 0x3D ) || (e.HasKeyword( 0x172 ) && WasNamed( e.Speech )) ) // vendor browse, *browse
			{
				if ( House != null && House.IsBanned( from ) && !IsOwner( from ) )
				{
					SayTo( from, 1062674 ); // You can't shop from this home as you have been banned from this establishment.
				}
				else
				{
					OpenBackpack( from );

					e.Handled = true;
				}
			}
			else if ( e.HasKeyword( 0x3E ) || (e.HasKeyword( 0x173 ) && WasNamed( e.Speech )) ) // vendor collect, *collect
			{
				if ( IsOwner( from ) )
				{
					CollectGold( from );

					e.Handled = true;
				}
			}
			else if ( e.HasKeyword( 0x3F ) || (e.HasKeyword( 0x174 ) && WasNamed( e.Speech )) ) // vendor status, *status
			{
				if ( IsOwner( from ) )
				{
					SendOwnerGump( from );

					e.Handled = true;
				}
				else
				{
					SayTo( from, 503226 ); // What do you care? You don't run this shop.	
				}
			}
			else if ( e.HasKeyword( 0x40 ) || (e.HasKeyword( 0x175 ) && WasNamed( e.Speech )) ) // vendor dismiss, *dismiss
			{
				if ( IsOwner( from ) )
				{
					Dismiss( from );

					e.Handled = true;
				}
			}
			else if ( e.HasKeyword( 0x41 ) || (e.HasKeyword( 0x176 ) && WasNamed( e.Speech )) ) // vendor cycle, *cycle
			{
				if ( IsOwner( from ) )
				{
					this.Direction = this.GetDirectionTo( from );

					e.Handled = true;
				}
			}
		}
Esempio n. 9
0
		public override void OnSpeech( SpeechEventArgs e )
		{
			if ( !e.Handled && e.HasKeyword( 0x0008 ) ) // *stable*
			{
				e.Handled = true;
				
				CloseClaimList( e.Mobile );				
				BeginStable( e.Mobile );
			}
			else if ( !e.Handled && e.HasKeyword( 0x0009 ) ) // *claim*
			{
				e.Handled = true;
				
				CloseClaimList( e.Mobile );
				
				int index = e.Speech.IndexOf( ' ' );

				if ( index != -1 )
					Claim( e.Mobile, e.Speech.Substring( index ).Trim() );
				else
					Claim( e.Mobile );
			}
			else
			{
				base.OnSpeech( e );
			}
		}
Esempio n. 10
0
        public override void OnSpeech( SpeechEventArgs e )
        {
            base.OnSpeech( e );

            EDI dest = GetDestination();

            if ( dest != null && !e.Handled && e.Mobile.InRange( this.Location, 3 ) )
            {
                if ( e.HasKeyword( 0x1D ) ) // *destination*
                    e.Handled = SayDestinationTo( e.Mobile );
                else if ( e.HasKeyword( 0x1E ) ) // *i will take thee*
                    e.Handled = AcceptEscorter( e.Mobile );
            }
        }
        public override void OnSpeech( SpeechEventArgs e )
        {
            base.OnSpeech( e );

            Mobile from = e.Mobile;

            if ( !e.Handled && InRange( from, ListenRange ) && from.Alive )
            {
                if ( e.HasKeyword( 0xE6 ) && (Insensitive.Equals( e.Speech, "orders" ) || WasNamed( e.Speech )) ) // *orders*
                {
                    if ( m_Town == null || !m_Town.IsSheriff( from ) )
                    {
                        this.Say( 1042189 ); // I don't work for you!
                    }
                    else if ( Town.FromRegion( this.Region ) == m_Town )
                    {
                        this.Say( 1042180 ); // Your orders, sire?
                        m_OrdersEnd = Core.Now + TimeSpan.FromSeconds( 10.0 );
                    }
                }
                else if ( Core.Now < m_OrdersEnd )
                {
                    if ( m_Town != null && m_Town.IsSheriff( from ) && Town.FromRegion( this.Region ) == m_Town )
                    {
                        m_OrdersEnd = Core.Now + TimeSpan.FromSeconds( 10.0 );

                        bool understood = true;
                        ReactionType newType = 0;

                        if ( Insensitive.Contains( e.Speech, "attack" ) )
                            newType = ReactionType.Attack;
                        else if ( Insensitive.Contains( e.Speech, "warn" ) )
                            newType = ReactionType.Warn;
                        else if ( Insensitive.Contains( e.Speech, "ignore" ) )
                            newType = ReactionType.Ignore;
                        else
                            understood = false;

                        if ( understood )
                        {
                            understood = false;

                            if ( Insensitive.Contains( e.Speech, "civil" ) )
                            {
                                ChangeReaction( null, newType );
                                understood = true;
                            }

                            FactionCollection factions = Faction.Factions;

                            for ( int i = 0; i < factions.Count; ++i )
                            {
                                Faction faction = factions[i];

                                if ( faction != m_Faction && Insensitive.Contains( e.Speech, faction.Definition.Keyword ) )
                                {
                                    ChangeReaction( faction, newType );
                                    understood = true;
                                }
                            }
                        }
                        else if ( Insensitive.Contains( e.Speech, "patrol" ) )
                        {
                            Home = Location;
                            RangeHome = 6;
                            Combatant = null;
                            m_Orders.Movement = MovementType.Patrol;
                            Say( 1005146 ); // This spot looks like it needs protection!  I shall guard it with my life.
                            understood = true;
                        }
                        else if ( Insensitive.Contains( e.Speech, "follow" ) )
                        {
                            Home = Location;
                            RangeHome = 6;
                            Combatant = null;
                            m_Orders.Follow = from;
                            m_Orders.Movement = MovementType.Follow;
                            Say( 1005144 ); // Yes, Sire.
                            understood = true;
                        }

                        if ( !understood )
                            Say( 1042183 ); // I'm sorry, I don't understand your orders...
                    }
                }
            }
        }
Esempio n. 12
0
		public override void OnSpeech( SpeechEventArgs e )
		{
			if( !e.Handled && e.Mobile.InRange( this, 6 ) )
			{
				int[] keywords = e.Keywords;
				string speech = e.Speech;

				// Check for a greeting or 'Hire'
				if( (e.HasKeyword( 0x003B ) == true) || (e.HasKeyword( 0x0162 ) == true) )
					e.Handled = this.SayHireCost();
			}

			base.OnSpeech( e );
		}
Esempio n. 13
0
		public virtual void OnSpeech(SpeechEventArgs e)
		{
			if (e.Mobile.Alive && e.Mobile.InRange(m_Mobile.Location, 3) && m_Mobile.IsHumanInTown())
			{
				if (e.HasKeyword(0x9D) && WasNamed(e.Speech)) // *move*
				{
					if (m_Mobile.Combatant != null)
					{
						// I am too busy fighting to deal with thee!
						m_Mobile.PublicOverheadMessage(MessageType.Regular, 0x3B2, 501482);
					}
					else
					{
						// Excuse me?
						m_Mobile.PublicOverheadMessage(MessageType.Regular, 0x3B2, 501516);
						WalkRandomInHome(2, 2, 1);
					}
				}
				else if (e.HasKeyword(0x9E) && WasNamed(e.Speech)) // *time*
				{
					if (m_Mobile.Combatant != null)
					{
						// I am too busy fighting to deal with thee!
						m_Mobile.PublicOverheadMessage(MessageType.Regular, 0x3B2, 501482);
					}
					else
					{
						int generalNumber;
						string exactTime;

						Clock.GetTime(m_Mobile, out generalNumber, out exactTime);

						m_Mobile.PublicOverheadMessage(MessageType.Regular, 0x3B2, generalNumber);
					}
				}
				else if (e.HasKeyword(0x6C) && WasNamed(e.Speech)) // *train
				{
					if (m_Mobile.Combatant != null)
					{
						// I am too busy fighting to deal with thee!
						m_Mobile.PublicOverheadMessage(MessageType.Regular, 0x3B2, 501482);
					}
					else
					{
						bool foundSomething = false;

						Skills ourSkills = m_Mobile.Skills;
						Skills theirSkills = e.Mobile.Skills;

						for (int i = 0; i < ourSkills.Length && i < theirSkills.Length; ++i)
						{
							Skill skill = ourSkills[i];
							Skill theirSkill = theirSkills[i];

							if (skill != null && theirSkill != null && skill.Base >= 60.0 && m_Mobile.CheckTeach(skill.SkillName, e.Mobile))
							{
								double toTeach = skill.Base / 3.0;

								if (toTeach > 42.0)
									toTeach = 42.0;

								if (toTeach > theirSkill.Base)
								{
									int number = 1043059 + i;

									if (number > 1043107)
										continue;

									if (!foundSomething)
										m_Mobile.Say(1043058); // I can train the following:

									m_Mobile.Say(number);

									foundSomething = true;
								}
							}
						}

						if (!foundSomething)
							m_Mobile.Say(501505); // Alas, I cannot teach thee anything.
					}
				}
				else
				{
					SkillName toTrain = (SkillName)(-1);

					for (int i = 0; toTrain == (SkillName)(-1) && i < e.Keywords.Length; ++i)
					{
						int keyword = e.Keywords[i];

						if (keyword == 0x154)
						{
							toTrain = SkillName.Anatomy;
						}
						else if (keyword >= 0x6D && keyword <= 0x9C)
						{
							int index = keyword - 0x6D;

							if (index >= 0 && index < m_KeywordTable.Length)
								toTrain = m_KeywordTable[index];
						}
					}

					if (toTrain != (SkillName)(-1) && WasNamed(e.Speech))
					{
						if (m_Mobile.Combatant != null)
						{
							// I am too busy fighting to deal with thee!
							m_Mobile.PublicOverheadMessage(MessageType.Regular, 0x3B2, 501482);
						}
						else
						{
							Skills skills = m_Mobile.Skills;
							Skill skill = skills[toTrain];

							if (skill == null || skill.Base < 60.0 || !m_Mobile.CheckTeach(toTrain, e.Mobile))
							{
								m_Mobile.Say(501507); // 'Tis not something I can teach thee of.
							}
							else
							{
								m_Mobile.Teach(toTrain, e.Mobile, 0, false);
							}
						}
					}
				}
			}

			string heardspeech = e.Speech;
			if (!m_Mobile.IOBFollower && m_Mobile.IOBAlignment != IOBAlignment.None && !m_Mobile.Tamable) // if we're NOT already following someone, listen for join command
			{
				if (CoreAI.IsDynamicFeatureSet(CoreAI.FeatureBits.IOBJoinEnabled))
				{
					if (heardspeech.ToLower().IndexOf("join me") != -1)
					{
						if (WasNamed(heardspeech))
						{
							if (e.Mobile is PlayerMobile)
							{
								PlayerMobile thispm = (PlayerMobile)e.Mobile;
								if (m_Mobile.IOBAlignment == thispm.IOBAlignment && thispm.IOBEquipped) //has to be same alignment
								{
									m_Mobile.AttemptIOBJoin(thispm);
									return;
								}
							}
						}
						else if (heardspeech.ToLower().IndexOf("all") != -1)
						{
							if (e.Mobile is PlayerMobile)
							{
								PlayerMobile thispm = (PlayerMobile)e.Mobile;
								if (m_Mobile.IOBAlignment == thispm.IOBAlignment && thispm.IOBEquipped) //has to be same alignment
								{
									m_Mobile.AttemptIOBJoin(thispm);
									return;
								}
							}
						}
					}
				}
			}

			if (m_Mobile.Controlled && m_Mobile.Commandable && !m_Mobile.IOBFollower)
			{
				m_Mobile.DebugSay("I listen");

				if (e.Mobile.Alive && e.Mobile == m_Mobile.ControlMaster)
				{
					m_Mobile.DebugSay("Its from my master");

					// erl: clear herding attempt, if one exists
					m_Mobile.TargetLocation = Point2D.Zero;

					int[] keywords = e.Keywords;
					string speech = e.Speech;

					// allow orcs to command in their own language
					if (speech.ToLower() == "lat stai") // all stay
					{
						if (m_Mobile.CheckControlChance(e.Mobile))
						{
							m_Mobile.ControlTarget = null;
							m_Mobile.ControlOrder = OrderType.Stay;
						}
						return;
					}
					if (speech.ToLower() == "lat clomp")
					{
						BeginPickTarget(e.Mobile, OrderType.Attack);
						return;
					}
					if (speech.ToLower() == "lat follow")
					{
						BeginPickTarget(e.Mobile, OrderType.Follow);
						return;
					}

					// First, check the all*
					for (int i = 0; i < keywords.Length; ++i)
					{
						int keyword = keywords[i];

						switch (keyword)
						{
							case 0x164: // all come
								{
									if (m_Mobile.CheckControlChance(e.Mobile))
									{
										m_Mobile.ControlTarget = null;
										m_Mobile.ControlOrder = OrderType.Come;
									}

									return;
								}
							case 0x165: // all follow
								{
									BeginPickTarget(e.Mobile, OrderType.Follow);
									return;
								}
							case 0x166: // all guard
								{
									if (m_Mobile.CheckControlChance(e.Mobile))
									{
										m_Mobile.ControlTarget = null;
										m_Mobile.ControlOrder = OrderType.Guard;
									}
									return;
								}
							case 0x167: // all stop
								{
									if (m_Mobile.CheckControlChance(e.Mobile))
									{
										m_Mobile.ControlTarget = null;
										m_Mobile.ControlOrder = OrderType.Stop;
									}
									return;
								}
							case 0x168: // all kill
							case 0x169: // all attack
								{
									BeginPickTarget(e.Mobile, OrderType.Attack);
									return;
								}
							case 0x16B: // all guard me
								{
									if (m_Mobile.CheckControlChance(e.Mobile))
									{
										m_Mobile.ControlTarget = e.Mobile;
										m_Mobile.ControlOrder = OrderType.Guard;
									}
									return;
								}
							case 0x16C: // all follow me
								{
									if (m_Mobile.CheckControlChance(e.Mobile))
									{
										m_Mobile.ControlTarget = e.Mobile;
										m_Mobile.ControlOrder = OrderType.Follow;
									}
									return;
								}
							case 0x170: // all stay
								{
									if (m_Mobile.CheckControlChance(e.Mobile))
									{
										m_Mobile.ControlTarget = null;
										m_Mobile.ControlOrder = OrderType.Stay;
									}
									return;
								}
						}
					}

					// No all*, so check *command
					for (int i = 0; i < keywords.Length; ++i)
					{
						int keyword = keywords[i];

						switch (keyword)
						{
							case 0x155: // *come
								{
									if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
									{
										m_Mobile.ControlTarget = null;
										m_Mobile.ControlOrder = OrderType.Come;
									}

									return;
								}
							case 0x156: // *drop
								{
									if (!m_Mobile.IsDeadPet && !m_Mobile.Summoned && WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
									{
										m_Mobile.ControlTarget = null;
										m_Mobile.ControlOrder = OrderType.Drop;
									}

									return;
								}
							case 0x15A: // *follow
								{
									if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
										BeginPickTarget(e.Mobile, OrderType.Follow);

									return;
								}
							case 0x15C: // *guard
								{
									if (!m_Mobile.IsDeadPet && WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
									{
										m_Mobile.ControlTarget = null;
										m_Mobile.ControlOrder = OrderType.Guard;
									}

									return;
								}
							case 0x15D: // *kill
							case 0x15E: // *attack
								{
									if (!m_Mobile.IsDeadPet && WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
										BeginPickTarget(e.Mobile, OrderType.Attack);

									return;
								}
							case 0x15F: // *patrol
								{
									if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
									{
										m_Mobile.ControlTarget = null;
										m_Mobile.ControlOrder = OrderType.Patrol;
									}

									return;
								}
							case 0x161: // *stop
								{
									if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
									{
										m_Mobile.ControlTarget = null;
										m_Mobile.ControlOrder = OrderType.Stop;
									}

									return;
								}
							case 0x163: // *follow me
								{
									if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
									{
										m_Mobile.ControlTarget = e.Mobile;
										m_Mobile.ControlOrder = OrderType.Follow;
									}

									return;
								}
							case 0x16D: // *release
								{
									if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
									{
										if (!m_Mobile.Summoned)
										{
											e.Mobile.SendGump(new Gumps.ConfirmReleaseGump(e.Mobile, m_Mobile));
										}
										else
										{
											m_Mobile.ControlTarget = null;
											m_Mobile.ControlOrder = OrderType.Release;
										}
									}
									return;
								}

							case 0x16E: // *transfer
								{
									if (!m_Mobile.IsDeadPet && WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
									{
										if (m_Mobile.Summoned)
											e.Mobile.SendLocalizedMessage(1005487); // You cannot transfer ownership of a summoned creature.
										else
											BeginPickTarget(e.Mobile, OrderType.Transfert);
									}

									return;
								}
							case 0x16F: // *stay
								{
									if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
									{
										m_Mobile.ControlTarget = null;
										m_Mobile.ControlOrder = OrderType.Stay;
									}

									return;
								}
						}
					}
				}
			}
			else if (m_Mobile.IOBFollower && !m_Mobile.Tamable)
			{
				m_Mobile.DebugSay("I listen to IOBLeader");

				if (e.Mobile.Alive && e.Mobile == m_Mobile.ControlMaster && ((PlayerMobile)e.Mobile).IOBEquipped)
				{
					m_Mobile.DebugSay("Its from my IOBLeader master");

					int[] keywords = e.Keywords;
					string speech = e.Speech;

					// allow orcs to command in their own language
					if (speech.ToLower() == "lat stai") // all stay
					{
						m_Mobile.ControlTarget = null;
						m_Mobile.ControlOrder = OrderType.Stay;
						return;
					}
					if (speech.ToLower() == "lat clomp")
					{
						BeginPickTarget(e.Mobile, OrderType.Attack);
						return;
					}
					if (speech.ToLower() == "lat follow")
					{
						m_Mobile.ControlTarget = e.Mobile;
						m_Mobile.ControlOrder = OrderType.Follow;
						return;
					}

					// First, check the all*
					for (int i = 0; i < keywords.Length; ++i)
					{
						int keyword = keywords[i];

						switch (keyword)
						{
							case 0x164: // all come
								{
									m_Mobile.ControlTarget = null;
									m_Mobile.ControlOrder = OrderType.Come;
									return;
								}
							case 0x165: // all follow
							case 0x16C: // all follow me
								{
									m_Mobile.ControlTarget = e.Mobile;
									m_Mobile.ControlOrder = OrderType.Follow;
									return;
								}
							case 0x167: // all stop
								{
									m_Mobile.ControlTarget = null;
									m_Mobile.ControlOrder = OrderType.Stop;
									return;
								}
							case 0x168: // all kill
							case 0x169: // all attack
								{
									BeginPickTarget(e.Mobile, OrderType.Attack);
									return;
								}
							case 0x170: // all stay
								{
									m_Mobile.ControlTarget = null;
									m_Mobile.ControlOrder = OrderType.Stay;
									return;
								}
						}
					}

					// No all*, so check *command
					for (int i = 0; i < keywords.Length; ++i)
					{
						int keyword = keywords[i];

						switch (keyword)
						{
							case 0x155: // *come
								{
									if (WasNamed(speech))
									{
										m_Mobile.ControlTarget = null;
										m_Mobile.ControlOrder = OrderType.Come;
									}
									return;
								}
							case 0x15A: // *follow
							case 0x163: // *follow me
								{
									if (WasNamed(speech))
									{
										m_Mobile.ControlTarget = e.Mobile;
										m_Mobile.ControlOrder = OrderType.Follow;
									}

									return;
								}
							case 0x161: // *stop
								{
									if (WasNamed(speech))
									{
										m_Mobile.ControlTarget = null;
										m_Mobile.ControlOrder = OrderType.Stop;
									}

									return;
								}
							case 0x15D: // *kill
							case 0x15E: // *attack
								{
									if (!m_Mobile.IsDeadPet && WasNamed(speech))
										BeginPickTarget(e.Mobile, OrderType.Attack);

									return;
								}
							case 0x16F: // *stay
								{
									if (WasNamed(speech))
									{
										m_Mobile.ControlTarget = null;
										m_Mobile.ControlOrder = OrderType.Stay;
									}
									return;
								}
						}
					}

					if (speech.ToLower().IndexOf("all dismiss") != -1)
					{
						m_Mobile.AttemptIOBDismiss();
						return;
					}
					else if (speech.ToLower().IndexOf("dismiss") != -1)
					{
						if (WasNamed(speech))
						{
							m_Mobile.AttemptIOBDismiss();
						}
						return;
					}

				}
			}
			else
			{
				if (e.Mobile.AccessLevel >= AccessLevel.GameMaster)
				{
					m_Mobile.DebugSay("Its from a GM");

					if (m_Mobile.FindMyName(e.Speech, true))
					{
						string[] str = e.Speech.Split(' ');
						int i;

						for (i = 0; i < str.Length; i++)
						{
							string word = str[i];

							if (Insensitive.Equals(word, "obey"))
							{
								m_Mobile.SetControlMaster(e.Mobile);

								if (m_Mobile.Summoned)
									m_Mobile.SummonMaster = e.Mobile;

								return;
							}
						}
					}
				}
			}
		}
        public override void OnSpeech( SpeechEventArgs args )
        {
            base.OnSpeech( args );

            if (IsDisabled())
                return;

            if ( args.Mobile.Alive && (args.HasKeyword( 0x0007 ) || args.Speech.ToLower().Contains("guards") || args.Speech.ToLower().Contains("guardas")) ) // *guards*
                CallGuards( args.Mobile.Location );
        }
Esempio n. 15
0
        public override void OnSpeech( SpeechEventArgs e )
        {
            Mobile from = e.Mobile;

            if ( e.Handled || !from.Alive || from.GetDistanceToSqrt( this ) > 3 )
                return;

            if ( e.HasKeyword( 0x3C ) || (e.HasKeyword( 0x171 ) && WasNamed( e.Speech ))  ) // vendor buy, *buy*
            {
                if ( IsOwner( from ) )
                {
                    SayTo( from, true, "You own this shop, just take what you want." ); // You own this shop, just take what you want.
                }
                else if ( House == null || !House.IsBanned( from ) )
                {
                    from.SendAsciiMessage( "Select the item you wish to buy." ); // Select the item you wish to buy.
                    from.Target = new PVBuyTarget();

                    e.Handled = true;
                }
            }
            else if ( e.HasKeyword( 0x3D ) || (e.HasKeyword( 0x172 ) && WasNamed( e.Speech )) ) // vendor browse, *browse
            {
                if ( House != null && House.IsBanned( from ) && !IsOwner( from ) )
                {
                    SayTo( from, 1062674 ); // You can't shop from this home as you have been banned from this establishment.
                }
                else
                {
                    OpenBackpack( from );

                    e.Handled = true;
                }
            }
            else if ( e.HasKeyword( 0x3E ) || (e.HasKeyword( 0x173 ) && WasNamed( e.Speech )) ) // vendor collect, *collect
            {
                if ( IsOwner( from ) )
                {
                    CollectGold( from );

                    e.Handled = true;
                }
            }
            else if ( e.HasKeyword( 0x3F ) || (e.HasKeyword( 0x174 ) && WasNamed( e.Speech )) ) // vendor status, *status
            {
                if ( IsOwner( from ) )
                {
                    double days = (HoldGold + BankAccount) / ((double)ChargePerDay);

                    /*SayTo(from, true, String.Format("Amount of days I can work: {0}", ((int)days).ToString()));
                    SayTo(from, true, String.Format("Earth days: {0}", ((int)(days/12)).ToString()));
                    SayTo(from, true, String.Format("Gold held for you: {0}gp", HoldGold.ToString()));
                    SayTo(from, true, String.Format("Gold held in my account: {0}gp", BankAccount.ToString()));
                    SayTo(from, true, String.Format("My charge per day is: {0}gp", ChargePerDay.ToString()));*/

                    SayTo(from, true, String.Format("I am holding {0} gold for you.", HoldGold.ToString()));
                    SayTo(from, true, String.Format("My current charge is {0} gold per day.", ChargePerDay.ToString()));

                    if (((HoldGold + BankAccount) / ChargePerDay) > 0)
                        SayTo(from, true, String.Format("Including your gold I'm holding, I have enough gold to continue working for {0} days. ({1} earth days)", ((int)days).ToString(), ((int)(days / 12)).ToString()));
                    else
                        SayTo(from, true, String.Format("You need to give me {0} gold by the end of the day to retain my services.", (ChargePerDay - HoldGold - BankAccount).ToString()));
                    //SendOwnerGump( from );

                    e.Handled = true;
                }
                else
                {
                    SayTo( from, true, "What do you care? You don't run this shop." ); // What do you care? You don't run this shop.
                }
            }
            else if ( e.HasKeyword( 0x40 ) || (e.HasKeyword( 0x175 ) && WasNamed( e.Speech )) ) // vendor dismiss, *dismiss
            {
                if ( IsOwner( from ) )
                {
                    Dismiss( from );

                    e.Handled = true;
                }
            }
            else if ( e.HasKeyword( 0x41 ) || (e.HasKeyword( 0x176 ) && WasNamed( e.Speech )) ) // vendor cycle, *cycle
            {
                if ( IsOwner( from ) )
                {
                    this.Direction = this.GetDirectionTo( from );

                    e.Handled = true;
                }
            }
        }
		public override void OnSpeech( SpeechEventArgs e )
		{
			Mobile from = e.Mobile;

			if ( !from.Alive )
				return;

			else if ( e.HasKeyword( 0x23 ) ) // I wish to lock this down
			{
				if ( from == m_Stone.Mayor )
				{
					from.Target = new CityLockDownTarget( m_Stone );
					from.SendMessage( "What would you like to secure?" );
				}
			}
			else if ( e.HasKeyword( 0x24 ) ) // I wish to release this
			{
				if ( from == m_Stone.Mayor )
				{
					from.Target = new CityReleaseTarget( m_Stone );
					from.SendMessage( "What would you like to release?" );
				}
			}
			else if ( e.HasKeyword( 0x34 ) ) // I ban thee
			{
				if ( from == m_Stone.Mayor )
				{
					from.Target = new CityBanTarget( m_Stone );
					from.SendMessage( "Who do you wish to ban?" );
				}
			}
			
			base.OnSpeech( e );
		}
Esempio n. 17
0
        public override void OnSpeech( SpeechEventArgs e )
        {
            if ( !e.Handled && e.Mobile.InRange( this.Location, 2 ) )
            {
                if ( e.HasKeyword( Keyword )  )
                {
                    e.Handled = true;

                    Mobile from = e.Mobile;
                    Guild g = from.Guild as Server.Guilds.Guild;

                    if ( from.Karma < (int)Noto.Great )
                    {
                        Say( "Thou art not famous enough to join our ranks." );
                        return;
                    }
                    else if ( g != null && g.Type != GuildType.Regular && g.Type != Type )
                    {
                        Say( "Thou art not properly affiliated to join our ranks." );
                        return;
                    }
                    else
                    {
                        Container pack = from.Backpack;
                        BaseShield shield = Shield;
                        Item twoHanded = from.FindItemOnLayer( Layer.TwoHanded );

                        if ( (pack != null && pack.FindItemByType( shield.GetType() ) != null) || ( twoHanded != null && shield.GetType().IsAssignableFrom( twoHanded.GetType() ) ) )
                        {
                            Say( "Why dost thou ask about virtue guards when thou art one?" );
                            shield.Delete();
                        }
                        else if ( from.PlaceInBackpack( shield ) )
                        {
                            Say( Utility.Random( 1007101, 5 ) );
                            Say( "Welcome to our ranks.  Here is thy shield." );
                            from.AddToBackpack( shield );
                        }
                        else
                        {
                            from.SendLocalizedMessage( 502868 ); // Your backpack is too full.
                            shield.Delete();
                        }
                    }
                }
                else
                {
                    if ( Utility.RandomBool() )
                    {
                        if ( SignupNumber > 0 )
                            Say( SignupNumber );
                        else if ( SignupString != "" )
                            Say( SignupString );
                        e.Handled = true;
                    }
                }
            }

            base.OnSpeech( e );
        }
Esempio n. 18
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            Mobile from = e.Mobile;

            if (!from.Alive || !m_House.IsInside(from))
                return;

            bool isOwner = m_House.IsOwner(from);

            if (isOwner && e.HasKeyword(0x28))
                m_House.AddTrashBarrel(from);
        }
        public override void OnSpeech( SpeechEventArgs e )
        {
            if ( !e.Handled && Active )
            {
                Mobile m = e.Mobile;

                if ( !Creatures && !m.Player )
                    return;

                if ( !m.InRange( GetWorldLocation(), m_Range ) )
                    return;

                bool isMatch = false;

                string speech = e.Speech.ToLower();

                if ( m_Substring != null )
                {
                    string[] keywords = m_Substring.Split( Delimeter );
                    for ( int i = 0; !isMatch && i < keywords.Length; i++ )
                        if ( speech.IndexOf( keywords[i] ) >= 0 )
                            isMatch = true;
                }
                else if ( m_Keyword >= 0 && e.HasKeyword( m_Keyword ) )
                    isMatch = true;

                if ( isMatch )
                {
                    e.Handled = true;
                    StartTeleport( m );
                }
            }
        }
Esempio n. 20
0
        public override void OnSpeech( SpeechEventArgs e )
        {
            base.OnSpeech( e );

            if ( !e.Handled && InRange( e.Mobile, 3 ) )
            {
                if ( m_NewsTimer == null && e.HasKeyword( 0x30 ) ) // *news*
                {
                    TownCrierEntry tce = GlobalTownCrierEntryList.Instance.GetRandomEntry();

                    if ( tce == null )
                    {
                        PublicOverheadMessage( MessageType.Regular, 0x3B2, 1005643 ); // I have no news at this time.
                    }
                    else
                    {
                        m_NewsTimer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 3.0 ), new TimerStateCallback( ShoutNews_Callback ), new object[]{ tce, 0 } );

                        PublicOverheadMessage( MessageType.Regular, 0x3B2, 502978 ); // Some of the latest news!
                    }
                }

                for ( int i = 0; i < m_Rumors.Length; ++i )
                {
                    BarkeeperRumor rumor = m_Rumors[i];

                    if ( rumor == null )
                        continue;

                    string keyword = rumor.Keyword;

                    if ( keyword == null || (keyword = keyword.Trim()).Length == 0 )
                        continue;

                    if ( Insensitive.Equals( keyword, e.Speech ) )
                    {
                        string message = rumor.Message;

                        if ( message == null || (message = message.Trim()).Length == 0 )
                            continue;

                        PublicOverheadMessage( MessageType.Regular, 0x3B2, false, message );
                    }
                }
            }
        }
Esempio n. 21
0
        public override void OnSpeech( SpeechEventArgs e )
        {
            Mobile from = e.Mobile;

            if ( e.Handled )
                return;

            if ( e.HasKeyword( 0x3C ) || (e.HasKeyword( 0x171 ) && WasNamed( e.Speech ))  ) // vendor buy, *buy*
            {
                if ( IsOwner( from ) )
                {
                    SayTo( from, 503212 ); // You own this shop, just take what you want.
                }
                else
                {
                    from.SendLocalizedMessage( 503213 );// Select the item you wish to buy.
                    from.Target = new PVBuyTarget();
                    e.Handled = true;
                }
            }
            else if ( e.HasKeyword( 0x3D ) || (e.HasKeyword( 0x172 ) && WasNamed( e.Speech )) ) // vendor browse, *browse
            {
                Container pack = Backpack;

                if ( pack != null )
                {
                    SayTo( from, IsOwner( from ) ? 1010642 : 503208 );// Take a look at my/your goods.
                    pack.DisplayTo( from );
                    e.Handled = true;
                }
            }
            else if ( e.HasKeyword( 0x3E ) || (e.HasKeyword( 0x173 ) && WasNamed( e.Speech )) ) // vendor collect, *collect
            {
                if ( IsOwner( from ) )
                {
                    GiveGold( from );
                    e.Handled = true;
                }
            }
            else if ( e.HasKeyword( 0x3F ) || (e.HasKeyword( 0x174 ) && WasNamed( e.Speech )) ) // vendor status, *status
            {
                if ( IsOwner( from  ) )
                {
                    from.SendGump( new PlayerVendorOwnerGump( this, from ) );
                    e.Handled = true;
                }
                else
                {
                    SayTo( from, 503226 ); // What do you care? You don't run this shop.
                }
            }
            else if ( e.HasKeyword( 0x40 ) || (e.HasKeyword( 0x175 ) && WasNamed( e.Speech )) ) // vendor dismiss, *dismiss
            {
                if ( IsOwner( from ) )
                    Dismiss( from );
            }
            else if ( e.HasKeyword( 0x41 ) || (e.HasKeyword( 0x176 ) && WasNamed( e.Speech )) ) // vendor cycle, *cycle
            {
                if ( IsOwner( from ) )
                    this.Direction = this.GetDirectionTo( from );
            }
        }
Esempio n. 22
0
        public virtual void OnSpeech( SpeechEventArgs e )
        {
            if( e.Mobile.Alive && e.Mobile.InRange( m_Mobile.Location, 3 ) && m_Mobile.IsHumanInTown() )
            {
                if( e.HasKeyword( 0x9D ) && WasNamed( e.Speech ) ) // *move*
                {
                    if( m_Mobile.Combatant != null )
                    {
                        // I am too busy fighting to deal with thee!
                        m_Mobile.PublicOverheadMessage( MessageType.Regular, 0x3B2, 501482 );
                    }
                    else
                    {
                        // Excuse me?
                        m_Mobile.PublicOverheadMessage( MessageType.Regular, 0x3B2, 501516 );
                        WalkRandomInHome( 2, 2, 1 );
                    }
                }
                else if( e.HasKeyword( 0x9E ) && WasNamed( e.Speech ) ) // *time*
                {
                    if( m_Mobile.Combatant != null )
                    {
                        // I am too busy fighting to deal with thee!
                        m_Mobile.PublicOverheadMessage( MessageType.Regular, 0x3B2, 501482 );
                    }
                    else
                    {
                        int generalNumber;
                        string exactTime;

                        Clock.GetTime( m_Mobile, out generalNumber, out exactTime );

                        m_Mobile.PublicOverheadMessage( MessageType.Regular, 0x3B2, generalNumber );
                    }
                }
                else if( e.HasKeyword( 0x6C ) && WasNamed( e.Speech ) ) // *train
                {
                    if( m_Mobile.Combatant != null )
                    {
                        // I am too busy fighting to deal with thee!
                        m_Mobile.PublicOverheadMessage( MessageType.Regular, 0x3B2, 501482 );
                    }
                    else
                    {
                        bool foundSomething = false;

                        Skills ourSkills = m_Mobile.Skills;
                        Skills theirSkills = e.Mobile.Skills;

                        for( int i = 0; i < ourSkills.Length && i < theirSkills.Length; ++i )
                        {
                            Skill skill = ourSkills[i];
                            Skill theirSkill = theirSkills[i];

                            if( skill != null && theirSkill != null && skill.Base >= 60.0 && m_Mobile.CheckTeach( skill.SkillName, e.Mobile ) )
                            {
                                double toTeach = skill.Base / 3.0;

                                if( toTeach > 42.0 )
                                    toTeach = 42.0;

                                if( toTeach > theirSkill.Base )
                                {
                                    int number = 1043059 + i;

                                    if( number > 1043107 )
                                        continue;

                                    if( !foundSomething )
                                        m_Mobile.Say( 1043058 ); // I can train the following:

                                    m_Mobile.Say( number );

                                    foundSomething = true;
                                }
                            }
                        }

                        if( !foundSomething )
                            m_Mobile.Say( 501505 ); // Alas, I cannot teach thee anything.
                    }
                }
                else
                {
                    SkillName toTrain = (SkillName)(-1);

                    for( int i = 0; toTrain == (SkillName)(-1) && i < e.Keywords.Length; ++i )
                    {
                        int keyword = e.Keywords[i];

                        if( keyword == 0x154 )
                        {
                            toTrain = SkillName.Anatomy;
                        }
                        else if( keyword >= 0x6D && keyword <= 0x9C )
                        {
                            int index = keyword - 0x6D;

                            if( index >= 0 && index < m_KeywordTable.Length )
                                toTrain = m_KeywordTable[index];
                        }
                    }

                    if( toTrain != (SkillName)(-1) && WasNamed( e.Speech ) )
                    {
                        if( m_Mobile.Combatant != null )
                        {
                            // I am too busy fighting to deal with thee!
                            m_Mobile.PublicOverheadMessage( MessageType.Regular, 0x3B2, 501482 );
                        }
                        else
                        {
                            Skills skills = m_Mobile.Skills;
                            Skill skill = skills[toTrain];

                            if( skill == null || skill.Base < 60.0 || !m_Mobile.CheckTeach( toTrain, e.Mobile ) )
                            {
                                m_Mobile.Say( 501507 ); // 'Tis not something I can teach thee of.
                            }
                            else
                            {
                                m_Mobile.Teach( toTrain, e.Mobile, 0, false );
                            }
                        }
                    }
                }
            }

            if( m_Mobile.Controlled && m_Mobile.Commandable )
            {
                m_Mobile.DebugSay( "Listening..." );

                bool isOwner = (e.Mobile == m_Mobile.ControlMaster);
                bool isFriend = (!isOwner && m_Mobile.IsPetFriend( e.Mobile ));

                if( e.Mobile.Alive && (isOwner || isFriend) )
                {
                    m_Mobile.DebugSay( "It's from my master" );

                    int[] keywords = e.Keywords;
                    string speech = e.Speech;

                    // First, check the all*
                    for( int i = 0; i < keywords.Length; ++i )
                    {
                        int keyword = keywords[i];

                        switch( keyword )
                        {
                            case 0x164: // all come
                            {
                                if( !isOwner )
                                    break;

                                if( m_Mobile.CheckControlChance( e.Mobile ) )
                                {
                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Come;
                                }

                                return;
                            }
                            case 0x165: // all follow
                            {
                                BeginPickTarget( e.Mobile, OrderType.Follow );
                                return;
                            }
                            case 0x166: // all guard
                            case 0x16B: // all guard me
                            {
                                if( !isOwner )
                                    break;

                                if( m_Mobile.CheckControlChance( e.Mobile ) )
                                {
                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Guard;
                                }
                                return;
                            }
                            case 0x167: // all stop
                            {
                                if( m_Mobile.CheckControlChance( e.Mobile ) )
                                {
                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Stop;
                                }
                                return;
                            }
                            case 0x168: // all kill
                            case 0x169: // all attack
                            {
                                if( !isOwner )
                                    break;

                                BeginPickTarget( e.Mobile, OrderType.Attack );
                                return;
                            }
                            case 0x16C: // all follow me
                            {
                                if( m_Mobile.CheckControlChance( e.Mobile ) )
                                {
                                    m_Mobile.ControlTarget = e.Mobile;
                                    m_Mobile.ControlOrder = OrderType.Follow;
                                }
                                return;
                            }
                            case 0x170: // all stay
                            {
                                if( m_Mobile.CheckControlChance( e.Mobile ) )
                                {
                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Stay;
                                }
                                return;
                            }
                        }
                    }

                    // No all*, so check *command
                    for( int i = 0; i < keywords.Length; ++i )
                    {
                        int keyword = keywords[i];

                        switch( keyword )
                        {
                            case 0x155: // *come
                            {
                                if( !isOwner )
                                    break;

                                if( WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) )
                                {
                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Come;
                                }

                                return;
                            }
                            case 0x156: // *drop
                            {
                                if( !isOwner )
                                    break;

                                if( !m_Mobile.IsDeadPet && !m_Mobile.Summoned && WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) )
                                {
                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Drop;
                                }

                                return;
                            }
                            case 0x15A: // *follow
                            {
                                if( WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) )
                                    BeginPickTarget( e.Mobile, OrderType.Follow );

                                return;
                            }
                            case 0x15B: // *friend
                            {
                                if( !isOwner )
                                    break;

                                if( WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) )
                                {
                                    if( m_Mobile.Summoned )
                                        e.Mobile.SendLocalizedMessage( 1005481 ); // Summoned creatures are loyal only to their summoners.
                                    else if( e.Mobile.HasTrade )
                                        e.Mobile.SendLocalizedMessage( 1070947 ); // You cannot friend a pet with a trade pending
                                    else
                                        BeginPickTarget( e.Mobile, OrderType.Friend );
                                }

                                return;
                            }
                            case 0x15C: // *guard
                            {
                                if( !isOwner )
                                    break;

                                if( !m_Mobile.IsDeadPet && WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) )
                                {
                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Guard;
                                }

                                return;
                            }
                            case 0x15D: // *kill
                            case 0x15E: // *attack
                            {
                                if( !isOwner )
                                    break;

                                if( !m_Mobile.IsDeadPet && WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) )
                                    BeginPickTarget( e.Mobile, OrderType.Attack );

                                return;
                            }
                            case 0x15F: // *patrol
                            {
                                if( !isOwner )
                                    break;

                                if( WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) )
                                {
                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Patrol;
                                }

                                return;
                            }
                            case 0x161: // *stop
                            {
                                if( WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) )
                                {
                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Stop;
                                }

                                return;
                            }
                            case 0x163: // *follow me
                            {
                                if( WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) )
                                {
                                    m_Mobile.ControlTarget = e.Mobile;
                                    m_Mobile.ControlOrder = OrderType.Follow;
                                }

                                return;
                            }
                            case 0x16D: // *release
                            {
                                if( !isOwner )
                                    break;

                                if( WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) )
                                {
                                    if( !m_Mobile.Summoned )
                                    {
                                        e.Mobile.SendGump( new Gumps.ConfirmReleaseGump( e.Mobile, m_Mobile ) );
                                    }
                                    else
                                    {
                                        m_Mobile.ControlTarget = null;
                                        m_Mobile.ControlOrder = OrderType.Release;
                                    }
                                }

                                return;
                            }
                            case 0x16E: // *transfer
                            {
                                if( !isOwner )
                                    break;

                                if( !m_Mobile.IsDeadPet && WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) )
                                {
                                    if( m_Mobile.Summoned )
                                        e.Mobile.SendLocalizedMessage( 1005487 ); // You cannot transfer ownership of a summoned creature.
                                    else if( e.Mobile.HasTrade )
                                        e.Mobile.SendLocalizedMessage( 1010507 ); // You cannot transfer a pet with a trade pending
                                    else
                                        BeginPickTarget( e.Mobile, OrderType.Transfer );
                                }

                                return;
                            }
                            case 0x16F: // *stay
                            {
                                if( WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) )
                                {
                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Stay;
                                }

                                return;
                            }
                        }
                    }
                }
            }
            else
            {
                if( e.Mobile.AccessLevel >= AccessLevel.GameMaster )
                {
                    m_Mobile.DebugSay( "It's from a GM" );

                    if( m_Mobile.FindMyName( e.Speech, true ) )
                    {
                        string[] str = e.Speech.Split( ' ' );
                        int i;

                        for( i=0; i < str.Length; i++ )
                        {
                            string word = str[i];

                            if( Insensitive.Equals( word, "obey" ) )
                            {
                                m_Mobile.SetControlMaster( e.Mobile );

                                if( m_Mobile.Summoned )
                                    m_Mobile.SummonMaster = e.Mobile;

                                return;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 23
0
        public override void OnSpeech( SpeechEventArgs e )
        {
            if ( !e.Handled && e.HasKeyword( Keyword ) && e.Mobile.InRange( this.Location, 2 ) )
            {
                e.Handled = true;

                Mobile from = e.Mobile;
                Guild g = from.Guild as Guild;

                if ( g == null || g.Type != Type )
                {
                    Say( SignupNumber );
                }
                else
                {
                    Container pack = from.Backpack;
                    BaseShield shield = Shield;
                    Item twoHanded = from.FindItemOnLayer( Layer.TwoHanded );

                    if ( (pack != null && pack.FindItemByType( shield.GetType() ) != null) || ( twoHanded != null && shield.GetType().IsAssignableFrom( twoHanded.GetType() ) ) )
                    {
                        Say( 1007110 ); // Why dost thou ask about virtue guards when thou art one?
                        shield.Delete();
                    }
                    else if ( from.PlaceInBackpack( shield ) )
                    {
                        Say( Utility.Random( 1007101, 5 ) );
                        Say( 1007139 ); // I see you are in need of our shield, Here you go.
                        from.AddToBackpack( shield );
                    }
                    else
                    {
                        from.SendLocalizedMessage( 502868 ); // Your backpack is too full.
                        shield.Delete();
                    }
                }
            }

            base.OnSpeech( e );
        }
Esempio n. 24
0
		public override void OnSpeech( SpeechEventArgs e )
		{
			if ( !e.Handled && Active )
			{
				Mobile m = e.Mobile;

				if ( !Creatures && !m.Player )
					return;

				if ( !m.InRange( GetWorldLocation(), m_Range ) )
					return;

				bool isMatch = false;

				if ( m_Keyword >= 0 && e.HasKeyword( m_Keyword ) )
					isMatch = true;
				else if ( m_Substring != null && e.Speech.ToLower().IndexOf( m_Substring.ToLower() ) >= 0 )
					isMatch = true;

				if ( !isMatch )
					return;

				e.Handled = true;
				StartTeleport( m );
			}
		}
Esempio n. 25
0
 public override void OnSpeech( SpeechEventArgs e )
 {
     if ( !e.Handled && e.HasKeyword( 0x0008 ) )
     {
         e.Handled = true;
         BeginStable( e.Mobile );
     }
     else
     {
         if (!e.Handled && e.Mobile.InRange(this.Location, 2))
         {
             if (Insensitive.Speech(e.Speech, "olin") || Insensitive.Speech(e.Speech, "enemy"))
             {
                 this.Say(true, "Bah, that scoundral? Olin believes eradicating the bunnies is the only solution.");
             }
             else if (Insensitive.Speech(e.Speech, "easter"))
             {
                 this.Say(true, "My favorite time of year. The only time the easter bunny makes an appearence. Quite a rare sight!");
             }
             else if (Insensitive.Speech(e.Speech, "bunny") || Insensitive.Speech(e.Speech, "rabbit") || Insensitive.Speech(e.Speech, "bunnies") || Insensitive.Speech(e.Speech, "rabbits"))
             {
                 this.Say(true, (Utility.RandomBool() ? "I hear they -love- carrots!" : "They always seem to be a problem this time of year. Bring them to me and I will stable them free!"));
             }
             else if (Insensitive.Speech(e.Speech, "job") || (Insensitive.Speech(e.Speech, "who are you")))
             {
                 this.Say(true, "Why, I am a rabbit herder. I make sure they live a healthy life, unlike Lord Olin.");
             }
             else if (Insensitive.Speech(e.Speech, "chest") || Insensitive.Speech(e.Speech, "box") || (Insensitive.Speech(e.Speech, "key")))
             {
                 this.Say(true, "I don't go snooping in your things! I, and only myself has the key.");
             }
             else if (Insensitive.Speech(e.Speech, "journal"))
             {
                 this.Say(true, "I don't go snooping in your things!");
             }
             else if (Insensitive.Contains(e.Speech, "document"))
             {
                 this.Say(true, "Yes... How did you hear of this?");
             }
             else
                 base.OnSpeech(e);
         }
     }
 }
Esempio n. 26
0
		public override void OnSpeech( SpeechEventArgs e )
		{
			base.OnSpeech( e );

			Mobile from = e.Mobile;

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

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

			if ( !isFriend )
				return;

			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 ) )
			{
				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. 27
0
        public virtual void OnSpeech( SpeechEventArgs e )
        {
            //Check Response
            if( e.Mobile.Alive && e.Mobile.InRange( m_Mobile.Location, 3 ) && m_Mobile.Body.IsHuman )
            {
                if (!(m_Mobile is BaseHire) && !(m_Mobile is BaseEscortable))
                {
                    m_Mobile.Direction = m_Mobile.GetDirectionTo(e.Mobile);
                    Timer m_timer = new ResponseTimer(m_Mobile, e, this);
                    m_timer.Start();
                }

                if (e.HasKeyword(0x9D) && WasNamed(e.Speech)) // *move*
                {
                    if (m_Mobile.Combatant != null)
                    {
                        // I am too busy fighting to deal with thee!
                        int OldHue = m_Mobile.SpeechHue;
                        m_Mobile.SpeechHue = 0x3B2;
                        m_Mobile.Say(true, "I am too busy fighting to deal with thee!");
                        m_Mobile.SpeechHue = OldHue;
                        //m_Mobile.PublicOverheadMessage( MessageType.Regular, 0x3B2, 501482 );
                    }
                    else
                    {
                        // Excuse me?
                        int OldHue = m_Mobile.SpeechHue;
                        m_Mobile.SpeechHue = 0x3B2;
                        m_Mobile.Say(true, "Excuse me?");
                        m_Mobile.SpeechHue = OldHue;
                        //m_Mobile.PublicOverheadMessage( MessageType.Regular, 0x3B2, 501516 );
                        WalkRandomInHome(2, 2, 1);
                    }
                }
                else if (e.HasKeyword(0x9E) && WasNamed(e.Speech)) // *time*
                {
                    if (m_Mobile.Combatant != null)
                    {
                        // I am too busy fighting to deal with thee!
                        int OldHue = m_Mobile.SpeechHue;
                        m_Mobile.SpeechHue = 0x3B2;
                        m_Mobile.Say(true, "I am too busy fighting to deal with thee!");
                        m_Mobile.SpeechHue = OldHue;
                        //m_Mobile.PublicOverheadMessage( MessageType.Regular, 0x3B2, 501482 );
                    }
                    else
                    {
                        int generalNumber;
                        string exactTime;

                        Clock.GetTime(m_Mobile, out generalNumber, out exactTime);

                        int OldHue = m_Mobile.SpeechHue;
                        m_Mobile.SpeechHue = 0x3B2;
                        switch (generalNumber - 1042950)
                        {
                            case 0: m_Mobile.Say(true, "'Tis the witching hour. 12 Midnight."); break;
                            case 1: m_Mobile.Say(true, "It's the middle of the night"); break;
                            case 2: m_Mobile.Say(true, "It's early in the morning"); break;
                            case 3: m_Mobile.Say(true, "It's late in the morning"); break;
                            case 4: m_Mobile.Say(true, "It's around noon"); break;
                            case 5: m_Mobile.Say(true, "It's the afternoon"); break;
                            case 6: m_Mobile.Say(true, "It's early in the evening"); break;
                            case 7: m_Mobile.Say(true, "It's late at night"); break;
                        }
                        m_Mobile.SpeechHue = OldHue;

                        //m_Mobile.PublicOverheadMessage( MessageType.Regular, 0x3B2, generalNumber );
                    }
                }
                else if (e.HasKeyword(0x6C) && WasNamed(e.Speech)) // *train
                {
                    if (m_Mobile.Combatant != null)
                    {
                        // I am too busy fighting to deal with thee!
                        int OldHue = m_Mobile.SpeechHue;
                        m_Mobile.SpeechHue = 0x3B2;
                        m_Mobile.Say(true, "I am too busy fighting to deal with thee!");
                        m_Mobile.SpeechHue = OldHue;
                        //m_Mobile.PublicOverheadMessage( MessageType.Regular, 0x3B2, 501482 );
                    }
                    else
                    {
                        bool foundSomething = false;

                        Skills ourSkills = m_Mobile.Skills;
                        Skills theirSkills = e.Mobile.Skills;

                        for (int i = 0; i < ourSkills.Length && i < theirSkills.Length; ++i)
                        {
                            Skill skill = ourSkills[i];
                            Skill theirSkill = theirSkills[i];

                            if (skill != null && theirSkill != null && skill.Base >= 60.0 && m_Mobile.CheckTeach(skill.SkillName, e.Mobile))
                            {
                                double toTeach = skill.Base / 3.0;

                                if (toTeach > 42.0)
                                    toTeach = 42.0;

                                if (toTeach > theirSkill.Base)
                                {
                                    int number = 1043059 + i;

                                    if (number > 1043107)
                                        continue;

                                    if (!foundSomething)
                                        m_Mobile.Say(true, "I can train the following:"); // I can train the following:

                                    //m_Mobile.Say( number );
                                    switch (i)
                                    {
                                        case 0: m_Mobile.Say(true, "alchemy"); break;
                                        case 1: m_Mobile.Say(true, "anatomy"); break;
                                        case 2: m_Mobile.Say(true, "animal lore"); break;
                                        case 3: m_Mobile.Say(true, "item identification"); break;
                                        case 4: m_Mobile.Say(true, "armslore"); break;
                                        case 5: m_Mobile.Say(true, "parrying"); break;
                                        case 6: m_Mobile.Say(true, "begging"); break;
                                        case 7: m_Mobile.Say(true, "blacksmithy"); break;
                                        case 8: m_Mobile.Say(true, "fletching"); break;
                                        case 9: m_Mobile.Say(true, "peacemaking"); break;
                                        case 10: m_Mobile.Say(true, "camping"); break;
                                        case 11: m_Mobile.Say(true, "carpentry"); break;
                                        case 12: m_Mobile.Say(true, "cartography"); break;
                                        case 13: m_Mobile.Say(true, "cooking"); break;
                                        case 14: m_Mobile.Say(true, "detecting hidden"); break;
                                        case 15: m_Mobile.Say(true, "discordance"); break;
                                        case 16: m_Mobile.Say(true, "evaluate intelligence"); break;
                                        case 17: m_Mobile.Say(true, "healing"); break;
                                        case 18: m_Mobile.Say(true, "fishing"); break;
                                        case 19: m_Mobile.Say(true, "forensic evaluation"); break;
                                        case 20: m_Mobile.Say(true, "herding"); break;
                                        case 21: m_Mobile.Say(true, "hiding"); break;
                                        case 22: m_Mobile.Say(true, "provoking"); break;
                                        case 23: m_Mobile.Say(true, "inscription"); break;
                                        case 24: m_Mobile.Say(true, "lockpicking"); break;
                                        case 25: m_Mobile.Say(true, "magery"); break;
                                        case 26: m_Mobile.Say(true, "resist spells"); break;
                                        case 27: m_Mobile.Say(true, "tactics"); break;
                                        case 28: m_Mobile.Say(true, "snooping"); break;
                                        case 29: m_Mobile.Say(true, "musicianship"); break;
                                        case 30: m_Mobile.Say(true, "poisoning"); break;
                                        case 31: m_Mobile.Say(true, "archery"); break;
                                        case 32: m_Mobile.Say(true, "spirit speak"); break;
                                        case 33: m_Mobile.Say(true, "stealing"); break;
                                        case 34: m_Mobile.Say(true, "tailoring"); break;
                                        case 35: m_Mobile.Say(true, "taming"); break;
                                        case 36: m_Mobile.Say(true, "taste identification"); break;
                                        case 37: m_Mobile.Say(true, "tinkering"); break;
                                        case 38: m_Mobile.Say(true, "tracking"); break;
                                        case 39: m_Mobile.Say(true, "veterinary"); break;
                                        case 40: m_Mobile.Say(true, "swordsmanship"); break;
                                        case 41: m_Mobile.Say(true, "maces"); break;
                                        case 42: m_Mobile.Say(true, "fencing"); break;
                                        case 43: m_Mobile.Say(true, "wrestling"); break;
                                        case 44: m_Mobile.Say(true, "lumberjacking"); break;
                                        case 45: m_Mobile.Say(true, "mining"); break;
                                        //case 46: m_Mobile.Say(true, "meditation"); break;
                                        //case 47: m_Mobile.Say(true, "stealth"); break;
                                        case 48: m_Mobile.Say(true, "disarming traps"); break;
                                    }
                                    foundSomething = true;
                                }
                            }
                        }

                        if (!foundSomething)
                            m_Mobile.Say(true, "Alas, I cannot teach thee anything."); // Alas, I cannot teach thee anything.

                        e.Handled = true;
                    }
                }
                else
                {
                    SkillName toTrain = (SkillName)(-1);

                    for (int i = 0; toTrain == (SkillName)(-1) && i < e.Keywords.Length; ++i)
                    {
                        int keyword = e.Keywords[i];

                        if (keyword == 0x154)
                        {
                            toTrain = SkillName.Anatomy;
                        }
                        else if (keyword >= 0x6D && keyword <= 0x9C)
                        {
                            int index = keyword - 0x6D;

                            if (index >= 0 && index < m_KeywordTable.Length)
                                toTrain = m_KeywordTable[index];
                        }
                    }

                    if (toTrain != (SkillName)(-1) && WasNamed(e.Speech))
                    {
                        if (m_Mobile.Combatant != null)
                        {
                            // I am too busy fighting to deal with thee!
                            int OldHue = m_Mobile.SpeechHue;
                            m_Mobile.SpeechHue = 0x3B2;
                            m_Mobile.Say(true, "I am too busy fighting to deal with thee!");
                            m_Mobile.SpeechHue = OldHue;
                            e.Handled = true;
                            //m_Mobile.PublicOverheadMessage( MessageType.Regular, 0x3B2, 501482 );
                            //m_Mobile.Say(true, "I am too busy fighting to deal with thee!");
                        }
                        else
                        {
                            Skills skills = m_Mobile.Skills;
                            Skill skill = skills[toTrain];

                            if (skill == null || skill.Base < 60.0 || !m_Mobile.CheckTeach(toTrain, e.Mobile))
                            {
                                m_Mobile.Say(true, "'Tis not something I can teach thee of."); // 'Tis not something I can teach thee of.
                                e.Handled = true;
                            }
                            else
                            {
                                m_Mobile.Teach(toTrain, e.Mobile, 0, false);
                                e.Handled = true;
                            }
                        }
                    }
                }
            }

            if( m_Mobile.Controlled && m_Mobile.Commandable )
            {
            m_Mobile.DebugSay( "Listening..." );

            bool isOwner = (e.Mobile == m_Mobile.ControlMaster);
            bool isFriend = (!isOwner && m_Mobile.IsPetFriend( e.Mobile ));

            if( e.Mobile.Alive && (isOwner || isFriend) )
            {
                m_Mobile.DebugSay( "It's from my master" );

                int[] keywords = e.Keywords;
                string speech = e.Speech;

                // First, check the all*
                /*for( int i = 0; i < keywords.Length; ++i )
                {
                    int keyword = keywords[i];

                    switch( keyword )
                    {
                        case 0x164: // all come
                        {
                            if( !isOwner )
                                break;

                            if( m_Mobile.CheckControlChance( e.Mobile ) )
                            {
                                m_Mobile.ControlTarget = null;
                                m_Mobile.ControlOrder = OrderType.Come;
                            }

                            return;
                        }
                        case 0x165: // all follow
                        {
                            BeginPickTarget( e.Mobile, OrderType.Follow );
                            return;
                        }
                        case 0x166: // all guard
                        case 0x16B: // all guard me
                        {
                            if( !isOwner )
                                break;

                            if( m_Mobile.CheckControlChance( e.Mobile ) )
                            {
                                m_Mobile.ControlTarget = null;
                                m_Mobile.ControlOrder = OrderType.Guard;
                            }
                            return;
                        }
                        case 0x167: // all stop
                        {
                            if( m_Mobile.CheckControlChance( e.Mobile ) )
                            {
                                m_Mobile.ControlTarget = null;
                                m_Mobile.ControlOrder = OrderType.Stop;
                            }
                            return;
                        }
                        case 0x168: // all kill
                        case 0x169: // all attack
                        {
                            if( !isOwner )
                                break;

                            BeginPickTarget( e.Mobile, OrderType.Attack );
                            return;
                        }
                        case 0x16C: // all follow me
                        {
                            if( m_Mobile.CheckControlChance( e.Mobile ) )
                            {
                                m_Mobile.ControlTarget = e.Mobile;
                                m_Mobile.ControlOrder = OrderType.Follow;
                            }
                            return;
                        }
                        case 0x170: // all stay
                        {
                            if( m_Mobile.CheckControlChance( e.Mobile ) )
                            {
                                m_Mobile.ControlTarget = null;
                                m_Mobile.ControlOrder = OrderType.Stay;
                            }
                            return;
                        }
                    }
                }*/

                    // No all*, so check *command
                    for( int i = 0; i < keywords.Length; ++i )
                    {
                        int keyword = keywords[i];

                        switch( keyword )
                        {
                            case 0x155: // *come
                            {
                                if( !isOwner )
                                    break;

                                if( WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) && !e.Handled )
                                {
                                    if (m_Mobile is BaseHire)
                                        m_Mobile.Say(true, "Very well.");

                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Come;
                                    e.Handled = true;
                                }

                                return;
                            }
                            case 0x156: // *drop
                            {
                                if( !isOwner )
                                    break;

                                if( !m_Mobile.IsDeadPet && !m_Mobile.Summoned && WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) && !e.Handled )
                                {
                                    if (m_Mobile is BaseHire)
                                        m_Mobile.Say(true, "Very well.");

                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Drop;
                                    e.Handled = true;
                                }

                                return;
                            }
                            case 0x15A: // *follow
                            {
                                if (WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile) && !e.Handled)
                                {
                                    if (m_Mobile is BaseHire)
                                        m_Mobile.Say(true, "Who shall I follow?");

                                    BeginPickTarget(e.Mobile, OrderType.Follow);
                                    e.Handled = true;
                                }

                                return;
                            }
                            case 0x15B: // *friend
                            {
                                if( !isOwner )
                                    break;

                                if( WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) && !e.Handled)
                                {
                                    if( m_Mobile.Summoned )
                                        e.Mobile.SendAsciiMessage( "Summoned creatures are loyal only to their summoners." ); // Summoned creatures are loyal only to their summoners.
                                    else if (e.Mobile.HasTrade)
                                        e.Mobile.SendAsciiMessage(" You cannot friend a pet with a trade pending."); // You cannot friend a pet with a trade pending
                                    else
                                    {
                                        if (m_Mobile is BaseHire)
                                            m_Mobile.Say(true, "I shall obey this person's orders as if they were your own.");

                                        BeginPickTarget(e.Mobile, OrderType.Friend);
                                    }
                                    e.Handled = true;
                                }

                                return;
                            }
                            case 0x15C: // *guard
                            {
                                if( !isOwner )
                                    break;

                                if( !m_Mobile.IsDeadPet && WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) && !e.Handled )
                                {
                                    if (m_Mobile is BaseHire)
                                        m_Mobile.Say(true, "Very well.");

                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Guard;
                                    e.Handled = true;
                                }

                                return;
                            }
                            case 0x15D: // *kill
                            case 0x15E: // *attack
                            {
                                if( !isOwner )
                                    break;

                                if (!m_Mobile.IsDeadPet && WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile) && !e.Handled)
                                {
                                    if (m_Mobile is BaseHire)
                                        m_Mobile.Say(true, "Who should I attack?");

                                    BeginPickTarget(e.Mobile, OrderType.Attack);
                                    e.Handled = true;
                                }

                                return;
                            }
                            case 0x15F: // *patrol
                            {
                                if( !isOwner )
                                    break;

                                if( WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) && !e.Handled )
                                {
                                    if (m_Mobile is BaseHire)
                                        m_Mobile.Say(true, "Patrolling.");

                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Patrol;
                                    e.Handled = true;
                                }

                                return;
                            }
                            case 0x161: // *stop
                            {
                                if( WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) && !e.Handled )
                                {
                                    if (m_Mobile is BaseHire)
                                        m_Mobile.Say(true, "Very well.");

                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Stop;
                                    e.Handled = true;
                                }

                                return;
                            }
                            case 0x163: // *follow me
                            {
                                if( WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) && !e.Handled)
                                {
                                    if (m_Mobile is BaseHire)
                                        m_Mobile.Say(true, "Very well.");

                                    m_Mobile.ControlTarget = e.Mobile;
                                    m_Mobile.ControlOrder = OrderType.Follow;
                                    e.Handled = true;
                                }

                                return;
                            }
                            case 0x16D: // *release
                            {
                                if( !isOwner )
                                    break;

                                if( WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) && !e.Handled)
                                {
                                    /*if( !m_Mobile.Summoned )
                                    {
                                        e.Mobile.SendGump( new Gumps.ConfirmReleaseGump( e.Mobile, m_Mobile ) );
                                    }
                                    else
                                    {*/
                                        if (m_Mobile is BaseHire)
                                            m_Mobile.Say(true, "I thank thee for thy kindness!");

                                        m_Mobile.ControlTarget = null;
                                        m_Mobile.ControlOrder = OrderType.Release;
                                        e.Handled = true;
                                    //}
                                }

                                return;
                            }
                            case 0x16E: // *transfer
                            {
                                if( !isOwner )
                                    break;

                                if( !m_Mobile.IsDeadPet && WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) && !e.Handled )
                                {
                                    /*if( m_Mobile.Summoned )
                                        e.Mobile.SendAsciiMessage( "You cannot transfer ownership of a summoned creature." ); // You cannot transfer ownership of a summoned creature.
                                    else */
                                    if (e.Mobile.HasTrade)
                                        e.Mobile.SendAsciiMessage("You cannot transfer a pet with a trade pending."); // You cannot transfer a pet with a trade pending
                                    else
                                    {
                                        if (m_Mobile is BaseHire)
                                            m_Mobile.Say(true, "Whom do you wish me to work for?");

                                        BeginPickTarget(e.Mobile, OrderType.Transfer);
                                    }
                                    e.Handled = true;
                                }

                                return;
                            }
                            case 0x16F: // *stay
                            {
                                if( WasNamed( speech ) && m_Mobile.CheckControlChance( e.Mobile ) && !e.Handled)
                                {
                                    if (m_Mobile is BaseHire)
                                        m_Mobile.Say(true, "Very well.");

                                    m_Mobile.ControlTarget = null;
                                    m_Mobile.ControlOrder = OrderType.Stay;
                                    e.Handled = true;
                                }

                                return;
                            }
                        }
                    }
                }
            }
            else
            {
                if( e.Mobile.AccessLevel >= AccessLevel.GameMaster )
                {
                    m_Mobile.DebugSay( "It's from a GM" );

                    if( m_Mobile.FindMyName( e.Speech, true ) )
                    {
                        string[] str = e.Speech.Split( ' ' );
                        int i;

                        for( i=0; i < str.Length; i++ )
                        {
                            string word = str[i];

                            if( Insensitive.Equals( word, "obey" ) )
                            {
                                m_Mobile.SetControlMaster( e.Mobile );

                                if( m_Mobile.Summoned )
                                    m_Mobile.SummonMaster = e.Mobile;

                                return;
                            }
                        }
                    }
                }
            }
        }
        public override void OnSpeech( SpeechEventArgs args )
        {
            base.OnSpeech( args );

            if ( IsDisabled() )
                return;

            if ( args.Mobile.Alive && args.HasKeyword( 0x0007 ) ) // *guards*
                CallGuards( args.Mobile.Location );
        }
Esempio n. 29
0
        public override void OnSpeech( SpeechEventArgs e )
        {
            if( !e.Handled && e.Mobile.InRange( this, 3 ) )
               {
                int[] keywords = e.Keywords;
                string speech = e.Speech;

            if( e.HasKeyword( 0x00FC ) )// how art thou
            {
            switch( Utility.Random( 4 ) )
             {
            case 0: this.Say( 502002 ); break; //Very well.
            case 1: this.Say( 1014089 ); break; //I am well.
            case 2: this.Say( 1014115 ); break; //Just fine.
            case 3: this.Say( 1014110 ); break; //I'm doing relatively well.
             }
            }
            if( e.HasKeyword( 0x003B ) )// Hail, Hello etc
             {
            switch( Utility.Random( 6 ) )
             {
            case 0: this.Say( 1007104 ); break; //Greetings, my friend.
            case 1: this.Say( 1007105 ); break; //Hail, my friend.
            case 2: this.Say( 1014085 ); break; //Greetings
            case 3: this.Say( 1014495 ); break; //Greetings. What might I help thee with?
            case 4: this.Say( 1014497 ); break; //Hello, my friend! How may I assist thee?
            case 5: this.Say( 1014116 ); break; // Let's see... I remember the names of Shame...
             }
             	}
            //Where am I? Start
            if( e.HasKeyword( 0x0122 ) && (Region.Name == "Britain"))// Where am i?
             {
            this.Say( 1014071 ); // Thou art in Britain
             	}
            else if( e.HasKeyword( 0x0122 ) && (Region.Name == "Jhelom"))// Where am i?
             {
            this.Say( "Thou art in Jhelom." ); // Thou art in Jhelom
             	}
            else if( e.HasKeyword( 0x0122 ) && (Region.Name == "Trinsic"))// Where am i?
             {
            this.Say( 1014359 ); // Thou'rt in Trinsic,near the Cape of Heros we are.
             	}
            else if( e.HasKeyword( 0x0122 ) && (Region.Name == "Cove"))// Where am i?
             {
            this.Say( 1014182 ); // This is Cove, friend.
             	}
            else if( e.HasKeyword( 0x0122 ) && (Region.Name == "Buccaneer's Den"))// Where am i?
             {
            this.Say( 1014171 ); // Thou'rt in Buccaneer's Den.
             	}
            else if( e.HasKeyword( 0x0122 ) && (Region.Name == "Moonglow"))// Where am i?
             {
            this.Say( "Thou art in Moonglow." ); // Thou'rt in Moonglow
             	}
            else if( e.HasKeyword( 0x0122 ) && (Region.Name == "Vesper"))// Where am i?
             {
            this.Say( "Thou'rt in Vesper, wonderful town, aye?" ); // Thou'rt in Vesper, wonderful town, aye?
             	}
            else if( e.HasKeyword( 0x0122 ) && (Region.Name == "Minoc"))// Where am i?
             {
            this.Say( "Thou'rt in Minoc, friend." ); // Thou'rt in Minoc, friend.
             	}
            else if( e.HasKeyword( 0x0122 ) && (Region.Name == "Nujel'm"))// Where am i?
             {
            this.Say( "Thou art in Nujel'm." ); // Thou art in Nujel'm.
             	}
            else if( e.HasKeyword( 0x0122 ) && (Region.Name == "Ocllo"))// Where am i?
             {
            this.Say( "Thou'rt in the wonderful town of Ocllo!" ); // Thou'rt in the wonderful town of Ocllo!
             	}
            else if( e.HasKeyword( 0x0122 ) && (Region.Name == "Serpent's Hold"))// Where am i?
             {
            this.Say( "Thou'rt in Serpent's Hold." ); // Thou'rt in Serpent's Hold
             	}
            else if( e.HasKeyword( 0x0122 ) && (Region.Name == "Skara Brae"))// Where am i?
             {
            this.Say( "Thou'rt in Skara Brae." ); // Thou'rt in Skara Brae
             	}
            else if( e.HasKeyword( 0x0122 ) && (Region.Name == "Papua"))// Where am i?
             {
            this.Say( "Thou art in Papua." ); // Thou art in Papua.
             	}
            else if( e.HasKeyword( 0x0122 ) && (Region.Name == "Delucia"))// Where am i?
             {
            this.Say( "Thou'rt in Delucia." ); // Thou'rt Delucia.
             	}
            else if( e.HasKeyword( 0x0122 ) && (Region.Name == "Haven"))// Where am i?
             {
            this.Say( "Thou'rt in Haven, young friend." ); // Thou'rt in Haven, young friend.
             	}
            //Where am I? End
            //Inns Start

            if( e.HasKeyword( 0x00CC ) && (Region.Name == "Britain"))// Where is the inn
             {
            switch( Utility.Random( 3 ) )
             {
            case 0: this.Say( 1014003 ); break; // An inn called Sweet Deams lies next ...
            case 1: this.Say( 1014032 ); break; // The Northside Inn is situated...
            case 2: this.Say( 1014007 ); break; // Despite it's name...
             }
             	}
            //Inns end

            //Moongates? Start
            if( e.HasKeyword( 0x0136 ))// Moongates?
             {
            this.Say( 1014130 ); // The moongates? They are...
             	}
            //Moongates? End

            //Moons Start
            if( e.HasKeyword( 0x0132 ))// Moons
             {
            this.Say( 1014121 ); // Our moons are...
             	}
            //Moons End
            //Where is Start here.
            if( e.HasKeyword( 0x00A1 ) && (Region.Name != "Britain"))// Where is Britain?
             {
            this.Say( 1014006 ); // Britain is bounded by two rivers. ...
            }
            else if( e.HasKeyword( 0x00AC ) && (Region.Name != "Trinsic"))// Where is Trinsic?
             {
            this.Say( 1014157 ); // If thou'rt looking for Trinsic,...
            }
            else if( e.HasKeyword( 0x00A3 ) && (Region.Name != "Jhelom"))// Where is Jhelom?
             {
            this.Say( 1014159 );  // Jhelom? 'Tis to be found...
            }
            else if( e.HasKeyword( 0x00A8 ) && (Region.Name != "Nujel'm"))// Where is Nujel'm?
             {
            this.Say( 1014160 );  // Nujel'm is an island city. Part of ...
            }
            else if( e.HasKeyword( 0x00A9 ) && (Region.Name != "Ocllo"))// Where is Ocllo?
             {
            this.Say( 1014161 );  // Ocllo... hmmm. 'Tis an island, I believe,
            }
            else if( e.HasKeyword( 0x00AB ) && (Region.Name != "Skara Brae"))// Where is Skara Brae?
             {
            this.Say( 1014165 );  // Skara Brae? Thou canst not get more west than that!
            }
            else if( e.HasKeyword( 0x00A7 ) && (Region.Name != "Moonglow"))// Where is Moonglow?
             {
            this.Say( 1014173 );  // Verity Isle is Moonglow's whereabouts. ...
            }
            else if( e.HasKeyword( 0x00A5 ) && (Region.Name != "Vesper"))// Where is Vesper?
             {
            this.Say( 1014174 );  // Vesper can be found on the eastern coast of...
            }
            else if( e.HasKeyword( 0x00AD ) && (Region.Name != "Yew"))// Where is Yew?
             {
            this.Say( 1014175 );  // Yew.. ahh, that is near to Empath Abbey. ...
            }
            //Where is End

            //Time Start
            if( e.HasKeyword( 0x009E ))// Time
             {
            this.Say( "I seem to lose track of time nowa days." );
             	}
            //Time End

            //Job
            if( e.HasKeyword( 0x00F8 ))// Job
             {
            this.Say( 1014502 ); //I am one of the many healers...
             	}
            //Job End

            }

            base.OnSpeech( e );
        }
Esempio n. 30
0
		public override void OnSpeech( SpeechEventArgs e )
		{
			if ( !e.Handled && e.HasKeyword( 0x0008 ) )
			{
				e.Handled = true;
				BeginStable( e.Mobile );
			}
			else if ( !e.Handled && e.HasKeyword( 0x0009 ) )
			{
				e.Handled = true;

				if ( !Insensitive.Equals( e.Speech, "claim" ) )
					BeginClaimList( e.Mobile );
				else
					Claim( e.Mobile );
			}
			else
			{
				base.OnSpeech( e );
			}
		}
Esempio n. 31
0
        public static string BritainHigh(BaseCreature m_Mobile, SpeechEventArgs e)
        {
            string response = null;

            if (e.HasKeyword(0x0122)) // *where am i"
            {
                switch (Utility.Random(3))
                {
                case 0: response = ("Why, thou'rt in the city of Britain, of course."); break;

                case 1: response = ("Thou art in Britain."); break;

                case 2: response = (String.Format("Thou art in Britain, {0}.", e.Mobile.Female ? "milady" : "milord")); break;
                }
            }
            else if (e.HasKeyword(0x0125)) // *dummies*, *dummy*, *training dummies*, *training dummy*
            {
                switch (Utility.Random(3))
                {
                case 0: response = ("The Cavalry Guild in Northeast Britain has sword-training dummies, if that is what thou art looking for."); break;

                case 1: response = ("Thou can work on thy swordplay at the old keep, south of Lord British's castle."); break;

                case 2: response = ("I think that Blackthorn's castle has some training devices, but I'm not certain."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "thief") || Insensitive.Speech(e.Speech, "thiev") || Insensitive.Speech(e.Speech, "steal"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("I know naught of thieves!"); break;

                case 1: response = ("Indeed, there be thievery in Britain."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "smith"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Which sort of smith? Weaponsmith, blacksmith?"); break;

                case 1: response = ("There are many sorts of smith."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "blacksmith"))
            {
                response = ("There is a blacksmith beside the castle moat on the northern edge of town.");
            }
            else if (Insensitive.Speech(e.Speech, "weaponsmith"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Thou mightest wish to check at the armourer's, or the castle."); break;

                case 1: response = ("Thou canst buy weapons at the blacksmith's shop."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "conservatory") || Insensitive.Speech(e.Speech, "bard") || Insensitive.Speech(e.Speech, "minstrel") || Insensitive.Speech(e.Speech, "musician") || Insensitive.Speech(e.Speech, "troubad"))
            {
                response = ("The center of the musical arts in Britain is the Bardic Conservatory on the north side of town.");
            }
            else if (Insensitive.Speech(e.Speech, "mage tower") || Insensitive.Speech(e.Speech, "mage guild") || Insensitive.Speech(e.Speech, "mage"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The Mage Tower is the building with all the arches, made of grey stone, on the north side of the town."); break;

                case 1: response = ("Ah, the Mage Guild is housed within a tower of many arches, with pools of water beside it."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "mage's shop") || Insensitive.Speech(e.Speech, "magic") || Insensitive.Speech(e.Speech, "magic shop") || Insensitive.Speech(e.Speech, "mage shop"))
            {
                switch (Utility.Random(5))
                {
                case 0: response = ("There are three or four merchants of the arcane in Britain."); break;

                case 1: response = ("The magic shop The Sorcerer's Delight is also known as the Mage Tower. Thou can purchase magical items there."); break;

                case 2: response = ("Ethral Goods Magic Shop has magical items for sale, and it boasts the only alchemist in Britain."); break;

                case 3: response = ("The magic shop Incantations and Enchantments is situated by the park in eastern Britain."); break;

                case 4: response = ("Sage Advice Magic Shop can sell thee some arcane items, if that is thy desire."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Sorcerer's Delight"))
            {
                response = ("Thou can purchase arcane goods at the Sorcerer's Delight - which some call the Mage Tower. It can be found in northern Britain, next to the Conservatory of Music.");
            }
            else if (Insensitive.Speech(e.Speech, "Ethral") || Insensitive.Speech(e.Speech, "Ethral Goods"))
            {
                response = ("Thou can find the Ethral Goods Magic Shop just south of the Main Gate. Next to the Premier Provisioner's shop.");
            }
            else if (Insensitive.Speech(e.Speech, "Incantations and Enchantments") || Insensitive.Speech(e.Speech, "Incantations"))
            {
                response = ("Incantations and Enchantments is in the middle of eastern Britain, on the south side of the park.");
            }
            else if (Insensitive.Speech(e.Speech, "Sage Advice"))
            {
                response = ("Thou can get to the Sage Advice Magic Shop on the east side of the river.");
            }
            else if (Insensitive.Speech(e.Speech, "stables"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Aside from Lord British's stables, the only ones I can think of lie on the western bank of the river."); break;

                case 1: response = ("Try the stables beside the Mage Tower."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "vet"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("There is a doctor of animals whose shop lies beside The Bucking Horse Stables."); break;

                case 1: response = ("The city's sole veterinarian lives by the river, by the Mage's Bridge."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "theatre"))
            {
                response = ("Lord British supports the arts. There is a public theatre across from the Bardic Conservatory.");
            }
            else if (Insensitive.Speech(e.Speech, "woodworker"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("A goodly carpenter lives not far from the market square before the castle gate."); break;

                case 1: response = ("There is a woodworker near the city library."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "theatre"))
            {
                response = ("There are many guilds in this city. 'Tis the benefit of living in Lord British's capital.");
            }
            else if (Insensitive.Speech(e.Speech, "mining guild") || Insensitive.Speech(e.Speech, "miners"))
            {
                response = ("There is a Mining Guild beside the city library.");
            }
            else if (Insensitive.Speech(e.Speech, "baker") || Insensitive.Speech(e.Speech, "bread"))
            {
                response = ("There's a baker on the market square before the castle gate.");
            }
            else if (Insensitive.Speech(e.Speech, "tanner") || Insensitive.Speech(e.Speech, "leather"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("A tanner's shop exists by Poor Gate, 'gainst the old city wall."); break;

                case 1: response = ("There is a leatherworker's shop facing the market square."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "healer"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("There is a healer on the market square, near the Main Gate."); break;

                case 1: response = ("If thou dost walk north through the main gates, thou will be facing the healer's shop."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "bowyer") || Insensitive.Speech(e.Speech, "fletcher"))
            {
                response = ("Try the bowyer just East of the theatre.");
            }
            else if (Insensitive.Speech(e.Speech, "butcher"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The butcher can be found between the docks, near the customs house."); break;

                case 1: response = ("In Southern Britain on the waterfront there is a butcher. His shop is between the two docks."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "armour") || Insensitive.Speech(e.Speech, "armor"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("There is an armourer's shop beside the Mage Gate. Just South of the old city wall."); break;

                case 1: response = ("Strength and Steel Armory is located in front of the Mage's Tower in Northern Britain."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "inn"))
            {
                switch (Utility.Random(4))
                {
                case 0: response = ("If there be one thing Britain is not lacking, it be inns!"); break;

                case 1: response = ("The Wayfarer's Inn is just to the East of the Mage's Bridge."); break;

                case 2: response = ("An inn called Sweet Dreams lies next to the Main Gate, just East of the healer's shop."); break;

                case 3: response = ("The North Side Inn is way up in North Britain, just past the Mage's Tower."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Wayfarer's Inn") || Insensitive.Speech(e.Speech, "Wayfarers Inn"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("'Tis South of the Cavalry Guild by the Mage's Gate."); break;

                case 1: response = ("The Wayfarer's Inn is beside the Mage's Gate, on the East side of the river."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Sweet Dreams"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The Sweet Dreams Inn is quite upscale!"); break;

                case 1: response = ("Despite its name, the Sweet Dreams inn is quite good. It is near the Main Gate."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Northside"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The Northside Inn is situated on the lake that surrounds Blackthorn's Castle."); break;

                case 1: response = ("The Northside Inn is quite good. It is just North of the Music Conservatory."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "alchemist"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The alchemist can be found with the mages in the the magic shop in front of the Main Gate."); break;

                case 1: response = ("Ethral Goods Magic Shop has an alchemist. Try there."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "weaponeer") || Insensitive.Speech(e.Speech, "weaponsmith"))
            {
                response = ("The blacksmith North of the Miner's Guild can probably sell thee anything thou might need.");
            }
            else if (Insensitive.Speech(e.Speech, "mechanician"))
            {
                response = ("The guildhall of the Mechanicians, or the Tinkers as some call them, is right beside Poor Gate.");
            }
            else if (Insensitive.Speech(e.Speech, "artisan"))
            {
                response = ("There be a guildhall for the artisans of the town outside the old walls, south of the Armorer's.");
            }
            else if (Insensitive.Speech(e.Speech, "provision"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = ("One can purchase provisions at any of a number of shops."); break;

                case 1: response = ("There is a provisioner's directly before the Main Gate."); break;

                case 2: response = ("A quite well-appointed provisioner's exists East of the river, just North of the Lighthouse."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "jewel"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("There is a jeweler's just to the South of the Artist's guild."); break;

                case 1: response = ("About as far East as thou can go, there is a jeweler's shop sitting next to the park."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "bank"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The First Bank of Britain lies next to the jeweler's, beside the moat."); break;

                case 1: response = ("The bank is outside the old walls, next to the moat."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "clothes") || (Insensitive.Speech(e.Speech, "clothiers")))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("A goodly shop for clothing is next to the Blue Boar Tavern."); break;

                case 1: response = ("Thou canst purchase clothes on the East side of the river, near the Cypress Bridge."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "tavern"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("If thou seekest a place to drink, well, there are many choices!"); break;

                case 1: response = ("There's the Salty Dog, The Unicorn's Horn, The Cat's Lair, and The Blue Boar taverns, here in Britain."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Salty Dog"))
            {
                response = ("The Salty Dog is a tavern overlooking the park, right next to The Wayfarer's Inn.");
            }
            else if (Insensitive.Speech(e.Speech, "Unicorn Horn"))
            {
                response = ("'Tis an expensive place, but the Unicorn Horn, overlooking the ocean on the east side, serves a decent ale.");
            }
            else if (Insensitive.Speech(e.Speech, "Blue Boar"))
            {
                response = ("The Blue Boar is just North of the library, on the river.");
            }
            else if (Insensitive.Speech(e.Speech, "Cat's Lair"))
            {
                response = ("The Cat's Lair is a bit disreputable, as it lies near the docks, but its beer is good.");
            }
            else if (Insensitive.Speech(e.Speech, "shipwright") || Insensitive.Speech(e.Speech, "oaken oar") || Insensitive.Speech(e.Speech, "boats") || Insensitive.Speech(e.Speech, "ships"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The place to buy waterfaring vessels is the Oaken Oar."); break;

                case 1: response = ("The Oaken Oar houses excellent shipwrights. It is on the waterfront by the mouth of the Narrow Neck."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "cartographer") || Insensitive.Speech(e.Speech, "map"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Cartographer's can usually be found sharing space with shipwrights."); break;

                case 1: response = ("If there's not a mapmaker to be found at the Oaken Oar, then I can't help thee much."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "customs") || Insensitive.Speech(e.Speech, "customs house"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The Customs office checks imported goods. 'Tis on the waterfront."); break;

                case 1: response = ("Smugglers from Buccaneer's Den have taken to going to Vesper since the Customs House opened on the waterfront."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "train") || Insensitive.Speech(e.Speech, "weapons trainer"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Thou canst be trained in weapons at the weapons trainer. But thou shouldst be warned that 'tis expensive. He caters to the nobility."); break;

                case 1: response = ("The weapons trainer? Ah, that is on the north edge of town, on the eastern bank of the river. 'Tis called the Cavalry Guild."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "lighthouse"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("'Tis being repaired, but it stands on the promontory o'erlooking Brittany Bay."); break;

                case 1: response = ("The lighthouse is a most imposing sight, but 'twas badly damaged in a storm, and 'tis inoperable."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Lord British"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("He liveth here, in Britain, in his castle."); break;

                case 1: response = ("Lord British doth reside in his castle, but the gates are always open."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "LB"))
            {
                response = ("LB? Mayhap thou means Lord British ....");
            }
            else if (Insensitive.Speech(e.Speech, "castle"))
            {
                if (Insensitive.Speech(e.Speech, "blackthorn's castle"))
                {
                    switch (Utility.Random(2))
                    {
                    case 0: response = ("Blackthorn stays out of sight mostly, sequestered in his castle up North of Britain."); break;

                    case 1: response = ("Blackthorn's castle is on an island in the middle of a lake North of Britain."); break;
                    }
                }
                else
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = ("Lord British's castle is quite huge. A moat encircles it. Thou canst not miss it."); break;

                    case 1: response = ("Lord British's castle forms the western side of the city. Only farms lie beyond it."); break;

                    case 2: response = ("Blackthorn's castle is on an island in the middle of a lake North of Britain."); break;
                    }
                }
            }
            else if (Insensitive.Speech(e.Speech, "blackthorn"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Blackthorn stays out of sight mostly, sequestered in his castle up North of Britain."); break;

                case 1: response = ("Blackthorn's castle is on an island in the middle of a lake North of Britain."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "old keep") || Insensitive.Speech(e.Speech, "fighter") || Insensitive.Speech(e.Speech, "warrior"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = ("The Warrior's Guild is housed in the Old Keep."); break;

                case 1: response = ("The Old Keep, where the Warrior's Guild is headquartered, was once the castle hereabouts, but now we have Lord British's castle."); break;

                case 2: response = ("'Tis crumbling into the Narrows, but the home of the Warrior's Guild is the Old Keep."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "farms") || Insensitive.Speech(e.Speech, "farmers"))
            {
                response = ("The farms in this area are all in the countryside, to the west of Lord British's castle. Thou must cross the Narrows and follow the road there.");
            }
            else if (Insensitive.Speech(e.Speech, "river"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Britain is bounded by two rivers. The Narrows is on the west and Brittany River on the east."); break;

                case 1: response = ("When most people say the river, they mean Brittany River, which runs through the middle of the city."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "narrows") || Insensitive.Speech(e.Speech, "narrows neck") || Insensitive.Speech(e.Speech, "neck"))
            {
                response = ("Narrows Neck is the name for the river mouth on the southwestern side of Britain.");
            }
            else if (Insensitive.Speech(e.Speech, "Brittany River"))
            {
                response = ("That's the river that runs down the middle of the city.");
            }
            else if (Insensitive.Speech(e.Speech, "gate"))
            {
                if (Insensitive.Speech(e.Speech, "River's Gate"))
                {
                    response = ("The Southernmost bridge is called River's Gate.");
                }
                else if (Insensitive.Speech(e.Speech, "poor gate"))
                {
                    switch (Utility.Random(2))
                    {
                    case 0: response = ("That is the name of the old gate beside the castle moat, for once the poor came in through there to go to market. It is quite narrow."); break;

                    case 1: response = ("Poor Gate is on the south wall, beside the Tinker's Guild."); break;
                    }
                }
                else if (Insensitive.Speech(e.Speech, "Main gate"))
                {
                    switch (Utility.Random(2))
                    {
                    case 0: response = ("The Main Gate is quite majestic! The space before it is paved with grey and red stones, and there be guard towers on either side."); break;

                    case 1: response = ("The Main Gate divides the central city from the waterfront."); break;
                    }
                }
                else
                {
                    response = ("There are two gates in the old city walls. The Poor Gate, and the Main Gate are the names.");
                }
            }
            else if (Insensitive.Speech(e.Speech, "city wall") || Insensitive.Speech(e.Speech, "wall"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = ("When Britain was but a young city, 'twas enclosed by a wall. But it has long since outgrown it."); break;

                case 1: response = ("Thou canst see that the old city walls are of a different vintage stone than the castle proper. 'Twas built before the current castle buildings."); break;

                case 2: response = ("The northern side of the old city wall hath disappeared completely. 'Tis said the Mage Tower was built from its fragments."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "bridge"))
            {
                if (Insensitive.Speech(e.Speech, "Northern bridge") || Insensitive.Speech(e.Speech, "Great Northern") || Insensitive.Speech(e.Speech, "Great bridge"))
                {
                    switch (Utility.Random(2))
                    {
                    case 0: response = ("The Great Northern Bridge is so called because it's the Northern-most bridge in Britain."); break;

                    case 1: response = ("The Great Northern Bridge is built fairly high above the water."); break;
                    }
                }
                else if (Insensitive.Speech(e.Speech, "Cypress Bridge"))
                {
                    switch (Utility.Random(2))
                    {
                    case 0: response = ("Cypress Bridge is named for the trees which greet thee coming and going across it."); break;

                    case 1: response = ("The Cypress Bridge is surrounded on one side by a tailor's shop and on the other by a magic shop."); break;
                    }
                }
                else if (Insensitive.Speech(e.Speech, "Mage's Bridge"))
                {
                    switch (Utility.Random(3))
                    {
                    case 0: response = ("The bridge next to the Mage's tower is thus called the Mage's Bridge."); break;

                    case 1: response = ("Mage's Bridge was once a gate leading into the city, but the old wall has outlived its usefulness and most of it has been torn down."); break;

                    case 2: response = ("The Mage's Bridge is so named for the fact that the Mage's Tower almost overlooks it."); break;
                    }
                }
                else
                {
                    switch (Utility.Random(6))
                    {
                    case 0: response = ("There are many bridges across the Brittany. There's the Great Northern Bridge at the north-most end, the Mage's Bridge, then the one we call Virtue's Pass. South of that there's Cypress Bridge, and the River's Gate Bridge. And, of course, the Gung-Farmer's Bridge connects Britain with the farmlands to the West."); break;

                    case 1: response = ("The bridge next to the Mage's tower is thus called the Mage's Bridge."); break;

                    case 2: response = ("The Great Northern Bridge is so called because it's the Northern-most bridge in Britain."); break;

                    case 3: response = ("Cypress Bridge is named for the trees which greet thee coming and going across it."); break;

                    case 4: response = ("Virtue's Pass connects to Virtue's Path, which will take thee into Lord British's Castle."); break;

                    case 5: response = ("There is the Gung-Farmer's Bridge, which leadeth across Narrows Neck."); break;
                    }
                }
            }
            else if (Insensitive.Speech(e.Speech, "Great Northern"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("The Great Northern Bridge is so called because it's the Northern-most bridge in Britain."); break;

                case 1: response = ("The Great Northern Bridge is built fairly high above the water."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Virtue's Pass"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Virtue's Pass connects to Virtue's Path, which will take thee into Lord British's Castle."); break;

                case 1: response = ("There used to be a gate at Virtue's Pass, it was torn down some time ago."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "Gung-Farmer") || Insensitive.Speech(e.Speech, "Gung Farmer"))
            {
                response = ("The Gung-Farmer's Bridge connects all the farms with Britain proper.");
            }
            else if (Insensitive.Speech(e.Speech, "ankh") || Insensitive.Speech(e.Speech, "death") || Insensitive.Speech(e.Speech, "temple") || Insensitive.Contains(e.Speech, "resur"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("Thou mayst find the temple, where thou canst be resurrected, directly by Mage Gate Bridge."); break;

                case 1: response = ("The ankh in the temple is capable of restoring life to the dead. 'Tis in northern part of town, beside the river."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "paws"))
            {
                response = ("Paws? Take a look at the feet of a dog!");
            }
            else if (Insensitive.Speech(e.Speech, "guardhouse") || Insensitive.Speech(e.Speech, "guard house"))
            {
                switch (Utility.Random(2))
                {
                case 0: response = ("There are two guardhouses. One near the Gung-Farmer's Bridge, and the other next to Virtue's Pass."); break;

                case 1: response = ("One Guardhouse is right beside the Cat's Lair Tavern."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "waterfront"))
            {
                response = ("The waterfront is what many call everything south of the old city wall. Properly speaking, it runneth along the river from River's Gate Bridge, down along the water to the Oaken Oar and the Narrows.");
            }
            else if (Insensitive.Speech(e.Speech, "moat"))
            {
                response = ("Long ago the Narrows were dug up to meet the moat, and now 'tis fed from the water of Brittany Bay.");
            }
            else if (Insensitive.Speech(e.Speech, "brittany bay"))
            {
                response = ("'Tis the bay on our southern coast.");
            }
            else if (Insensitive.Speech(e.Speech, "ocean"))
            {
                response = ("The ocean is to the south of Britain.");
            }
            else if (Insensitive.Speech(e.Speech, "undead") || Insensitive.Speech(e.Speech, "skeleton") || Insensitive.Speech(e.Speech, "graves") || Insensitive.Speech(e.Speech, "graveyard") || Insensitive.Speech(e.Speech, "crypt") || Insensitive.Speech(e.Speech, "cemetery") || Insensitive.Speech(e.Speech, "mausoleum"))
            {
                switch (Utility.Random(3))
                {
                case 0: response = ("Ah, 'tis a terrible thing, but the graveyard far to the north has become infested with the living bones of the dead."); break;

                case 1: response = ("We have had to abandon our mausoleums, for the cemetery north of here has been touched by magic and is now filled with undead skeletons."); break;
                }
            }
            else if (Insensitive.Speech(e.Speech, "orc") || Insensitive.Speech(e.Speech, "camp"))
            {
                response = ("There is a plague of orcs on the western side of the farms--if thou seekest their encampments, that is the place to look.");
            }

            return(response);
        }