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


C# Mobile.SendSound方法代码示例

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


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

示例1: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			from.CloseGump(typeof(WebstoneGump));
			from.SendSound (1224);// 1224= click noise
			from.SendGump( new WebstoneGump() );
			from.SendSound (240);
		}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:7,代码来源:WebStone.cs

示例2: SendSound

		public virtual void SendSound(Mobile m, int soundID)
		{
			if (Options.Sounds.Enabled && m != null && !m.Deleted && soundID > 0)
			{
				m.SendSound(soundID);
			}
		}
开发者ID:jasegiffin,项目名称:JustUO,代码行数:7,代码来源:Battle_Sounds.cs

示例3: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack))
            {
                if (Amount > 1)
                {
                    Container pack = from.Backpack;

                    if(pack != null)
                    {
                        Matches match = new Matches();

                        if (pack.CheckHold(from, match, true))
                        {
                            pack.DropItem(match);
                            this.Amount--;

                            match.ItemID = 2578;
                            from.SendSound(0x047);
                            match.IsLight = true;
                        }
                        else
                            match.Delete();
                    }
                }
                else if (!m_IsLight)
                {
                    new InternalTimer(this);
                    from.SendLocalizedMessage(1116114); //You ignite the match.

                    ItemID = 2578;
                    from.SendSound(0x047);
                    m_IsLight = true;
                }
                else
                {
                    from.Target = new InternalTarget(this);
                    from.SendLocalizedMessage(1116113); //Target the cannon whose fuse you wish to light.
                }
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:41,代码来源:Matches.cs

示例4: OnDragDropInto

        public override bool OnDragDropInto( Mobile from, Item item, Point3D p, byte gridloc )
        {
            if ( !CheckHold( from, item, true, true ) )
                return false;

            var house = HousingHelper.FindHouseAt( this );

            if ( house != null && house.IsLockedDown( this ) )
            {
                if ( item is VendorRentalContract || ( item is Container && ( (Container) item ).FindItemByType( typeof( VendorRentalContract ) ) != null ) )
                {
                    from.SendLocalizedMessage( 1062492 ); // You cannot place a rental contract in a locked down container.
                    return false;
                }

                if ( !house.LockDown( from, item, false ) )
                    return false;
            }

            item.Location = new Point3D( p.X, p.Y, 0 );
            item.SetGridLocation( gridloc, this );
            AddItem( item );

            from.SendSound( GetDroppedSound( item ), GetWorldLocation() );

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

示例5: OnDragDrop

		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			if ( dropped is LargeBOD || dropped is SmallBOD )
			{
				if ( !IsChildOf( from.Backpack ) )
				{
					from.SendLocalizedMessage( 1062385 ); // You must have the book in your backpack to add deeds to it.
					return false;
				}
				else if ( !from.Backpack.CheckHold( from, dropped, true, true ) )
					return false;
				else if ( m_Entries.Count < 500 )
				{
					if ( dropped is LargeBOD )
						m_Entries.Add( new BOBLargeEntry( (LargeBOD)dropped ) );
					else if ( dropped is SmallBOD ) // Sanity
						m_Entries.Add( new BOBSmallEntry( (SmallBOD)dropped ) );

					InvalidateProperties();

					if ( m_Entries.Count / 5 > m_ItemCount )
					{
						m_ItemCount++;
						InvalidateItems();
					}

					from.SendSound(0x42, GetWorldLocation());
					from.SendLocalizedMessage( 1062386 ); // Deed added to book.

					if ( from is PlayerMobile )
						from.SendGump( new BOBGump( (PlayerMobile)from, this ) );

					dropped.Delete();

					return true;
				}
				else
				{
					from.SendLocalizedMessage( 1062387 ); // The book is full of deeds.
					return false;
				}
			}

			from.SendLocalizedMessage( 1062388 ); // That is not a bulk order deed.
			return false;
		}
开发者ID:nydehi,项目名称:runuomondains,代码行数:46,代码来源:BulkOrderBook.cs

示例6: CheckSpawn

		public static void CheckSpawn( Mobile killer, Mobile victim ) {
			if ( killer != null && victim != null ) {
				PlayerState ps = PlayerState.Find( victim );

				if ( ps != null ) {
					int chance = ps.Rank.Rank;

					if ( chance > Utility.Random( 100 ) ) {
						int weight = 0;

						foreach ( WeightedItem item in _items ) {
							weight += item.Weight;
						}

						weight = Utility.Random( weight );

						foreach ( WeightedItem item in _items ) {
							if ( weight < item.Weight ) {
								Item obj = item.Construct();

								if ( obj != null ) {
									killer.AddToBackpack( obj );

									killer.SendSound( 1470 );
									killer.LocalOverheadMessage(
										Server.Network.MessageType.Regular, 2119, false,
										"You notice a strange item on the corpse, and decide to pick it up."
									);

									try {
										using ( StreamWriter op = new StreamWriter( "faction-power-items.log", true ) ) {
											op.WriteLine( "{0}\t{1}\t{2}\t{3}", DateTime.UtcNow, killer, victim, obj );
										}
									} catch {
									}
								}

								break;
							} else {
								weight -= item.Weight;
							}
						}
					}
				}
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:46,代码来源:PowerFactionItem.cs

示例7: DoPrayerEffect

        public bool DoPrayerEffect(PlayerMobile from, Mobile target)
        {
            if (target == null || target.Deleted || !target.Alive || target.IsDeadBondedPet)
                return false;
            if (from == null || from.Deleted)
                return false;

            if (!String.IsNullOrEmpty(m_Message))
                target.SendMessage(m_Message);
            target.SendSound(SoundID);
            int offset = m_Intensity + PowerBonus(from);
            switch (m_Effect)
            {
                case PrayerEffect.Strength:
                    {
                        #region Strength

                        string name = String.Format("[Prayer] {0} Offset", m_Effect);

                        StatMod mod = target.GetStatMod(name);

                        //one is negative and the other is positive, so adding up
                        if (mod != null && ((mod.Offset <= 0 && offset > 0) || (offset < 0 && mod.Offset >= 0)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.Str, name, mod.Offset + offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //nothing to replace, just adding
                        else if (mod == null)
                        {
                            target.AddStatMod(new StatMod(StatType.Str, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //replacing the current mod with a larger one
                        else if (mod != null && ((mod.Offset <= 0 && offset < mod.Offset) || (mod.Offset >= 0 && mod.Offset < offset)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.Str, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }

                        return false;
                        #endregion
                    }
                case PrayerEffect.Dexterity:
                    {
                        #region Dexterity
                        string name = String.Format("[Prayer] {0} Offset", m_Effect);

                        StatMod mod = target.GetStatMod(name);

                        //one is negative and the other is positive, so adding up
                        if (mod != null && ((mod.Offset <= 0 && offset > 0) || (offset < 0 && mod.Offset >= 0)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.Dex, name, mod.Offset + offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //nothing to replace, just adding
                        else if (mod == null)
                        {
                            target.AddStatMod(new StatMod(StatType.Dex, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //replacing the current mod with a larger one
                        else if (mod != null && ((mod.Offset <= 0 && offset < mod.Offset) || (mod.Offset >= 0 && mod.Offset < offset)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.Dex, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }

                        return false;
                        #endregion
                    }
                case PrayerEffect.Intelligence:
                    {
                        #region Intelligence

                        string name = String.Format("[Prayer] {0} Offset", m_Effect);

                        StatMod mod = target.GetStatMod(name);

                        //one is negative and the other is positive, so adding up
                        if (mod != null && ((mod.Offset <= 0 && offset > 0) || (offset < 0 && mod.Offset >= 0)))
                        {
                            target.RemoveStatMod(name);
                            target.AddStatMod(new StatMod(StatType.Int, name, mod.Offset + offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //nothing to replace, just adding
                        else if (mod == null)
                        {
                            target.AddStatMod(new StatMod(StatType.Int, name, offset, TimeSpan.FromSeconds(m_Duration)));
                            return true;
                        }
                        //replacing the current mod with a larger one
                        else if (mod != null && ((mod.Offset <= 0 && offset < mod.Offset) || (mod.Offset >= 0 && mod.Offset < offset)))
                        {
//.........这里部分代码省略.........
开发者ID:justdanofficial,项目名称:khaeros,代码行数:101,代码来源:CustomFaithSpell.cs

示例8: OnDragDrop

		public override	bool OnDragDrop( Mobile	from, Item dropped )
		{
			if ( !Movable && !CheckAccess( from	) )
			{
				from.SendMessage("You cannot access	this");	
				return false;
			}

			if ( !(	dropped	is Seed	) )
			{
				from.SendMessage( "You can only	store seeds	in this	box." );
				return	false;
			}
			BaseHouse house	= BaseHouse.FindHouseAt( from );
			int	lockdowns =	0;
			if(house !=null)
				lockdowns =	house.LockDownCount;
			int	seeds =	lockdowns +1;
			
			if(house !=	null &&	!Movable &&	seeds >	house.MaxLockDowns)
			{
				from.SendMessage( "This	would exceed the houses	lockdown limit." );
				return false;	
			}

			int seedcount = SeedCount();
			if(	seedcount > m_maxSeeds )
			{
				from.SendMessage( "This	seed box cannot	hold any more seeds." );
				return false;
			}
			
			
			Seed seed = ( Seed	) dropped;
			int type =	ConvertType( seed.PlantType	);
			int hue = ConvertHue( seed.PlantHue );

			m_counts[ type,	hue	] ++;
			itemcount =	SeedCount()	/5;
			this.TotalItems	= itemcount;

			if (Parent is Container)
			{
				// calling the full version with (-itemcount - 1) prevents double-counting the seedbox
				if (!((Container)Parent).CheckHold(from, this, true, true, (-TotalItems - 1), (int)(-TotalWeight - Weight)))
				{
					m_counts[type, hue]--; // reverse the change to our state
					itemcount = SeedCount() / 5;
					TotalItems = itemcount;
					return false;
				}
			}

			from.SendSound( ((dropped.GetDropSound() != -1) ? dropped.GetDropSound() : 0x42), GetWorldLocation() );

			dropped.Delete();
			InvalidateProperties();
			return true;
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:59,代码来源:SeedBox.cs

示例9: OnDragDrop

        public override bool OnDragDrop( Mobile from, Item dropped )
        {
            if ( !( dropped is BaseBook ) && !( dropped is Runebook )
                || ( dropped is BaseBook && ( (BaseBook)dropped ).Writable ) )
            {
                from.SendMessage( "You may only add runebooks and sealed books to a library." );
                return false;
            }

            if ( !CheckAccess( from ) )
            {
                from.SendMessage( "Only owners and co-owners can add books to a locked-down library." );
                return false;
            }

            BaseHouse house = BaseHouse.FindHouseAt( from );
            int lockdowns = 0;
            if ( house != null )
                lockdowns = house.LockDownCount;
            int maxbooks = lockdowns + 1;

            if ( house != null && maxbooks > house.MaxLockDowns )
            {
                from.SendMessage( "This would exceed the houses lockdown limit." );
                return false;
            }

            if ( this.TotalItems > Max_Books )
            {
                from.SendMessage( "The library is full." );
                return false;
            }
            //add the book everything checks out
            dropped.IsLockedDown = true;
            AddItem( dropped );
            m_Books.Add( dropped );

            from.SendSound( DropSound, GetWorldLocation( ) );

            return true;
        }
开发者ID:zerodowned,项目名称:angelisland,代码行数:41,代码来源:Library.cs

示例10: GetContextMenuEntries

      public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
      	{
      	from.SendSound(1224);// 1224= click noise
 			base.GetContextMenuEntries(from, list);
 			list.Add(new MenuEntry(from, this));
      	}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:6,代码来源:WebStone.cs

示例11: OnCrack

        public virtual void OnCrack(Mobile from)
        {
            Item item;
            from.SendSound(0x3B3);

            if (from.RawStr < Utility.Random(150))
            {
                from.SendMessage("You swing, but fail to crack the rock any further.");
                return;
            }

            switch (Utility.Random(5))
            {
                default:
                case 0: item = new GeodeEast(); break;
                case 1: item = new GeodeSouth(); break;
                case 2: item = new GeodeShardEast(); break;
                case 3: item = new GeodeShardSouth(); break;
                case 4: item = new LavaRock(); break;
            }

            if (item != null)
            {
                from.AddToBackpack(item);
                from.SendMessage("You have split the lava rock!");
                Delete();
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:28,代码来源:LavaFishItems.cs

示例12: verificarFomeSede

        /*
         * Kaltar
         *
         * Reduz a metade dos atributos do jogador se estiver com fome ou sede.
         * As penalidades são comulativas de sede e fome.
         */
        private static void verificarFomeSede(Mobile m)
        {
            if (!m.Alive)
            {
                return;
            }

            string estadoFome = null;
            string estadoSede = null;

            if(m.Hunger < -8) {
                estadoFome = "a beira da morte por fome";
            }
            else if(m.Hunger < -5) {
                estadoFome = "morrendo de fome";
            }
            else if(m.Hunger < 0) {
                estadoFome = "com muita fome";
            }
            else if(m.Hunger < 2) {
                estadoFome = "com fome";
            }

            if(m.Thirst < -8) {
                estadoSede = "a beira da morte por sede";
            }
            else if(m.Thirst < -5) {
                estadoSede = "morrendo de sede";
            }
            else if(m.Thirst < 0) {
                estadoSede = "com muita sede";
            }
            else if(m.Thirst < 2) {
                estadoSede = "com sede";
            }

            if(estadoFome != null || estadoSede != null) {
                m.SendMessage("Você esta {0} e {1}.", (estadoFome != null ? estadoFome : "alimentado"), (estadoSede != null ? estadoSede : "hidratado"));

                if(!m.Female) {
                    m.SendSound(1077); //son de reclamando
                }
                else {
                    m.SendSound(805);  //son de reclamando
                }
            }

            if(m.Thirst < -10) {
                m.Thirst = -10;

                if(m.AccessLevel == AccessLevel.Player) {
                    m.Hits /= 2;
                    m.Mana /= 2;
                    m.Stam /=2;
                }
            }

            if(m.Hunger < -10) {
                m.Hunger = -10;

                if(m.AccessLevel == AccessLevel.Player) {
                    m.Hits /= 2;
                    m.Mana /= 2;
                    m.Stam /=2;
                }
            }
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:73,代码来源:FoodDecay.cs

示例13: HandleDrop

        public virtual bool HandleDrop( Mobile from, Item dropped )
        {
            if (m_Collected >= m_Needed)
            {
                from.SendAsciiMessage("We have received all that we need of that already!  Thanks anyways!");
                return false;
            }

            if (m_Type == null)
            {
                if (CollectionType == null)
                {
                    from.SendAsciiMessage("That does not belong in this collection barrel!");
                    return false;
                }

                try
                {
                    m_Type = ScriptCompiler.FindTypeByName(CollectionType, true);
                }
                catch
                {
                }

                if (m_Type == null)
                {
                    from.SendAsciiMessage("That does not belong in this collection barrel!");
                    return false;
                }
            }

            if (CheckItem(dropped))
            {
                from.SendAsciiMessage("Thank you for your donation to our cause!");
                from.SendSound(GetDroppedSound(dropped), GetWorldLocation());

                m_Collected += dropped.Amount;

                if ( m_Record.ContainsKey( from ) )
                {
                    m_Record[from] += dropped.Amount;
                }
                else
                {
                    m_Record.Add( from, dropped.Amount );
                }

                dropped.Delete();

                return true;
            }
            else
            {
                from.SendAsciiMessage("That does not belong in this collection barrel!");
                return false;
            }
        }
开发者ID:greeduomacro,项目名称:divinity,代码行数:57,代码来源:CollectionBarrel.cs

示例14: OnDragDropInto

		public override bool OnDragDropInto( Mobile from, Item dropped, Point3D point3d )
		{
			
			BaseHouse housefoundation = BaseHouse.FindHouseAt(this);
        	Item item = dropped as Item;

        	if (dropped.Weight + dropped.TotalWeight + this.TotalWeight >= this.MaxWeight)
        	{
        		if (IsLockedDown)
	        		from.SendMessage(38,"Seems to be just a Decoration Mailbox.");

        		if (IsSecure)
        			from.SendMessage(38,"This will be to much weight for the Mailbox to hold.");
        		return false;
        	}

        	if ((housefoundation == null) & (this.PublicCanDrop == true))
        	{
        		from.SendMessage(68,"You put that into the Mailbox.");
        		DropItem( dropped );
        		from.SendSound( GetDroppedSound( item ), GetWorldLocation() );
        		AdjustMailboxFlagUp(this);        		
        		return true;//false for the moment cause of losing bag
        	}
        	else if((housefoundation != null) & (this.IsSecure))
        	{
        		from.SendMessage(68,"You put that into the Mailbox.");
        		DropItem( dropped );
        		from.SendSound( GetDroppedSound( item ), GetWorldLocation() );
        		AdjustMailboxFlagUp(this);
        		return true;//false for the moment cause of losing bag
        	}
        	else
        	{
        		from.SendMessage(38,"You can not do that.");
        		return false;
        	}
		}        
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:38,代码来源:MailBox.cs

示例15: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        	{
        	SecureLevel securelevel = this.m_Level;
        	BaseHouse housefoundation = BaseHouse.FindHouseAt(this);

        	if (from.InRange( this, 2 ))
        		{
        		if ( housefoundation == null )
        			{
        			if (from.AccessLevel >= AccessLevel.Counselor || this.PublicCanOpen == true )
        				{
        				if (from.AccessLevel >= AccessLevel.Counselor)
        				{//if a GMs opens
        					AdjustMailboxFlagDown(this);
        					from.SendSound (45);
        					base.OnDoubleClick(from);
        					return;
        				}
        				else
        				{//if a regular player opens a public mailbox
        					from.SendMessage("You can look inside the mailbox, but you can not reach anything.");
        					from.SendSound (45);
        					base.OnDoubleClick(from);
        					return;
        				}
        			}
        			else
        			{
        				from.SendMessage("You can not open this mailbox.");
        			}
        		}
        		else if (CheckAccess( from ) && housefoundation.IsFriend( from ) )
        		{
        			base.OnDoubleClick(from);
        			AdjustMailboxFlagDown(this);
					from.SendSound (45);
					}
        		else
        			{
        			from.SendMessage("You are not allowed to open that.");
        			}
        		}
        	else
        		{
        		from.SendLocalizedMessage( 500446 ); // That is too far away.
        		}
        	}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:47,代码来源:MailBox.cs


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