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


C# PlayerMobile.SendLocalizedMessage方法代码示例

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


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

示例1: EmbraceHonor

		private static void EmbraceHonor( PlayerMobile pm )
		{
			if ( pm.HonorActive )
			{
				pm.SendLocalizedMessage( 1063230 ); // You must wait awhile before you can embrace honor again.
				return;
			}

			if ( GetHonorDuration( pm ) == 0 )
			{
				pm.SendLocalizedMessage( 1063234 ); // You do not have enough honor to do that
				return;
			}

			TimeSpan waitTime = DateTime.UtcNow - pm.LastHonorUse;
			if ( waitTime < UseDelay )
			{
				TimeSpan remainingTime = UseDelay - waitTime;
				int remainingMinutes = (int) Math.Ceiling( remainingTime.TotalMinutes );

				pm.SendLocalizedMessage( 1063240, remainingMinutes.ToString() ); // You must wait ~1_HONOR_WAIT~ minutes before embracing honor again
				return;
			}
			
			pm.SendGump( new HonorSelf( pm ) );
			
		}
开发者ID:nathanvy,项目名称:runuo,代码行数:27,代码来源:Honor.cs

示例2: Resurrect

		public static void Resurrect( PlayerMobile m, AnkhOfSacrificeAddon ankh )
		{
			if ( m == null )
			{
			}
			else if ( !m.InRange( ankh.GetWorldLocation(), 2 ) )
			{
				m.SendLocalizedMessage( 500446 ); // That is too far away.
			}
			else if ( m.Alive )
			{
				m.SendLocalizedMessage( 1060197 ); // You are not dead, and thus cannot be resurrected!
			}
			else if ( m.AnkhNextUse > DateTime.UtcNow )
			{			
				TimeSpan delay = m.AnkhNextUse - DateTime.UtcNow;

				if ( delay.TotalMinutes > 0 )
					m.SendLocalizedMessage( 1079265, Math.Round( delay.TotalMinutes ).ToString() ); // You must wait ~1_minutes~ minutes before you can use this item.
				else
					m.SendLocalizedMessage( 1079263, Math.Round( delay.TotalSeconds ).ToString() ); // You must wait ~1_seconds~ seconds before you can use this item.		
			}
			else
			{
				m.CloseGump( typeof( AnkhResurrectGump ) );
				m.SendGump( new AnkhResurrectGump( m, ResurrectMessage.VirtueShrine ) );
			}
		}
开发者ID:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:28,代码来源:AnkhOfSacrifice.cs

示例3: Resurrect

		public static void Resurrect( PlayerMobile m, AnkhOfSacrificeAddon ankh )
		{
			BaseHouse ankhhouse = BaseHouse.FindHouseAt( ankh );

			if ( m != null && ankhhouse != null && ankhhouse.IsFriend( m ) )
			{
				if ( !m.InRange( ankh.GetWorldLocation(), 2 ) )
					m.SendLocalizedMessage( 500446 ); // That is too far away.
				else if ( m.Alive )
					m.SendLocalizedMessage( 1060197 ); // You are not dead, and thus cannot be resurrected!
				else if ( m.AnkhNextUse > DateTime.UtcNow )
				{
					TimeSpan delay = m.AnkhNextUse - DateTime.UtcNow;

					if ( delay.TotalMinutes > 0 )
						m.SendLocalizedMessage( 1079265, Math.Round( delay.TotalMinutes ).ToString() ); // You must wait ~1_minutes~ minutes before you can use this item.
					else
						m.SendLocalizedMessage( 1079263, Math.Round( delay.TotalSeconds ).ToString() ); // You must wait ~1_seconds~ seconds before you can use this item.
				}
				else
				{
					m.CloseGump( typeof( AnkhResurrectGump ) );
					/*PlayerMobile pres = m as PlayerMobile;

					if (pres.MurderBounty > 0)
						m.SendGump( new ResurrectGump( m, m, pres.MurderBounty ) );
					else*/
						m.SendGump( new AnkhResurrectGump( m, ResurrectMessage.VirtueShrine ) );
				}
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:31,代码来源:AnkhOfSacrifice.cs

示例4: ActivateEmbrace

        public static void ActivateEmbrace(PlayerMobile pm)
        {
            int duration = GetHonorDuration(pm);
            int usedPoints;

            if (pm.Virtues.Honor < 4399)
                usedPoints = 400;
            else if (pm.Virtues.Honor < 10599)
                usedPoints = 600;
            else
                usedPoints = 1000;

            VirtueHelper.Atrophy(pm, VirtueName.Honor, usedPoints);

            pm.HonorActive = true;
            pm.SendLocalizedMessage(1063235); // You embrace your honor

            Timer.DelayCall(TimeSpan.FromSeconds(duration),
                delegate()
                {
                    pm.HonorActive = false;
                    pm.LastHonorUse = DateTime.UtcNow;
                    pm.SendLocalizedMessage(1063236); // You no longer embrace your honor
                });
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:25,代码来源:Honor.cs

示例5: Shoot

        private static void Shoot(PlayerMobile from, Mobile target, INinjaWeapon weapon)
        {
            if (from != target && CanUseWeapon(from, weapon) && from.CanBeHarmful(target))
            {
                if (weapon.WeaponMinRange == 0 || !from.InRange(target, weapon.WeaponMinRange))
                {
                    from.NinjaWepCooldown = true;

                    from.Direction = from.GetDirectionTo(target);

                    from.RevealingAction();

                    weapon.AttackAnimation(from, target);

                    ConsumeUse(weapon);

                    if (CombatCheck(from, target))
                    {
                        Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerStateCallback<object[]>(OnHit), new object[] { from, target, weapon });
                    }

                    Timer.DelayCall(TimeSpan.FromSeconds(2.5), new TimerStateCallback<PlayerMobile>(ResetUsing), from);
                }
                else
                {
                    from.SendLocalizedMessage(1063303); // Your target is too close!
                }
            }
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:29,代码来源:NinjaWeapons.cs

示例6: GiveArtifactTo

        public static void GiveArtifactTo( PlayerMobile pm )
        {
            Item item = (Item) Activator.CreateInstance( Artifacts[Utility.Random( Artifacts.Length )] );

            bool message = true;

            if ( !pm.AddToBackpack( item ) )
            {
                Container bank = pm.BankBox;

                if ( !( bank != null && bank.TryDropItem( pm, item, false ) ) )
                {
                    pm.SendLocalizedMessage( 1072523, "", 64 ); // You find an artifact, but your backpack and bank are too full to hold it.

                    message = false;

                    item.MoveToWorld( pm.Location, pm.Map );
                }
            }

            if ( message )
                pm.SendLocalizedMessage( 1062317, "", 64 ); // For your valor in combating the fallen beast, a special artifact has been bestowed on you.

            EffectPool.ArtifactDrop( pm );

            pm.DoomCredits = 0;
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:27,代码来源:DoomArtifactGiver.cs

示例7: Use

        public void Use( PlayerMobile pm )
        {
            if ( DateTime.Now < pm.NextGemOfSalvationUse )
            {
                TimeSpan left = pm.NextGemOfSalvationUse - DateTime.Now;

                if ( left >= TimeSpan.FromMinutes( 1.0 ) )
                    pm.SendLocalizedMessage( 1095131, ( ( left.Hours * 60 ) + left.Minutes ).ToString() ); // Your spirit lacks cohesion. You must wait ~1_minutes~ minutes before invoking the power of a Gem of Salvation.
                else
                    pm.SendLocalizedMessage( 1095130, left.Seconds.ToString() ); // Your spirit lacks cohesion. You must wait ~1_seconds~ seconds before invoking the power of a Gem of Salvation.
            }
            else
            {
                pm.CloseGump( typeof( ResurrectGump ) );
                pm.SendGump( new GemResurrectGump( pm, this ) );
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:17,代码来源:GemOfSalvation.cs

示例8: OnTalk

        public override void OnTalk(PlayerMobile pm)
        {
            if (!HasQuest(pm))
            {
                BaseBoat boat = FishQuestHelper.GetBoat(pm);

                if (boat != null && boat is BaseGalleon)
                {
                    if (((BaseGalleon)boat).Scuttled)
                    {
                        pm.SendLocalizedMessage(1116752); //Your ship is a mess!  Fix it first and then we can talk about catching pirates.
                    }
                    else
                    {
                        ProfessionalBountyQuest q = new ProfessionalBountyQuest((BaseGalleon)boat);
                        q.Owner = pm;
                        q.Quester = this;

                        pm.CloseGump(typeof(MondainQuestGump));
                        pm.SendGump(new MondainQuestGump(q));
                    }
                }
                else if (boat != null && !(boat is BaseGalleon))
                {
                    SayTo(pm, 1116751); //The ship you are captaining could not take on a pirate ship.  Bring a warship if you want this quest.
                }
                else if(m_NextSay < DateTime.UtcNow)
                {
                    if (m_LastSay == 0)
                    {
                        if (this.Map != Map.Tokuno)
                            Say(1152651);  //I'm G.B. Bigglesby, proprietor of the G.B. Bigglesby Free Trade Floating Emporium.
                        else
                            Say("I am {0}, proprietor of {0} Free Trade Coroporation of Tokuno.", Name);
                        m_LastSay = 1;
                    }
                    else
                    {
                        Say(1152652);  //This sea market be me life's work and 'tis me pride and joy..
                        m_LastSay = 0;
                    }

                    m_NextSay = DateTime.UtcNow + TimeSpan.FromSeconds(5);
                }
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:46,代码来源:GBBigglesby.cs

示例9: AwardVirtue

        public static void AwardVirtue( PlayerMobile pm, VirtueName virtue, int amount )
        {
            if ( virtue == VirtueName.Compassion )
            {
                if ( pm.CompassionGains > 0 && DateTime.Now > pm.NextCompassionDay )
                {
                    pm.NextCompassionDay = DateTime.MinValue;
                    pm.CompassionGains = 0;
                }

                if ( pm.CompassionGains >= 5 )
                {
                    pm.SendLocalizedMessage( 1053004 ); // You must wait about a day before you can gain in compassion again.
                    return;
                }
            }

            bool gainedPath = false;
            string virtueName = Enum.GetName( typeof( VirtueName ), virtue );

            if ( VirtueHelper.Award( pm, virtue, amount, ref gainedPath ) )
            {
                // TODO: Localize?
                if ( gainedPath )
                    pm.SendMessage( "You have gained a path in {0}!", virtueName );
                else
                    pm.SendMessage( "You have gained in {0}.", virtueName );

                if ( virtue == VirtueName.Compassion )
                {
                    pm.NextCompassionDay = DateTime.Now + TimeSpan.FromDays( 1.0 );
                    ++pm.CompassionGains;

                    if ( pm.CompassionGains >= 5 )
                        pm.SendLocalizedMessage( 1053004 ); // You must wait about a day before you can gain in compassion again.
                }
            }
            else
            {
                // TODO: Localize?
                pm.SendMessage( "You have achieved the highest path of {0} and can no longer gain any further.", virtueName );
            }
        }
开发者ID:OurUO,项目名称:ouruo-server,代码行数:43,代码来源:VirtueHelper.cs

示例10: OnTalk

        public override bool ShowContextMenu { get { return true; } }//
		public override void OnTalk( PlayerMobile player, bool contextMenu )
		{
			QuestSystem qs = player.Quest;

			if ( qs is CollectorQuest )
			{
				Direction = GetDirectionTo( player );

				QuestObjective obj = qs.FindObjective( typeof( FindTomasObjective ) );

				if ( obj != null && !obj.Completed )
				{
					Item paints = new EnchantedPaints();

					if ( !player.PlaceInBackpack( paints ) )
					{
						paints.Delete();
						player.SendLocalizedMessage( 1046260 ); // You need to clear some space in your inventory to continue with the quest.  Come back here when you have more space in your inventory.
					}
					else
					{
						obj.Complete();
					}
				}
				else if ( qs.IsObjectiveInProgress( typeof( CaptureImagesObjective ) ) )
				{
					qs.AddConversation( new TomasDuringCollectingConversation() );
				}
				else
				{
					obj = qs.FindObjective( typeof( ReturnImagesObjective ) );

					if ( obj != null && !obj.Completed )
					{
						if ( player.Backpack != null )
							player.Backpack.ConsumeUpTo( typeof( EnchantedPaints ), 1 );

						obj.Complete();
					}
				}
			}
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:43,代码来源:TomasONeerlan.cs

示例11: CheckComplete

		public bool CheckComplete( PlayerMobile pm )
		{
			if ( CompletedCount( pm ) == Needed.Length )
				return true;

			pm.SendLocalizedMessage( 1073644 ); // You must complete all the tasks before proceeding...
			return false;
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:8,代码来源:BoonCollector.cs

示例12: DonatePet

		public virtual void DonatePet( PlayerMobile player, BaseCreature pet )
		{
			for ( int i = 0; i < m_Donations.Count; i ++ )
				if ( m_Donations[ i ].Type == pet.GetType() )
				{
					pet.Delete();
					Donate( player, m_Donations[ i ], 1 );
					return;
				}
				
			player.SendLocalizedMessage( 1073113 ); // This Collection is not accepting that type of creature.
		}
开发者ID:nydehi,项目名称:runuomondains,代码行数:12,代码来源:BaseCollectionMobile.cs

示例13: Reward

		public virtual void Reward( PlayerMobile player, CollectionItem reward, int hue )
		{
			Item item = QuestHelper.Construct( reward.Type ) as Item;
			
			if ( item != null && player.AddToBackpack( item ) )
			{
				if ( hue > 0 )
					item.Hue = hue;
				
				player.AddCollectionPoints( CollectionID, (int) reward.Points * -1 );
				player.SendLocalizedMessage( 1073621 ); // Your reward has been placed in your backpack.
				player.PlaySound( 0x5A7 );	
			}			
			else if ( item != null )
			{
				player.SendLocalizedMessage( 1074361 ); // The reward could not be given.  Make sure you have room in your pack.
				item.Delete();
			}
			
			reward.OnGiveReward( player, this, hue );	
			
			player.SendGump( new ComunityCollectionGump( player, this, Location ) );
		}
开发者ID:nydehi,项目名称:runuomondains,代码行数:23,代码来源:BaseCollectionMobile.cs

示例14: Donate

		public virtual void Donate( PlayerMobile player, CollectionItem item, int amount )
		{
			int points = (int) ( amount * item.Points );
		
			player.AddCollectionPoints( CollectionID, points );
			
			player.SendLocalizedMessage( 1072816 ); // Thank you for your donation!
			player.SendLocalizedMessage( 1072817, points.ToString() ); // You have earned ~1_POINTS~ reward points for this donation.	
			player.SendLocalizedMessage( 1072818, points.ToString() ); // The Collection has been awarded ~1_POINTS~ points
			
			Points += points;
			
			InvalidateProperties();
		}
开发者ID:nydehi,项目名称:runuomondains,代码行数:14,代码来源:BaseCollectionMobile.cs

示例15: OnVirtueRejected

        public static void OnVirtueRejected( PlayerMobile protector, PlayerMobile protectee )
        {
            string args = String.Format( "{0}\t{1}", protector.Name, protectee.Name );

            protectee.SendLocalizedMessage( 1049453, args ); // You have declined protection from ~1_NAME~.
            protector.SendLocalizedMessage( 1049454, args ); // ~2_NAME~ has declined your protection.

            if ( protector.BeginAction( typeof( JusticeVirtue ) ) )
                Timer.DelayCall( TimeSpan.FromMinutes( 15.0 ), new TimerStateCallback( RejectDelay_Callback ), protector );
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:10,代码来源:Justice.cs


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