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


C# Mobile.LocalOverheadMessage方法代码示例

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


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

示例1: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( GetWorldLocation(), 2 ) || !from.InLOS( this ) )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that
			}
			else if ( Visible && ( ItemID == 4656 || ItemID == 4702 ) && DateTime.Now >= m_NextUse )
			{
				Point3D p = GetWorldLocation();

				if ( 1 > Utility.Random( Math.Max( Math.Abs( from.X - p.X ), Math.Abs( from.Y - p.Y ) ) ) )
				{
					Effects.PlaySound( from.Location, from.Map, from.GetHurtSound() );
					from.PublicOverheadMessage( MessageType.Regular, from.SpeechHue, true, "Ouch!" );
					SpellHelper.Damage( TimeSpan.FromSeconds( 0.5 ), from, Utility.Dice( 2, 10, 5 ) );
				}

				Effects.PlaySound( GetWorldLocation(), Map, 0x387 );

				Timer.DelayCall( TimeSpan.FromSeconds( 0.25 ), new TimerCallback( Down1 ) );
				Timer.DelayCall( TimeSpan.FromSeconds( 0.50 ), new TimerCallback( Down2 ) );

				Timer.DelayCall( TimeSpan.FromSeconds( 5.00 ), new TimerCallback( BackUp ) );

				m_NextUse = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
			}
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:27,代码来源:Guillotine.cs

示例2: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if (! from.InRange( this.GetWorldLocation(), 1 ))
			{
				from.LocalOverheadMessage( MessageType.Regular, 906, 1019045 ); // I can't reach that.
			}	
		}
开发者ID:nick12344356,项目名称:The-Basement,代码行数:7,代码来源:RewardCake.cs

示例3: OnDoubleClick

		public override void OnDoubleClick( Mobile m )
		{
			if ( !m.InRange( this, 2 ) )
			{
				m.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
				return;
			}

			if ( RaisableItem != null && RaisableItem.Deleted )
				RaisableItem = null;

			Flip();

			if ( RaisableItem != null )
			{
				if ( RaisableItem.IsRaisable )
				{
					RaisableItem.Raise();
					m.LocalOverheadMessage( MessageType.Regular, 0x5A, true, "You hear a grinding noise echoing in the distance." );
				}
				else
				{
					m.LocalOverheadMessage( MessageType.Regular, 0x5A, true, "You flip the switch again, but nothing happens." );
				}
			}
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:26,代码来源:RaiseSwitch.cs

示例4: OnDragDrop

		public override bool OnDragDrop( Mobile from, Item item )
		{

			if ( item.LootType == LootType.Newbied || item.LootType == LootType.Blessed )
			{
                from.LocalOverheadMessage(MessageType.Regular, 906, true, "You cannot trash blessed or newbied items");
                return false;
			}
            if (!base.OnDragDrop(from, item))
                return false;

            
            if (TotalItems >= 50)
            {
                Empty(501478); // The trash is full!  Emptying!
            }
            
            else
            {
                /*
                from.LocalOverheadMessage(MessageType.Regular, 906, true, string.Format("The item will be deleted in 20 seconds"));
                
                if (m_Timer != null)
                    m_Timer.Stop();
                else
                    m_Timer = new EmptyTimer(this);

                m_Timer.Start();
                */
                from.LocalOverheadMessage(MessageType.Regular, 906, true, "You trash the item");
                item.Delete();

			}
            return true;
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:35,代码来源:MiniTrashCan.cs

示例5: Drink

		public override void Drink( Mobile from )
		{
			if ( from.Hits < from.HitsMax )
			{
				if ( from.Poisoned || MortalStrike.IsWounded( from ) )
				{
					from.LocalOverheadMessage( MessageType.Regular, 0x22, 1005000 ); // You can not heal yourself in your current state.
				}
				else
				{
					if ( from.BeginAction( typeof( BaseHealPotion ) ) )
					{
						DoHeal( from );

						BasePotion.PlayDrinkEffect( from );

						if ( !Engines.ConPVP.DuelContext.IsFreeConsume( from ) )
							this.Consume();

						Timer.DelayCall( TimeSpan.FromSeconds( Delay ), new TimerStateCallback( ReleaseHealLock ), from );
					}
					else
					{
						from.LocalOverheadMessage( MessageType.Regular, 0x22, 500235 ); // You must wait 10 seconds before using another healing potion.
					}
				}
			}
			else
			{
				from.SendLocalizedMessage( 1049547 ); // You decide against drinking this potion, as you are already at full health.
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:32,代码来源:BaseHealPotion.cs

示例6: OnTarget

			protected override void OnTarget( Mobile from, object o )
			{
                IEntity entity = o as IEntity; if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, m_Owner))
                {
                    return;
                }
                IPoint3D loc = o as IPoint3D;

				if ( loc == null )
					return;

				if ( m_Owner.CheckSequence() )
				{
					SpellHelper.Turn( from, o );

					if ( o is Mobile )
						from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 ); // That did not need to be unlocked.
					else if ( !( o is LockableContainer ) )
						from.SendLocalizedMessage( 501666 ); // You can't unlock that!
					else
					{
						LockableContainer cont = (LockableContainer)o;

						if ( Multis.BaseHouse.CheckSecured( cont ) )
							from.SendLocalizedMessage( 503098 ); // You cannot cast this on a secure item.
						else if ( !cont.Locked )
							from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 ); // That did not need to be unlocked.
						else if ( cont.LockLevel == 0 )
							from.SendLocalizedMessage( 501666 ); // You can't unlock that!
						else
						{
							Effects.SendLocationParticles( EffectItem.Create( new Point3D( loc ), from.Map, EffectItem.DefaultDuration ), 0x376A, 9, 32, 5024 );
							Effects.PlaySound( loc, from.Map, 0x1FF );

							int level = (int)(from.Skills[SkillName.Magery].Value * 0.55) - 4; // Note from Alan: I see why somebody changed this from below, so you can't magic unlock a GM tinker chest
                                                                                                // but it is also preventing you from picking that lock which is pretty silly
                            //int level = (int)(from.Skills[SkillName.Magery].Value * 0.8) - 4; // <-- this is RunUO default

                            if (cont.LockLevel == -255) // it is magic locked so always succeed at unlocking
                            {
                                cont.Locked = false;
                                cont.LockLevel = cont.RequiredSkill - 10;
                            }
                            else if ( level >= cont.RequiredSkill && !(cont is TreasureMapChest && ((TreasureMapChest)cont).Level > 2) ) // this is basically a magery skill vs lock level check
							{
								cont.Locked = false;
							}
							else
								from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503099 ); // My spell does not seem to have an effect on that lock.
						}
					}

					m_Owner.FinishSequence();
				}
			}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:55,代码来源:Unlock.cs

示例7: OnDoubleClick

 }//  hitching rope
 public override void OnDoubleClick(Mobile from)
 {
     if (from.InRange(this.GetWorldLocation(), 2))
     {
         from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1071159); // Select the hitching post you want to supply hitching rope.
         from.Target = new InternalTarget(this);
     }
     else
     {
         from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
     }
 }
开发者ID:Crome696,项目名称:ServUO,代码行数:13,代码来源:HitchingRope.cs

示例8: OnTarget

			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( m_Thorn.Deleted )
					return;

				if ( !m_Thorn.IsChildOf( from.Backpack ) )
				{
					from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
					return;
				}

				if ( !from.CanBeginAction( typeof( GreenThorns ) ) )
				{
					from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061908 ); // * You must wait a while before planting another thorn. *
					return;
				}

				if ( from.Map != Map.Trammel && from.Map != Map.Felucca )
				{
					from.LocalOverheadMessage( MessageType.Regular, 0x2B2, true, "No solen lairs exist on this facet.  Try again in Trammel or Felucca." );
					return;
				}

				LandTarget land = targeted as LandTarget;

				if ( land == null )
				{
					from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061912 ); // * You cannot plant a green thorn there! *
				}
				else
				{
					GreenThornsEffect effect = GreenThornsEffect.Create( from, land );

					if ( effect == null )
					{
						from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061913 ); // * You sense it would be useless to plant a green thorn there. *
					}
					else
					{
						m_Thorn.Consume();

						from.LocalOverheadMessage( MessageType.Emote, 0x961, 1061914 ); // * You push the strange green thorn into the ground *
						from.NonlocalOverheadMessage( MessageType.Emote, 0x961, 1061915, from.Name ); // * ~1_PLAYER_NAME~ pushes a strange green thorn into the ground. *

						from.BeginAction( typeof( GreenThorns ) );
						new GreenThorns.EndActionTimer( from ).Start();

						effect.Start();
					}
				}
			}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:51,代码来源:GreenThorns.cs

示例9: OnTarget

			protected override void OnTarget( Mobile from, object o )
			{
				IPoint3D loc = o as IPoint3D;

				if( loc == null )
					return;

				if( m_Owner.CheckSequence() )
				{
					SpellHelper.Turn( from, o );

					Effects.SendLocationParticles( EffectItem.Create( new Point3D( loc ), from.Map, EffectItem.DefaultDuration ), 0x376A, 9, 32, 5024 );

					Effects.PlaySound( loc, from.Map, 0x1FF );

					if( o is Mobile )
						from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 ); // That did not need to be unlocked.
					else if( !(o is LockableContainer) )
						from.SendLocalizedMessage( 501666 ); // You can't unlock that!
					else
					{
						LockableContainer cont = (LockableContainer)o;

						if( Multis.BaseHouse.CheckSecured( cont ) )
							from.SendLocalizedMessage( 503098 ); // You cannot cast this on a secure item.
						else if( !cont.Locked )
							from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503101 ); // That did not need to be unlocked.
						else if( cont.LockLevel == 0 )
							from.SendLocalizedMessage( 501666 ); // You can't unlock that!
						else
						{
							int level = (int)(from.Skills[SkillName.Magery].Value * 0.8) - 4;
							level += (int)(from.Skills[SkillName.EvalInt].Value * 0.2);

							if( level >= cont.RequiredSkill && !(cont is TreasureMapChest && ((TreasureMapChest)cont).Level > 2) )
							{
								cont.Locked = false;

								if( cont.LockLevel == -255 )
									cont.LockLevel = cont.RequiredSkill - 10;
							}
							else
							{
								from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 503099 ); // My spell does not seem to have an effect on that lock.
							}
						}
					}
				}

				m_Owner.FinishSequence();
			}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:51,代码来源:Unlock.cs

示例10: Throw

		public void Throw( Mobile from )
		{
			BaseKnife knife = from.Weapon as BaseKnife;

			if ( knife == null )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500751 ); // Try holding a knife...
				return;
			}

			from.Animate( from.Mounted ? 26 : 9, 7, 1, true, false, 0 );
			from.MovingEffect( this, knife.ItemID, 7, 1, false, false );
			from.PlaySound( 0x238 );

			double rand = Utility.RandomDouble();

			int message;
			if ( rand < 0.05 )
				message = 500752; // BULLSEYE! 50 Points!
			else if ( rand < 0.20 )
				message = 500753; // Just missed the center! 20 points.
			else if ( rand < 0.45 )
				message = 500754; // 10 point shot.
			else if ( rand < 0.70 )
				message = 500755; // 5 pointer.
			else if ( rand < 0.85 )
				message = 500756; // 1 point.  Bad throw.
			else
				message = 500757; // Missed.

			PublicOverheadMessage( MessageType.Regular, 0x3B2, message );
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:32,代码来源:DartBoard.cs

示例11: OnMoveOver

		public override bool OnMoveOver( Mobile m )
		{
			if( m.SolidHueOverride != -1 )
				return true;
			else if( m.Player && !m.Alive ) // mobile is dead
			{
				m.SolidHueOverride = -1;

				if( m_TargetMap != null && m_TargetMap != Map.Internal )
				{
					m.MoveToWorld( m_Target, m_TargetMap );
					BaseCreature.TeleportPets( m, m_Target, m_TargetMap );
				}
				else
					m.SendAsciiMessage( "This has not yet been activated" );

				m.Combatant = null;
				m.Warmode = false;
				m.Resurrect();
				return false;
			}
			else if( ( m.Player ) && ( m.Hits < m.HitsMax ) )
				m.LocalOverheadMessage( MessageType.Regular, 906, true, "For liablity issues, we require all visitors to be in perfect health!" );
			else if( m.Player && m.SolidHueOverride != 2544 )
			{
                m_CasinoTimer = new CasinoTimer(this, m);
                m_CasinoTimer.Start();				
				m.SolidHueOverride = 2544;
				m.SendAsciiMessage( "You are about to enter the Casino!" );
			}

			return true;
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:33,代码来源:CasinoEntrance.cs

示例12: OnTarget

            protected override void OnTarget(Mobile from, object o)
            {
                if (o is Container)
                {
                    Container xx = o as Container;

                    //make sure they aren't targeting same container
                    if (xx == FromCont)
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x22, true, "The container to dump INTO must be different from the one you are dumping FROM.");
                        return;
                    }
                    if (xx == FromCont || xx.IsChildOf(FromCont))
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x22, true, "You cannot sort INTO a subcontainer of the same container you are sorting FROM.");
                        return;
                    }
                    Item[] items = FromCont.FindItemsByType(typeof(Item), true);
                    foreach (Item item in items)
                    {
                        if (!(xx.TryDropItem(from, item, true)))
                            from.SendMessage("That container is too full!");
                    }
                }
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x22, true, "That is not a container!");
                }
            }
开发者ID:greeduomacro,项目名称:last-wish,代码行数:29,代码来源:Dump.cs

示例13: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1040019 ); // The bola must be in your pack to use it.
			}
			else if ( !from.CanBeginAction( typeof( Bola ) ) )
			{
				from.SendLocalizedMessage( 1049624 ); // You have to wait a few moments before you can use another bola!
			}
			else if ( from.Target is BolaTarget )
			{
				from.SendLocalizedMessage( 1049631 ); // This bola is already being used.
			}
			else if ( !HasFreeHands( from ) )
			{
				from.SendLocalizedMessage( 1040015 ); // Your hands must be free to use this
			}
			else if ( from.Mounted )
			{
				from.SendLocalizedMessage( 1040016 ); // You cannot use this while riding a mount
			}
			else if ( Server.Spells.Ninjitsu.AnimalForm.UnderTransformation( from ) )
			{
				from.SendLocalizedMessage( 1070902 ); // You can't use this while in an animal form!
			}
			else
			{
				EtherealMount.StopMounting( from );

				from.Target = new BolaTarget( this );
				from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...*
				from.NonlocalOverheadMessage( MessageType.Emote, 0x3B2, 1049633, from.Name ); // ~1_NAME~ begins to menacingly swing a bola...
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:35,代码来源:Bola.cs

示例14: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			Direction dir;
			if ( from.Location != this.Location )
				dir = from.GetDirectionTo( this );
			else if ( this.East )
				dir = Direction.West;
			else
				dir = Direction.North;

			from.Direction = dir;

			bool canThrow = true;

			if ( !from.InRange( this, 4 ) || !from.InLOS( this ) )
				canThrow = false;
			else if ( this.East )
				canThrow = ( dir == Direction.Left || dir == Direction.West || dir == Direction.Up );
			else
				canThrow = ( dir == Direction.Up || dir == Direction.North || dir == Direction.Right );

			if ( canThrow )
				Throw( from );
			else
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:26,代码来源:DartBoard.cs

示例15: CheckUse

		private bool CheckUse( Mobile from )
		{
			if ( !IsAccessibleTo( from ) )
				return false;

			if ( from.Map != Map || !from.InRange( GetWorldLocation(), 2 ) || !from.InLOS(this) )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
				return false;
			}

			if ( !from.CanBeginAction( typeof( FireHorn ) ) )
			{
				from.SendLocalizedMessage( 1049615 ); // You must take a moment to catch your breath.
				return false;
			}

			int sulfAsh = Core.AOS ? 4 : 15;
			if ( from.Backpack == null || from.Backpack.GetAmount( typeof( SulfurousAsh ) ) < sulfAsh )
			{
				from.SendLocalizedMessage( 1049617 ); // You do not have enough sulfurous ash.
				return false;
			}

			return true;
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:26,代码来源:FireHorn.cs


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