当前位置: 首页>>代码示例>>C#>>正文


C# Mobile.SendMessage方法代码示例

本文整理汇总了C#中Server.Mobile.SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.SendMessage方法的具体用法?C# Mobile.SendMessage怎么用?C# Mobile.SendMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Mobile的用法示例。


在下文中一共展示了Mobile.SendMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GiveGift

		public override void GiveGift( Mobile mob )
		{
			GiftBox box = new GiftBox();

			box.DropItem( new MistletoeDeed() );
			box.DropItem( new PileOfGlacialSnow() );
			box.DropItem( new LightOfTheWinterSolstice() );

			int random = Utility.Random( 100 );

			if ( random < 60 )
				box.DropItem( new DecorativeTopiary() );
			else if ( random < 84 )
				box.DropItem( new FestiveCactus() );
			else
				box.DropItem( new SnowyTree() );

			switch ( GiveGift( mob, box ) )
			{
				case GiftResult.Backpack:
					mob.SendMessage( 0x482, "Happy Holidays from the team!  Gift items have been placed in your backpack." );
					break;
				case GiftResult.BankBox:
					mob.SendMessage( 0x482, "Happy Holidays from the team!  Gift items have been placed in your bank box." );
					break;
			}
		}
开发者ID:Godkong,项目名称:Origins,代码行数:27,代码来源:Winter2004.cs

示例2: OnDoubleClick

		public override void OnDoubleClick( Mobile m )

		{
			Item a = m.Backpack.FindItemByType( typeof(EnchantedRope) );
			if ( a != null )
			{	
			Item b = m.Backpack.FindItemByType( typeof(GlowingShipModel) );
			if ( b != null )
			{
			Item c = m.Backpack.FindItemByType( typeof(SacredAnchor) );
			if ( c != null )
			{
			Item d = m.Backpack.FindItemByType( typeof(SpecialSeaMap) );
			if ( d != null )
			{						
				m.AddToBackpack( new MasterOfTheSeaChest() );
				a.Delete();
				b.Delete();
				c.Delete();
				d.Delete();				
				m.SendMessage( "You place the artifacts into the Sea Chest for a Full Master of the Sea Chest!" );
				this.Delete();
			}
			}
			}
			}			
				else
			{
				m.SendMessage( "You are missing some artifacts." );
			}
		}		
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:31,代码来源:SeaChest.cs

示例3: GiveGift

		public override void GiveGift( Mobile mob )
		{
			HalloweenBag2007 bag = new HalloweenBag2007();

			bag.DropItem( new HalloweenLantern2007() );

			switch ( Utility.Random( 4 ) )
			{      	
				case 0: bag.DropItem(new HalloweenCloak2007()); break;
				case 1: bag.DropItem(new HalloweenTunic2007()); break;
				case 2: bag.DropItem(new HalloweenDoublet2007()); break;
				case 3: bag.DropItem(new HalloweenBoots2007()); break;
			}

			if ( 0.1 > Utility.RandomDouble() )
			{
				bag.DropItem( new HalloweenOuiJaBoard2007() );
			}

			switch ( GiveGift( mob, bag ) )
			{
				case GiftResult.Backpack:
					mob.SendMessage( 0x482, "Happy Halloween from Tannis and Victoria!  Gift items have been placed in your backpack." );
					break;
				case GiftResult.BankBox:
					mob.SendMessage( 0x482, "Happy Halloween ffrom Tannis and Victoria!  Gift items have been placed in your bank box." );
					break;
			}
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:29,代码来源:Halloween2007.cs

示例4: OnDoubleClick

		public override void OnDoubleClick( Mobile m )

		{
			Item d = m.Backpack.FindItemByType( typeof(SigilofMinax) );
			if ( d != null )
			{	
				Item c = m.Backpack.FindItemByType( typeof(SigilofLloth) );
				if ( c != null )
				{
					Item n = m.Backpack.FindItemByType( typeof(SigilofGoat) );
					if ( n != null )
					{
						Item p = m.Backpack.FindItemByType( typeof(SigilofTreefolk) );
						if ( p != null )
						{
							m.AddToBackpack( new BraceletofMinax() );
							d.Delete();
							c.Delete();
							n.Delete();
							p.Delete();
							m.SendMessage( "The four Sigils of the Minaxian Minions and Minax herself have been United!" );
						}
					}
					else
					{
						m.SendMessage( "You Are Missing Something..." );
					}
				}
			}
			
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:31,代码来源:Minax+Crystal.cs

示例5: OnDamage

		public override void OnDamage( int amount, Mobile from, bool willKill )
		{
			if ( from != null && from.Map != null )
			{
				int amt = 0;

				Mobile target = this;

				if ( willKill )
					amt = 3 + ((Utility.Random( 6 ) % 5) >> 2); // 20% = 1, 20% = 2, 60% = 0

				if ( Hits < 550 )
				{
					double rand = Utility.RandomDouble();

					if ( 0.10 > rand )
						target = from;

					if ( 0.20 > rand )
						amt++;
				}

				if ( amt > 0 )
				{
					SpillAcid( target, amt );

					if ( willKill )
						from.SendMessage( "Your body explodes into a pile of venom!" );
					else
						from.SendMessage( "The creature spits venom at you!" );
				}
			}

			base.OnDamage( amount, from, willKill );
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:35,代码来源:Kyrk.cs

示例6: OnDoubleClick

		public override void OnDoubleClick( Mobile m )

		{
			Item a = m.Backpack.FindItemByType( typeof(ArrianasDiamond) );
			if ( a != null )
			{	
			Item b = m.Backpack.FindItemByType( typeof(ArrianasClips) );
			if ( b != null )
			{
			Item c = m.Backpack.FindItemByType( typeof(ArrianasHoops) );
			if ( c != null )
			{
			
				m.AddToBackpack( new DiamondHoopEarrings() );
				a.Delete();
				b.Delete();
				c.Delete();
				m.SendMessage( "You Combine the knowledge of Arriana's ancestry into a Heirloom" );
				this.Delete();
			}
			}
				else
			{
				m.SendMessage( "You are missing something..." );
		}
		}
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:27,代码来源:AncientJewelryBox.cs

示例7: DecayAccounts_Callback

        public static void DecayAccounts_Callback( Mobile from, bool okay, object state )
        {
            if ( okay )
            {
                List<Account> list = (List<Account>)state;

                CommandLogging.WriteLine( from, "{0} {1} deleting {2} old account{3}", from.AccessLevel, CommandLogging.Format( from ), list.Count, list.Count == 1 ? "" : "s" );

                NetState.Pause();

                for ( int i = 0; i < list.Count; ++i )
                {
                    Account a = (Account)list[i];

                    if ( a != null )
                        a.Delete();
                }

                NetState.Resume();

                from.SendMessage( "You have deleted {0} old accounts{1}.", list.Count, list.Count == 1 ? "" : "s" );
            }
            else
            {
                from.SendMessage( "You have chosen not to delete old accounts." );
            }
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:27,代码来源:Cleanup.cs

示例8: OnTarget

         		protected override void OnTarget( Mobile from, object target ) 
         		{ 

            			if ( target == from ) 
               				from.SendMessage( "This can only be used on pets." );

				else if ( target is PlayerMobile )
					from.SendMessage( "You cannot dye them." );

				else if ( target is Item )
					from.SendMessage( "You cannot dye that." );

          			else if ( target is BaseCreature ) 
          			{ 
          				BaseCreature c = (BaseCreature)target;	
					if ( c.BodyValue == 400 || c.BodyValue == 401 && c.Controlled == false )
					{
						from.SendMessage( "You cannot dye them." );
					}
					else if ( c.ControlMaster != from && c.Controlled == false )
					{
						from.SendMessage( "This is not your pet." );
					}
					else if ( c.Controlled == true && c.ControlMaster == from)
					{
						c.Hue = 2118;
						from.SendMessage( 53, "Your pet has now been dyed." );
						from.PlaySound( 0x23E );
						m_Powder.Delete();
					}
  
            			}
         		} 
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:33,代码来源:RedPetDye.cs

示例9: TryDropItem

		public override bool TryDropItem( Mobile from, Item dropped, bool sendFullMessage )
		{
			if ( m_Participant == null || !m_Participant.Contains( from ) )
			{
				if ( sendFullMessage )
					from.SendMessage( "You are not allowed to place items here." );

				return false;
			}

			if ( dropped is Container || dropped.Stackable )
			{
				if ( sendFullMessage )
					from.SendMessage( "That item cannot be used as stakes." );

				return false;
			}

			if ( !base.TryDropItem( from, dropped, sendFullMessage ) )
				return false;

			if ( from != null )
				m_Owners[dropped] = from;

			return true;
		}
开发者ID:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:26,代码来源:StakesContainer.cs

示例10: OnTarget

		protected override void OnTarget( Mobile from, object target )
		{
			if ( target is BaseWeapon || target is BaseArmor || target is BaseClothing || target is BaseJewel )
			{
				Item item = (Item)target;

				XmlLevelItem a = (XmlLevelItem)XmlAttach.FindAttachment(item, typeof(XmlLevelItem));

				if ( a != null )
				{
					from.SendMessage( "That already is levelable!");
					return;
				}
				else
				{
					if( item.RootParent != from ) // Make sure its in their pack or they are wearing it
					{
						from.SendMessage( "You cannot make that levelable there!" );
					}
					else
					{
						XmlAttach.AttachTo(item, new XmlLevelItem());

						from.SendMessage( "You magically make the item levelable..." );

						m_Deed.Delete();
					}
				}
			}
			else
			{
				from.SendMessage( "You cannot make that levelable" );
			}
		}
开发者ID:rokann,项目名称:JustUO,代码行数:34,代码来源:LevelItemDeed.cs

示例11: OnDoubleClick

     		public override void OnDoubleClick( Mobile from ) 
		{ 
			
                        if ( Parent != from ) 
                        { 
                                from.SendMessage( "The costume must be equiped to be used." ); 
                        } 

			else if ( from.Mounted == true )
			{
				from.SendMessage( "You cannot be mounted while wearing your costume!" );
			}


			else if ( from.BodyMod == 0x0 )
                        { 
				

               			from.SendMessage( "You pull the mask over your head." );
				from.PlaySound( 0x440 );
				from.BodyMod = 75;
				from.DisplayGuildTitle = false; 
                        
			}
			else
			{
				from.SendMessage( "You lower the mask." );
				from.PlaySound( 0x440 );
				from.BodyMod = 0x0;
				from.DisplayGuildTitle = true;
				this.Transformed = false;
			}
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:33,代码来源:CyclopsCostume.cs

示例12: OnTarget

		protected override void OnTarget( Mobile from, object targeted )
		{
			if( targeted is Mobile )
			{
				Mobile m = ((Mobile)targeted);

				if( m == creature )
				{
					from.SendMessage( "It cannot attack itself!" );
					from.SendGump( new CreatureControl( creature, from ) );
				}

				else
				{

					if( creature.Alive )
					{
						m_AI.Action = ActionType.Combat;
						m_AI.NextMove = DateTime.Now;
						creature.Combatant = m;
						from.SendGump( new CreatureControl( creature, from ) );
					}
				}
			}

			else
			{
				from.SendMessage( "You cannot attack that!" );
				from.SendGump( new CreatureControl( creature, from ) );
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:31,代码来源:CreatureController.cs

示例13: OnTarget

		protected override void OnTarget( Mobile from, object target ) 
		{  
			if ( target is PlayerVendor )
			{
				PlayerVendor vendor = (PlayerVendor)target;
				if (vendor.IsOwner(from))
				{
					from.SendMessage("What dost thou wish to name thy servant?");
					from.Prompt = new RenamePrompt(from,vendor,m_Deed );                
				}

				else
				{
					vendor.SayTo(from, "I do not work for thee! Only my master may change my name.");
				}
			}
			else if (target is PlayerBarkeeper)
			{
				PlayerBarkeeper barkeep = (PlayerBarkeeper)target;
				if (barkeep.IsOwner(from))
				{
					from.SendMessage("What dost thou wish to name thy servant?");
					from.Prompt = new RenamePrompt(from,barkeep,m_Deed );                
				}

				else
				{
					barkeep.SayTo(from, "I do not work for thee! Only my master may change my name.");
				}
			}
			else
			{
				from.SendMessage("Thou canst only change the names of thy servants."); 
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:35,代码来源:NPCNameChangeDeed.cs

示例14: OnTarget

			protected override void OnTarget( Mobile from, object targeted )
			{
				if( from == null || targeted == null ) return;

				string name = String.Empty;
				string typename = targeted.GetType().Name;
				string article = "a";

				if( typename != null && typename.Length > 0 )
				{
					if( "aeiouy".IndexOf( typename.ToLower()[0] ) >= 0 )
					{
						article = "an";
					}
				}

				if( targeted is Item )
				{
					name = ((Item)targeted).Name;
				}
				else
					if( targeted is Mobile )
					{
						name = ((Mobile)targeted).Name;
					}
				if( name != String.Empty && name != null )
				{
					from.SendMessage( "That is {0} {1} named '{2}'", article, typename, name );
				}
				else
				{
					from.SendMessage( "That is {0} {1} with no name", article, typename );
				}
			}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:34,代码来源:WhatIsIt.cs

示例15: OnTarget

        protected override void OnTarget( Mobile from, object target )
        {
            if( target is HitchingPost )
            {
                HitchingPost post = (HitchingPost)target;

                if( !from.InRange(post.GetWorldLocation(), 1) )
                    from.SendLocalizedMessage(500295);

                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, from.EmoteHue, false, "*ties the rope to the hitching post ring*");
                    from.SendMessage("Target the pet you wish to hitch.");

                    from.Target = new PostToPetTarget();
                }
            }
            else if( target is BaseCreature )
                from.SendMessage("You must tie the rope to a hitching post before being able to hitch your pet.");

            else if( target is PlayerMobile )
                from.SendMessage("The person looks at you in disgust.");

            else if( target == from )
                from.SendMessage("That would be a stupid idea.");
        }
开发者ID:ITLongwell,项目名称:Ulmeta,代码行数:26,代码来源:HitchToPostTarget.cs


注:本文中的Server.Mobile.SendMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。