Ejemplo n.º 1
0
		public override void OnSpeech(SpeechEventArgs e)
		{
			if (XmlScript.HasTrigger(this, TriggerName.onSpeech) &&
				UberScriptTriggers.Trigger(this, e.Mobile, TriggerName.onSpeech, null, e.Speech))
			{
				return;
			}

			Mobile m = e.Mobile;
			Faction fact = Faction.Find(m);

			if (!e.Handled && m.Alive && e.HasKeyword(0x38)) // *appraise*
			{
				if (FactionAllegiance != null && fact != null && FactionAllegiance != fact)
				{
					Say("I will not do business with the enemy!");
				}
				else if (!TestCenter.Enabled)
				{
					PublicOverheadMessage(MessageType.Regular, 0x3B2, 500608); // Which deed would you like appraised?
					m.BeginTarget(12, false, TargetFlags.None, Appraise_OnTarget);
					e.Handled = true;
				}
			}

			base.OnSpeech(e);
		}
Ejemplo n.º 2
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"))
                {
                    bool showList = true;

                    if (e.Speech.Length > 6)   //sanity
                    {
                        string name = e.Speech.Substring(6).Trim();

                        for (int i = 0; i < e.Mobile.Stabled.Count; ++i)
                        {
                            if (Insensitive.Equals(e.Mobile.Stabled[i].Name, name))     //Similar names?
                            {
                                showList = false;
                                break;
                            }
                        }

                        //What about pets with the same name, or 'similar' names, ie Fluffy 1, Fluffy 2?? - Similar names don't work.. what about identicals?
                        //What if you try and claim a pet that doesn't exist? -- GUMP
                    }

                    if (showList)
                    {
                        BeginClaimList(e.Mobile);
                    }
                }
                else
                {
                    Claim(e.Mobile);
                }
            }
            else
            {
                base.OnSpeech(e);
            }
        }
        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 (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);
        }
Ejemplo n.º 4
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            PlayerMobile pm = e.Mobile as PlayerMobile;

            if (pm != null && !e.Handled)
            {
                if (e.HasKeyword(0x0008))
                {
                    e.Handled = true;
                    if (pm.HasDonated || !m_DonatorsOnly)
                    {
                        BeginStable(e.Mobile);
                    }
                    else
                    {
                        SayTo(e.Mobile, "Only active donators may use my services!");
                    }
                }
                else if (e.HasKeyword(0x0009))
                {
                    e.Handled = true;
                    if (pm.HasDonated || !m_DonatorsOnly)
                    {
                        if (!Insensitive.Equals(e.Speech, "claim"))
                        {
                            BeginClaimList(e.Mobile);
                        }
                        else
                        {
                            Claim(e.Mobile);
                        }
                    }
                    else
                    {
                        SayTo(e.Mobile, "Only active donators may use my services!");
                    }
                }
                else
                {
                    base.OnSpeech(e);
                }
            }
            else
            {
                base.OnSpeech(e);
            }
        }
Ejemplo n.º 5
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);

                var index = e.Speech.IndexOf(' ');

                if (index != -1)
                {
                    Claim(e.Mobile, e.Speech.Substring(index).Trim());
                }
                else
                {
                    Claim(e.Mobile);
                }
            }
            else if (!e.Handled && e.Speech.ToLower().IndexOf("stablecount") >= 0)
            {
                IPooledEnumerable eable = e.Mobile.Map.GetMobilesInRange(e.Mobile.Location, 8);
                e.Handled = true;

                foreach (Mobile m in eable)
                {
                    if (m is AnimalTrainer)
                    {
                        e.Mobile.SendLocalizedMessage(1071250, String.Format("{0}\t{1}", e.Mobile.Stabled.Count.ToString(), GetMaxStabled(e.Mobile).ToString())); // ~1_USED~/~2_MAX~ stable stalls used.
                        break;
                    }
                }

                eable.Free();
            }
            else
            {
                base.OnSpeech(e);
            }
        }
Ejemplo n.º 6
0
        public override void OnSpeech(SpeechEventArgs args)
        {
            if (IsDisabled())
            {
                return;
            }

            if (args.Mobile.Player && args.Mobile.Alive && args.HasKeyword(0x0007))
            {
                CallGuards(args.Mobile);
            }

            if (args.Mobile.Alive && args.HasKeyword(0x0007)) // *guards*
            {
                CallGuards(args.Mobile.Location);
            }
        }
Ejemplo n.º 7
0
        // Temporary
        public override void OnSpeech(SpeechEventArgs e)
        {
            base.OnSpeech(e);

            Mobile from = e.Mobile;

            if (m_Mobile is BaseVendor && from.InRange(m_Mobile, 4) && !e.Handled)
            {
                if (m_Mobile.Combatant != null)
                {
                    e.Handled = true;

                    // I am too busy fighting to deal with thee!
                    m_Mobile.PublicOverheadMessage(MessageType.Regular, 0x3B2, 501482);
                }
                else if (e.HasKeyword(0x14D))                 // *vendor sell*
                {
                    e.Handled = true;

                    ((BaseVendor)m_Mobile).VendorSell(from);
                    m_Mobile.FocusMob = from;
                }
                else if (e.HasKeyword(0x3C))
                {
                    e.Handled = true;

                    ((BaseVendor)m_Mobile).VendorBuy(from);
                    m_Mobile.FocusMob = from;
                }
                else if (WasNamed(e.Speech))
                {
                    e.Handled = true;

                    if (e.HasKeyword(0x177))                     // *sell*
                    {
                        ((BaseVendor)m_Mobile).VendorSell(from);
                    }
                    else if (e.HasKeyword(0x171))                     // *buy*
                    {
                        ((BaseVendor)m_Mobile).VendorBuy(from);
                    }

                    m_Mobile.FocusMob = from;
                }
            }
        }
Ejemplo n.º 8
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 = Payday(this);
                    this.SayHireCost();
                }
            }

            base.OnSpeech(e);
        }
Ejemplo n.º 9
0
        private static void OnSpeech(SpeechEventArgs e)
        {
            Mobile from = e.Mobile;

            if (from is PlayerMobile && e.HasKeyword(0x0031) && from.Karma >= 50)
            {
                from.Target = new HonorTarget();
            }
        }
Ejemplo n.º 10
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            Mobile m = e.Mobile;

            if (e.HasKeyword(0x0002))
            {
                e.Handled = true;
            }
        }
Ejemplo n.º 11
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);
                }
            }
        }
Ejemplo n.º 12
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);
                    }
                }
            }
        }
Ejemplo n.º 13
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.Now )
						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.Now || (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 );
		}
Ejemplo n.º 14
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*
            {
                from.SendLocalizedMessage(503213);                                 // Select the item you wish to buy.
                from.Target = new BuyTarget(this);

                e.Handled = true;
            }
            else if (e.HasKeyword(0x3D) || (e.HasKeyword(0x172) && WasNamed(e.Speech)))           // vendor browse, *browse
            {
                Backpack.DisplayTo(from);
                e.Handled = true;
            }
            else if (e.Speech.ToLower().IndexOf("price") > -1 && e.Mobile == m_Owner && WasNamed(e.Speech))
            {
                from.Target = new PriceTarget(this);

                e.Handled = true;
            }
            else if (e.Speech.ToLower().IndexOf("collect") > -1 && e.Mobile == m_Owner && WasNamed(e.Speech))
            {
                if (BankBox.Items == null || BankBox.Items.Count == 0)
                {
                    m_Owner.SendMessage("I have not sold any items.");
                    return;
                }

                for (int i = 0; i < BankBox.Items.Count; i++)
                {
                    m_Owner.Backpack.AddItem((Item)BankBox.Items[i]);
                }

                e.Handled = true;
            }
        }
Ejemplo n.º 15
0
 public override void OnSpeech(SpeechEventArgs e)
 {
     if (!e.Handled && e.HasKeyword(0x16D))
     {
         return;
     }
     else
     {
         base.OnSpeech(e);
     }
 }
Ejemplo n.º 16
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (!e.Handled && m_Active)
            {
                Mobile m = e.Mobile;

                if (this.Open)
                {
                    return;
                }

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

                if (m_CombatCheck && SpellHelper.CheckCombat(m))
                {
                    m.SendMessage(1154, "I cannot open to those in battle.");
                    e.Handled = true;
                    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.Contains(m_Substring))
                {
                    isMatch = true;
                }

                if (!isMatch)
                {
                    return;
                }

                e.Handled = true;
                this.Open = true;
                m.SendMessage(1154, "The door has been opened.");

                if (m_QuickClose)
                {
                    m_Timer.Start();
                }
            }
        }
Ejemplo n.º 17
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);
        }
Ejemplo n.º 18
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, Appraise_OnTarget );
				e.Handled = true;
			}

			base.OnSpeech( e );
		}
Ejemplo n.º 19
0
        // Temporary
        public override void OnSpeech(SpeechEventArgs e)
        {
            base.OnSpeech(e);

            Mobile from = e.Mobile;

            if (m_Mobile is BaseVendor && from.InRange(m_Mobile, Core.AOS ? 1 : 4) && !e.Handled)
            {
                if (e.HasKeyword(0x14D))                     // *vendor sell*
                {
                    e.Handled = true;

                    ((BaseVendor)m_Mobile).VendorSell(from);
                    m_Mobile.FocusMob = from;
                }
                else if (e.HasKeyword(0x3C))                     // *vendor buy*
                {
                    e.Handled = true;

                    ((BaseVendor)m_Mobile).VendorBuy(from);
                    m_Mobile.FocusMob = from;
                }
                else if (WasNamed(e.Speech))
                {
                    if (e.HasKeyword(0x177))                         // *sell*
                    {
                        e.Handled = true;

                        ((BaseVendor)m_Mobile).VendorSell(from);
                    }
                    else if (e.HasKeyword(0x171))                         // *buy*
                    {
                        e.Handled = true;

                        ((BaseVendor)m_Mobile).VendorBuy(from);
                    }

                    m_Mobile.FocusMob = from;
                }
            }
        }
Ejemplo n.º 20
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (e.Mobile is PlayerMobile && e.Mobile.Alive)
            {
                if (e.Speech.ToLower() == this.Name.ToLower())
                {
                    this.Say("Did you want to talk to me?");
                }

                if (e.HasKeyword(0x003b))                     // *hi*
                {
                    this.Say("Hello to thee, {0}.", e.Mobile.Name);
                }

                if (e.HasKeyword(0x00fa))                     // *bye*
                {
                    this.Say("Fare thee well, {0}.", e.Mobile.Name);
                }

                if (e.HasKeyword(0x0016))                     // *help*
                {
                    switch (Utility.Random(5))
                    {
                    case 0:
                        this.Say("I would assist thee, but I am tired."); break;

                    case 1:
                        this.Say("Alas, I cannot help thee, I am on my break."); break;

                    case 2:
                        this.Say("No help for thee today."); break;

                    case 3:
                        this.Say("We shall protect thee."); break;

                    case 4:
                        this.Say("What is my help worth to thee?"); break;
                    }
                }
            }
        }
Ejemplo n.º 21
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (XmlScript.HasTrigger(this, TriggerName.onSpeech) &&
                UberScriptTriggers.Trigger(this, e.Mobile, TriggerName.onSpeech, null, e.Speech))
            {
                return;
            }
            if (!e.Handled && e.HasKeyword(Keyword) && e.Mobile.InRange(Location, 2))
            {
                e.Handled = true;

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

                var ethic = Ethics.Player.Find(e.Mobile);

                if (g == null && ethic == null || g != null && g.Type != Type && ethic == null)
                {
                    Say(SignupNumber);
                }
                else if (ethic != null && Shield is OrderShield && ethic.Ethic is EvilEthic ||
                         ethic != null && Shield is ChaosShield && ethic.Ethic is HeroEthic)
                {
                    Say("Begone!  You do not follow the proper ethic to wield one of our order's shields.");
                }
                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().IsInstanceOfType(twoHanded)))
                    {
                        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);
        }
Ejemplo n.º 22
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (XmlScript.HasTrigger(this, TriggerName.onSpeech) && UberScriptTriggers.Trigger(this, e.Mobile, TriggerName.onSpeech, null, e.Speech))
            {
                return;
            }
            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)) || (e.HasKeyword(0x0162)))
                {
                    e.Handled = Payday(this);
                    this.SayHireCost();
                }
            }

            base.OnSpeech(e);
        }
Ejemplo n.º 23
0
        public override void OnSpeech(SpeechEventArgs args)
        {
            if (IsGuarded == false)
            {
                return;
            }

            if (args.Mobile.Alive && args.HasKeyword(0x0007))                 // *guards*
            {
                CallGuards(args.Mobile.Location);
            }
        }
Ejemplo n.º 24
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (!e.Handled && e.Mobile.InRange(this, 4))
            {
                if (e.HasKeyword(0x003B) || e.HasKeyword(0x0162))
                {
                    e.Handled = true;
                    if (this.Controled)
                    {
                        if (this.ControlMaster == e.Mobile)
                        {
                        }
                        else
                        {
                            Say("I don't think I've agreed to work with you...yet?");
                        }
                    }
                }
            }

            base.OnSpeech(e);
        }
Ejemplo n.º 25
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (!e.Handled && e.HasKeyword(0x0008)) // *stable*
            {
                e.Handled = true;

                BeginStable(e.Mobile);
            }
            else
            {
                base.OnSpeech(e);
            }
        }
Ejemplo n.º 26
0
        public override void OnSpeech(SpeechEventArgs args)
        {
            base.OnSpeech(args);

            if (this.IsDisabled())
            {
                return;
            }

            if (args.Mobile.Alive && args.HasKeyword(0x0007)) // *guards*
            {
                this.CallGuards(args.Mobile.Location);
            }
        }
Ejemplo n.º 27
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            Mobile from = e.Mobile;

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

            if (e.HasKeyword(0x40) || (e.HasKeyword(0x175) && WasNamed(e.Speech)))                     // vendor dismiss, *dismiss
            {
                if (IsOwner(from))
                {
                    this.Dismiss(from);

                    e.Handled = true;
                }
            }
            else
            {
                base.OnSpeech(e);
            }
        }
Ejemplo n.º 28
0
        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);
            }
        }
Ejemplo n.º 29
0
        public override void OnSpeech( SpeechEventArgs e )
        {
            base.OnSpeech( e );

            Mobile from = e.Mobile;

            if ( m_Mobile is BaseVendor && from.InRange( m_Mobile, 4 ) && !e.Handled )
            {
                if ( e.HasKeyword( 0x14D ) ) // *vendor sell*
                {
                    ((BaseVendor)m_Mobile).VendorSell( from );
                    e.Handled = true;
                    m_Mobile.FocusMob = from;
                }
                else if ( e.HasKeyword( 0x3C ) ) // *vendor buy*
                {
                    ((BaseVendor)m_Mobile).VendorBuy( from );
                    e.Handled = true;
                    m_Mobile.FocusMob = from;
                }
                else if ( WasNamed( e.Speech ) || Insensitive.StartsWith( e.Speech, "hi " ) )
                {
                    if ( e.HasKeyword( 0x177 ) ) // *sell*
                    {
                        ((BaseVendor)m_Mobile).VendorSell( from );
                        e.Handled = true;
                        m_Mobile.FocusMob = from;
                    }
                    else if ( e.HasKeyword( 0x171 ) ) // *buy*
                    {
                        ((BaseVendor)m_Mobile).VendorBuy( from );
                        e.Handled = true;
                        m_Mobile.FocusMob = from;
                    }
                }
            }
        }
Ejemplo n.º 30
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (XmlScript.HasTrigger(this, TriggerName.onSpeech) &&
                UberScriptTriggers.Trigger(this, e.Mobile, TriggerName.onSpeech, null, e.Speech))
            {
                return;
            }

            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);
            }
        }
Ejemplo n.º 31
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            base.OnSpeech(e);

            Mobile from = e.Mobile;

            if (m_Mobile is BaseVendor && from.InRange(m_Mobile, 4) && !e.Handled)
            {
                if (e.HasKeyword(0x14D))                     // *vendor sell*
                {
                    ((BaseVendor)m_Mobile).VendorSell(from);
                    e.Handled         = true;
                    m_Mobile.FocusMob = from;
                }
                else if (e.HasKeyword(0x3C))                     // *vendor buy*
                {
                    ((BaseVendor)m_Mobile).VendorBuy(from);
                    e.Handled         = true;
                    m_Mobile.FocusMob = from;
                }
                else if (WasNamed(e.Speech) || Insensitive.StartsWith(e.Speech, "hi "))
                {
                    if (e.HasKeyword(0x177))                         // *sell*
                    {
                        ((BaseVendor)m_Mobile).VendorSell(from);
                        e.Handled         = true;
                        m_Mobile.FocusMob = from;
                    }
                    else if (e.HasKeyword(0x171))                         // *buy*
                    {
                        ((BaseVendor)m_Mobile).VendorBuy(from);
                        e.Handled         = true;
                        m_Mobile.FocusMob = from;
                    }
                }
            }
        }
Ejemplo n.º 32
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (CheckAccess(e.Mobile) && IsLockedDown)
            {
                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);
                }
            }
        }
Ejemplo n.º 33
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, a 'hire', or a 'servant'
                if ((e.HasKeyword(0x003B) == true) || (e.HasKeyword(0x0162) == true) || (e.HasKeyword(0x000C) == true))
                {
                    if (Controlled == false)
                    {
                        e.Handled = Payday(this);
                        this.SayHireCost();
                    }
                    else
                    {
                        this.Say(1042495);                          // I have already been hired.
                    }
                }
            }

            base.OnSpeech(e);
        }
        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);
        }
Ejemplo n.º 35
0
		public override void OnSpeech( SpeechEventArgs e )
		{
			Mobile from = e.Mobile;

			if ( !e.Handled && from is PlayerMobile && from.InRange( 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 );
		}
Ejemplo n.º 36
0
		// Temporary 
		public override void OnSpeech( SpeechEventArgs e )
		{
			base.OnSpeech( e );
 
			Mobile from = e.Mobile;
 
			if ( m_Mobile is BaseVendor && from.InRange( m_Mobile, Core.AOS ? 1 : 4 ) && !e.Handled )
			{
				if ( e.HasKeyword( 0x14D ) ) // *vendor sell*
				{
					e.Handled = true;

					((BaseVendor)m_Mobile).VendorSell( from );
					m_Mobile.FocusMob = from;
				}
				else if ( e.HasKeyword( 0x3C ) ) // *vendor buy*
				{
					e.Handled = true;

					((BaseVendor)m_Mobile).VendorBuy( from );
					m_Mobile.FocusMob = from;
				}
				else if ( WasNamed( e.Speech ) )
				{
					if ( e.HasKeyword( 0x177 ) ) // *sell*
					{
						e.Handled = true;

						((BaseVendor)m_Mobile).VendorSell( from );
					}
					else if ( e.HasKeyword( 0x171 ) ) // *buy*
					{
						e.Handled = true;

						((BaseVendor)m_Mobile).VendorBuy( from );
					}

					m_Mobile.FocusMob = from;
				}
			}
		}
Ejemplo n.º 37
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 );
			}
		}
Ejemplo n.º 38
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (XmlScript.HasTrigger(this, TriggerName.onSpeech) &&
                UberScriptTriggers.Trigger(this, e.Mobile, TriggerName.onSpeech, null, e.Speech))
            {
                return;
            }

            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
                {
                    if (WasNamed(e.Speech))
                    {
                        OpenBackpack(from);
                    }
                    else
                    {
                        IPooledEnumerable mobiles = from.GetMobilesInRange(2);

                        foreach (
                            PlayerVendor m in mobiles.OfType<PlayerVendor>().Where(m => m.CanSee(from) && m.InLOS(from))
                            )
                        {
                            m.OpenBackpack(from);
                        }

                        mobiles.Free();
                    }

                    e.Handled = true;
                }
            }
            else if (e.HasKeyword(0x3E) || (e.HasKeyword(0x173) && WasNamed(e.Speech))) // vendor collect, *collect
            {
                if (IsOwner(from))
                {
                    CollectCurrency(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))
                {
                    Direction = GetDirectionTo(from);

                    e.Handled = true;
                }
            }
        }
Ejemplo n.º 39
0
		public override void OnSpeech(SpeechEventArgs e)
		{
			if (XmlScript.HasTrigger(this, TriggerName.onSpeech) &&
				UberScriptTriggers.Trigger(this, e.Mobile, TriggerName.onSpeech, null, e.Speech))
			{
				return;
			}

			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);
			}
		}
Ejemplo n.º 40
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) && this.WasNamed(e.Speech))) // vendor buy, *buy*
            {
                if (this.IsOwner(from))
                {
                    this.SayTo(from, 503212); // You own this shop, just take what you want.
                }
                else if (this.House == null || !this.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) && this.WasNamed(e.Speech))) // vendor browse, *browse
            {
                if (this.House != null && this.House.IsBanned(from) && !this.IsOwner(from))
                {
                    this.SayTo(from, 1062674); // You can't shop from this home as you have been banned from this establishment.
                }
                else
                {
                    if (this.WasNamed(e.Speech))
                        this.OpenBackpack(from);
                    else
                    {
                        IPooledEnumerable mobiles = e.Mobile.GetMobilesInRange(2);
						
                        foreach (Mobile m in mobiles)
                            if (m is PlayerVendor && m.CanSee(e.Mobile) && m.InLOS(e.Mobile))
                                ((PlayerVendor)m).OpenBackpack(from);
						
                        mobiles.Free();
                    }
					
                    e.Handled = true;
                }
            }
            else if (e.HasKeyword(0x3E) || (e.HasKeyword(0x173) && this.WasNamed(e.Speech))) // vendor collect, *collect
            {
                if (this.IsOwner(from))
                {
                    this.CollectGold(from);

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

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

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

                    e.Handled = true;
                }
            }
        }
Ejemplo n.º 41
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            base.OnSpeech(e);

            EDI dest = this.GetDestination();

            if (dest != null && !e.Handled && e.Mobile.InRange(this.Location, 3))
            {
                if (e.HasKeyword(0x1D)) // *destination*
                    e.Handled = this.SayDestinationTo(e.Mobile);
                else if (e.HasKeyword(0x1E)) // *i will take thee*
                    e.Handled = this.AcceptEscorter(e.Mobile);
            }
        }
Ejemplo n.º 42
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (!e.Handled && e.HasKeyword(this.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 != this.Type)
                {
                    this.Say(this.SignupNumber);
                }
                else
                {
                    Container pack = from.Backpack;
                    BaseShield shield = this.Shield;
                    Item twoHanded = from.FindItemOnLayer(Layer.TwoHanded);

                    if ((pack != null && pack.FindItemByType(shield.GetType()) != null) || (twoHanded != null && shield.GetType().IsAssignableFrom(twoHanded.GetType())))
                    {
                        this.Say(1007110); // Why dost thou ask about virtue guards when thou art one?
                        shield.Delete();
                    }
                    else if (from.PlaceInBackpack(shield))
                    {
                        this.Say(Utility.Random(1007101, 5));
                        this.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);
        }
Ejemplo n.º 43
0
        public override void OnSpeech( SpeechEventArgs e )
        {
            base.OnSpeech( e );

            if ( !e.Handled && this.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 );
                    }
                }
            }
        }
Ejemplo n.º 44
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (this.m_NewsTimer == null && e.HasKeyword(0x30) && e.Mobile.Alive && this.InRange(e.Mobile, 12)) // *news*
            {
                this.Direction = this.GetDirectionTo(e.Mobile);

                TownCrierEntry tce = this.GetRandomEntry();

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

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

					var 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.ControlOrder = OrderType.Guard;
                                        m_Mobile.ControlTarget = null;
									}
									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 || (m_Mobile is GrizzledMare))
										{
											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.ControlOrder = OrderType.Guard;
                                        m_Mobile.ControlTarget = null;
										
									}

									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 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 || (m_Mobile is GrizzledMare))
										{
											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))
					{
						var 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;
							}
						}
					}
				}
			}
		}
Ejemplo n.º 46
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 );
			}
		}
Ejemplo n.º 47
0
		// Temporary 
		public override void OnSpeech( SpeechEventArgs e )
		{
			base.OnSpeech( e );
 
			var from = e.Mobile;

			if ( m_Mobile is BaseVendor && from.InRange( m_Mobile, m_Mobile.RangePerception ) && !e.Handled )
			{
				if ( WasNamed( e.Speech ) )
				{
					e.Handled = true;

					if ( e.HasKeyword( 0x177 ) ) // *sell*
						((BaseVendor)m_Mobile).VendorSell( from );
					else if ( e.HasKeyword( 0x171 ) ) // *buy*
						((BaseVendor)m_Mobile).VendorBuy( from );

                    if (m_InteractTimer != null)
                        m_InteractTimer.Stop();

                    m_InteractTimer = new InteractTimer(from, (BaseVendor) m_Mobile);
                    m_InteractTimer.Start();

                    m_Mobile.FocusMob = from;
				}
				else if (e.HasKeyword(0x171) && !NamedInRange(from,e.Speech))//Buy
				{
					e.Handled = true;
					((BaseVendor)m_Mobile).VendorBuy(from);

                    if (m_InteractTimer != null)
                        m_InteractTimer.Stop();

                    m_InteractTimer = new InteractTimer(from, (BaseVendor)m_Mobile);
                    m_InteractTimer.Start();

                    m_Mobile.FocusMob = from;
				}
				else if (e.HasKeyword(0x177) && !NamedInRange(from, e.Speech))//Sell
				{
					e.Handled = true;
					((BaseVendor)m_Mobile).VendorSell(from);

                    if (m_InteractTimer != null)
                        m_InteractTimer.Stop();

                    m_InteractTimer = new InteractTimer(from, (BaseVendor)m_Mobile);
                    m_InteractTimer.Start();

                    m_Mobile.FocusMob = from;
				}
			}
		}
Ejemplo n.º 48
0
		// Temporary 
		public override void OnSpeech( SpeechEventArgs e )
		{
			base.OnSpeech( e );
 
			Mobile from = e.Mobile;
 
			if ( m_Mobile is BaseVendor && from.InRange( m_Mobile, Core.AOS ? 1 : 4 ) && !e.Handled )
			{
				if ( e.HasKeyword( 0x14D ) ) // *vendor sell*
				{
					e.Handled = true;

					((BaseVendor)m_Mobile).VendorSell( from );
					m_Mobile.FocusMob = from;
				}
				else if ( e.HasKeyword( 0x3C ) )
				{
					e.Handled = true;

					((BaseVendor)m_Mobile).VendorBuy( from );
					m_Mobile.FocusMob = from;
				}
				else if ( WasNamed( e.Speech ) )
				{
					e.Handled = true;

					if ( e.HasKeyword( 0x177 ) ) // *sell*
						((BaseVendor)m_Mobile).VendorSell( from );
					else if ( e.HasKeyword( 0x171 ) ) // *buy*
						((BaseVendor)m_Mobile).VendorBuy( from );

					m_Mobile.FocusMob = from;
				}
//I added				
				else // sell bag
                {
                    string speech = e.Speech.ToLower();
                    if (speech.EndsWith(" sell bag") || speech.StartsWith("sell bag ") || speech == "sell bag" || speech.Contains(" sell bag "))
                    {
                        e.Handled = true;
                        ((BaseVendor)m_Mobile).VendorSellBag(from);
                        m_Mobile.FocusMob = from;
                    }
                }
//I added				

			}
		}
Ejemplo n.º 49
0
        public override void OnSpeech( SpeechEventArgs e )
        {
            base.OnSpeech( e );

            Mobile from = e.Mobile;

            if ( !e.Handled && this.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 = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
                    }
                }
                else if ( DateTime.Now < m_OrdersEnd )
                {
                    if ( m_Town != null && m_Town.IsSheriff( from ) && Town.FromRegion( this.Region ) == m_Town )
                    {
                        m_OrdersEnd = DateTime.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...
                        }
                    }
                }
            }
        }
Ejemplo n.º 50
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
            {
                     if( this is Alchemist)// Job
                     {
             this.Say( 1014434 );
                     }
                     if( this is Architect)// Job
                     {
             this.Say( 1014436 );
                     }
                     if( this is Armorer)// Job
                     {
             this.Say( 1014437 );
                     }
                     if( this is Bard)// Job
                     {
             this.Say( 1014442 );
                     }
                     if( this is Beekeeper)// Job
                     {
             this.Say( 1014446 );
                     }
                     if( this is Blacksmith)// Job
                     {
             this.Say( 1014448 );
                     }
                     if( this is Bower)// Job
                     {
             this.Say( 1014449 );
                     }
                     if( this is Butcher)// Job
                     {
             this.Say( 1014451 );
                     }
                     if( this is Carpenter)// Job
                     {
             this.Say( 1014452 );
                     }
                     if( this is Cobbler)// Job
                     {
             this.Say( 1014456 );
                     }
                     if( this is Cook)// Job
                     {
             this.Say( 1014464 );
                     }
                     if( this is Farmer)// Job
                     {
             this.Say( 1014484 );
                     }
                     if( this is Fisherman)// Job
                     {
             this.Say( 1014487 );
                     }
                     if( this is Furtrader)// Job
                     {
             this.Say( 1014489 );
                     }
                     if( this is Glassblower)// Job
                     {
             this.Say( 1014493 );
                     }
                     if( this is InnKeeper)// Job
                     {
             this.Say( 1014508 );
                     }
                     if( this is Jeweler)// Job
                     {
             this.Say( 1014512 );
                     }
                     if( this is Mage)// Job
                     {
             this.Say( 1014515 );
                     }
                     if( this is Mapmaker)// Job
                     {
             this.Say( 1014517 );
                     }
                     if( this is Miner)// Job
                     {
             this.Say( 1014522 );
                     }
                     if( this is Provisioner)// Job
                     {
             this.Say( 1014534 );
                     }
                     if( this is Rancher)// Job
                     {
             this.Say( 1014535 );
                     }
                     if( this is Ranger)// Job
                     {
             this.Say( 1014536 );
                     }
                     if( this is Shipwright)// Job
                     {
             this.Say( 1014553 );
                     }
                     if( this is Tailor)// Job
                     {
             this.Say( 1014556 );
                     }
                     if( this is Tanner)// Job
                     {
             this.Say( 1014558 );
                     }
                     if( this is Weaponsmith)// Job
                     {
             this.Say( 1014448 );
                     }
             	}
            //Job End

            }

            base.OnSpeech( e );
        }
Ejemplo n.º 51
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (this.CheckAccess(e.Mobile) && this.IsLockedDown)
            {
                if (!e.Handled && e.HasKeyword(0x0008))
                {
                    e.Handled = true;
                    this.BeginStable(e.Mobile);
                }
                else if (!e.Handled && e.HasKeyword(0x0009))
                {
                    e.Handled = true;

                    if (!Insensitive.Equals(e.Speech, "claim"))
                        this.BeginClaimList(e.Mobile);
                    else
                        this.Claim(e.Mobile);
                }
                else
                {
                    base.OnSpeech(e);
                }
            }
        }
Ejemplo n.º 52
0
		public virtual void OnSpeech( SpeechEventArgs e )
		{
			if( e.Mobile.Alive && e.Mobile.InRange( m_Mobile.Location, 2 ) && !(e.Mobile is BaseCreature) && m_Mobile.Body.IsHuman)
			{
				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
					{
						Skills ourSkills = m_Mobile.Skills;
						Skills theirSkills = e.Mobile.Skills;

						ArrayList skillsToTeach = new ArrayList();

						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;
                                else
                                    toTeach = 40.0;

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

									if( number > 1043107 )
										continue;

									skillsToTeach.Add(CliLoc.LocToString(number));
								}
							}
						}

						if (skillsToTeach.Count == 0)
						{
							m_Mobile.Say("There is nothing that I can teach you.");
							//m_Mobile.Say( 501505 ); // Alas, I cannot teach thee anything.
						}
						else
						{
							string speach = "For a fee I can teach thee of ";

							if (skillsToTeach.Count == 1) speach += skillsToTeach[0] + ".";
							else
							{
								for (int i = 0; i < skillsToTeach.Count - 1; ++i)
									speach += skillsToTeach[i] + ", ";

								speach += "and " + skillsToTeach[skillsToTeach.Count - 1] + ".";
							}

							m_Mobile.Say(speach);
						}
					}
				}
				/*else if( e.Speech.ToLower().Contains( "where" ) && WasNamed( e.Speech ) ) // Where
				{
					//Iza
					if( string.IsNullOrEmpty( e.Mobile.Region.Name ) )
						m_Mobile.Say( string.Format( "You are in {0}.", e.Mobile.Region.Name ) );
					else
						m_Mobile.Say( "Why, you are here!" );
				}*/

                // "*train discordance"-keyword missing from speech.mul file.. (wtf?)

				else
				{
					SkillName toTrain = (SkillName)(-1);

                    if (e.Speech.ToLower().Contains("train discordance") || e.Speech.ToLower().Contains("teach discordance"))
                    {
                        toTrain = SkillName.Discordance;
                    }
                    else if (e.Speech.ToLower().Contains("train disarming traps") || e.Speech.ToLower().Contains("train remove trap") || e.Speech.ToLower().Contains("teach disarming traps") || e.Speech.ToLower().Contains("teach remove trap"))
                    {
                        toTrain = SkillName.RemoveTrap;
                    }
                    else
                    {
                        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("I know nothing about {0}.", toTrain );
								//m_Mobile.Say(501507); // 'Tis not something I can teach thee of.
							}
							else
							{
								m_Mobile.Teach(toTrain, e.Mobile, 0, false);
							}
						}
					}
					else
					{
						#region Iza edit
						if (WasNamed(e.Speech))
						{
							bool hasSpoken = false;

							for (int i = 0; i < m_GreetKeyword.Length; ++i)
								if (e.Speech.ToLower().Contains(m_GreetKeyword[i]))
								{
									m_Mobile.Say(m_GreetRespone[Utility.Random(m_GreetRespone.Length)]);
									hasSpoken = true;
									break;
								}

							if (!hasSpoken)
								for (int i = 0; i < m_PartKeyword.Length; ++i)
									if (e.Speech.ToLower().Contains(m_PartKeyword[i]))
									{
										m_Mobile.Say(m_PartRespone[Utility.Random(m_PartRespone.Length)]);
										break;
									}
						}
						#endregion
					}
                    Iza.NPC_Speech.npcs.SmartRespond(e, m_Mobile, e.Speech);
				}
			}

			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 = e.Mobile;
									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;
							}
						}
					}

					//Added some missing "all" control orders.
					if (e.Speech.ToLower().Contains("all ") && isOwner)
					{
						if (e.HasKeyword(0x16D)) // *release
						{
							m_Mobile.ControlTarget = null;
							m_Mobile.ControlOrder = OrderType.Release;

							return;
						}
						else if (e.HasKeyword(0x16E)) // *transfer
						{
							if (!m_Mobile.IsDeadPet && WasNamed(speech) && m_Mobile.CheckControlChance(e.Mobile))
							{
                                if (m_Mobile.Summoned || (m_Mobile is GrizzledMare))
                                    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 if (m_Mobile is BaseMount && ((BaseMount)m_Mobile).DonationMount)
                                    e.Mobile.SendAsciiMessage("You cannot transfer mounts that you got by donating");
								else
									BeginPickTarget(e.Mobile, OrderType.Transfer);
							}

							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    Taran: Disabled to prevent easy llama bombing
							{
								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 || (m_Mobile is GrizzledMare))
                                        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 ) )
								{
									{
										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 if (m_Mobile is BaseMount && ((BaseMount)m_Mobile).DonationMount)
                                        e.Mobile.SendAsciiMessage("You cannot transfer mounts that you got by donating");
									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;
							}
						}
					}
				}
			}
		}
Ejemplo n.º 53
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            base.OnSpeech(e);

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

            bool isOwner = this.m_House.IsOwner(from);
            bool isCoOwner = isOwner || this.m_House.IsCoOwner(from);
            bool isFriend = isCoOwner || this.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 <= this.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, this.m_House));
                }
                else
                {
                    from.SendLocalizedMessage(501320); // Only the house owner may do this.
                }
            }

            if (!this.m_House.IsInside(from) || !this.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(this.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 (!this.m_House.Public && this.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, this.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, this.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, this.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, this.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, this.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)
                {
                    this.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)
                {
                    this.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.
                }
            }
        }
Ejemplo n.º 54
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            if (!e.Handled && this.Active)
            {
                Mobile m = e.Mobile;

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

                bool isMatch = false;

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

                if (!isMatch || !this.CanTeleport(m))
                    return;

                e.Handled = true;
                this.StartTeleport(m);
            }
        }
Ejemplo n.º 55
0
 public override void OnSpeech(SpeechEventArgs e)
 {
     if (!e.Handled && e.HasKeyword(0x16D))
     {
         return;
     }
     else
     {
         base.OnSpeech(e);
     }
 }
Ejemplo n.º 56
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, a 'hire', or a 'servant'
				if( ( e.HasKeyword( 0x003B ) == true ) || ( e.HasKeyword( 0x0162 ) == true ) || ( e.HasKeyword( 0x000C ) == true ) )
				{
					if( Controlled == false )
					{
						e.Handled = Payday( this );
						this.SayHireCost();
					}
					else
					{
						this.Say( 1042495 );// I have already been hired.
					}
				}
			}

			base.OnSpeech( e );
		}
Ejemplo n.º 57
0
		public override void OnSpeech(SpeechEventArgs e)
		{
			if (XmlScript.HasTrigger(this, TriggerName.onSpeech) &&
				UberScriptTriggers.Trigger(this, e.Mobile, TriggerName.onSpeech, null, e.Speech))
			{
				return;
			}
			if (!e.Handled && e.HasKeyword(Keyword) && e.Mobile.InRange(Location, 2))
			{
				e.Handled = true;

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

			    var ethic = Ethics.Player.Find(e.Mobile);

                if (g == null && ethic == null || g != null && g.Type != Type && ethic == null)
				{
					Say(SignupNumber);
				}
                else if (ethic != null && Shield is OrderShield && ethic.Ethic is EvilEthic ||
                         ethic != null && Shield is ChaosShield && ethic.Ethic is HeroEthic)
                {
                    Say("Begone!  You do not follow the proper ethic to wield one of our order's shields.");
                }
				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().IsInstanceOfType(twoHanded)))
					{
						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);
		}
Ejemplo n.º 58
0
		public override void OnSpeech(SpeechEventArgs e)
		{
			if (!e.Handled && Active)
			{
				Mobile m = e.Mobile;

				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 || !CanTeleport(m))
				{
					return;
				}

				e.Handled = true;
				StartTeleport(m);
			}
		}
Ejemplo n.º 59
0
		public override void OnSpeech(SpeechEventArgs args)
		{
			base.OnSpeech(args);

			if (IsDisabled())
			{
				return;
			}

			if (args.Mobile.Alive && args.HasKeyword(0x0007)) // *guards*
			{
				CallGuards(args.Mobile.Location);
			}
		}
Ejemplo n.º 60
0
		public override void OnSpeech(SpeechEventArgs e)
		{
			base.OnSpeech(e);

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

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

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

			//string speech = e.Speech.Trim().ToLower();

			if (e.HasKeyword(0x33)) // remove thyself
			{
				from.SendLocalizedMessage(501326); // Target the individual to eject from this house.
				from.Target = new HouseKickTarget(m_House);
			}
			else if (e.HasKeyword(0x34)) // I ban thee
			{
				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
				{
					from.SendLocalizedMessage(1010587); // You are not a co-owner of this house.
				}
			}
			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
				{
					from.SendLocalizedMessage(1010587); // You are not a co-owner of this house.
				}
			}
			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(502096); // You must own the 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(502096); // You must own the 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
				{
					from.SendLocalizedMessage(1010587); // You are not a co-owner of this house.
				}
			}
			else if (e.HasKeyword(0x28))
			{
				if (isCoOwner)
				{
					m_House.AddTrashBarrel(from);
				}
				else
				{
					from.SendLocalizedMessage(1010587); // You are not a co-owner of this house.
				}
			}
			else if (from.AccessLevel >= AccessLevel.GameMaster)
			{
				if (Insensitive.Equals(e.Speech, "i wish to add this"))
				{
					from.SendMessage("Choose the item you wish to add to the house.");
					from.Target = new AddonTarget(false, m_House);
				}
				else if (Insensitive.Equals(e.Speech, "i wish to remove this"))
				{
					from.SendMessage("Choose the item you wish to remove from the house.");
					from.Target = new AddonTarget(true, m_House);
				}
			}
		}