public static void HandleSpeech(SpeechConquestContainer e)
 {
     if (e != null && e.Mobile != null && e.Mobile is PlayerMobile)
     {
         CheckProgress <SpeechConquest>((PlayerMobile)e.Mobile, e);
     }
 }
        protected virtual int GetProgress(ConquestState state, SpeechConquestContainer args)
		{
            if (state.User == null)
                return 0;

			if (args == null || String.IsNullOrEmpty(args.Speech))
			{
				return 0;
			}

			if (!Search.Execute(args.Speech, Phrase, IgnoreCase))
			{
				if (SpeechChangeReset)
				{
					return -state.Progress;
				}

				return 0;
			}

			return 1;
		}
        protected virtual int GetProgress(ConquestState state, SpeechConquestContainer args)
        {
            if (state.User == null)
            {
                return(0);
            }

            if (args == null || String.IsNullOrEmpty(args.Speech))
            {
                return(0);
            }

            if (!Search.Execute(args.Speech, Phrase, IgnoreCase))
            {
                if (SpeechChangeReset)
                {
                    return(-state.Progress);
                }

                return(0);
            }

            return(1);
        }
 public static void HandleSpeech(SpeechConquestContainer e)
 {
     if (e != null && e.Mobile != null && e.Mobile is PlayerMobile)
     {
         CheckProgress<SpeechConquest>((PlayerMobile) e.Mobile, e);
     }
 }
		public override void DoSpeech(string text, int[] keywords, MessageType type, int hue)
		{
			if (Guilds.Guild.NewGuildSystem && (type == MessageType.Guild || type == MessageType.Alliance))
			{
				var g = Guild as Guild;

				if (g == null)
				{
					SendLocalizedMessage(1063142); // You are not in a guild!
					return;
				}

				if (type == MessageType.Alliance)
				{
					if (g.Alliance != null && g.Alliance.IsMember(g))
					{
						//g.Alliance.AllianceTextMessage( hue, "[Alliance][{0}]: {1}", this.Name, text );
						g.Alliance.AllianceChat(this, text);
						SendToStaffMessage(this, "[Alliance]: {0}", text);

						AllianceMessageHue = hue;
					}
					else
					{
						SendLocalizedMessage(1071020); // You are not in an alliance!
					}

					return;
				}

				/*if (type != MessageType.Guild)
				{
					return;
				}*/

				GuildMessageHue = hue;

				g.GuildChat(this, text);
				SendToStaffMessage(this, "[Guild]: {0}", text);
				return;
			}

            SpeechConquestContainer regArgs = new SpeechConquestContainer(this, text, type, hue, keywords);

            Conquests.HandleSpeech(regArgs);

		    if (IsArcade)
		    {
		        var wep = Weapon as BaseWeapon;
                if (wep != null && DateTime.UtcNow > NextArcadeSwingTime)
		        {
		            switch (text)
		            {
		                case "!9":
		                {
                            Arcade.Arcade.SwingDirection(this, Direction.North);
                            NextArcadeSwingTime = DateTime.UtcNow +
		                                      TimeSpan.FromSeconds(0.6 * Math.Pow(wep.DamageMax / 48.0, 0.5));
		                    return;
		                }
		                case "!6":
		                {
                            Arcade.Arcade.SwingDirection(this, Direction.Right);
                            NextArcadeSwingTime = DateTime.UtcNow +
		                                      TimeSpan.FromSeconds(0.6 * Math.Pow(wep.DamageMax / 48.0, 0.5));
		                    return;
		                }
		                case "!3":
		                {
                            Arcade.Arcade.SwingDirection(this, Direction.East);
                            NextArcadeSwingTime = DateTime.UtcNow +
		                                      TimeSpan.FromSeconds(0.6 * Math.Pow(wep.DamageMax / 48.0, 0.5));
		                    return;
		                }
		                case "!2":
		                {
                            Arcade.Arcade.SwingDirection(this, Direction.Down);
                            NextArcadeSwingTime = DateTime.UtcNow +
		                                      TimeSpan.FromSeconds(0.6 * Math.Pow(wep.DamageMax / 48.0, 0.5));
		                    return;
		                }
		                case "!1":
		                {
                            Arcade.Arcade.SwingDirection(this, Direction.South);
                            NextArcadeSwingTime = DateTime.UtcNow + TimeSpan.FromSeconds(0.6 * wep.DamageMax / 24);
		                    return;
		                }
		                case "!4":
		                {
		                    Arcade.Arcade.SwingDirection(this, Direction.Left);
                            NextArcadeSwingTime = DateTime.UtcNow +
		                                      TimeSpan.FromSeconds(0.6 * Math.Pow(wep.DamageMax / 48.0, 0.5));
		                    return;
		                }
		                case "!7":
		                {
                            Arcade.Arcade.SwingDirection(this, Direction.West);
                            NextArcadeSwingTime = DateTime.UtcNow +
		                                      TimeSpan.FromSeconds(0.6 * Math.Pow(wep.DamageMax / 48.0, 0.5));
		                    return;
		                }
		                case "!8":
		                {
                            Arcade.Arcade.SwingDirection(this, Direction.Up);
                            NextArcadeSwingTime = DateTime.UtcNow +
		                                      TimeSpan.FromSeconds(0.6 * Math.Pow(wep.DamageMax / 48.0, 0.5));
		                    return;
		                }
		            }
		        }
		        else if ((text == "!2" || text == "!3" || text == "!4" || text == "!1" || text == "!6" || text == "!7" ||
                          text == "!8" || text == "!9") && DateTime.UtcNow <= NextArcadeSwingTime)
		        {
		            SendMessage(38, "You fumble your weapon attempting to swing it too quickly.");
                    NextArcadeSwingTime = DateTime.UtcNow +
		                              TimeSpan.FromSeconds(0.8 * Math.Pow(wep.DamageMax / 48.0, 0.5));
		            return;
		        }
		    }

		    base.DoSpeech(text, keywords, type, hue);
		}