using System;
using Server.Items;
using Server.Misc;

namespace Server.Misc
{
    class CitizenTalking
    {
		public static void CitizenTalk( Mobile m )
		{
			string sSourceName = NameList.RandomName( "male" );
			string sSourceJob = NameList.RandomName( "career" );
			if ( Utility.RandomBool() )
				sSourceName = NameList.RandomName( "female" );

			string sSource = "I heard about";	
			switch( Utility.RandomMinMax( 1, 13 ) )
			{
				case 1: sSource = "Rumors are spoken about"; break;
				case 2: sSource = "They are talking about"; break;
				case 3: sSource = "There are rumors about"; break;
				case 4: sSource = "I was told about"; break;
				case 5: sSource = "I heard someone talking about"; break;
				case 6: sSource = "There is a story about"; break;
				case 7: sSource = sSourceName + " told me about"; break;
				case 8: sSource = sSourceName + " the " + sSourceJob + " told me about"; break;
				case 9: sSource = "Some " + sSourceJob + " told me about"; break;
				case 10: sSource = sSourceName + " the " + sSourceJob + " heard about"; break;
				case 11: sSource = "Some " + sSourceJob + " heard about"; break;
				case 12: sSource = sSourceName + " the " + sSourceJob + " learned about"; break;
				case 13: sSource = "Some " + sSourceJob + " learned about"; break;
			}

			string sPren = "this";	
			switch( Utility.RandomMinMax( 1, 4 ) )
			{
				case 1: sPren = "a"; break;
				case 2: sPren = "the"; break;
				case 3: sPren = "that"; break;
			}

			string sThey = NameList.RandomName( "male" );	
				if ( Utility.RandomBool() )
					sThey = NameList.RandomName( "female" );

			string city = NameList.RandomName( "city" );

			string dungeon = NameList.RandomName( "dungeon" );

			string sAdventurer = NameList.RandomName( "adventurer" );

			string sDebt = NameList.RandomName( "debt" );

			int relic = Utility.RandomMinMax( 1, 59 );	

			string sSpeech = "We are supposed to wait for " + sThey + ".";
			switch( Utility.RandomMinMax( 1, 10 ) )
			{
				case 1: sSpeech = "We are supposed to wait for " + sThey + "."; break;	
				case 2: sSpeech = sThey + " lives somewhere near " + city + "."; break;	
				case 3: sSpeech = "We will go find " + sThey + " tomorrow."; break;	
				case 4: sSpeech = "We need to split this loot we have."; break;	
				case 5: sSpeech = sThey + " still owes me " + Utility.RandomMinMax( 5, 200 ) + " gold " + sDebt + "."; break;	
				case 6: sSpeech = "I think " + sThey + " stole it while we were " + NameList.RandomName( "action" ) + "."; break;	
				case 7: sSpeech = sThey + " will bring it here when they find it."; break;	
				case 8: sSpeech = NameList.RandomName( "question" ) + " " + sThey + "?"; break;	
				case 9: sSpeech = sThey + " sold " + sPren + " " + NameList.RandomName( "describe" ) + " " + NameList.RandomName( "item" ) + " for " + Utility.RandomMinMax( 5, 200 ) + " gold."; break;	
				case 10: sSpeech = "I paid " + sThey + " " + Utility.RandomMinMax( 5, 200 ) + " gold for " + sPren + " " + NameList.RandomName( "describe" ) + " " + NameList.RandomName( "item" ) + "."; break;	
			}

			string sHappen = "A friend of mine died"; string sEnd = ".";	
			switch( Utility.RandomMinMax( 0, 35 ) )
			{
				case 0: sHappen = "A friend of mine was lost in"; sEnd = "."; break;	
				case 1: sHappen = "A friend of mine died in"; sEnd = "."; break;	
				case 2: sHappen = "I lost that weapon in"; sEnd = "."; break;	
				case 3: sHappen = "Have you ever been to"; sEnd = "?"; break;	
				case 4: sHappen = "Have you ever heard of"; sEnd = "?"; break;	
				case 5: sHappen = "When did you go to"; sEnd = "?"; break;	
				case 6: sHappen = "How did you get to"; sEnd = "?"; break;	
				case 7: sHappen = "Why did you go to"; sEnd = "?"; break;	
				case 8: sHappen = "What did you find in"; sEnd = "?"; break;	
				case 9: sHappen = "You found that in"; sEnd = "?"; break;	
				case 10: sHappen = "They died in"; sEnd = "."; break;	
				case 11: sHappen = "I have never been to"; sEnd = "."; break;	
				case 12: sHappen = "That artifact came from"; sEnd = "."; break;	
				case 13: sHappen = "They got lost in"; sEnd = "."; break;	
				case 14: sHappen = "They vanished in"; sEnd = "."; break;	
				case 15: sHappen = "I almost didn't make it out of"; sEnd = "."; break;	
				case 16: sHappen = "They didn't make it out of"; sEnd = "."; break;	
				case 17: sHappen = "I lost that magic item in"; sEnd = "."; break;	
				case 18: sHappen = "Did you lose it in"; sEnd = "?"; break;	
				case 19: sHappen = "We should go search in"; sEnd = "."; break;	
				case 20: sHappen = "We should go explore in"; sEnd = "."; break;	
				case 21: sHappen = "Tonight we will go to"; sEnd = "."; break;	
				case 22: sHappen = sThey + " was lost in"; sEnd = "."; break;	
				case 23: sHappen = sThey + " died in"; sEnd = "."; break;	
				case 24: sHappen = sThey + " lost that weapon in"; sEnd = "."; break;	
				case 25: sHappen = "When did " + sThey + " go to"; sEnd = "?"; break;	
				case 26: sHappen = "How did " + sThey + " get to"; sEnd = "?"; break;	
				case 27: sHappen = "Why did " + sThey + " go to"; sEnd = "?"; break;	
				case 28: sHappen = "What did " + sThey + " find in"; sEnd = "?"; break;	
				case 29: sHappen = sThey + " found that in"; sEnd = "?"; break;	
				case 30: sHappen = sThey + " has never been to"; sEnd = "."; break;	
				case 31: sHappen = sThey + " vanished in"; sEnd = "."; break;	
				case 32: sHappen = sThey + " almost didn't make it out of"; sEnd = "."; break;	
				case 33: sHappen = sThey + " didn't make it out of"; sEnd = "."; break;	
				case 34: sHappen = sThey + " lost that magic item in"; sEnd = "."; break;	
				case 35: sHappen = "Did " + sThey + " lose it in"; sEnd = "?"; break;	
			}

			string sEvent = sHappen + " " + dungeon + sEnd;	

			int iWillSay = Utility.RandomMinMax( 1, 8 );	

			if ( iWillSay < 3 )
			{
				switch( Utility.RandomMinMax( 1, 39 ) )
				{
					case 1: m.PlaySound( m.Female ? 778 : 1049 ); m.Say( "*ah!*" ); break;	
					case 2: m.PlaySound( m.Female ? 779 : 1050 ); m.Say( "Ah ha!" ); break;	
					case 3: m.PlaySound( m.Female ? 780 : 1051 ); m.Say( "*applauds*" ); break;	
					case 4: m.PlaySound( m.Female ? 781 : 1052 ); m.Say( "*blows nose*" );	break;	
					case 5: m.PlaySound( m.Female ? 786 : 1057 ); m.Say( "*cough*" ); break;	
					case 6: m.PlaySound( m.Female ? 782 : 1053 ); m.Say( "*burp*" ); break;	
					case 7: m.PlaySound( m.Female ? 784 : 1055 ); m.Say( "*clears throat*" ); break;	
					case 8: m.PlaySound( m.Female ? 785 : 1056 ); m.Say( "*cough*" ); break;	
					case 9: m.PlaySound( m.Female ? 787 : 1058 ); m.Say( "*cries*" ); break;	
					case 10: m.PlaySound( m.Female ? 792 : 1064 ); m.Say( "*farts*" ); break;	
					case 11: m.PlaySound( m.Female ? 793 : 1065 ); m.Say( "*gasp*" ); break;	
					case 12: m.PlaySound( m.Female ? 794 : 1066 ); m.Say( "*giggles*" ); break;	
					case 13: m.PlaySound( m.Female ? 0x31B : 0x42B ); m.Say( "*groans*" ); break;	
					case 14: m.PlaySound( m.Female ? 0x338 : 0x44A ); m.Say( "*growls*" ); break;	
					case 15: m.PlaySound( m.Female ? 797 : 1069 ); m.Say( "Hey!" ); break;	
					case 16: m.PlaySound( m.Female ? 798 : 1070 ); m.Say( "*hiccup*" ); break;	
					case 17: m.PlaySound( m.Female ? 799 : 1071 ); m.Say( "Huh?" ); break;	
					case 18: m.PlaySound( m.Female ? 801 : 1073 ); m.Say( "*laughs*" ); break;	
					case 19: m.PlaySound( m.Female ? 802 : 1074 ); m.Say( "No!" ); break;	
					case 20: m.PlaySound( m.Female ? 803 : 1075 ); m.Say( "Oh!" ); break;	
					case 21: m.PlaySound( m.Female ? 811 : 1085 ); m.Say( "Oooh." ); break;	
					case 22: m.PlaySound( m.Female ? 812 : 1086 ); m.Say( "Oops!" ); break;	
					case 23: m.PlaySound( m.Female ? 0x32E : 0x440 ); m.Say( "Ahhhh!" ); break;	
					case 24: m.PlaySound( m.Female ? 815 : 1089 ); m.Say( "Shhh!" ); break;	
					case 25: m.PlaySound( m.Female ? 816 : 1090 ); m.Say( "*sigh*" ); break;	
					case 26: m.PlaySound( m.Female ? 817 : 1091 ); m.Say( "Ahh-choo!" ); break;	
					case 27: m.PlaySound( m.Female ? 818 : 1092 ); m.Say( "*sniff*" ); break;	
					case 28: m.PlaySound( m.Female ? 819 : 1093 ); m.Say( "*snore*" ); break;	
					case 29: m.PlaySound( m.Female ? 820 : 1094 ); m.Say( "*spits*" ); break;	
					case 30: m.PlaySound( m.Female ? 821 : 1095 ); m.Say( "*whistles*" ); break;	
					case 31: m.PlaySound( m.Female ? 783 : 1054 ); m.Say( "Woohoo!" ); break;	
					case 32: m.PlaySound( m.Female ? 822 : 1096 ); m.Say( "*yawns*" ); break;	
					case 33: m.PlaySound( m.Female ? 823 : 1097 ); m.Say( "Yea!" ); break;	
					case 34: m.PlaySound( m.Female ? 0x31C : 0x42C ); m.Say( "*yells*" ); break;	
					case 35: m.PlaySound( Utility.RandomList( 0x30, 0x2D6 ) ); break;	
					case 36: m.PlaySound( Utility.RandomList( 0x30, 0x2D6 ) ); break;	
					case 37: m.PlaySound( Utility.RandomList( 0x30, 0x2D6 ) ); break;	
					case 38: m.PlaySound( Utility.RandomList( 0x30, 0x2D6 ) ); break;	
					case 39: m.PlaySound( Utility.RandomList( 0x30, 0x2D6 ) ); break;	
				}
			}
			else if ( iWillSay < 5 ){ m.Say( sEvent ); }
			else { m.Say( sSpeech ); }
		}
	}
}