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


C# BaseCreature.PlaySound方法代码示例

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


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

示例1: DoAntiArchery

		//BEGIN ANTI ARCHERY

		public static void DoAntiArchery(BaseCreature mobile, Mobile player)
		{
			if ( mobile.Combatant != null )
				if ( !player.InRange( mobile, 5 ) )
				{                 
					Point3D from = mobile.Location;
					Point3D to = player.Location;

					if ( mobile.Mana >= 10 )
					{
						mobile.Location = to;
						
						mobile.Mana -= 10;

						mobile.Say( "Grrrr" );

						Effects.SendLocationParticles( EffectItem.Create( from, mobile.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
						Effects.SendLocationParticles( EffectItem.Create(   to, mobile.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 5023 );

						mobile.PlaySound( 0x1FE );
					}
				}
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:25,代码来源:MobileFeatures.cs

示例2: LevelUp


//.........这里部分代码省略.........
                player.RawMana += player.StatScale;
            }

            if( player is Dragon )
            {
                if( player.Level > 19 && player.BodyValue == 61 )
                {
                    Gold newloot = new Gold( Utility.RandomMinMax( 1, 3 ) );
                    Container pack = player.Backpack;

                    if( pack != null )
                        pack.DropItem( newloot );

                    player.BodyValue = 59;
                }

                if( player.Level > 38 && player.BodyValue == 59 )
                {
                    Gold newloot = new Gold( Utility.RandomMinMax( 3, 6 ) );
                    Container pack = player.Backpack;

                    if( pack != null )
                        pack.DropItem( newloot );

                    player.BodyValue = 46;
                }
            }

            if( player is Mercenary && ((Mercenary)player).Lives < 8 )
                ((Mercenary)player).Lives++;

            else if( player is BaseBreedableCreature )
            {
                BaseBreedableCreature bbc = player as BaseBreedableCreature;

                if( player.Level % 5 == 0 && bbc.PetEvolution > 0 )
                {
                    bbc.RaiseRandomFeat();
                    bbc.PetEvolution--;
                }

                bbc.UpdateSpeeds();

                if( ((BaseBreedableCreature)player).Lives < (8 + ((BaseBreedableCreature)player).ExtraLives) )
                    ((BaseBreedableCreature)player).Lives++;

                if (player is Serpent)
                {
                    if (player.Level == 40)
                    {
                        if (player is GrassSnake)
                        {
                            ((GrassSnake)player).SetConstrict(true);
                            player.SetDex(player.RawDex / 3);
                            player.BodyValue = 89;
                            player.Emote("*" + player.Name + " has grown more langurous but also more powerful!*");
                            player.PlaySound(0x05E);
                        }
                        else
                        {
                            player.BodyValue = 89;
                            player.Emote("*" + player.Name + " is growing!*");
                            player.PlaySound(0x05E);
                        }
                    }

                    if(player is Viper)
                        ((Viper)player).incSerpentPoison();
                    else if(player is Copperhead)
                        ((Copperhead)player).incSerpentPoison();
                    else if(player is Cobra)
                        ((Cobra)player).incSerpentPoison();
                    else if(player is BlackMamba)
                        ((BlackMamba)player).incSerpentPoison();
                }

                    if (player is WorkHorse)
                    {
                        List<Item> packItems = new List<Item>();
                        foreach (Item item in (player as WorkHorse).Backpack.Items)
                            packItems.Add(item);

                        StrongBackpack newPack = new StrongBackpack((player as WorkHorse).Backpack.MaxWeight + player.StatScale);
                        newPack.MaxItems += Utility.Random(player.StatScale);
                        foreach (Item item in packItems)
                            newPack.AddItem(item);

                        (player as WorkHorse).Backpack.Delete();
                        (player as WorkHorse).AddItem(newPack);
                    }
            }

            else if( player.Controlled && player.Lives < 8 )
                player.Lives++;

            AwardSkill( player, i );

            if( player.Level < 50 )
                CheckLevel( player );
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:101,代码来源:LevelSystem.cs

示例3: DoMoves

		public static void DoMoves( BaseCreature from, Mobile target )
		{
			switch ( Utility.Random( 3 ) )
			{
				case 0:
				
				if ( Utility.Random( 500 ) <= from.RoarAttack )
				{
					int power;
					int mindam;
					int maxdam;

					if ( from.RoarAttack > 3 )
					{
						mindam = from.RoarAttack / 3;
						maxdam = from.RoarAttack / 2;
					}
					else
					{
						mindam = 1;
						maxdam = 3;
					}

					if ( from.RoarAttack > 10 )
						power = from.RoarAttack / 10;
					else
						power = 1;

					ArrayList targets = new ArrayList();

					foreach ( Mobile m in from.GetMobilesInRange( power ) )
					{
						if ( m != from )
							targets.Add( m );
					}
								
					for ( int i = 0; i < targets.Count; ++i )
					{
						Mobile m = (Mobile)targets[i];

						if ( m is BaseCreature )
						{
							BaseCreature bc = (BaseCreature)m;

							bc.BeginFlee( TimeSpan.FromSeconds( 30.0 ) );
							AOS.Damage( target, from, Utility.RandomMinMax( mindam, maxdam ), 20, 20, 20, 20, 20 );
						}
					}	
				}
				
				break;

				case 1:
				
				if ( Utility.Random( 500 ) <= from.PetPoisonAttack )
				{
					Effects.SendLocationParticles( EffectItem.Create( target.Location, target.Map, EffectItem.DefaultDuration ), 0x36B0, 1, 14, 63, 7, 9915, 0 );
					Effects.PlaySound( target.Location, target.Map, 0x229 );

					int mindam;
					int maxdam;

					if ( from.PetPoisonAttack > 3 )
					{
						mindam = from.PetPoisonAttack / 3;
						maxdam = from.PetPoisonAttack / 2;
					}
					else
					{
						mindam = 1;
						maxdam = 3;
					}

					int level = from.PetPoisonAttack / 20;

					if ( level > 5 )
						level = 5;

					target.ApplyPoison( from.ControlMaster, Poison.GetPoison( level ) );
					AOS.Damage( target, from, Utility.RandomMinMax( mindam, maxdam ), 0, 0, 0, 0, 100 );
				}
				
				break;

				case 2:
				
				if ( Utility.Random( 500 ) <= from.FireBreathAttack )
				{
					int mindam;
					int maxdam;

					if ( from.PetPoisonAttack > 3 )
					{
						mindam = from.PetPoisonAttack / 3;
						maxdam = from.PetPoisonAttack / 2;
					}
					else
					{
						mindam = 1;
						maxdam = 3;
//.........这里部分代码省略.........
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:101,代码来源:PetMoves.cs

示例4: OnUsed

        public bool OnUsed( Mobile from, BaseCreature pet )
        {
            if ( pet.GetStatMod( "[Tasty Treat] Str" ) != null )
            {
                from.SendLocalizedMessage( 1113051 ); // Your pet is still enjoying the last tasty treat!
                return false;
            }
            else if ( DateTime.Now < pet.NextTastyTreat )
            {
                from.SendLocalizedMessage( 1113049 ); // Your pet is still recovering from the last tasty treat.
                return false;
            }
            else
            {
                pet.SayTo( from, 1113050 ); // Your pet looks much happier.

                pet.FixedEffect( 0x375A, 10, 15 );
                pet.PlaySound( 0x1E7 );

                AddEffect( pet );

                pet.NextTastyTreat = DateTime.Now + Duration + Cooldown;

                if ( this.Amount > 1 )
                {
                    this.Amount -= 1;
                    from.Backpack.DropItem( this );
                }
                else
                {
                    Delete();
                }

                return true;
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:36,代码来源:TastyTreat.cs

示例5: ActStoned

		public static void ActStoned(BaseCreature mobile)
		{
			mobile.Direction = (Direction)Utility.Random( 8 );
			
			if( s_HumanTalked == false ) 
			{ 
				s_HumanTalked = true; 
				SayStonedRandom( stonedsay, mobile ); 
				mobile.PlaySound( 0x420 );   // coughing
				StonedSpamTimer t = new StonedSpamTimer(); 
				t.Start(); 

				if (1 == Utility.Random(20))
					mobile.PlaySound( mobile.Female ? 794 : 1066 );
			} 	
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:16,代码来源:MobileFeatures.cs

示例6: OnUsed

        public bool OnUsed( Mobile from, BaseCreature pet )
        {
            if ( m_UnderEffect.Contains( pet ) )
            {
                from.SendLocalizedMessage( 1113075 ); // Your pet is still under the effect of armor essence.
                return false;
            }
            else if ( DateTime.Now < pet.NextArmorEssence )
            {
                from.SendLocalizedMessage( 1113076 ); // Your pet is still recovering from the last armor essence it consumed.
                return false;
            }
            else
            {
                pet.SayTo( from, 1113050 ); // Your pet looks much happier.

                pet.FixedEffect( 0x375A, 10, 15 );
                pet.PlaySound( 0x1E7 );

                List<ResistanceMod> mods = new List<ResistanceMod>();

                mods.Add( new ResistanceMod( ResistanceType.Physical, 15 ) );
                mods.Add( new ResistanceMod( ResistanceType.Fire, 10 ) );
                mods.Add( new ResistanceMod( ResistanceType.Cold, 10 ) );
                mods.Add( new ResistanceMod( ResistanceType.Poison, 10 ) );
                mods.Add( new ResistanceMod( ResistanceType.Energy, 10 ) );

                for ( int i = 0; i < mods.Count; i++ )
                    pet.AddResistanceMod( mods[i] );

                m_UnderEffect.Add( pet );

                Timer.DelayCall( Duration, new TimerCallback(
                    delegate
                    {
                        for ( int i = 0; i < mods.Count; i++ )
                            pet.RemoveResistanceMod( mods[i] );

                        m_UnderEffect.Remove( pet );
                    } ) );

                pet.NextArmorEssence = DateTime.Now + Duration + Cooldown;

                Delete();

                return true;
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:48,代码来源:VialOfArmorEssence.cs

示例7: CheckLevel

		public static void CheckLevel( Mobile defender, BaseCreature attacker, int count )
		{
			bool nolevel = false;
			Type typ = attacker.GetType();
			string nam = attacker.Name;

			foreach ( string check in FSATS.NoLevelCreatures )
			{
  				if ( check == nam )
    					nolevel = true;
			}

			if ( nolevel != false )
				return;

			int expgainmin, expgainmax;

			if ( attacker is BaseBioCreature || attacker is BioCreature || attacker is BioMount )
			{
			}
			else if ( defender is BaseCreature )
			{
				if ( attacker.Controlled == true && attacker.ControlMaster != null && attacker.Summoned == false )
				{
					BaseCreature bc = (BaseCreature)defender;

					expgainmin = bc.HitsMax * 25;
					expgainmax = bc.HitsMax * 50;

					int xpgain = Utility.RandomMinMax( expgainmin, expgainmax );
					
					if ( count > 1 )
						xpgain = xpgain / count;

					if ( attacker.Level <= attacker.MaxLevel - 1 )
					{
						attacker.Exp += xpgain;
						attacker.ControlMaster.SendMessage( "Your pet has gained {0} experience points.", xpgain );
					}
			
					int nextLevel = attacker.NextLevel * attacker.Level;

					if ( attacker.Exp >= nextLevel && attacker.Level <= attacker.MaxLevel - 1 )
					{
						DoLevelBonus( attacker );

						Mobile cm = attacker.ControlMaster;
						attacker.Level += 1;
						attacker.Exp = 0;
						attacker.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
						attacker.PlaySound( 503 );
						cm.SendMessage( 38, "Your pets level has increased to {0}.", attacker.Level );

						int gain = Utility.RandomMinMax( 10, 50 );

						attacker.AbilityPoints += gain;

						if ( attacker.ControlMaster != null )
						{
							attacker.ControlMaster.SendMessage( 38, "Your pet {0} has gained some ability points.", gain );
						}

						if ( attacker.Level == 9 )
						{
							attacker.AllowMating = true;
							cm.SendMessage( 1161, "Your pet is now at the level to mate." );
						}
						if ( attacker.Evolves == true )
						{
							if ( attacker.UsesForm1 == true && attacker.F0 == true )
							{
								DoEvoCheck( attacker );

								attacker.BodyValue = attacker.Form1;
								attacker.BaseSoundID = attacker.Sound1;
								attacker.F1 = true;
								attacker.F2 = false;
								attacker.F3 = false;
								attacker.F4 = false;
								attacker.F5 = false;
								attacker.F6 = false;
								attacker.F7 = false;
								attacker.F8 = false;
								attacker.F9 = false;
								attacker.UsesForm1 = false;
								cm.SendMessage( 64, "Your pet has evoloved." );
							}
							else if ( attacker.UsesForm2 == true && attacker.F1 == true )
							{
								DoEvoCheck( attacker );

								attacker.BodyValue = attacker.Form2;
								attacker.BaseSoundID = attacker.Sound2;
								attacker.F1 = false;
								attacker.F2 = true;
								attacker.F3 = false;
								attacker.F4 = false;
								attacker.F5 = false;
								attacker.F6 = false;
								attacker.F7 = false;
//.........这里部分代码省略.........
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:101,代码来源:PetLeveling.cs

示例8: FireBreathAttack

        public static void FireBreathAttack(BaseCreature from, Mobile target)
        {
            if (from.FireBreathAttack < 10 || from == null || target == null)
                return;

            // Scale FireBreath Attack, IE 100 points = 100% of the standard 25% breath scaler, then drop to 75% since it later reburns them.
            // Confused yet? 100 points is equal to 75% of the damage of every other fire breathing monster.
            int damage = (int)((from.Hits * (0.01 * ((28 * from.FireBreathAttack) / 100))) * 0.75);

            from.MovingParticles(target, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
            from.PlaySound(Core.AOS ? 0x15E : 0x44B);
            from.Say("Fire Breath");
            target.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.LeftFoot);
            target.PlaySound(0x208);

            AOS.Damage(target, from, damage, 0, 0, 0, 0, 100);

            new FireBreathDOT(target, from, from.FireBreathAttack).Start();
        }
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:19,代码来源:PetMoves.cs


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