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


C# Mobile.SendMessage方法代码示例

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


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

示例1: OnTarget

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

            if ( t.IsParagon == true )
            { 
               from.SendMessage( "That pet is already a paragon!" );
            } 
            else if ( t.ControlMaster != from ) 
            { 
               from.SendMessage( "That is not your pet!" ); 
            } 
            else  
             
               { 

			t.IsParagon = !t.IsParagon;
			from.SendMessage( "Your pet is now a paragon!" );

                  m_Deed.Delete(); // Delete the deed 
               } 
            
         } 
         else 
         { 
            from.SendMessage( "That is not a valid traget." );  
         } 
      } 
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:30,代码来源:ParagonPetDeed.cs

示例2: OnDoubleClick

		public override void OnDoubleClick(Mobile from) 
		{ 
			if ( from == null || !from.Alive ) return;

			// lumbervalue = 100; will give 100% sucsess in picking
			lumberValue = from.Skills[SkillName.Lumberjacking].Value / 5;

			if ( DateTime.Now > lastpicked.AddSeconds(3) ) // 3 seconds between picking
			{
				lastpicked = DateTime.Now;
				if ( from.InRange( this.GetWorldLocation(), 2 ) ) 
				{ 
					if ( lumberValue > Utility.Random( 100 ) )
					{
						from.Direction = from.GetDirectionTo( this );
						from.Animate( 32, 5, 1, true, false, 0 ); // Bow

						from.SendMessage(AgriTxt.PullRoot); 
						this.Delete(); 

						from.AddToBackpack( new NightshadeUprooted() );
					}
					else from.SendMessage(AgriTxt.HardPull); 
				} 
				else 
				{ 
					from.SendMessage(AgriTxt.HardPull); 
				} 
			}
		} 
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:30,代码来源:NightShade.00.ScZ.cs

示例3: OnDoubleClick

        public override void OnDoubleClick( Mobile from )
        {
            if ( !( IsChildOf( from.Backpack ) ) ) from.SendMessage( "That has to be in your pack to be able to use it" );
            else if ( from.Mounted ) from.SendMessage( "You can not use this while riding" );
            else if ( bodyadjust != from.BodyMod && from.BodyMod != 0 ) from.SendMessage( "You can not use this while all ready morphed" );
            else
            {
                if ( bodyadjust == 0 && (from.BodyValue == 0x190 || from.BodyValue == 0x191 || from.BodyValue == 605 || from.BodyValue == 606 ))
                {
                    from.BodyMod = 157;
                    bodyadjust = from.BodyMod;
                    from.PlaySound( 1105 );
                  	Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0x376A, 1, 29, 0x47D, 2, 9962, 0 );
                  	Effects.SendLocationParticles( EffectItem.Create( new Point3D( from.X, from.Y, from.Z - 7 ), from.Map, EffectItem.DefaultDuration ), 0x37C4, 1, 29, 0x47D, 2, 9502, 0 );

                }
                else if(bodyadjust == from.BodyMod)
                {
                    from.BodyMod = 0;
                    bodyadjust = from.BodyMod;
                    from.PlaySound( 1105 );
                    Effects.SendLocationParticles( EffectItem.Create( from.Location, from.Map, EffectItem.DefaultDuration ), 0x376A, 1, 29, 0x47D, 2, 9962, 0 );
                    Effects.SendLocationParticles( EffectItem.Create( new Point3D( from.X, from.Y, from.Z - 7 ), from.Map, EffectItem.DefaultDuration ), 0x37C4, 1, 29, 0x47D, 2, 9502, 0 );

                    this.Delete();
                }
                else bodyadjust = 0;
            }
        }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:29,代码来源:Giant+Black+Widow+Costume+Gem.cs

示例4: OnTarget

		protected override void OnTarget( Mobile from, object target ) // Override the protected OnTarget() for our feature
		{
            if (_mDeed.Deleted || _mDeed.RootParent != from)
                return;
		    BaseBoat boat;
		    var boatcomponent = target as BoatComponent;
		    if (boatcomponent != null)
		        boat = boatcomponent.Boat;
		    else
		        boat = target as BaseBoat;

		    if (boat == null)
		    {
		        from.SendMessage(54, "This deed only works on boats!  Please target either the boats wheel or the tillerman to dye the boat.");
		        return;
		    }

		    if (boat.Owner != from)
		    {
                from.SendMessage(54, "Only the owner of this boat may dye it.");		        
		    }
		    else
		    {
		        foreach (var component in boat.BoatComponents)
		        {
		            component.Hue = _mDeed.DyeableHue;
		        }
		        boat.Hue = _mDeed.DyeableHue;
                from.SendMessage(54, "You have successfully dyed your boat.");	
		        _mDeed.Consume();
		    }
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:32,代码来源:BoatDyeDeed.cs

示例5: 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:greeduomacro,项目名称:last-wish,代码行数:26,代码来源:StakesContainer.cs

示例6: OnDoubleClick

		public override void OnDoubleClick( Mobile from ) // Override double click of the deed to call our target
		{
			if ( !IsChildOf( from.Backpack ) ) // Make sure its in their pack
			{
				 from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
			else if ( (from.Followers + 3) < from.FollowersMax + 1 )
			{
				this.Delete();

				from.SendMessage( "You use the contract." );

				EvoMerc merc = new EvoMerc();

         			merc.Map = from.Map; 
         			merc.Location = from.Location; 

				merc.Controlled = true;

				merc.ControlMaster = from;

				merc.IsBonded = true;

			}
			else
			{
				from.SendMessage( "You have too many followers to hire your Mercenary." );			
			}
		}	
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:29,代码来源:EvoMercDeed.cs

示例7: OnDoubleClick

		public override void OnDoubleClick(Mobile from) 
		{ 
			if ( from == null || !from.Alive ) return;

			// lumbervalue = 100; will give 100% sucsess in picking
			mageValue = from.Skills[SkillName.Magery].Value + 20;

			if ( DateTime.Now > lastpicked.AddSeconds(1) ) // 3 seconds between picking changed to 1 sec
			{
				lastpicked = DateTime.Now;
				if ( from.InRange( this.GetWorldLocation(), 1 ) ) 
				{ 
					if ( mageValue > Utility.Random( 100 ) )
					{
						from.Direction = from.GetDirectionTo( this );
						from.Animate( 32, 5, 1, true, false, 0 ); // Bow

						from.SendMessage("You pull the plant up by the root."); 
						this.Delete(); 

						from.AddToBackpack( new MandrakeUprooted() );
					}
					else from.SendMessage("The plant is hard to pull up."); 
				} 
				else 
				{ 
					from.SendMessage( "You are too far away to harvest anything." ); 
				} 
			}
		} 
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:30,代码来源:Mandrake.cs

示例8: OnTarget

		protected override void OnTarget( Mobile from, object target ) // Override the protected OnTarget() for our feature
		{
			// Check targetted thing is a container

			if(target is BaseGraveStone) {

				// Is a container, so cast

				BaseGraveStone bc = (BaseGraveStone) target;

				// Check player crafted

				if(!bc.IsChildOf(from.Backpack)) {
					from.SendMessage("The gravestone you wish to engrave must be in your backpack.");
					return;
				}

				from.SendMessage("Please enter the words you wish to engrave :");
				from.Prompt = new RenamePrompt(from, bc, m_Graver);
			}
			else {
				// Not a container

				from.SendMessage("This tool can only be used on a gravestone.");
			}

		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:27,代码来源:StoneGraver.cs

示例9: 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:greeduomacro,项目名称:last-wish,代码行数:27,代码来源:Winter2004.cs

示例10: OnDoubleClick

public override void OnDoubleClick( Mobile from )
{

if( m_Placer == null || m_Placer.Deleted )
m_Placer = from;

if( from.InRange( this.GetWorldLocation(), 10 ) )
{
if( m_Placer == null || from == m_Placer || from.AccessLevel >= AccessLevel.GameMaster )
{
Container c = m_Placer.Backpack;
Gold t = new Gold( m_Value );
if( c.TryDropItem( m_Placer, t, true ) )
{
this.Delete();
m_Placer.SendMessage( "The item disolves and gives you a refund" );
}
else
{
t.Delete();
m_Placer.SendMessage("For some reason, the refund didn't work! Please page a GM");
}
}
else
{
from.SendMessage( "Stay out of my yard!" );
}
}
else
{
from.SendMessage( "The item is too far away" );
}
}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:33,代码来源:YardItem.cs

示例11: OnCantSeeTarget

		protected override void OnCantSeeTarget(Mobile from, object targeted)
		{
			from.SendMessage("You cannot see that.");
			from.SendMessage("Select a new target.");
			from.Target = new DuelTarget(m_Mobile, m_Duel);
			return;
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:7,代码来源:DuelTarget.cs

示例12: CheckDrop

        private bool CheckDrop(Mobile from, Item dropped)
        {
            bool valid = false;
            for (int i = 0; i < m_AllowedReagents.Length; i++)
            {
                if (dropped.GetType() == m_AllowedReagents[i])
                {
                    valid = true;
                    break;
                }
            }
            if (valid)
            {
                int curAmount = 0;
                List<Item> items = this.Items;

                foreach (Item item in items)
                {
                    if (item.GetType() == dropped.GetType())
                        curAmount += item.Amount;
                }

                if ((curAmount + dropped.Amount) > m_MaxReagents)
                {
                    from.SendMessage("That pouch cannot hold anymore of that type of reagent!");
                    return false;
                }
                else return true;
            }
            else
            {
                from.SendMessage("You can only place reagents in this pouch.");
                return false;
            }
        }
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:35,代码来源:ReagentPouches.cs

示例13: soif

		static public bool soif( Mobile from, int fillFactor )
		{
			if ( from.Thirst >= 20 )
			{
				from.SendMessage( "ah pu soif!" );
				return false;
			}
			
			int iThirst = from.Thirst + fillFactor;
			if ( iThirst >= 20 )
			{
				from.Thirst = 20;
				from.SendMessage( "c'est trop bon , mais la vous pouvez plus!" );
			}
			else
			{
				from.Thirst = iThirst;
				
				if ( iThirst < 5 )
					from.SendMessage( "Vous buvez cela , mais avez encore très très soif." );
				else if ( iThirst < 10 )
					from.SendMessage( "Vous buvez et vous sentez un peu mieux." );
				else if ( iThirst < 15 )
					from.SendMessage( "Apres avoir vu , vous vous senter bcp mieux." );
				else
					from.SendMessage( "Apres cette boisson , vous etes comblé." );
			}
			
			return true;
		}
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:30,代码来源:MilkItems.cs

示例14: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            var backpack = from.Backpack;

            var item1 = (BronzeIngot) backpack.FindItemByType(typeof (BronzeIngot));

            if (item1 != null)
            {
                BaseIngot m_Ore1 = item1;

                var toConsume = m_Ore1.Amount;

                if ((m_Ore1.Amount > 499) && (m_Ore1.Amount < 501))
                {
                    m_Ore1.Delete();
                    from.SendMessage("You've successfully converted the Metal.");
                    from.AddToBackpack(new ValoriteIngot(500));
                    Delete();
                }
                else if ((m_Ore1.Amount < 500) || (m_Ore1.Amount > 500))
                {
                    from.SendMessage("You can only convert 500 Bronze Ingots at a time.");
                }
            }
            else
            {
                from.SendMessage("There isn't Bronze Ingots in your Backpack.");
            }
        }
开发者ID:rokann,项目名称:JustUO,代码行数:29,代码来源:ElixirofValoriteConversion.cs

示例15: StaffAbuse_OnTarget

        public static void StaffAbuse_OnTarget(Mobile from, object obj)
        {
            if (from == null || from.Deleted || !(obj is Mobile))
                return;

            Mobile abuser = (Mobile)obj as Mobile;
            if (abuser != null)
            {
                if (abuser.AccessLevel == AccessLevel.Player)
                {
                    from.SendMessage("The targeted person has accesslevel player. Request canceled.");
                    return;
                }
                else if (abuser.AccessLevel == AccessLevel.Administrator)
                {
                    from.SendMessage("This command does not work on administrators. Request canceled.");
                    return;
                }

                if (abuser.Backpack != null)
                {
                    while (abuser.Backpack.ConsumeTotal(typeof(StaffOrb), 1, true)) { }
                }
                abuser.AccessLevel = AccessLevel.Player;
                abuser.Frozen = true;
                abuser.MoveToWorld(new Point3D(5275, 1172, 0), Map.Felucca); // move abuser to felucca jail
                Server.Scripts.Commands.CommandHandlers.BroadcastMessage(AccessLevel.Seer, 38, String.Format("Staffmessage: {0} was blamed by {1} for staffpower abusing.", abuser.Name, from.Name));
            }
        }
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:29,代码来源:StaffAbuse.cs


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