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


C# Items.BaseInstrument类代码示例

本文整理汇总了C#中Server.Items.BaseInstrument的典型用法代码示例。如果您正苦于以下问题:C# BaseInstrument类的具体用法?C# BaseInstrument怎么用?C# BaseInstrument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: OnPickedInstrument

 public static void OnPickedInstrument( Mobile from, BaseInstrument instrument )
 {
     from.RevealingAction();
     from.SendLocalizedMessage( 1049525 ); // Whom do you wish to calm?
     from.Target = new InternalTarget( from, instrument );
     from.NextSkillTime = DateTime.Now + TimeSpan.FromHours( 6.0 );
 }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:7,代码来源:Peacemaking.cs

示例2: OnPickedInstrument

		public static void OnPickedInstrument(Mobile from, BaseInstrument instrument)
		{
			from.RevealingAction();
			from.SendLocalizedMessage(1049541); // Choose the target for your song of discordance.
			from.Target = new DiscordanceTarget(from, instrument);
			from.NextSkillTime = Core.TickCount + 6000;
		}
开发者ID:Crome696,项目名称:ServUO,代码行数:7,代码来源:Discordance.cs

示例3: OnPickedInstrument

 public static void OnPickedInstrument( Mobile from, BaseInstrument instrument )
 {
     from.RevealingAction();
     from.SendLocalizedMessage( 1049541 ); // Choose the target for your song of discordance.
     from.Target = new DiscordanceTarget( from, instrument );
     from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 6.0 );
 }
开发者ID:Leorgrium,项目名称:runuo,代码行数:7,代码来源:Discordance.cs

示例4: OnPickedInstrument

 public static void OnPickedInstrument( Mobile from, BaseInstrument instrument )
 {
     from.RevealingAction();
     //from.SendLocalizedMessage( 501587 ); // Whom do you wish to incite?
     from.SendAsciiMessage("Whom do you wish to incite?");
     from.Target = new InternalFirstTarget( from, instrument );
 }
开发者ID:Ravenwolfe,项目名称:Origins,代码行数:7,代码来源:Provocation.cs

示例5: OnPickedInstrument

		public static void OnPickedInstrument(Mobile from, BaseInstrument instrument)
		{
			from.RevealingAction();
			from.SendLocalizedMessage(1049525); // Whom do you wish to calm?
			from.Target = new InternalTarget(from, instrument);
			from.NextSkillTime = Core.TickCount + 21600000;
		}
开发者ID:FreeReign,项目名称:JustUO,代码行数:7,代码来源:Peacemaking.cs

示例6: InternalFirstTarget

			public InternalFirstTarget( Mobile from, BaseInstrument instrument ) : base( BaseInstrument.GetBardRange( from, SkillName.Provocation ), false, TargetFlags.None )
			{
				m_Instrument = instrument;

                if (from is PlayerMobile)
                    ((PlayerMobile)from).ResetPlayerAction(this);
			}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:7,代码来源:Provocation.cs

示例7: OnPickedInstrument

        public static void OnPickedInstrument(Mobile from, BaseInstrument instrument)
        {
            from.RevealingAction();
            if (!BaseInstrument.CheckMusicianship(from))
            {
                from.SendLocalizedMessage(500612); // You play poorly, and there is no effect.
                instrument.PlayInstrumentBadly(from);
                instrument.ConsumeUse(from);
            }
            else if (!from.CheckSkill(SkillName.Peacemaking, 0.0, 100.0))
            {
                from.SendLocalizedMessage(500613); // You attempt to calm everyone, but fail.
                instrument.PlayInstrumentBadly(from);
                instrument.ConsumeUse(from);
            }
            else
            {
                instrument.PlayInstrumentWell(from);
                instrument.ConsumeUse(from);

                Map map = from.Map;

                if (map != null)
                {
                    int range = BaseInstrument.GetBardRange(from, SkillName.Peacemaking);

                    bool calmed = false;

                    foreach (Mobile m in from.GetMobilesInRange(range))
                    {
                        #region Dueling
                        if (m.Region is Engines.ConPVP.SafeZone)
                            continue;
                        #endregion

                        BaseCreature bc = m as BaseCreature;
                        if ((bc != null && bc.Uncalmable) || m == from || !m.Alive)
                            continue;

                        calmed = true;

                        m.SendLocalizedMessage(500616); // You hear lovely music, and forget to continue battling!
                        m.Combatant = null;
                        if (!m.Player)
                            m.Warmode = false;

                        if (bc != null && !bc.BardPacified)
                            bc.Pacify(from, DateTime.Now + TimeSpan.FromSeconds(2.5));
                    }

                    if (!calmed)
                        from.SendLocalizedMessage(1049648); // You play hypnotic music, but there is nothing in range for you to calm.
                    else
                        from.SendLocalizedMessage(500615); // You play your hypnotic music, stopping the battle.
                }
            }
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:57,代码来源:Peacemaking.cs

示例8: Deserialize

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			if ( Backpack != null )
				m_Instrument = Backpack.FindItemByType( typeof( BaseInstrument ) ) as BaseInstrument;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:9,代码来源:Bard.cs

示例9: OnPickedInstrument

		public static void OnPickedInstrument( Mobile from, BaseInstrument instrument )
		{
			from.RevealingAction();

      if ( !BaseInstrument.CheckMusicianship( from ) )
      { 
        from.SendLocalizedMessage( 500612 ); // You play poorly, and there is no effect.
        instrument.PlayInstrumentBadly( from );
        instrument.ConsumeUse( from );
      }
      else if ( !from.CheckSkill( SkillName.Peacemaking, 0.0, 100.0 ) )
      {
        from.SendLocalizedMessage( 500613 ); // You attempt to calm everyone, but fail.
        instrument.PlayInstrumentBadly( from );
        instrument.ConsumeUse( from );
      }
      else
      {
        instrument.PlayInstrumentWell( from );
        instrument.ConsumeUse( from );

        Map map = from.Map;

        if ( map != null )
        {
          int range = BaseInstrument.GetBardRange( from, SkillName.Peacemaking );

          bool calmed = false;

          foreach ( Mobile m in from.GetMobilesInRange( range ) )
          {
            if ( (m is BaseCreature && ((BaseCreature)m).Uncalmable) || m == from || !from.CanBeHarmful( m, false ) )
              continue;

            calmed = true;

            m.SendLocalizedMessage( 500616 ); // You hear lovely music, and forget to continue battling!
            m.Combatant = null;
            m.Warmode = false;

            if ( m is BaseCreature && !((BaseCreature)m).BardPacified )
              ((BaseCreature)m).Pacify( from, DateTime.Now + TimeSpan.FromSeconds( 1.0 ) );
          }

          if ( !calmed )
            from.SendLocalizedMessage( 1049648 ); // You play hypnotic music, but there is nothing in range...
          else
            from.SendLocalizedMessage( 500615 ); // You play your hypnotic music, stopping the battle.
            
        }
      }
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:52,代码来源:Peacemaking.cs

示例10: PlayNote

		public static void PlayNote( PlayerMobile from, string note, BaseInstrument instrument )
		{
			try
			{
				//Pix: added sanity checks
				if (from == null || instrument == null) return;

				int it = (int)GetInstrumentType(instrument);
				int nv;

				// If Musicianship is not GM, there is a chance of playing a random note.
				if (!BaseInstrument.CheckMusicianship(from))
				{
					instrument.ConsumeUse(from);
					nv = Utility.Random(25);
					//Console.WriteLine("Random note value chosen: {0}", nv );
				}
				else
				{
					nv = (int)GetNoteValue(note);
				}

				//Pix: added bounds checking
				if (nv >= 0 && it >=0 &&
					nv < NoteSounds.Length && it < NoteSounds[nv].Length)
				{
					int sound = NoteSounds[nv][it];

					from.PlaySound(sound, true);
				}
			}
			catch (Exception ex)
			{
				Scripts.Commands.LogHelper.LogException(ex);
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:36,代码来源:Music.cs

示例11: InternalSecondTarget

 public InternalSecondTarget( Mobile from, BaseInstrument instrument, BaseCreature creature )
     : base(BaseInstrument.GetBardRange( from, SkillName.Provocation ), false, TargetFlags.None)
 {
     m_Instrument = instrument;
     m_Creature = creature;
 }
开发者ID:Ravenwolfe,项目名称:Origins,代码行数:6,代码来源:Provocation.cs

示例12: DiscordanceTarget

			public DiscordanceTarget( Mobile from, BaseInstrument inst ) : base( BaseInstrument.GetBardRange( from, SkillName.Discordance ), false, TargetFlags.Harmful )
			{
				m_Instrument = inst;

                if (from is PlayerMobile)
                    ((PlayerMobile)from).ResetPlayerAction(this);
			}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:7,代码来源:Discordance.cs

示例13: OnPickedInstrument

        public static void OnPickedInstrument( Mobile from, BaseInstrument instrument )
        {
            //from.RevealingAction();
            //from.SendLocalizedMessage( 1049525 ); // Whom do you wish to calm?
            //from.Target = new InternalTarget( from, instrument );
            //from.NextSkillTime = DateTime.Now + TimeSpan.FromHours( 6.0 );
            from.RevealingAction();

            if ( !instrument.IsChildOf( from.Backpack ) )
            {
                from.SendLocalizedMessage( 1062488 ); // The instrument you are trying to play is no longer in your backpack!
            }
            else
            {
                //m_SetSkillTime = false;
                from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 10.0 );

                if ( !BaseInstrument.CheckMusicianship( from ) )
                {
                    from.SendLocalizedMessage( 500612 ); // You play poorly, and there is no effect.
                    instrument.PlayInstrumentBadly( from );
                    instrument.ConsumeUse( from );
                }
                else if ( !from.CheckSkill( SkillName.Peacemaking, 0.0, 100.0 ) )
                {
                    from.SendLocalizedMessage( 500613 ); // You attempt to calm everyone, but fail.
                    instrument.PlayInstrumentBadly( from );
                    instrument.ConsumeUse( from );
                }
                else
                {
                    from.NextSkillTime = DateTime.Now + TimeSpan.FromSeconds( 5.0 );
                    instrument.PlayInstrumentWell( from );
                    instrument.ConsumeUse( from );

                    Map map = from.Map;

                    if ( map != null )
                    {
                        int range = BaseInstrument.GetBardRange( from, SkillName.Peacemaking );

                        bool calmed = false;

                        foreach ( Mobile m in from.GetMobilesInRange( range ) )
                        {
                            if ( (m is BaseCreature && ((BaseCreature)m).Uncalmable) || m == from || !from.CanBeHarmful( m, false ) )
                                continue;

                            calmed = true;

                            m.SendLocalizedMessage( 500616 ); // You hear lovely music, and forget to continue battling!
                            m.Combatant = null;
                            m.Warmode = false;

                            if ( m is BaseCreature && !((BaseCreature)m).BardPacified )
                                ((BaseCreature)m).Pacify( from, DateTime.Now + TimeSpan.FromSeconds( 1.0 ) );
                        }

                        if ( !calmed )
                            from.SendLocalizedMessage( 1049648 ); // You play hypnotic music, but there is nothing in range for you to calm.
                        else
                            from.SendLocalizedMessage( 500615 ); // You play your hypnotic music, stopping the battle.
                    }
                }
            }
        }
开发者ID:guy489,项目名称:runuot2a,代码行数:66,代码来源:Peacemaking.cs

示例14: SetInstrument

		public static void SetInstrument( Mobile from, BaseInstrument item )
		{
			m_Instruments[from] = item;
		}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:4,代码来源:BaseInstrument.cs

示例15: GetInstrumentType

		public static InstrumentType GetInstrumentType( BaseInstrument instrument )
		{
			// Can't play notes on drums or tamborines
			if ( instrument is Harp ) return InstrumentType.Harp;
			if ( instrument is LapHarp ) return InstrumentType.LapHarp;
			if ( instrument is Lute ) return InstrumentType.Lute;
			else return 0;
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:8,代码来源:Music.cs


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