當前位置: 首頁>>代碼示例>>C#>>正文


C# Server.Mobile類代碼示例

本文整理匯總了C#中Server.Mobile的典型用法代碼示例。如果您正苦於以下問題:C# Mobile類的具體用法?C# Mobile怎麽用?C# Mobile使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Mobile類屬於Server命名空間,在下文中一共展示了Mobile類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: LegalGrappling

        public static bool LegalGrappling( Mobile mob )
        {
            if( mob == null || mob.Deleted || !mob.Alive || mob.Blessed )
                return false;

            return true;
        }
開發者ID:justdanofficial,項目名稱:khaeros,代碼行數:7,代碼來源:GrappleTimer.cs

示例2: InternalTimer

            public InternalTimer(Mobile m)
                : base(TimeSpan.FromMinutes(1.0))
            {
                this.m_Mobile = m;

                this.Priority = TimerPriority.OneSecond;
            }
開發者ID:jasegiffin,項目名稱:JustUO,代碼行數:7,代碼來源:SpellHelper.cs

示例3: MarrowQuestGump

 public MarrowQuestGump( Mobile owner )
     : base(50,50)
 {
     //----------------------------------------------------------------------------------------------------
     AddPage( 0 );AddImageTiled(  54, 33, 369, 400, 2624 );AddAlphaRegion( 54, 33, 369, 400 );AddImageTiled( 416, 39, 44, 389, 203 );
     //--------------------------------------Window size bar--------------------------------------------
     AddImage( 97, 49, 9005 );AddImageTiled( 58, 39, 29, 390, 10460 );AddImageTiled( 412, 37, 31, 389, 10460 );
     AddBackground(85, 30, 329, 408, 3500);
     AddLabel( 140, 60, 0x34, "Marrow's Task" );
     //----------------------/----------------------------------------------/
     AddHtml( 107, 140, 300, 230, " < BODY > " +
     "<BASEFONT COLOR=YELLOW>Hello there, might you be interested in<BR>" +
     "<BASEFONT COLOR=YELLOW>helping me with a little task?<BR>" +
     "<BASEFONT COLOR=YELLOW><BR>" +
     "<BASEFONT COLOR=YELLOW>I am researching a new type of potion<BR>" +
     "<BASEFONT COLOR=YELLOW>and I need some reptile bones to finish<BR>" +
     "<BASEFONT COLOR=YELLOW>my tests.  As you can see though, I am <BR>" +
     "<BASEFONT COLOR=YELLOW>no fighter and cannot get them myself.<BR>" +
     "<BASEFONT COLOR=YELLOW><BR>" +
     "<BASEFONT COLOR=YELLOW>Although my research has made my coin <BR>" +
     "<BASEFONT COLOR=YELLOW>purse rather light these days I will be<BR>" +
     "<BASEFONT COLOR=YELLOW>sure to reward you with something.  I<BR>" +
     "<BASEFONT COLOR=YELLOW>just need 20 bones, that should be <BR>" +
     "<BASEFONT COLOR=YELLOW>plenty.  You should be able to find<BR>" +
     "<BASEFONT COLOR=YELLOW>some right outside of town.  Thanks!<BR>" +
     "</BODY>", false, true);
     //----------------------/----------------------------------------------/
     AddImage( 430, 9, 10441);AddImageTiled( 40, 38, 17, 391, 9263 );AddImage( 6, 25, 10421 );AddImage( 34, 12, 10420 );AddImageTiled( 94, 25, 342, 15, 10304 );AddImageTiled( 40, 427, 415, 16, 10304 );AddImage( -10, 314, 10402 );AddImage( 56, 150, 10411 );AddImage( 155, 120, 2103 );AddImage( 136, 84, 96 );AddButton( 225, 390, 0xF7, 0xF8, 0, GumpButtonType.Reply, 0 );
 }
開發者ID:Ziden,項目名稱:ServUO-EC-Test-Fork,代碼行數:29,代碼來源:MarrowQuestGump.cs

示例4: RewardConfirmGump

        public RewardConfirmGump( Mobile from, RewardEntry entry )
            : base(0, 0)
        {
            m_From = from;
            m_Entry = entry;

            from.CloseGump( typeof( RewardConfirmGump ) );

            AddPage( 0 );

            AddBackground( 10, 10, 500, 300, 2600 );

            AddHtmlLocalized( 30, 55, 300, 35, 1006000, false, false ); // You have selected:

            if ( entry.NameString != null )
                AddHtml( 335, 55, 150, 35, entry.NameString, false, false );
            else
                AddHtmlLocalized( 335, 55, 150, 35, entry.Name, false, false );

            AddHtmlLocalized( 30, 95, 300, 35, 1006001, false, false ); // This will be assigned to this character:
            AddLabel( 335, 95, 0, from.Name );

            AddHtmlLocalized( 35, 160, 450, 90, 1006002, true, true ); // Are you sure you wish to select this reward for this character?  You will not be able to transfer this reward to another character on another shard.  Click 'ok' below to confirm your selection or 'cancel' to go back to the selection screen.

            AddButton( 60, 265, 4005, 4007, 1, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 95, 266, 150, 35, 1006044, false, false ); // Ok

            AddButton( 295, 265, 4017, 4019, 0, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 330, 266, 150, 35, 1006045, false, false ); // Cancel
        }
開發者ID:justdanofficial,項目名稱:khaeros,代碼行數:30,代碼來源:RewardConfirmGump.cs

示例5: OnTarget

        protected override void OnTarget( Mobile from, object targeted )
        {
            try
            {
                if ( m_Type == typeof( Type ) )
                    targeted = targeted.GetType();
                else if ( (m_Type == typeof( BaseAddon ) || m_Type.IsAssignableFrom( typeof( BaseAddon ) )) && targeted is AddonComponent )
                    targeted = ((AddonComponent)targeted).Addon;

                if ( m_Type.IsAssignableFrom( targeted.GetType() ) )
                {
                    Server.Scripts.Commands.CommandLogging.LogChangeProperty( m_Mobile, m_Object, m_Property.Name, targeted.ToString() );
                    m_Property.SetValue( m_Object, targeted, null );
                    PropertiesGump.OnValueChanged( m_Object, m_Property, m_Stack );
                }
                else
                {
                    m_Mobile.SendMessage( "That cannot be assigned to a property of type : {0}", m_Type.Name );
                }
            }
            catch
            {
                m_Mobile.SendMessage( "An exception was caught. The property may not have changed." );
            }
        }
開發者ID:FreeReign,項目名稱:Rebirth-Repack,代碼行數:25,代碼來源:SetObjectTarget.cs

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

示例7: OnCancel

        public override void OnCancel( Mobile from )
        {
            if ( GuildMenu.BadLeader( m_Mobile, m_Guild ) )
                return;

            m_Mobile.SendMenu( new GuildmasterMenu( m_Mobile, m_Guild ) );
        }
開發者ID:Ravenwolfe,項目名稱:Origins,代碼行數:7,代碼來源:GuildNamePrompt.cs

示例8: Data

        public Data(Mobile m)
        {
            c_Mobile = m;

            c_Friends = new ArrayList();
            c_Ignores = new ArrayList();
            c_Messages = new ArrayList();
            c_GIgnores = new ArrayList();
            c_GListens = new ArrayList();
            c_IrcIgnores = new ArrayList();
            c_Sounds = new Hashtable();
            c_PerPage = 10;
            c_SystemC = 0x161;
            c_GlobalMC = 0x26;
            c_GlobalCC = 0x47E;
            c_GlobalGC = 0x44;
            c_GlobalFC = 0x17;
            c_GlobalWC = 0x3;
            c_StaffC = 0x3B4;
            c_MsgC = 0x480;
            c_AwayMsg = "";
            c_Signature = "";
            c_BannedUntil = DateTime.Now;

            if (m.AccessLevel >= AccessLevel.Administrator)
                c_GlobalAccess = true;

            s_Datas[m] = this;

            foreach (Channel c in Channel.Channels)
                if (c.NewChars)
                    c.Join(m);
        }
開發者ID:guy489,項目名稱:runuot2a,代碼行數:33,代碼來源:Data.cs

示例9: AllowHarmful

 public override bool AllowHarmful( Mobile from, Mobile target )
 {
     if (Contains(from.Location) && Contains(target.Location)) // only when both are inside the region
         return true;
     else
         return false;
 }
開發者ID:justdanofficial,項目名稱:khaeros,代碼行數:7,代碼來源:SanctuaryRegion.cs

示例10: GetAccountDuration

        private static string GetAccountDuration( Mobile m )
        {
            Account a = m.Account as Account;

            if ( a == null )
                return "";

            TimeSpan ts = DateTime.Now - a.Created;

            string v;

            if ( Format( ts.TotalDays, "This account is {0} day{1} old.", out v ) )
                return v;

            if ( Format( ts.TotalHours, "This account is {0} hour{1} old.", out v ) )
                return v;

            if ( Format( ts.TotalMinutes, "This account is {0} minute{1} old.", out v ) )
                return v;

            if ( Format( ts.TotalSeconds, "This account is {0} second{1} old.", out v ) )
                return v;

            return "";
        }
開發者ID:FreeReign,項目名稱:Rebirth-Repack,代碼行數:25,代碼來源:Profile.cs

示例11: OnMoveOver

		public override bool OnMoveOver( Mobile m )
		{
			if( !m_AllowCreatures && !m.Player )
				return true;
			
			if( m.Alive)
					{
					m.SendMessage( "You must be dead to use this portal." );
					m.Say("Duh... I am not dead... Hello? Use a Rune book..");
					m.PlaySound( 0x440 );
					return true;
					}
			if( m_TelePets)
				{
				Server.Mobiles.BaseCreature.TeleportPets( m, m_DestLoc, m_DestMap );
				}
				
				m.Say("Have mercy on my soul.");
				World.Broadcast( 32, true, "A Darkening chime is heard throughout the land as Dracula has consumed another victim. May {0} rest in peace.", m.Name );
				m.PlaySound(0x1F7);

				m.MoveToWorld( m_DestLoc, m_DestMap );

				return false;
				
			

		}
開發者ID:greeduomacro,項目名稱:dragonknights-uo,代碼行數:28,代碼來源:DraculasDeadOnlyTeleportalOut.cs

示例12: GetMaxWeight

		public const int OverloadAllowance = 4; // We can be four stones overweight without getting fatigued

		public static int GetMaxWeight( Mobile m )
		{
			//return ((( Core.ML && m.Race == Race.Human) ? 100 : 40 ) + (int)(3.5 * m.Str));
			//Moved to core virtual method for use there

			return m.MaxWeight;
		}
開發者ID:nick12344356,項目名稱:The-Basement,代碼行數:9,代碼來源:WeightOverloading.cs

示例13: StealingTarget

            public StealingTarget( Mobile thief )
                : base(1, false, TargetFlags.None)
            {
                m_Thief = thief;

                AllowNonlocal = true;
            }
開發者ID:justdanofficial,項目名稱:khaeros,代碼行數:7,代碼來源:Stealing.cs

示例14: OnMoveOver

		public override bool OnMoveOver( Mobile m )
		{

			if ( m == null || m.Deleted || m.Backpack == null || m.Backpack.Deleted )
				return true;

			if ( Active && m_itemType != null )
			{
				if ( !Creatures && !m.Player )
					return true;

				m_item = m.Backpack.FindItemByType(m_itemType, true);
				if ( m_item != null )
				{
					StartTeleport(m);
					return false;
				}
				else
				{
					if ( m_Message != null && m != null)
						m.SendMessage(m_Message);
				}


			}
			return true;
		}
開發者ID:kamronbatman,項目名稱:DefianceUO-Pre1.10,代碼行數:27,代碼來源:CheckForItemTeleporter.cs

示例15: OnGotMeleeAttack

		public override void OnGotMeleeAttack( Mobile attacker )
		{
			base.OnGotMeleeAttack( attacker );

			if ( 0.40 >= Utility.RandomDouble() ) // 40% chance to clone itself.
				AddClonedOoze( attacker, 0.25 );
		}
開發者ID:kamronbatman,項目名稱:DefianceUO-Pre1.10,代碼行數:7,代碼來源:ClonedOoze.cs


注:本文中的Server.Mobile類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。