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


C# Mobile.PublicOverheadMessage方法代码示例

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


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

示例1: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( this.GetWorldLocation(), 2 ) || !from.InLOS( this ) )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that
			}
			else if ( Visible && ( ItemID == 4656 || ItemID == 4702 ) && DateTime.Now >= m_NextUse )
			{
				Point3D p = this.GetWorldLocation();

				if ( 1 > Utility.Random( Math.Max( Math.Abs( from.X - p.X ), Math.Abs( from.Y - p.Y ) ) ) )
				{
					Effects.PlaySound( from.Location, from.Map, from.GetHurtSound() );
					from.PublicOverheadMessage( MessageType.Regular, from.SpeechHue, true, "Ouch!" );
					Spells.SpellHelper.Damage( TimeSpan.FromSeconds( 0.5 ), from, Utility.Dice( 2, 10, 5 ) );
				}

				Effects.PlaySound( this.GetWorldLocation(), this.Map, 0x387 );

				Timer.DelayCall( TimeSpan.FromSeconds( 0.25 ), new TimerCallback( Down1 ) );
				Timer.DelayCall( TimeSpan.FromSeconds( 0.50 ), new TimerCallback( Down2 ) );

				Timer.DelayCall( TimeSpan.FromSeconds( 5.00 ), new TimerCallback( BackUp ) );

				m_NextUse = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
			}
		}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:27,代码来源:Guillotine.cs

示例2: OnTarget

		protected override void OnTarget( Mobile from, object targeted ) 
		{ 
			if ( from.Name == null)
			{
				from.SendMessage("Your name is not valid fix it now");
				return;
			}
           
			if ( targeted is Mobile )
			{ 
				Mobile m_target = (Mobile)targeted;
				from.PublicOverheadMessage(MessageType.Emote ,20, true,"*" + from.Name + " Points at*");
            	
				if ( m_target.Name != null)
					m_target.PublicOverheadMessage(MessageType.Emote ,20,true, "*" + m_target.Name + "*");
				else
					m_target.PublicOverheadMessage(MessageType.Emote ,20,true,"*"+ from.Name + " whatever it is!*");
			}
			else if ( targeted is Item ) 
			{ 
				Item m_target = (Item)targeted;
				from.PublicOverheadMessage(MessageType.Emote ,20, true,"*" + from.Name + " Points at*");
				if (m_target.Name != null)
					m_target.PublicOverheadMessage(MessageType.Emote ,20,true, "* " + m_target.Name + "*");
				else
					m_target.PublicOverheadMessage(MessageType.Emote ,20,true, "*Points Here*");
			}
			else 
			{
				IPoint3D p = targeted as IPoint3D; 

				if ( p != null ) 
				{
					Map map = from.Map;
					Item pointer = new Item (8302);
					Point3D m_point = new Point3D(p);
					pointer.MoveToWorld(m_point,map);
					pointer.Movable = false;
					PointTimer p_time = new PointTimer(pointer);
					from.PublicOverheadMessage(MessageType.Emote ,20, true, "*" + from.Name.ToString() + " Points at*");
					pointer.PublicOverheadMessage(MessageType.Emote ,20, true, "*This Spot*" );
				}
				else
				{ 
					from.SendMessage( "Cannot point at this for some reason!" ); 
				} 
			}     
		}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:48,代码来源:Point.cs

示例3: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); //That must be in your pack to use it.
			}
			else
			{
				if( from.Skills.Magery.Base < 85 )
				{
					from.SendMessage( "The scroll bursts into flame in your hands!" );
					from.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Waist );
					from.Damage( Utility.RandomMinMax( 40, 55 ) );
					
					this.Delete();
				}
				else
				{
					from.Frozen = true;
					from.PublicOverheadMessage( MessageType.Spell, from.SpeechHue, true, "In Kal Quas", false );
					
					if( !from.Mounted && from.Body.IsHuman )
						from.Animate( 206, 7, 1, true, false, 0 );
					
					from.BeginTarget( 10, false, TargetFlags.None, new TargetCallback( BlessingOfKhopesh_OnTarget ) );
				}
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:28,代码来源:SpellScrolls.cs

示例4: PokerMessage

		public void PokerMessage( Mobile from, string message )
		{
			from.PublicOverheadMessage( Server.Network.MessageType.Regular, 0x9A, true, message );

			for ( int i = 0; i < m_Players.Count; ++i )
				if ( m_Players[i].Mobile != null )
					m_Players[i].Mobile.SendMessage( 0x9A, "[{0}]: {1}", from.Name, message );
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:8,代码来源:PokerGame.cs

示例5: OnEquip

		public override bool OnEquip( Mobile m ) {
			m.PublicOverheadMessage( Server.Network.MessageType.Regular, m.EmoteHue, true, "*as you place the ring on your hand, you feel a sudden jolt of painful energy course through your body and the ring becomes heavy.*" );
			m.PlaySound( 0x5BF );
			m.Hits = 0;
			m.Stam = 0;

			this.Hue = 1175;
			this.LootType = LootType.Cursed;
			this.Name = "a blackened, jewel-encrusted ring";

			return base.OnEquip( m );
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:12,代码来源:IzkarksRing.cs

示例6: OnDoubleClick

		public override void OnDoubleClick( Mobile from ) 
		{
			switch ( ((Item)this).ItemID )
			{
				case 0x12AB: // Closed north
					if ( Utility.Random( 2 ) == 0 )
						((Item)this).ItemID = 0x12A5;
					else
						((Item)this).ItemID = 0x12A8;
					break;
				case 0x12AC: // Closed east
					if ( Utility.Random( 2 ) == 0 )
						((Item)this).ItemID = 0x12A6;
					else
						((Item)this).ItemID = 0x12A7;
					break;
				case 0x12A5: from.PublicOverheadMessage( MessageType.Regular, 0, false, string.Format( "*{0} draws {1}*", from.Name, GetFortune() ) ); break;
				case 0x12A6: from.PublicOverheadMessage( MessageType.Regular, 0, false, string.Format( "*{0} draws {1}*", from.Name, GetFortune() ) ); break;
				case 0x12A8: from.PublicOverheadMessage( MessageType.Regular, 0, false, string.Format( "*{0} draws {1}*", from.Name, GetFortune() ) ); break;
				case 0x12A7: from.PublicOverheadMessage( MessageType.Regular, 0, false, string.Format( "*{0} draws {1}*", from.Name, GetFortune() ) ); break;
			}
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:22,代码来源:Mtg.cs

示例7: Target

        public void Target(IPoint3D p, Mobile defender)
        {
            Map map = defender.Map;

            if (this.Parent == null || !(this.Parent is Mobile))
                return;

            Mobile attacker = (Mobile)this.Parent;

            if (p is RecallRune)
            {
                RecallRune rune = (RecallRune)p;

                if (rune.Marked)
                {
                    defender.PublicOverheadMessage(Server.Network.MessageType.Regular, defender.SpeechHue, true, "*the earth trembles and time slows, a small rift appearing and drawing you both into its depth*");
                    attacker.SendMessage("You and your combatant have been sent to the rune\'s location.");

                    defender.MoveToWorld(rune.Target, rune.TargetMap);
                    attacker.MoveToWorld(rune.Target, rune.TargetMap);

                    Effects.PlaySound(defender, map, 510);
                    Effects.SendLocationParticles(defender, 0x37C4, 10, 10, 2023);
                    Effects.PlaySound(attacker, map, 510);
                    Effects.SendLocationParticles(attacker, 0x37C4, 10, 10, 2023);
                }
                else
                    attacker.SendMessage("That is not a valid target.");
            }
            else if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
            {
                attacker.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if (Server.Spells.SpellHelper.CheckMulti(new Point3D(p), map))
            {
                attacker.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if (defender.BodyValue != 402 && defender.BodyValue != 403)
            {
                _lastUsed = DateTime.Now;

                Point3D to = new Point3D(p);

                defender.MoveToWorld(to, map);
                defender.ProcessDelta();

                Effects.PlaySound(defender, map, 510);
                Effects.SendLocationParticles(defender, 0x37C4, 10, 10, 2023);
                Effects.SendLocationParticles(EffectItem.Create(to, map, EffectItem.DefaultDuration), 0x37C4, 10, 10, 5023);
            }
        }
开发者ID:greeduomacro,项目名称:hubroot,代码行数:51,代码来源:DaggerOfTheRift.cs

示例8: HungerDecay

		public static void HungerDecay( Mobile m )
		{         
            if ( m != null && m is Player) 
            {
                Adventurer adv = Perk.GetByType<Adventurer>((Player)m);

                if (adv != null) 

                    if (Utility.RandomDouble() < 0.33 && m.Hunger < 20)
                    {
                        m.Hunger += adv.HungerThirstBonus();
                    }                                  
            }

            if ((m != null && m.Alive && m.Hunger >= 1 && m.AccessLevel == AccessLevel.Player) &&
                ((Player)m).Race != Race.Liche && ((Player)m).Race != Race.Elemental)
                m.Hunger --;

			if( m != null && m.Alive )
			{
				if( m.Hunger > 14 )
					return;

				else if( m.Hunger >= 10 && m.Hunger <= 14 )
					m.SendMessage( "You feel somewhat hungry." );

				else if( m.Hunger >= 5 && m.Hunger < 10 )
					m.SendMessage( "You feel quite hungry." );

				else if( m.Hunger > 0 && m.Hunger < 5 )
					m.SendMessage( "You are very hungry, and should find something to eat." );

				else
				{
					m.SendMessage( "Your lack of food is wasting away at your body!" );
					m.Damage( Utility.RandomMinMax(25, 45 ) );
                    m.Stam -= Utility.RandomMinMax(20, 30);
                    m.Mana -= Utility.RandomMinMax(20, 30);
				}

				if( m.Hunger < 10 )
				{
					m.PublicOverheadMessage( MessageType.Regular, m.EmoteHue, true, String.Format( "*{0} stomach growls softly*", m.Female ? "her" : "his" ) );

					if( m.Hidden )
						m.RevealingAction();
				}
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:49,代码来源:FoodDecay.cs

示例9: OnDoubleClick

        public override void OnDoubleClick( Mobile m )
        {
            if ( !m.InRange( this.GetWorldLocation(), 3 ) )
                return;
            if ( m_Controller.Enabled )
                return;

            if ( (m_Wanderer == null || !m_Wanderer.Alive) )
            {
                m_Wanderer = new WandererOfTheVoid();
                m_Wanderer.MoveToWorld( LeverPuzzleController.lr_Enter, Map.Malas );
                m_Wanderer.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1060002, "" ); // I am the guardian of...
                Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( CallBackMessage ) );
            }
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:15,代码来源:LeverPuzzleItems.cs

示例10: SupplyGear

        public static void SupplyGear(Mobile m, CustomGameEventSupplier eventSupplier)
        {
            //Supply the right type of gear
            SupplyType supplyType = eventSupplier.SupplyType;
            if (supplyType == SupplyType.MaxGear)
                SupplyMaxGear(m, eventSupplier.ClothHue, eventSupplier.GearHue, eventSupplier.TeamName, eventSupplier.NewbieAllItems, eventSupplier.StayEquipped, eventSupplier.ConsumeItems);
            else if (supplyType == SupplyType.RegularGear)
                SupplyRegGear(m, eventSupplier.ClothHue, eventSupplier.GearHue, eventSupplier.TeamName, eventSupplier.NewbieAllItems, eventSupplier.StayEquipped, eventSupplier.ConsumeItems);
            else if (supplyType == SupplyType.Custom)
            {
                if (!eventSupplier.CanUseCustomGear)
                    m.PublicOverheadMessage(MessageType.Regular, 906, true, "Custom setup error.");

                //Copy all the items in our bags and make them to event items
                for (int i = 0; i < eventSupplier.ItemContaiers.Length; i++)
                    if (eventSupplier.ItemContaiers[i].Items.Count > 0)
                        SupplyCustomItems(eventSupplier.ItemContaiers[i].Items, m, eventSupplier.ItemContaiers[i].AcceptsType, 
                            eventSupplier.NewbieAllItems, eventSupplier.ClothHue, eventSupplier.GearHue, eventSupplier.TeamName, 
                            eventSupplier.StayEquipped, eventSupplier.ConsumeItems);
            }
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:21,代码来源:SupplySystem.cs

示例11: CheckTriggers


//.........这里部分代码省略.........
				}

				// check to see if we have to continue
				if( needs_player_trigger && !has_player_trigger ) return;

				// if mob property triggering is set then look for the mob and test properties
				if( m_MobPropertyName != null && m_MobPropertyName.Length > 0 &&
					m_MobTriggerName != null && m_MobTriggerName.Length > 0 )
				{
					needs_mob_trigger = true;

					string status_str;

					if( BaseXmlSpawner.TestMobProperty( this, MobTriggerId, m_MobPropertyName, null, out status_str ) )
					{
						has_mob_trigger = true;
					}
					else
						has_mob_trigger = false;

					if( status_str != null && status_str.Length > 0 )
					{
						this.status_str = status_str;
					}
				}

				// check to see if we have to continue
				if( needs_mob_trigger && !has_mob_trigger ) return;

				// if player-carried item triggering is set then test for the presence of an item on the player an in their pack
				if( m_ItemTriggerName != null && m_ItemTriggerName.Length > 0 )
				{
					//enable_triggering = false;
					needs_item_trigger = true;

					has_item_trigger = BaseXmlSpawner.CheckForCarried( m, m_ItemTriggerName );
				}
				// check to see if we have to continue
				if( needs_item_trigger && !has_item_trigger ) return;

				// if player-carried noitem triggering is set then test for the presence of an item in the players pack that should block triggering
				if( m_NoItemTriggerName != null && m_NoItemTriggerName.Length > 0 )
				{
					needs_noitem_trigger = true;

					has_noitem_trigger = BaseXmlSpawner.CheckForNotCarried( m, m_NoItemTriggerName );
				}
				// check to see if we have to continue
				if( needs_noitem_trigger && !has_noitem_trigger ) return;

				// if this was called without being proximity triggered then check to see that the non-movement triggers were enabled.
				if( !hasproximity && !needs_object_trigger && !needs_mob_trigger && !m_ExternalTriggering ) return;

				// all of the necessary trigger conditions have been met so go ahead and trigger
				// after you make the probability check

				if( Utility.RandomDouble() < m_TriggerProbability )
				{

					// play a sound indicating the spawner has been triggered
					if( m_ProximityTriggerSound > 0 && m != null && !m.Deleted )
						m.PlaySound( m_ProximityTriggerSound );

					// display the trigger message
					if( m_ProximityTriggerMessage != null && m_ProximityTriggerMessage.Length > 0 && m != null && !m.Deleted )
						m.PublicOverheadMessage( MessageType.Regular, 0x3B2, true, m_ProximityTriggerMessage );

					// enable spawning at the next ontick
					// this will also start the refractory timer and send the triggering indicators
					ProximityActivated = true;

					// keep track of who triggered this
					m_mob_who_triggered = m;

					// keep track of the skill that triggered this
					if( s != null )
					{
						m_skill_that_triggered = s.SkillName;
					}
					else
					{
						m_skill_that_triggered = XmlSpawnerSkillCheck.RegisteredSkill.Invalid;
					}


				}
				else
				{
					m_skipped = true;
					// reset speech triggering if it was set

					m_speechTriggerActivated = false;

					// reset skill triggering if it was set
					m_skillTriggerActivated = false;
					// reset external triggering if it was set
					//this.m_ExternalTrigger = false;
				}
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:101,代码来源:XmlSpawner2.cs

示例12: PublicOverheadMessage

        public static void PublicOverheadMessage( Mobile m, MessageType messageType, int hue, TextDefinition def )
        {
            if ( def == null )
                return;

            if ( def.m_Number > 0 )
                m.PublicOverheadMessage( messageType, hue, def.m_Number );
            else if ( def.m_String != null )
                m.PublicOverheadMessage( messageType, hue, false, def.m_String );
        }
开发者ID:svvota,项目名称:runuo,代码行数:10,代码来源:TextDefinition.cs

示例13: OnDoubleClick

        public override void OnDoubleClick( Mobile from )
        {
            if ( IsLockedDown )
            {
                if ( !from.InRange( this.Location, 2 ) )
                {
                    from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
                    return;
                }

                IHouse house = HousingHelper.FindHouseAt( from );

                if ( house != null )
                {
                    from.PublicOverheadMessage( MessageType.Regular, 0x3B2, 1071131 ); // Praying…

                    if ( m_CooldownList.Contains( from ) )
                    {
                        from.SendLocalizedMessage( 1071145 ); // In order to summon an undead again, you have to wait for at least 90 minutes.
                    }
                    else
                    {
                        Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback(
                            delegate
                            {
                                // Add the skill mod
                                SkillMod mod = new DefaultSkillMod( SkillName.SpiritSpeak, true, 5.0 );
                                mod.ObeyCap = true;
                                from.AddSkillMod( mod );
                                m_Table[from] = new BonusContext( Timer.DelayCall( Duration, new TimerStateCallback<Mobile>( RemoveEffect ), from ), mod );

                                // Set the cooldown
                                m_CooldownList.Add( from );
                                Timer.DelayCall( Cooldown, new TimerCallback( delegate { m_CooldownList.Remove( from ); } ) );

                                // Spawn our undead friend :)
                                SummonUndead( from );

                                from.SendLocalizedMessage( 1071148 ); // You feel a greater sense.
                            } ) );
                    }
                }
                else
                    from.SendLocalizedMessage( 502436 ); // That is not accessible.
            }
            else
                from.SendLocalizedMessage( 502692 ); // This must be in a house and be locked down to work.
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:48,代码来源:AncestralGravestone.cs

示例14: GiveReward

        public void GiveReward(Mobile from, int total)
        {
            int toGive = (total - 200) * 10;
            if (toGive < 0)
                toGive = 0;

            try 
            {
                string message = string.Format("Congratulations! You have scored a grand total of {0} points. You win {1} gold.", total, toGive);
                string overheadMessage = string.Format("Yahtzee! {0} Points", total);
                if (!(toGive == 0))
                    from.AddToBackpack(new Gold(toGive));
                from.SendMessage(50, message);
                from.PublicOverheadMessage(MessageType.Regular, 50, true, overheadMessage, true );
            }
            catch { }
            

        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:19,代码来源:Yahtzee.cs

示例15: OnTarget

        protected override void OnTarget(Mobile from, object target)
        {
            if (!from.CanSee(target))
            {
                from.SendMessage("Target cannot be seen.");
            }
            else if (!from.Alive)
            {
                from.SendMessage("You cannot transform out of your current state.");
            }
            else if (target is Mobile && ((Mobile)target).Alive)
            {
                Mobile t = (Mobile)target;

                if (t == from)
                {
                    from.HueMod = -1;

                    ((Player)from).RawStr -= ((Player)from).StrMod;
                    ((Player)from).RawDex -= ((Player)from).DexMod;
                    ((Player)from).RawInt -= ((Player)from).IntMod;

                    ((Player)from).RaceBody = 58;
                    ((Player)from).AdjustBody();

                    ((Player)from).StrMod = 0;
                    ((Player)from).DexMod = 0;
                    ((Player)from).IntMod = 0;

                    ((Player)from).BodyDamageBonus = 0;

                }

                else if (from.Mounted && !t.Body.IsHuman)
                {
                    from.SendMessage("You cannot transform while mounted.");
                }

                else
                {
                    from.FixedParticles(14089, 0, 30, 0, 1155, 7, EffectLayer.CenterFeet);

                    ((Player)from).RaceBody = t.Body;
                    ((Player)from).AdjustBody();

                    from.HueMod = t.Hue;

                    ((Player)from).RawStr -= ((Player)from).StrMod;
                    ((Player)from).RawDex -= ((Player)from).DexMod;
                    ((Player)from).RawInt -= ((Player)from).IntMod;

                    ((Player)from).StrMod = (int)(t.RawStr / 10);
                    ((Player)from).DexMod = (int)(t.RawDex / 10);
                    ((Player)from).IntMod = (int)(t.RawInt / 10);

                    from.RawStr += ((Player)from).StrMod;
                    from.RawDex += ((Player)from).DexMod;
                    from.RawInt += ((Player)from).IntMod;

                    if (t.Body.IsHuman == false)
                    {
                        ((Player)from).BodyDamageBonus = (int)(t.RawStr / 15);
                    }

                    if (t.Body.IsHuman)
                    {
                        from.HairItemID = t.HairItemID;
                        from.FacialHairItemID = t.FacialHairItemID;
                        from.HairHue = t.HairHue;
                        from.FacialHairHue = t.FacialHairHue;
                    }

                    from.PublicOverheadMessage(MessageType.Regular, from.EmoteHue, false, String.Format("*transforms into the shape of {0}*", t.RawName));

                    hasChanged = true;

                    for (int x = 1; x <= 2; x++)
                    {
                        Item toDisarm = from.FindItemOnLayer(Layer.OneHanded);

                        if (toDisarm == null || !toDisarm.Movable)
                            toDisarm = from.FindItemOnLayer(Layer.TwoHanded);

                        Container pack = from.Backpack;
                        pack.DropItem(toDisarm);
                    }
                }
            }

            else
            {
                from.SendMessage("You cannot take that form.");
            }
        }
开发者ID:ITLongwell,项目名称:Ulmeta,代码行数:94,代码来源:RaceAbilityEntry.cs


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