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


C# Mobile.SendLocalizedMessage方法代码示例

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


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

示例1: OnDragDrop

		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			if ( !this.IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1060640 ); // The item must be in your backpack to use it.
				return false;
			}

			Key key = dropped as Key;

			if ( key == null || key.KeyValue == 0 )
			{
				from.SendLocalizedMessage( 501689 ); // Only non-blank keys can be put on a keyring.
				return false;
			}
			else if ( this.Keys.Count >= MaxKeys )
			{
				from.SendLocalizedMessage( 1008138 ); // This keyring is full.
				return false;
			}
			else
			{
				Add( key );
				from.SendLocalizedMessage( 501691 ); // You put the key on the keyring.
				return true;
			}
		}
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:27,代码来源:KeyRing.cs

示例2: OnDoubleClickSecureTrade

		public override void OnDoubleClickSecureTrade( Mobile from )
		{
			if ( !from.InRange( GetWorldLocation(), 2 ) )
			{
				from.SendLocalizedMessage( 500446 ); // That is too far away.
			}
			else if ( m_Entries.Count == 0 )
			{
				from.SendLocalizedMessage( 1062381 ); // The book is empty.
			}
			else
			{
				from.SendGump( new BOBGump( (PlayerMobile)from, this ) );

				SecureTradeContainer cont = GetSecureTradeCont();

				if ( cont != null )
				{
					SecureTrade trade = cont.Trade;

					if ( trade != null && trade.From.Mobile == from )
						trade.To.Mobile.SendGump( new BOBGump( (PlayerMobile)(trade.To.Mobile), this ) );
					else if ( trade != null && trade.To.Mobile == from )
						trade.From.Mobile.SendGump( new BOBGump( (PlayerMobile)(trade.From.Mobile), this ) );
				}
			}
		}
开发者ID:nydehi,项目名称:runuomondains,代码行数:27,代码来源:BulkOrderBook.cs

示例3: OnTarget

		public virtual void OnTarget( Mobile from, object obj )
		{
			if ( Deleted )
				return;

			SwampDragon pet = obj as SwampDragon;

			if ( pet == null || pet.HasBarding )
			{
				from.SendLocalizedMessage( 1053025 ); // That is not an unarmored swamp dragon.
			}
			else if ( !pet.Controlled || pet.ControlMaster != from )
			{
				from.SendLocalizedMessage( 1053026 ); // You can only put barding on a tamed swamp dragon that you own.
			}
			else if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1060640 ); // The item must be in your backpack to use it.
			}
			else
			{
				pet.BardingExceptional = this.Exceptional;
				pet.BardingCrafter = this.Crafter;
				pet.BardingHP = pet.BardingMaxHP;
				pet.BardingResource = this.Resource;
				pet.HasBarding = true;
				pet.Hue = this.Hue;

				this.Delete();

				from.SendLocalizedMessage( 1053027 ); // You place the barding on your swamp dragon.  Use a bladed item on your dragon to remove the armor.
			}
		}
开发者ID:Godkong,项目名称:RunUO,代码行数:33,代码来源:DragonBardingDeed.cs

示例4: OnMoveOver

        public override bool OnMoveOver( Mobile m )
        {
            if ( !base.OnMoveOver( m ) )
                return false;

            PlayerMobile pm = m as PlayerMobile;

            if ( m is BaseCreature )
                pm = ( (BaseCreature) m ).ControlMaster as PlayerMobile;

            if ( pm != null && pm.SacredQuest )
            {
                // May the Virtues guide thine quest.
                m.SendLocalizedMessage( 1112227 );

                return true;
            }
            else
            {
                // Thou must be on a Sacred Quest to pass through.
                m.SendLocalizedMessage( 1112226 );

                return false;
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:25,代码来源:SacredQuestBlocker.cs

示例5: ValidatePlacement

		public bool ValidatePlacement( Mobile from, Point3D loc )
		{
			if ( from.AccessLevel >= AccessLevel.GameMaster )
				return true;

			if ( !from.InRange( this.GetWorldLocation(), 1 ) )
			{
				from.SendLocalizedMessage( 500446 ); // That is too far away.
				return false;
			}

			Map map = from.Map;

			if ( map == null )
				return false;

			BaseHouse house = BaseHouse.FindHouseAt( loc, map, 20 );

			if ( house != null && !house.IsFriend( from ) )
			{
				from.SendLocalizedMessage(500269); // You cannot build that there.
				return false;
			}

			if ( !map.CanFit( loc, 20 ) )
			{
				from.SendLocalizedMessage( 500269 ); // You cannot build that there.
				return false;
			}

			return true;
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:32,代码来源:SiegeRamDeed.cs

示例6: DestroyFurniture

		private void DestroyFurniture( Mobile from, Item item )
		{
			if ( !from.InRange( item.GetWorldLocation(), 3 ) )
			{
				from.SendLocalizedMessage( 500446 ); // That is too far away.
				return;
			}
			else if ( !item.IsChildOf( from.Backpack ) && !item.Movable )
			{
				from.SendLocalizedMessage( 500462 ); // You can't destroy that while it is here.
				return;
			}

			from.SendLocalizedMessage( 500461 ); // You destroy the item.
			Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x3B3 );

			if ( item is Container )
			{
				if ( item is TrapableContainer )
					(item as TrapableContainer).ExecuteTrap( from );

				((Container)item).Destroy();
			}
			else
			{
				item.Delete();
			}
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:28,代码来源:HarvestTarget.cs

示例7: AddRune

        public void AddRune(Mobile from, RecallRune dropped)
        {
            if (Entries.Count < 16)
            {
                RecallRune rune = dropped;

                if (rune.Marked && rune.TargetMap != null)
                {
                    Entries.Add(new RunebookEntry(rune.Target, rune.TargetMap, rune.Description, rune.House));

                    dropped.Delete();

                    from.Send(new PlaySound(0x42, GetWorldLocation()));

                    string desc = rune.Description;

                    if (desc == null || (desc = desc.Trim()).Length == 0)
                        desc = "(nondescript)";

                    from.SendMessage(desc);
                }
                else
                {
                    from.SendLocalizedMessage(502409); // This rune does not have a marked location.
                }
            }
            else
            {
                from.SendLocalizedMessage(502401); // This runebook is full.
            }
        }
开发者ID:greeduomacro,项目名称:DimensionsNewAge,代码行数:31,代码来源:InternalRunebook.cs

示例8: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
			else
			{
				this.Delete();

				Item i = null;

				switch ( Utility.Random( (from.BAC >= 5) ? 6 : 5) )
				{
					case 0: i = new OrigamiButterfly();	break;
					case 1: i = new OrigamiSwan();		break;
					case 2: i = new OrigamiFrog();		break;
					case 3: i = new OrigamiShape();		break;
					case 4: i = new OrigamiSongbird();	break;
					case 5: i = new OrigamiFish();		break;
				}

				if( i != null )
					from.AddToBackpack( i );

				from.SendLocalizedMessage( 1070822 ); // You fold the paper into an interesting shape.
			}
		}
开发者ID:Godkong,项目名称:RunUO,代码行数:28,代码来源:Origami.cs

示例9: OnDoubleClick

        public override void OnDoubleClick( Mobile from )
        {
            if ( !from.InRange( Location, 2 ) )
            {
                // I can't reach that.
                from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 );
            }
            else if ( from is PlayerMobile && ( (PlayerMobile) from ).SacredQuest )
            {
                // You cannot think of any reason to want to do this.
                from.SendLocalizedMessage( 1080538 );
            }
            else if ( from.Backpack != null )
            {
                from.DropHolding();

                Item key = from.Backpack.FindItemByType( KeyType );

                if ( key != null )
                {
                    // You are already carrying a copy of this key fragment.
                    from.SendLocalizedMessage( 1111653 );
                }
                else
                {
                    from.PlaceInBackpack( (Item) Activator.CreateInstance( KeyType ) );

                    // You reach for the key and receive a glowing copy that you place in your bag.
                    from.SendLocalizedMessage( 1111652 );
                }
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:32,代码来源:KeyFragmentSpawner.cs

示例10: OnDoubleClick

        public override void OnDoubleClick( Mobile from )
        {
            if ( !IsChildOf( from.Backpack ) )
            {
                from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
            }
            else if ( from.AccessLevel >= AccessLevel.GameMaster )
            {
                from.SendLocalizedMessage( 503248 );//Your godly powers allow you to place this vendor whereever you wish.

                Mobile v = new PlayerVendor( from );
                v.Location = from.Location;
                v.Direction = from.Direction & Direction.Mask;
                v.Map = from.Map;
                v.SayTo( from, 503246 ); // Ah! it feels good to be working again.

                this.Delete();
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt( from );
                if ( house == null && from.Region is HouseRegion )
                {
                    //allow placement in tents
                    house = ((HouseRegion)from.Region).House;
                    if ( house != null && !(house is Tent) )
                        house = null;
                }

                if ( house == null )
                {
                    from.SendLocalizedMessage( 503240 );//Vendors can only be placed in houses.
                }
                else if ( !house.IsOwner( from ) )
                {
                    from.SendLocalizedMessage( 503242 ); // You must ask the owner of this house to make you a friend in order to place this vendor here,
                }
                else
                {
                    IPooledEnumerable eable = from.GetMobilesInRange( 0 );
                    foreach ( Mobile m in eable )
                    {
                        if ( !m.Player )
                        {
                            from.SendAsciiMessage( "There is something blocking that location." );
                            eable.Free();
                            return;
                        }
                    }

                    Mobile v = new PlayerVendor( from );
                    v.Location = from.Location;
                    v.Direction = from.Direction & Direction.Mask;
                    v.Map = from.Map;
                    v.SayTo( from, 503246 ); // Ah! it feels good to be working again.

                    this.Delete();
                }
            }
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:60,代码来源:PlayerVendorDeed.cs

示例11: CheckUse

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

			if ( from.Map != this.Map || !from.InRange( GetWorldLocation(), 2 ) )
			{
				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:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:26,代码来源:FireHorn.cs

示例12: Resurrect

		public static void Resurrect( Mobile from )
		{
			if ( from.Alive )
				return;

			PlayerMobile pm = from as PlayerMobile;

			if ( pm == null )
				return;

			if ( from.Criminal )
			{
				from.SendLocalizedMessage( 1052007 ); // You cannot use this ability while flagged as a criminal.
			}
			else if ( !VirtueHelper.IsSeeker( from, VirtueName.Sacrifice ) )
			{
				from.SendLocalizedMessage( 1052004 ); // You cannot use this ability.
			}
			else if ( pm.AvailableResurrects <= 0 )
			{
				from.SendLocalizedMessage( 1052005 ); // You do not have any resurrections left.
			}
			else
			{
				/*
				 * We need to wait for them to accept the gump or they can just use
				 * Sacrifice and cancel to have items in their backpack for free.
				 */
				from.CloseGump( typeof( ResurrectGump ) );
				from.SendGump( new ResurrectGump( from, true ) );
			}
		}
开发者ID:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:32,代码来源:Sacrifice.cs

示例13: OnTarget

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

						if(cap.Hits > cap.HitsMax / 10)
						{
                            from.SendLocalizedMessage(1116756); //The pirate seems to have too much fight left to be bound.
						}
						else if(cap.TryBound(from, m_Rope.Quest))
						{
							m_Rope.BoundMobile = cap;
                            m_Rope.Quest.OnBound(cap);
                            cap.OnBound(m_Rope.Quest);

                            from.SendLocalizedMessage(1116721); //You begin binding the pirate.

                            m_Rope.DoDelayedDelete(from);
						} 	
					}
					else
					{
                        from.SendMessage("They cannot by bound by that!");
					}
				}
				else
				{
                    from.SendMessage("They cannot by bound by that!");
				}
			}
开发者ID:Crome696,项目名称:ServUO,代码行数:33,代码来源:BindingRope.cs

示例14: OnMoveOver

		public override bool OnMoveOver( Mobile m )
		{
			if ( m.AccessLevel > AccessLevel.Player )
				return true;

			bool sendMessage = m.Player;

			if ( m is BaseCreature )
				m = ((BaseCreature)m).ControlMaster;

			PlayerMobile pm = m as PlayerMobile;

			if ( pm != null )
			{
				QuestSystem qs = pm.Quest;

				if ( qs is DarkTidesQuest )
				{
					QuestObjective obj = qs.FindObjective( typeof( SpeakCavePasswordObjective ) );

					if ( obj != null && obj.Completed )
					{
						if ( sendMessage )
							m.SendLocalizedMessage( 1060648 ); // With Horus' permission, you are able to pass through the barrier.

						return true;
					}
				}
			}

			if ( sendMessage )
				m.SendLocalizedMessage( 1060649, "", 0x66D ); // Without the permission of the guardian Horus, the magic of the barrier prevents your passage.

			return false;
		}
开发者ID:jsrn,项目名称:MidnightWatchServer,代码行数:35,代码来源:CrystalCaveBarrier.cs

示例15: GiveArtifactTo

        public static void GiveArtifactTo(Mobile m)
        {
            var item = Activator.CreateInstance(m_Artifacts[Utility.Random(m_Artifacts.Length)]) as Item;

            if (item == null)
            {
                return;
            }

            if (m.AddToBackpack(item))
            {
                m.SendLocalizedMessage(1072223); // An item has been placed in your backpack.
                m.SendLocalizedMessage(1062317);
                    // For your valor in combating the fallen beast, a special artifact has been bestowed on you.
            }
            else if (m.BankBox.TryDropItem(m, item, false))
            {
                m.SendLocalizedMessage(1072224); // An item has been placed in your bank box.
                m.SendLocalizedMessage(1062317);
                    // For your valor in combating the fallen beast, a special artifact has been bestowed on you.
            }
            else
            {
                // Item was placed at feet by m.AddToBackpack
                m.SendLocalizedMessage(1072523);
                    // You find an artifact, but your backpack and bank are too full to hold it.
            }
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:28,代码来源:MondainsLegacy.cs


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