Пример #1
0
public override void OnSpeech( SpeechEventArgs e )
	{
	base.OnSpeech( e );
	Mobile from = e.Mobile;
	string message;
	RoastPig roastpork = new RoastPig();
		if ( from.InRange( this, 4 ))
		{
			if (e.Speech.ToLower() == "slave" || e.Speech.ToLower() == "servant" || e.Speech.ToLower() == "squire")
			{
       				message = "How might I serve thee, My Lord?";
       				this.Say( message );
			}
			else if (e.Speech.ToLower() == "follow")
			{
        			message = "As you command.";
        			this.Say( message );
			}
			else if (e.Speech.ToLower() == "tithe" || e.Speech.ToLower() == "donate")
			{
				from.SendGump( new TithingGump( from, 0 ) );
        			message = "I admire your faith.";
        			this.Say( message );
			}
			else if (e.Speech.ToLower() == "make camp" || e.Speech.ToLower() == "setup camp")
			{
				new Campfire().MoveToWorld( this.Location, this.Map );
				message = "I am securing thy camp now.";
			        this.Say( message );
			}
			else if (e.Speech.ToLower() == "master" || e.Speech.ToLower() == "who's your daddy")
			{
				message = String.Format( from.Name );
				this.Say( message );
				this.Say( "is my master");

			}
			else if (e.Speech.ToLower() == "food" || e.Speech.ToLower() == "cook" || e.Speech.ToLower() == "dinner")
			{
				if ( from.Backpack != null && from.Backpack.ConsumeTotal( typeof( Gold ), 100 ) )
					{
						from.AddToBackpack( roastpork );
			                    	message = "Dinner is served, my lord.";
                    				this.Say( message );
					}
					else
					{
						message = "But we haven't the money to buy food, Lord.";
						this.Say( message );
					}
			}
			else if (e.Speech.ToLower() == "reg" || e.Speech.ToLower() == "reagent")
			{
				if ( from.Backpack != null && from.Backpack.ConsumeTotal( typeof( Gold ), 1000 ) )
					{
						from.AddToBackpack( new BagOfReagents( 75 ));
						message = "Your total comes to 1000gp.";
						this.Say( message );
					}
					else
					{
						message = "I'm sorry my Lord, but you haven't the 1000gp for that";
						this.Say( message );
					}

			}










			else if (e.Speech.ToLower() == "smelt" || e.Speech.ToLower() == "ingot")
			{
				int i = 0;
				//Iron
				if ( from.Backpack != null && from.Backpack.ConsumeTotal( typeof( IronOre ), 1 ) )
					{
						do
						{
							from.AddToBackpack( new IronIngot( 2 ));
							i = ( i + 1 );
						}
						while( from.Backpack.ConsumeTotal( typeof( IronOre ), 1 ));
					}
				i = 0;
				//DullCopper
				if ( from.Backpack != null && from.Backpack.ConsumeTotal( typeof( DullCopperOre ), 1 ) )
					{
						do
						{
							from.AddToBackpack( new DullCopperIngot( 2 ));
							i = ( i + 1 );
						}
						while( from.Backpack.ConsumeTotal( typeof( DullCopperOre ), 1 ));
					}
				i = 0;
				//ShadowIron
				if ( from.Backpack != null && from.Backpack.ConsumeTotal( typeof( ShadowIronOre ), 1 ) )
					{
						do
						{
							from.AddToBackpack( new ShadowIronIngot( 2 ));
							i = ( i + 1 );
						}
						while( from.Backpack.ConsumeTotal( typeof( ShadowIronOre ), 1 ));
					}
				i = 0;
				//Copper
				if ( from.Backpack != null && from.Backpack.ConsumeTotal( typeof( CopperOre ), 1 ) )
					{
						do
						{
							from.AddToBackpack( new CopperIngot( 2 ));
							i = ( i + 1 );
						}
						while( from.Backpack.ConsumeTotal( typeof( CopperOre ), 1 ));
					}
				i = 0;
				//Bronze
				if ( from.Backpack != null && from.Backpack.ConsumeTotal( typeof( BronzeOre ), 1 ) )
					{
						do
						{
							from.AddToBackpack( new BronzeIngot( 2 ));
							i = ( i + 1 );
						}
						while( from.Backpack.ConsumeTotal( typeof( BronzeOre ), 1 ));
					}
				i = 0;
				//Gold
				if ( from.Backpack != null && from.Backpack.ConsumeTotal( typeof( GoldOre ), 1 ) )
					{
						do
						{
							from.AddToBackpack( new GoldIngot( 2 ));
							i = ( i + 1 );
						}
						while( from.Backpack.ConsumeTotal( typeof( GoldOre ), 1 ));
					}
				i = 0;
				//Agapite
				if ( from.Backpack != null && from.Backpack.ConsumeTotal( typeof( AgapiteOre ), 1 ) )
					{
						do
						{
							from.AddToBackpack( new AgapiteIngot( 2 ));
							i = ( i + 1 );
						}
						while( from.Backpack.ConsumeTotal( typeof( AgapiteOre ), 1 ));
					}
				i = 0;
				//Verite
				if ( from.Backpack != null && from.Backpack.ConsumeTotal( typeof( VeriteOre ), 1 ) )
					{
						do
						{
							from.AddToBackpack( new VeriteIngot( 2 ));
							i = ( i + 1 );
						}
						while( from.Backpack.ConsumeTotal( typeof( VeriteOre ), 1 ));
					}
				i = 0;
				//Valorite
				if ( from.Backpack != null && from.Backpack.ConsumeTotal( typeof( ValoriteOre ), 1 ) )
					{
						do
						{
							from.AddToBackpack( new ValoriteIngot( 2 ));
							i = ( i + 1 );
						}
						while( from.Backpack.ConsumeTotal( typeof( ValoriteOre ), 1 ));
					}
				i = 0;

				// To add custom ore types just copy the above ^^^
			}
			else if (e.Speech.ToLower() == "res" || e.Speech.ToLower() == "resurrect")
			{
				if ( !from.Alive && from.Map != null && from.Map.CanFit( from.Location, 16, false, false ) )
					{
						from.PlaySound( 0x214 );
						from.FixedEffect( 0x376A, 10, 16 );
						from.SendGump( new ResurrectGump( from ) );
						message = "I shall summon thee back from the abyss, my lord";
						this.Say( message );
					}
					else
					{
					from.SendLocalizedMessage( 502391 );
					}
		}
	}}
Пример #2
0
		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			BankBox box = from.BankBox;
			if ( box == null )
				return false;

			if ( dropped is HolidayDeed )
			{
				if(message != null)
					SayTo(from, message);
				Item random = null;
				int randomitem = Utility.RandomMinMax(0, 3);

                if (randomitem == 0)
                {
                    random = new Snowman();
                    random.Name = "snowman";
                }

				if(randomitem == 1)
					random = new SnowPile();

				if(randomitem == 2)
					random = new EternalEmbers();

				if(randomitem == 3)
				{
					if(Utility.RandomBool() )
						random = new RedPoinsettia();
					else
						random = new WhitePoinsettia();

                    random.Name = "poinsettia";
				}

				Item roast = new RoastPig();
                roast.Name = "roast pig";

				Item candle = new CandleLong();
                candle.Name = "candle";
				candle.Hue = Utility.RandomList(0, 3343, 72, 7, 1274, 53);

				Item cookie = new Cookies();
                cookie.Name = "Christmas cookies";

				GiftBox Giftbox = new GiftBox();

                string year = DateTime.Now.Year.ToString();
                string Signature = "Christmas " + year;

                Giftbox.Name = Signature;

                roast.Name += " - " + Signature;
				Giftbox.DropItem(roast);
                candle.Name += " - " + Signature;
				Giftbox.DropItem(candle);
                random.Name += " - " + Signature;
				Giftbox.DropItem(random);
                cookie.Name += " - " + Signature;
				Giftbox.DropItem(cookie);

				//drop it all to bank
				// Adam: This method fails if the bank is full!
				// box.TryDropItem( from, Giftbox, false );
				// this one won't 
				box.AddItem( Giftbox );

				//delete deed.
				dropped.Delete();
				return true;
			}
			else //if not a holiday deed dont accept anything
				return false;
		}