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


C# Mobile.CheckAlive方法代码示例

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


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

示例1: OnVirtueUsed

		public static void OnVirtueUsed( Mobile from )
		{
			if ( !from.CheckAlive() )
				return;

			PlayerMobile protector = from as PlayerMobile;

			if ( protector == null )
				return;

			if ( !VirtueHelper.IsSeeker( protector, VirtueName.Justice ) )
			{
				protector.SendLocalizedMessage( 1049610 ); // You must reach the first path in this virtue to invoke it.
			}
			else if ( !protector.CanBeginAction( typeof( JusticeVirtue ) ) )
			{
				protector.SendLocalizedMessage( 1049370 ); // You must wait a while before offering your protection again.
			}
			else if ( protector.JusticeProtectors.Count > 0 )
			{
				protector.SendLocalizedMessage( 1049542 ); // You cannot protect someone while being protected.
			}
			else if ( protector.Map != Map.Felucca )
			{
				protector.SendLocalizedMessage( 1049372 ); // You cannot use this ability here.
			}
			else
			{
				protector.BeginTarget( 14, false, TargetFlags.None, new TargetCallback( OnVirtueTargeted ) );
				protector.SendLocalizedMessage( 1049366 ); // Choose the player you wish to protect.
			}
		}
开发者ID:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:32,代码来源:Justice.cs

示例2: GetContextMenuEntries

		public override void GetContextMenuEntries( Mobile from, List<ContextMenuEntry> list )
		{
			base.GetContextMenuEntries( from, list );

			if ( from.CheckAlive() && IsChildOf( from.Backpack ) )
				list.Add( new NameBookEntry( from, this ) );
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:7,代码来源:TMapBook.cs

示例3: BeginStable

        public void BeginStable( Mobile from )
        {
            if ( Deleted || !from.CheckAlive() )
                return;

                SayTo( from, true, "Which bunny wouldst thou like to stable here?");

                from.Target = new StableTarget( this );
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:9,代码来源:RabbitHerder.cs

示例4: EndRelease

 public virtual void EndRelease( Mobile from )
 {
     if ( from == null || (!Deleted && Controlled && from == ControlMaster && from.CheckAlive()) )
     {
         Effects.SendLocationParticles( EffectItem.Create( Location, Map, EffectItem.DefaultDuration ), 0x3728, 1, 13, 2100, 3, 5042, 0 );
         PlaySound( 0x201 );
         Delete();
     }
 }
开发者ID:greeduomacro,项目名称:divinity,代码行数:9,代码来源:BaseFamiliar.cs

示例5: BeginRepair

        public void BeginRepair(Mobile from)
        {
            if (Deleted || !from.CheckAlive())
                return;

            SayTo(from, "What do you want me to repair?");

            from.Target = new RepairTarget(this);

        }
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:10,代码来源:RepairingLeatherWorker.cs

示例6: BeginPetSale

      public void BeginPetSale( Mobile from ) 
      { 
         if ( Deleted || !from.CheckAlive() ) 
            return; 

         SayTo( from, "Which one of my reindeer have you found?" ); 

         from.Target = new PetSaleTarget( this ); 
         
      } 
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:10,代码来源:SantaClaus.cs

示例7: ThirstDecay

        public static void ThirstDecay( Mobile m )
        {
            //kaltar
            //if ( m != null && m.Thirst >= 1 )
            //	m.Thirst -= 1;

            #region kaltar
            if ( m != null && m.CheckAlive()) {
                m.Hunger -= 1;
            }
            #endregion
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:12,代码来源:FoodDecay.cs

示例8: ApplyInsuranceChanges

        public static void ApplyInsuranceChanges( Mobile from, ItemInsuranceInfo[] arInfo )
        {
            if ( !from.CheckAlive() )
                return;

            foreach ( ItemInsuranceInfo info in arInfo )
            {
                if ( info.Toggled )
                {
                    Item item = info.Item;

                    if ( !item.IsChildOf( from ) )
                    {
                        from.SendLocalizedMessage( 1060871, String.Empty, 0x23 ); // You can only insure items that you have equipped or that are in your backpack
                    }
                    else if ( item.Insured )
                    {
                        item.Insured = false;
                        from.SendLocalizedMessage( 1060874, String.Empty, 0x35 ); // You cancel the insurance on the item
                    }
                    else
                    {
                        if ( !item.PayedInsurance )
                        {
                            int cost = info.GetCost();

                            if ( Banker.Withdraw( from, cost ) )
                            {
                                from.SendLocalizedMessage( 1060398, cost.ToString() ); // ~1_AMOUNT~ gold has been withdrawn from your bank box.
                                item.PayedInsurance = true;
                            }
                            else
                            {
                                from.SendLocalizedMessage( 1061079, String.Empty, 0x23 ); // You lack the funds to purchase the insurance
                                continue;
                            }
                        }

                        item.Insured = true;
                        from.SendLocalizedMessage( 1060873, String.Empty, 0x23 ); // You have insured the item
                    }
                }
            }
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:44,代码来源:ConfirmInsureGump.cs

示例9: EndStable

		public void EndStable( Mobile from, BaseCreature pet )
		{
			if ( Deleted || !from.CheckAlive() )
				return;

			if ( !pet.Controlled || pet.ControlMaster != from )
			{
				SayTo( from, 1042562 ); // You do not own that pet!
			}
			//Pix: 10/7/2004 - allow dead pets to be stabled.
			//else if ( pet.IsDeadPet )
			//{
			//	SayTo( from, 1049668 ); // Living pets only, please.
			//}
			else if ( pet.Summoned )
			{
				SayTo( from, 502673 ); // I can not stable summoned creatures.
			}
			else if ( pet.IOBFollower ) // Don't stable IOB Bretheren
			{
				SayTo( from, "You can't stable your bretheren!" );
			}
			else if ( pet.Body.IsHuman )
			{
				SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
			}
			else if ( (pet is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0) )
			{
				SayTo( from, 1042563 ); // You need to unload your pet.
			}
			else if ( pet.Combatant != null && pet.InRange( pet.Combatant, 12 ) && pet.Map == pet.Combatant.Map )
			{
				SayTo( from, 1042564 ); // I'm sorry.  Your pet seems to be busy.
			}
			else if ( from.Stabled.Count >= GetMaxStabled( from ) )
			{
				SayTo( from, 1042565 ); // You have too many pets in the stables!
			}
			else
			{
				Container bank = from.BankBox;

				if ( bank != null && bank.ConsumeTotal( typeof( Gold ), 30 ) )
				{
					pet.ControlTarget = null;
					pet.ControlOrder = OrderType.Stay;
					pet.Internalize();

					pet.SetControlMaster( null );
					pet.SummonMaster = null;

					pet.IsStabled = true;
					from.Stabled.Add( pet );

					SayTo( from, 502679 ); // Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. In one real world week, I shall sell it off if it is not claimed!
				}
				else
				{
					SayTo( from, 502677 ); // But thou hast not the funds in thy bank account!
				}
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:62,代码来源:AnimalTrainer.cs

示例10: EndClaimList

		public void EndClaimList( Mobile from, BaseCreature pet )
		{
			if ( pet == null || pet.Deleted || from.Map != this.Map || !from.InRange( this, 14 ) || !from.Stabled.Contains( pet ) || !from.CheckAlive() )
				return;

			if ( (from.Followers + pet.ControlSlots) <= from.FollowersMax )
			{
				pet.SetControlMaster( from );

				if ( pet.Summoned )
					pet.SummonMaster = from;

				pet.ControlTarget = from;
				pet.ControlOrder = OrderType.Follow;

				pet.MoveToWorld( from.Location, from.Map );

				pet.IsStabled = false;
				from.Stabled.Remove( pet );

				SayTo( from, 1042559 ); // Here you go... and good day to you!
			}
			else
			{
				SayTo( from, 1049612, pet.Name ); // ~1_NAME~ remained in the stables because you have too many followers.
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:27,代码来源:AnimalTrainer.cs

示例11: BeginCustomize

        public void BeginCustomize( Mobile m )
        {
            if ( !m.CheckAlive() )
                return;

            RelocateEntities();

            foreach ( Item item in GetItems() )
            {
                item.Location = BanLocation;
            }

            foreach ( Mobile mobile in GetMobiles() )
            {
                if ( mobile != m )
                    mobile.Location = BanLocation;
            }

            DesignContext.Add( m, this );
            m.Send( new BeginHouseCustomization( this ) );

            if ( m.NetState != null )
                SendInfoTo( m.NetState );

            DesignState.SendDetailedInfoTo( m.NetState );
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:26,代码来源:HouseFoundation.cs

示例12: EndConfirmTransfer

		public void EndConfirmTransfer( Mobile from, Mobile to )
		{
			if ( Deleted || !from.CheckAlive() || !IsOwner( from ) )
				return;

			if ( NewVendorSystem && HasPersonalVendors )
			{
				from.SendLocalizedMessage( 1062467 ); // You cannot trade this house while you still have personal vendors inside.
			}
			else if ( DecayLevel == DecayLevel.DemolitionPending )
			{
				from.SendLocalizedMessage( 1005321 ); // This house has been marked for demolition, and it cannot be transferred.
			}
			else if ( from == to )
			{
				from.SendLocalizedMessage( 1005330 ); // You cannot transfer a house to yourself, silly.
			}
			else if ( to.Player )
			{
				if ( BaseHouse.HasAccountHouse( to ) )
				{
					from.SendLocalizedMessage( 501388 ); // You cannot transfer ownership to another house owner or co-owner!
				}
				else if ( CheckTransferPosition( from, to ) )
				{
					NetState fromState = from.NetState, toState = to.NetState;

					if ( fromState != null && toState != null )
					{
						if ( from.HasTrade )
						{
							from.SendLocalizedMessage( 1062071 ); // You cannot trade a house while you have other trades pending.
						}
						else if ( to.HasTrade )
						{
							to.SendLocalizedMessage( 1062071 ); // You cannot trade a house while you have other trades pending.
						}
						else if( !to.Alive )
						{
							// TODO: Check if the message is correct.
							from.SendLocalizedMessage( 1062069 ); // You cannot transfer this house to that person.
						}
						else
						{
							Container c = fromState.AddTrade( toState );

							c.DropItem( new TransferItem( this ) );
						}
					}
				}
			}
			else
			{
				from.SendLocalizedMessage( 501384 ); // Only a player can own a house!
			}
		}
开发者ID:ITLongwell,项目名称:mondains-legacy,代码行数:56,代码来源:BaseHouse.cs

示例13: OnSecureTrade

			public override void OnSecureTrade( Mobile from, Mobile to, Mobile newOwner, bool accepted )
			{
				if ( Deleted )
					return;

				Delete();

				if ( m_House == null || m_House.Deleted || !m_House.IsOwner( from ) || !from.CheckAlive() || !to.CheckAlive() )
					return;
				

				if ( !accepted )
					return;

				from.SendLocalizedMessage( 501338 ); // You have transferred ownership of the house.
				to.SendLocalizedMessage( 501339 ); /* You are now the owner of this house.
													* The house's co-owner, friend, ban, and access lists have been cleared.
													* You should double-check the security settings on any doors and teleporters in the house.
													*/

				m_House.RemoveKeys( from );
				m_House.Owner = to;
				m_House.Bans.Clear();
				m_House.Friends.Clear();
				m_House.CoOwners.Clear();
				m_House.ChangeLocks( to );
				m_House.LastTraded = DateTime.Now;
			}
开发者ID:ITLongwell,项目名称:mondains-legacy,代码行数:28,代码来源:BaseHouse.cs

示例14: VendorSell

        public override void VendorSell( Mobile from )
        {
            if ( !IsActiveBuyer )
                return;

            if ( !from.CheckAlive() )
                return;

            if ( !CheckVendorAccess( from ) )
            {
                Say( 501522 ); //I shall not treat with scum like thee!
                return;
            }

            Container pack = from.Backpack;

            if ( pack != null )
            {
                VendorEntry[] info = (VendorEntry[])m_CustomSellList.ToArray( typeof( VendorEntry ) );

                Hashtable table = new Hashtable();

                foreach ( VendorEntry entry in info )
                {
                    Item[] items = pack.FindItemsByType( entry.Type );

                    foreach ( Item item in items )
                    {
                        if ( item is Container && ((Container)item).Items.Count != 0 )
                            continue;

                        if ( item.IsStandardLoot() && item.Movable )
                            table[item] = new SellItemState( item, entry.Price, item.Name );
                    }
                }

                if ( table.Count > 0 )
                {
                    SendPacksTo( from );

                    from.Send( new VendorSellList( this, table ) );
                }
                else
                {
                    Say( true, "You have nothing I would be interested in." );
                }
            }
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:48,代码来源:Treasurer.cs

示例15: OnSecureTrade

            public override void OnSecureTrade( Mobile from, Mobile to, Mobile newOwner, bool accepted )
            {
                if( Deleted )
                    return;

                Delete();

                if( m_Creature == null || m_Creature.Deleted || m_Creature.ControlMaster != from || !from.CheckAlive() || !to.CheckAlive() )
                    return;

                if( from.Map != m_Creature.Map || !from.InRange( m_Creature, 14 ) )
                    return;

                if( accepted )
                {
                    if( m_Creature.SetControlMaster( to ) )
                    {
                        if( m_Creature.Summoned )
                            m_Creature.SummonMaster = to;

                        m_Creature.ControlTarget = to;
                        m_Creature.ControlOrder = OrderType.Follow;

                        m_Creature.BondingBegin = DateTime.MinValue;
                        m_Creature.OwnerAbandonTime = DateTime.MinValue;
                        m_Creature.IsBonded = false;

                        m_Creature.PlaySound( m_Creature.GetIdleSound() );

                        string args = String.Format( "{0}\t{1}\t{2}", from.Name, m_Creature.Name, to.Name );

                        from.SendLocalizedMessage( 1043253, args ); // You have transferred your pet to ~3_GETTER~.
                        to.SendLocalizedMessage( 1043252, args ); // ~1_NAME~ has transferred the allegiance of ~2_PET_NAME~ to you.
                    }
                }
            }
开发者ID:greeduomacro,项目名称:aediliszeta,代码行数:36,代码来源:BaseAI.cs


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