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


C# PlayerMobile.SendMessage方法代码示例

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


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

示例1: CheckBites

        public static void CheckBites( PlayerMobile pm, Mobile zombie )
        {
            double infectionChance;

            if( zombie is Zombie )
                infectionChance = 0.02;
            else if ( zombie is ZombieBrute )
                infectionChance = 0.03;
            else
                infectionChance = 0.0;

            double chance = Utility.RandomDouble();

            bool wouldHaveBeenBitten = chance < infectionChance;

            infectionChance -= GetArmourBiteProtection( pm );

            bool bitten = chance < infectionChance;

            if ( bitten )
            {
                pm.SendMessage( "The zombie strikes you with a grievious blow!" );
                BroadcastBite( pm );
            }
            else if ( wouldHaveBeenBitten )
                pm.SendMessage( "The zombie strikes you with a grievious blow, but your armour protects you." );
        }
开发者ID:jsrn,项目名称:ZUOmbies,代码行数:27,代码来源:ZombieInfection.cs

示例2: IncrementSlayerCount

        public void IncrementSlayerCount(PlayerMobile player)
        {
            SlayerTitleAttachment attachment = SlayerTitleSystem.FindAttachment(player);

            if (attachment != null)
            {
                SlayerSystemTracker tracker = attachment.FindSystemName(SlayerTitleName);

                if (tracker != null)
                {
                    tracker.SlayerCount += 1;

                    string newTitle = GetTitleAwarded(tracker.SlayerCount);

                    if (newTitle != null)
                    {
                        if (tracker.LastTitleAwarded == null || tracker.LastTitleAwarded != newTitle)
                        {
                            if (tracker.LastTitleAwarded != null && tracker.LastTitleAwarded != newTitle)
                            {
                                try { player.CollectionTitles.Remove(tracker.LastTitleAwarded); }
                                catch { }
                            }

                            player.AddCollectionTitle(newTitle);
                            tracker.LastTitleAwarded = newTitle;
                            player.SendSound(0x3D);
                            player.SendMessage(0xC8, String.Format("Your have been awarded the title of '{0}' for {1} kills.", newTitle, tracker.SlayerCount));
                        }
                    }
                }
            }
        }
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:33,代码来源:BaseSlayerTitle.cs

示例3: OnSpectatorAdded

		protected virtual void OnSpectatorAdded(PlayerMobile pm)
		{
			if (pm != null && !pm.Deleted)
			{
				pm.SendMessage("You have been granted a front-row seat.");
			}
		}
开发者ID:Ravenwolfe,项目名称:Core,代码行数:7,代码来源:Battle_Spectate.cs

示例4: CustomSpellScrollCopyTarget

        public CustomSpellScrollCopyTarget( PlayerMobile m, CustomMageSpell Spell )
            : base(8, false, TargetFlags.None)
        {
            spell = Spell;

            m.SendMessage( "Choose the scroll you wish to copy this spell to." );
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:7,代码来源:CustomSpellScrollCopyTarget.cs

示例5: CanRemoveThisBackground

        public override bool CanRemoveThisBackground( PlayerMobile m )
        {
            if( m.RawInt < 10 )
            {
                m.SendMessage( "That would lower your current Intelligence too much." );
                return false;
            }

            return base.CanRemoveThisBackground( m );
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:10,代码来源:Smart.cs

示例6: CanAcquireThisBackground

        public override bool CanAcquireThisBackground( PlayerMobile m )
        {
            if( m.RawStr < 10 )
            {
                m.SendMessage( "Your current Strength is already too low." );
                return false;
            }

            return base.CanAcquireThisBackground( m );
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:10,代码来源:Weak.cs

示例7: StaffMessages

        private static void StaffMessages(PlayerMobile user)
        {
            if (user == null)
            {
                return;
            }

            if (user.EventMsgFlag)
            {
                user.SendMessage(54, "Currently Disabled.");
                //user.EventMsgFlag = false;
                //user.SendMessage(54, "You have chosen to opt-out of staff notifies and event pop-ups. Type [staffmessages to opt back in.");
            }
            else if (!user.EventMsgFlag)
            {
                user.SendMessage(54, "Currently Disabled.");
                //user.EventMsgFlag = true;
                //user.SendMessage(54, "You have chosen to opt-in to staff notifies and event pop-ups. Type [staffmessages to opt back out.");               
            }
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:20,代码来源:NotifyIgnore.cs

示例8: TakePlayerTokens

        public static bool TakePlayerTokens(PlayerMobile player, int amount, bool informPlayer)
        {
            #if USE_TOKENS
            ulong masterLooterTokens = 0;
            int curTokens = 0;
            int amountLeft = amount;
            int firstPortion = 0;
            if (amount < 0)
                return false;
            
            // Get Player's total tokens
            MasterLooterBackpack backpack = Daat99MasterLootersUtils.GetMasterLooter(player);
            if (backpack != null)
            {
                masterLooterTokens = backpack.TokensAmount;
            }
            Item[] tokenStacks = player.Backpack.FindItemsByType(typeof(Daat99Tokens));
            foreach (Item tokenStack in tokenStacks)
            {
                curTokens += tokenStack.Amount;
            }

            // Check Total Tokens >= Item Cost
            if ((curTokens + int.Parse(masterLooterTokens.ToString()) >= amountLeft))
            {
                // Withdraw from backpack first
                if (amountLeft > curTokens)
                {
                    firstPortion = curTokens;
                }
                else
                {
                    firstPortion = amountLeft;
                }
                amountLeft -= player.Backpack.ConsumeUpTo(typeof(Daat99Tokens), firstPortion, false);

                // Withdraw remaining from MasterLooterBackpack
                if (amountLeft > 0)
                {
                    backpack.RemoveTokensAmount(ulong.Parse(amountLeft.ToString()));
                }
            return true;
            }
            else
            {
                player.SendMessage(1173, String.Format("You have {0} tokens in your backpack but require {1}.", curTokens, amount));
            }

            if (amountLeft == 0)
                return true;
            #endif
            return false;
        }
开发者ID:Jascen,项目名称:UOSmart,代码行数:53,代码来源:daat99's+Token+System.cs

示例9: GuildDyeTarget

        public GuildDyeTarget( PlayerMobile m, int hue, bool clothing, CustomGuildStone guild )
            : base(8, false, TargetFlags.None)
        {
            m_hue = hue;
            m_clothing = clothing;
            m_guild = guild;

            if( hue < 0 && CustomGuildStone.IsGuildLeader(m, guild) )
                m.SendMessage( "Target an item of the desired colour for your guild's {0} colour.", clothing == true ? "clothing" : "armour" );

            else
            {
                if( !clothing )
                    m.SendMessage( "Choose the piece of armour you wish to enamel." );

                else
                    m.SendMessage( "Choose the piece of clothing you wish to dye." );

                if( CustomGuildStone.IsGuildLeader(m, guild) )
                    m.SendMessage( "If you wish to reset your guild's {0} colour, target yourself.", clothing == true ? "clothing" : "armour" );
            }
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:22,代码来源:GuildDyeTarget.cs

示例10: DisplayDesktop

		public static void DisplayDesktop(PlayerMobile viewer, PlayerMobile viewed)
		{
			if (viewer == null || viewed == null)
			{
				return;
			}

			if (viewer == viewed)
			{
				viewer.SendMessage(0x22, "You can't view your own desktop!");
				return;
			}

			if (!viewed.IsOnline())
			{
				viewer.SendMessage(0x22, "You can't view desktop of an off-line player!");
				return;
			}

			if (!_RestoreStates.ContainsKey(viewer))
			{
				_RestoreStates.Add(viewer, new List<SuperGump>());
			}
			else if (_RestoreStates[viewer] == null)
			{
				_RestoreStates[viewer] = new List<SuperGump>();
			}
			else
			{
				return;
			}

			_RestoreStates[viewer].AddRange(
				EnumerateInstances<SuperGump>(viewer, true)
					.Where(g => g != null && !g.IsDisposed && g.IsOpen && !g.Hidden && !(g is DesktopGump) && g.Hide(true) == g));

			Send(new DesktopGump(viewer, viewed));
		}
开发者ID:greeduomacro,项目名称:RuneUO,代码行数:38,代码来源:DesktopGump.cs

示例11: HandlePopupRequest

		private static bool HandlePopupRequest(PlayerMobile user, MOTDMessage message)
		{
			if (user == null || user.Deleted)
			{
				return false;
			}

			if (message == null)
			{
				user.SendMessage(0x22, "No message to display.");
				return false;
			}

			SuperGump.Send(new MOTDMessageOverviewGump(user, selected: message));
			return true;
		}
开发者ID:jasegiffin,项目名称:JustUO,代码行数:16,代码来源:MOTD.cs

示例12: GrantTitle

        private void GrantTitle(PlayerMobile pm, TitleProfile p)
        {
            if (Title == null || pm == null || p == null)
            {
                return;
            }

            if (p.Contains(Title))
            {
                pm.SendMessage(0x22, "YOU ALREADY OWN THIS TITLE.  THIS SHOULDN'T HAPPEN.  PLEASE PAGE IN.");
                return;
            }

            p.Add(Title);

            pm.PrivateOverheadMessage(
                MessageType.Label, 1287, true,
                "*You have gained the title: " + (!pm.Female ? Title.MaleTitle : Title.FemaleTitle) + "*", pm.NetState);

            Delete();
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:21,代码来源:ConquestTitleScroll.cs

示例13: OnInviteAccept

		protected virtual void OnInviteAccept(PlayerMobile pm)
		{
			if (pm == null || pm.Deleted || !IsOnline(pm))
			{
				return;
			}

			if (!IsQueued(pm))
			{
				pm.SendMessage("You are not queued for {0}", Name);
				return;
			}

			if (IsParticipant(pm))
			{
				pm.SendMessage("You are already participating in {0}", Name);
				return;
			}

			if (InOtherBattle(pm))
			{
				pm.SendMessage("You cannot join {0} while you are in another battle.", Name);
				return;
			}

			if (IsFull)
			{
				pm.SendMessage("The battle is full, you will be sent an invite if someone leaves.");
				return;
			}

			var team = Queue[pm];

			if (team == null || team.Deleted) // Assume AutoAssign is true
			{
				if (Teams.Count == 1)
				{
					team = Teams[0];
				}
				else if (AutoAssign) // Make sure AutoAssign is true
				{
					team = GetAutoAssignTeam(pm);
				}
			}

			if (team == null || team.Deleted) // Fallback to most empty, or random team
			{
				team = GetMostEmptyTeam();

				if (team == null || team.Deleted)
				{
					team = GetRandomTeam();
				}
			}

			if (team == null || team.Deleted)
			{
				pm.SendMessage("The team you've chosen seems to have vanished in the void, sorry about that.");
				Queue.Remove(pm);
				return;
			}

			if (team.IsFull)
			{
				pm.SendMessage("The team you've chosen is full, you will be sent an invite if someone leaves.");
				return;
			}

			Queue.Remove(pm);
			team.AddMember(pm, true);
			SendSound(pm, Options.Sounds.InviteAccept);
		}
开发者ID:Ravenwolfe,项目名称:Core,代码行数:72,代码来源:Battle_Membership.cs

示例14: ApplySkilltoPlayer

        public void ApplySkilltoPlayer(PlayerMobile pm)
        {
            Skill skill = pm.Skills[SkillName];

            if (skill == null)
            {
                return;
            }

            double count = pm.Skills.Total / 10;
            double cap = pm.SkillsCap / 10;
            double decreaseamount;
            int bonus = SkillBonus;

            List<Skill> decreased = GetDecreasableSkills(pm, count, cap,
                out decreaseamount);

            if (decreased.Count > 0 && decreaseamount <= 0)
            {
                pm.SendMessage("You have exceeded the skill cap and do not have a skill set to be decreased.");
            }
            else if ((skill.Base + bonus) > skill.Cap)
            {
                pm.SendMessage("Your skill is too high to raise it further.");
            }
            else if (skill.Lock != SkillLock.Up)
            {
                pm.SendMessage("You must set the skill to be increased in order to raise it further.");
            }
            else
            {
                if ((cap - count + decreaseamount) >= bonus)
                {
                    pm.SendMessage(54, "Your " + skill.SkillName + " has increased by " + SkillBonus + ".");
                    DecreaseSkills(pm, decreased, count, cap, decreaseamount);
                    IncreaseSkill(pm, skill);

                    Consume();
                }
                else
                {
                    pm.SendMessage(
                        "You have exceeded the skill cap and do not have enough skill set to be decreased.");
                }
            }
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:46,代码来源:SkillScroll.cs

示例15: ApplySkilltoPet

        public void ApplySkilltoPet(BaseCreature pet, PlayerMobile owner)
        {
            Skill skill = pet.Skills[SkillName];

            if (skill == null)
            {
                return;
            }

            if (skill.BaseFixedPoint == 0)
            {
                owner.SendMessage("You cannot use a skill scroll on a pet that hasn't already had some training in " + SkillName);
                return;
            }

            double count = pet.Skills.Total / 10;
            double cap = pet.SkillsCap / 10;
            int bonus = SkillBonus;

            if ((skill.Base + bonus) > skill.Cap)
            {
                owner.SendMessage("Your pets skill is too high to raise it further.");
            }
            else
            {
                owner.SendMessage(54, "Your pets " + skill.SkillName + " has increased by " + SkillBonus + ".");
                IncreaseSkill(pet, skill);

                Consume();
            }
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:31,代码来源:SkillScroll.cs


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