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


C# Mobile.NonlocalOverheadMessage方法代码示例

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


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

示例1: OnHit

        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if( !Validate(attacker) || !CheckStam(attacker, true) )
                return;

            ClearCurrentAbility(attacker);

            if( (defender is BaseCreature && ((BaseCreature)defender).BleedImmune) )
            {
                attacker.SendLocalizedMessage(1062052); // Your target is not affected by the bleed attack!
                return;
            }

            attacker.SendLocalizedMessage(1060159); // Your target is bleeding!
            defender.SendLocalizedMessage(1060160); // You are bleeding!

            if( defender is PlayerMobile )
            {
                defender.LocalOverheadMessage(MessageType.Regular, 0x21, 1060757); // You are bleeding profusely
                defender.NonlocalOverheadMessage(MessageType.Regular, 0x21, 1060758, defender.Name); // ~1_NAME~ is bleeding profusely
            }

            defender.PlaySound(0x133);
            defender.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist);

            BeginBleed(defender, attacker);
        }
开发者ID:greeduomacro,项目名称:hubroot,代码行数:27,代码来源:BleedAttack.cs

示例2: OnHit

		public override void OnHit( Mobile attacker, Mobile defender, int damage )
		{
			if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
				return;

			ClearCurrentAbility( attacker );

			// Necromancers under Lich or Wraith Form are immune to Bleed Attacks.
			TransformContext context = TransformationSpell.GetContext( defender );

			if ( (context != null && ( context.Type == typeof( LichFormSpell ) || context.Type == typeof( WraithFormSpell ))) ||
				(defender is BaseCreature && ((BaseCreature)defender).BleedImmune) )
			{
				attacker.SendLocalizedMessage( 1062052 ); // Your target is not affected by the bleed attack!
				return;
			}

			attacker.SendLocalizedMessage( 1060159 ); // Your target is bleeding!
			defender.SendLocalizedMessage( 1060160 ); // You are bleeding!

			if ( defender is PlayerMobile )
			{
				defender.LocalOverheadMessage( MessageType.Regular, 0x21, 1060757 ); // You are bleeding profusely
				defender.NonlocalOverheadMessage( MessageType.Regular, 0x21, 1060758, defender.Name ); // ~1_NAME~ is bleeding profusely
			}

			defender.PlaySound( 0x133 );
			defender.FixedParticles( 0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist );

			BeginBleed( defender, attacker );
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:31,代码来源:BleedAttack.cs

示例3: 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

示例4: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (!this.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 (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null))
            {
                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 if (from.Flying)
			{
				from.SendLocalizedMessage(1113414); // You cannot use this while flying!
			}
            else
            {
                EtherealMount.StopMounting(from);

                if (Core.AOS)
                {
                    Item one = from.FindItemOnLayer(Layer.OneHanded);
                    Item two = from.FindItemOnLayer(Layer.TwoHanded);

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

                    if (two != null)
                        from.AddToBackpack(two);
                }

                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:Crome696,项目名称:ServUO,代码行数:51,代码来源:Bola.cs

示例5: OnHit

        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !IsBladeweaveAttack )
            {
                if ( !Validate( attacker ) )
                    return;
                if ( !CheckMana( attacker, true ) )
                    return;
            }

            ClearCurrentAbility( attacker );

            if ( defender is BaseCreature )
            {
                if ( defender != null && ( (BaseCreature) defender ).BleedImmune )
                {
                    attacker.SendLocalizedMessage( 1062052 ); // Your target is not affected by the bleed attack!

                    return;
                }
            }

            TransformContext context = TransformationSpell.GetContext( defender );

            // Necromancers under Lich Form or Wraith Form are immune to Bleed Attacks.
            if ( context == null || ( context.Type != typeof( LichFormSpell ) && context.Type != typeof( WraithFormSpell ) ) )
            {
                attacker.SendLocalizedMessage( 1060159 ); // Your target is bleeding!
                defender.SendLocalizedMessage( 1060160 ); // You are bleeding!

                if ( defender is PlayerMobile )
                {
                    defender.LocalOverheadMessage( MessageType.Regular, 0x21, 1060757 ); // You are bleeding profusely
                    defender.NonlocalOverheadMessage( MessageType.Regular, 0x21, 1060758, defender.Name ); // ~1_NAME~ is bleeding profusely
                }

                defender.PlaySound( 0x133 );
                defender.FixedParticles( 0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist );

                TimeSpan duration = ComputeDuration( defender );

                BuffInfo.AddBuff( defender, new BuffInfo( BuffIcon.Bleed, 1075829, duration, defender, String.Format( "{0}\t{1}\t{2}", 5, 10, 2 ) ) );

                BeginBleed( defender, attacker, duration );
            }
            else
            {
                attacker.SendLocalizedMessage( 1062052 ); // Your target is not affected by the bleed attack!
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:50,代码来源:BleedAttack.cs

示例6: OnDeath

		public void OnDeath( Mobile mob, Container corpse )
		{
			if ( !m_Registered || !m_Started )
				return;

			DuelPlayer pl = Find( mob );

			if ( pl != null && !pl.Eliminated )
			{
				if ( m_EventGame != null && !m_EventGame.OnDeath( mob, corpse ) )
					return;

				pl.Eliminated = true;

				if ( mob.Poison != null )
					mob.Poison = null;

				Requip( mob, corpse );
				DelayBounce( TimeSpan.FromSeconds( 4.0 ), mob, corpse );

				Participant winner = CheckCompletion();

				if ( winner != null )
				{
					Finish( winner );
				}
				else if ( !m_Yielding )
				{
					mob.LocalOverheadMessage( MessageType.Regular, 0x22, false, "You have been defeated." );
					mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, String.Format( "{0} has been defeated.", mob.Name ) );
				}
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:33,代码来源:DuelContext.cs

示例7: OnLocationChanged

		public void OnLocationChanged( Mobile mob )
		{
			if ( !m_Registered || !m_StartedBeginCountdown || m_Finished )
				return;

			Arena arena = m_Arena;

			if ( arena == null )
				return;

			if ( mob.Map == arena.Facet && arena.Bounds.Contains( mob.Location ) )
				return;

			DuelPlayer pl = Find( mob );

			if ( pl == null || pl.Eliminated )
				return;

			if ( mob.Map == Map.Internal ) {
				// they've logged out

				if ( mob.LogoutMap == arena.Facet && arena.Bounds.Contains( mob.LogoutLocation ) ) {
					// they logged out inside the arena.. set them to eject on login

					mob.LogoutLocation = arena.Outside;
				}
			}

			pl.Eliminated = true;

			mob.LocalOverheadMessage( MessageType.Regular, 0x22, false, "You have forfeited your position in the duel." );
			mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, String.Format( "{0} has forfeited by leaving the dueling arena.", mob.Name ) );

			Participant winner = CheckCompletion();

			if ( winner != null )
				Finish( winner );
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:38,代码来源:DuelContext.cs

示例8: DoDestroyEquipment

        private void DoDestroyEquipment(Mobile target)
        {
            if (target.AccessLevel == AccessLevel.Player && InRange(target, 1) && 0.25 > Utility.RandomDouble())
                //15% chance
            {
                var items = new List<Item>();

                for (int i = 0; i < target.Items.Count; i++)
                {
                    Item item = target.Items[i];
                    if (item is IDurability && ((IDurability) item).MaxHitPoints > 0 &&
                        item.LootType != LootType.Blessed && item.BlessedFor == null &&
                        !(InsuranceEnabled && item.Insured))
                    {
                        items.Add(item);
                    }
                }

                if (items.Count > 0)
                {
                    Item toDestroy = items[Utility.Random(items.Count)];
                    string name = toDestroy.Name;
                    if (String.IsNullOrEmpty(name))
                    {
                        name = toDestroy.ItemData.Name;
                    }

                    toDestroy.Delete();

                    target.NonlocalOverheadMessage(MessageType.Regular, 0x3B2, 1080034, name);
                        // Their ~1_NAME~ is destroyed by the attack.
                    target.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1080035, name);
                        // Your ~1_NAME~ is destroyed by the attack.
                }
            }
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:36,代码来源:ValoriteElemental.cs

示例9: OnTarget

			protected override void OnTarget( Mobile from, object o )
			{
				int itemID = 0;
				if (o is LandTarget)
				{
				if (from.Map == Map.Malas || from.Map == Map.Ilshenar)
					{
					from.PrivateOverheadMessage( MessageType.Regular, 0x2B2, true, "No solen lairs exist on this facet.  Try again in Trammel or Felucca.", from.NetState);
					return;
					}
				Point3D p = new Point3D( o as IPoint3D );
				itemID = from.Map.Tiles.GetLandTile( ((LandTarget)o).X, ((LandTarget)o).Y ).ID & 0x3FFF;
				bool goodspot = false;
				int effect = 0;
				for ( int i = 0; i < m_DirtIDs.Length; i += 2 )
					{
					if ( itemID >= m_DirtIDs[i] && itemID <= m_DirtIDs[i + 1] )
						{
						goodspot = true;
						effect = 1;
						}
					}
				for ( int i = 0; i < m_SwampIDs.Length; i += 2 )
					{
					if ( itemID >= m_SwampIDs[i] && itemID <= m_SwampIDs[i + 1] )
						{
						goodspot = true;
						effect = 2;
						}
					}
				for ( int i = 0; i < m_SandIDs.Length; i += 2 )
					{
					if ( itemID >= m_SandIDs[i] && itemID <= m_SandIDs[i + 1] )
						{
						goodspot = true;
						effect = 3;
						}
					}
				for ( int i = 0; i < m_SnowIDs.Length; i += 2 )
					{
					if ( itemID >= m_SnowIDs[i] && itemID <= m_SnowIDs[i + 1] )
						{
						goodspot = true;
						effect = 4;
						}
					}
				for ( int i = 0; i < m_FurrowsIDs.Length; i += 2 )
					{
					if ( itemID >= m_FurrowsIDs[i] && itemID <= m_FurrowsIDs[i + 1] )
						{
						goodspot = true;
						effect = 5;
						}
					}
				if ( goodspot )
					{
					m_GreenThorn.Consume();
					from.LocalOverheadMessage( MessageType.Emote, 0x2B2, 1061914 ); // * You push the strange green thorn into the ground *
					from.NonlocalOverheadMessage( MessageType.Emote, 0x2B2, 1061915, from.Name ); // * ~1_PLAYER_NAME~ pushes a strange green thorn into the ground. *
					from.PlaySound(0x106);
					Effects.SendLocationParticles( EffectItem.Create( p, from.Map, EffectItem.DefaultDuration ), 0x3735, 1, 182, 0xBE3 );
					new ThornEffectTimer( from, p, effect ).Start();
					new DelayTimer(from).Start();
					}
				else
					{
					from.SendLocalizedMessage( 1061913 ); // * You sense it would be useless to plant a green thorn there. *
					from.EndAction( typeof( GreenThorn ) );
					}
				}
				else
					{
					from.SendLocalizedMessage( 1061912 ); // * You cannot plant a green thorn there! *
					from.EndAction( typeof( GreenThorn ) );
					}
			}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:76,代码来源:PlantResources.cs

示例10: OnTarget

            protected override void OnTarget(Mobile from, object targeted)
            {
                from.RevealingAction();

                if (targeted is Mobile)
                {
                    if (targeted is BaseCreature)
                    {
                        BaseCreature creature = (BaseCreature)targeted;

                        if (!creature.Tamable)
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049655, from.NetState); // That creature cannot be tamed.
                        }
                        else if (creature.Controlled)
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502804, from.NetState); // That animal looks tame already.
                        }
                        else if (from.Female && !creature.AllowFemaleTamer)
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049653, from.NetState); // That creature can only be tamed by males.
                        }
                        else if (!from.Female && !creature.AllowMaleTamer)
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049652, from.NetState); // That creature can only be tamed by females.
                        }
                        else if (creature is CuSidhe && from.Race != Race.Elf)
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502801, from.NetState); // You can't tame that!
                        }
                        else if (from.Followers + creature.ControlSlots > from.FollowersMax)
                        {
                            from.SendLocalizedMessage(1049611); // You have too many followers to tame that creature.
                        }
                        else if (creature.Owners.Count >= BaseCreature.MaxOwners && !creature.Owners.Contains(from))
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1005615, from.NetState); // This animal has had too many owners and is too upset for you to tame.
                        }
                        else if (MustBeSubdued(creature))
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1054025, from.NetState); // You must subdue this creature before you can tame it!
                        }
                        else if (CheckMastery(from, creature) || from.Skills[SkillName.AnimalTaming].Value >= creature.MinTameSkill)
                        {
                            FactionWarHorse warHorse = creature as FactionWarHorse;

                            if (warHorse != null)
                            {
                                Faction faction = Faction.Find(from);

                                if (faction == null || faction != warHorse.Faction)
                                {
                                    creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1042590, from.NetState); // You cannot tame this creature.
                                    return;
                                }
                            }

                            if (m_BeingTamed.Contains(targeted))
                            {
                                creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502802, from.NetState); // Someone else is already taming this.
                            }
                            else if (creature.CanAngerOnTame && 0.95 >= Utility.RandomDouble())
                            {
                                creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502805, from.NetState); // You seem to anger the beast!
                                creature.PlaySound(creature.GetAngerSound());
                                creature.Direction = creature.GetDirectionTo(from);

                                if (creature.BardPacified && Utility.RandomDouble() > .24)
                                {
                                    Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ResetPacify), creature);
                                }
                                else
                                {
                                    creature.BardEndTime = DateTime.Now;
                                }

                                creature.BardPacified = false;

                                if (creature.AIObject != null)
                                    creature.AIObject.DoMove(creature.Direction);

                                if (from is PlayerMobile && !(((PlayerMobile)from).HonorActive || TransformationSpellHelper.UnderTransformation(from, typeof(EtherealVoyageSpell))))
                                    creature.Combatant = from;
                            }
                            else
                            {
                                m_BeingTamed[targeted] = from;

                                from.LocalOverheadMessage(MessageType.Emote, 0x59, 1010597); // You start to tame the creature.
                                from.NonlocalOverheadMessage(MessageType.Emote, 0x59, 1010598); // *begins taming a creature.*

                                new InternalTimer(from, creature, Utility.Random(3, 2)).Start();

                                this.m_SetSkillTime = false;
                            }
                        }
                        else
                        {
                            creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502806, from.NetState); // You have no chance of taming this creature.
                        }
//.........这里部分代码省略.........
开发者ID:m309,项目名称:ForkUO,代码行数:101,代码来源:AnimalTaming.cs

示例11: DoDamage

        public void DoDamage(Mobile to)
        {
            to.Send(new UnicodeMessage(this.Serial, this.ItemID, MessageType.Regular, 0x3B2, 3, "", "", "The generator shoots an arc of electricity at you!"));
            to.BoltEffect(0);
            to.LocalOverheadMessage(MessageType.Regular, 0xC9, true, "* Your body convulses from electric shock *");
            to.NonlocalOverheadMessage(MessageType.Regular, 0xC9, true, string.Format("* {0} spasms from electric shock *", to.Name));

            AOS.Damage(to, to, 60, 0, 0, 0, 0, 100);

            if (!to.Alive)
                return;

            if (this.m_DamageTable[to] == null)
            {
                to.Frozen = true;

                DamageTimer timer = new DamageTimer(this, to);
                this.m_DamageTable[to] = timer;

                timer.Start();
            }
        }
开发者ID:m309,项目名称:ForkUO,代码行数:22,代码来源:PowerGenerator.cs

示例12: OnTarget

            protected override void OnTarget( Mobile from, object targeted )
            {
                from.RevealingAction();

                if ( targeted is Mobile )
                {
                    if ( targeted is BaseCreature )
                    {
                        BaseCreature creature = (BaseCreature)targeted;

                        if ( !creature.Tamable || creature.MinTameSkill > 150 )
                        {
                            from.SendLocalizedMessage( 502469 ); // That being can not be tamed.
                        }
                        else if ( creature.Controled )
                        {
                            from.SendLocalizedMessage( 502467 ); // That animal looks tame already.
                        }
                        else if ( from.Female ? !creature.AllowFemaleTamer : !creature.AllowMaleTamer )
                        {
                            from.SendLocalizedMessage( 502801 ); // You can't tame that!
                        }
                        /*else if ( from.Followers + creature.ControlSlots > from.FollowersMax )
                        {
                            from.SendLocalizedMessage( 1049611 ); // You have too many followers to tame that creature.
                        }*/
                        /*else if ( creature.Owners.Count >= BaseCreature.MaxOwners && !creature.Owners.Contains( from ) )
                        {
                            from.SendLocalizedMessage( 1005615 ); // This animal has had too many owners and is too upset for you to tame.
                        }*/
                        else if ( MustBeSubdued( creature ) )
                        {
                            from.SendLocalizedMessage( 1054025 ); // You must subdue this creature before you can tame it!
                        }
                        else if ( CheckMastery( from, creature ) || from.Skills[SkillName.AnimalTaming].Value >= creature.MinTameSkill*1.2 - 25.0 )
                        {
                            if ( m_BeingTamed.Contains( targeted ) )
                            {
                                from.SendLocalizedMessage( 502802 ); // Someone else is already taming this.
                            }
                            else
                            {
                                m_BeingTamed[targeted] = from;

                                // Face the creature
                                from.Direction = from.GetDirectionTo( creature );

                                from.LocalOverheadMessage( MessageType.Emote, 0x59, 1010597 ); // You start to tame the creature.
                                from.NonlocalOverheadMessage( MessageType.Emote, 0x59, 1010598 ); // *begins taming a creature.*

                                new InternalTimer( from, creature, Utility.Random( 3, 2 ) ).Start();
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage( 502806 ); // You have no chance of taming this creature.
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage( 502469 ); // That being can not be tamed.
                    }
                }
                else
                {
                    from.SendLocalizedMessage( 502801 ); // You can't tame that!
                }
            }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:68,代码来源:AnimalTaming.cs

示例13: OnTarget


//.........这里部分代码省略.........
						else if (from.Female && !creature.AllowFemaleTamer)
						{
							creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049653, from.NetState);
								// That creature can only be tamed by males.
						}
						else if (!from.Female && !creature.AllowMaleTamer)
						{
							creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1049652, from.NetState);
								// That creature can only be tamed by females.
						}
						else if (creature is CuSidhe && from.Race != Race.Elf)
						{
							creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502801, from.NetState); // You can't tame that!
						}
						else if (from.Followers + creature.ControlSlots > from.FollowersMax)
						{
							from.SendLocalizedMessage(1049611); // You have too many followers to tame that creature.
						}
						else if (creature.Owners.Count >= BaseCreature.MaxOwners && !creature.Owners.Contains(from))
						{
							creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1005615, from.NetState);
								// This animal has had too many owners and is too upset for you to tame.
						}
						else if (MustBeSubdued(creature))
						{
							creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1054025, from.NetState);
								// You must subdue this creature before you can tame it!
						}
						else if (CheckMastery(from, creature) || from.Skills[SkillName.AnimalTaming].Value >= creature.MinTameSkill)
						{
							var warHorse = creature as FactionWarHorse;

							if (warHorse != null)
							{
								Faction faction = Faction.Find(from);

								if (faction == null || faction != warHorse.Faction)
								{
									creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1042590, from.NetState);
										// You cannot tame this creature.
									return;
								}
							}

							if (m_BeingTamed.ContainsKey(creature))
							{
								creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502802, from.NetState);
									// Someone else is already taming this.
							}
							else if (creature.CanAngerOnTame && 0.95 >= Utility.RandomDouble())
							{
								creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502805, from.NetState);
									// You seem to anger the beast!
								creature.PlaySound(creature.GetAngerSound());
								creature.Direction = creature.GetDirectionTo(from);

								if (creature.BardPacified && 0.75 > Utility.RandomDouble())
								{
									Timer.DelayCall(TimeSpan.FromSeconds(2.0), ResetPacify, creature);
								}
								else
								{
									creature.BardEndTime = DateTime.UtcNow;
									creature.BardPacified = false;

									if (creature.AIObject != null)
									{
										creature.AIObject.DoMove(creature.Direction);
									}
								}
							}
							else
							{
								m_BeingTamed[creature] = from;

								from.LocalOverheadMessage(MessageType.Emote, 0x59, 1010597); // You start to tame the creature.
								from.NonlocalOverheadMessage(MessageType.Emote, 0x59, 1010598); // *begins taming a creature.*

								new InternalTimer(from, creature, Utility.Random(3, 2)).Start();

								m_SetSkillTime = false;
							}
						}
						else
						{
							creature.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502806, from.NetState);
								// You have no chance of taming this creature.
						}
					}
					else
					{
						((Mobile)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 502469, from.NetState);
							// That being cannot be tamed.
					}
				}
				else
				{
					from.SendLocalizedMessage(502801); // You can't tame that!
				}
			}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:101,代码来源:AnimalTaming.cs

示例14: OnTarget

			protected override void OnTarget( Mobile from, object targeted )
			{
				from.RevealingAction();

				if ( targeted is Mobile )
				{
					if ( targeted is BaseCreature )
					{
						BaseCreature creature = (BaseCreature)targeted;

						if ( !creature.Tamable )
						{
							from.SendLocalizedMessage( 502469 ); // That being can not be tamed.
						}
						else if ( creature.Controlled )
						{
							from.SendLocalizedMessage( 502467 ); // That animal looks tame already.
						}
						else if ( from.Female ? !creature.AllowFemaleTamer : !creature.AllowMaleTamer )
						{
							from.SendLocalizedMessage( 502801 ); // You can't tame that!
						}
						else if ( from.Followers + creature.ControlSlots > from.FollowersMax )
						{
							from.SendLocalizedMessage( 1049611 ); // You have too many followers to tame that creature.
						}
						else if ( creature.Owners.Count >= BaseCreature.MaxOwners && !creature.Owners.Contains( from ) )
						{
							from.SendLocalizedMessage( 1005615 ); // This animal has had too many owners and is too upset for you to tame.
						}
						else if ( MustBeSubdued( creature ) )
						{
							from.SendLocalizedMessage( 1054025 ); // You must subdue this creature before you can tame it!
						}
						else if ( creature.BardProvoked )
						{
							from.SendMessage("That creature is too angry to tame.");
						}
						else if ( CheckMastery( from, creature ) || from.Skills[SkillName.AnimalTaming].Value >= creature.MinTameSkill )
						{
							if ( m_BeingTamed.Contains( targeted ) )
							{
								from.SendLocalizedMessage( 502802 ); // Someone else is already taming this.
							}
							else if ( (creature is Dragon || creature is Nightmare || creature is SwampDragon || creature is WhiteWyrm) && 0.95 >= Utility.RandomDouble() )
							{
								from.SendLocalizedMessage( 502805 ); // You seem to anger the beast!
								creature.PlaySound( creature.GetAngerSound() );
								creature.Direction = creature.GetDirectionTo( from );
								creature.Combatant = from;
							}
							else
							{
								m_BeingTamed[targeted] = from;

								from.LocalOverheadMessage( MessageType.Emote, 0x59, 1010597 ); // You start to tame the creature.
								from.NonlocalOverheadMessage( MessageType.Emote, 0x59, 1010598 ); // *begins taming a creature.*

								new InternalTimer( from, creature, Utility.Random( 3, 2 ) ).Start();

								m_SetSkillTime = false;
							}
						}
						else
						{
							from.SendLocalizedMessage( 502806 ); // You have no chance of taming this creature.
						}
					}
					else
					{
						from.SendLocalizedMessage( 502469 ); // That being can not be tamed.
					}
				}
				else
				{
					from.SendLocalizedMessage( 502801 ); // You can't tame that!
				}
			}
开发者ID:zerodowned,项目名称:angelisland,代码行数:78,代码来源:AnimalTaming.cs

示例15: PlayEndingEffect

        public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
        {
            if ( toolBroken )
                from.SendAsciiMessage("You have worn out your tool.");
                //from.SendLocalizedMessage( 1044038 ); // You have worn out your tool

            if ( failed )
            {
                int OldHue = from.SpeechHue;
                from.SpeechHue = from.EmoteHue;

                if (lostMaterial)
                {
                    from.LocalOverheadMessage(MessageType.Regular, from.EmoteHue, true, String.Format("*You carve the wood away but are left with nothing.*"));
                    from.NonlocalOverheadMessage(MessageType.Regular, from.EmoteHue, true, String.Format("*{0} stops carving, but is left with nothing useful.*", from.Name));
                    //from.Say(true, "*stops carving, but is left with nothing useful.*");
                }
                //from.SendAsciiMessage("You failed to create the item, and some of your materials are lost.");
                //return 1044043; // You failed to create the item, and some of your materials are lost.
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, from.EmoteHue, true, String.Format("*You carve the wood away but are left with nothing.*"));
                    from.NonlocalOverheadMessage(MessageType.Regular, from.EmoteHue, true, String.Format("*{0} stops carving, but is left with nothing useful.*", from.Name));
                    //from.Say(true, "*stops carving, but is left with nothing useful.*");
                }
                    //from.SendAsciiMessage("You failed to create the item, but no materials were lost.");
                    //return 1044157; // You failed to create the item, but no materials were lost.

                from.SpeechHue = OldHue;
            }
            else
            {
                if (item.ItemType == typeof(Arrow))
                    from.SendAsciiMessage("You make some arrows and put them in your backpack.");
                else if (item.ItemType == typeof(Bolt))
                    from.SendAsciiMessage("You make some bolts and put them in your backpack.");
                else if (item.ItemType == typeof(Kindling))
                    from.SendAsciiMessage("You make kindling and put it in your backpack.");
                else if (item.ItemType == typeof(Shaft))
                        from.SendAsciiMessage("You make some shafts and put them in your backpack.");
                else if (item.ItemType == typeof(Bow))
                    from.SendAsciiMessage("You make a bow and put it in your backpack.");
                else if (item.ItemType == typeof(Crossbow))
                    from.SendAsciiMessage("You make a crossbow and put it in your backpack.");
                else if (item.ItemType == typeof(HeavyCrossbow))
                    from.SendAsciiMessage("You make a heavy crossbow and put it in your backpack.");
                else
                    from.SendAsciiMessage("You create the item and put it in your backpack.");

                /*if ( quality == 0 )
                    from.SendAsciiMessage("You were barely able to make this item.  It's quality is below average.");
                    //return 502785; // You were barely able to make this item.  It's quality is below average.
                else if ( makersMark && quality == 2 )
                    from.SendAsciiMessage("You create an exceptional quality item and affix your maker's mark.");
                    //return 1044156; // You create an exceptional quality item and affix your maker's mark.
                else if ( quality == 2 )
                    from.SendAsciiMessage("You create an exceptional quality item.");
                    //return 1044155; // You create an exceptional quality item.
                else
                    from.SendAsciiMessage("You create the item.");
                    return 1044154; // You create the item.*/
            }
            return 500638;
        }
开发者ID:Godkong,项目名称:Origins,代码行数:64,代码来源:DefBowFletching.cs


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