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


C# BaseCreature.InRange方法代码示例

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


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

示例1: DoAbilityMoltenBreath

        public void DoAbilityMoltenBreath(BaseCreature target, BaseMetaPet pet)
        {
            pet.AIObject.NextMove = DateTime.UtcNow + TimeSpan.FromSeconds(1.0);
            pet.PlaySound(pet.BaseSoundID);
            pet.Animate(12, 5, 1, true, false, 0);

            var queue = new EffectQueue();
            queue.Deferred = false;

            Point3D endpoint = target.Location;
            Point3D[] line = pet.Location.GetLine3D(endpoint, pet.Map);

            if (target.InRange(pet.Location, 10))
            {
                int n = 0;
                foreach (Point3D p in line)
                {
                    n += 20;
                    Point3D p1 = p;
                    queue.Add(
                        new EffectInfo(
                            p,
                            pet.Map,
                            14089,
                            0,
                            10,
                            30,
                            EffectRender.Normal,
                            TimeSpan.FromMilliseconds(n),
                            () =>
                            {
                                foreach (Mobile player in AcquireTargets(pet, p1, 0))
                                {
                                    player.Damage(Level * 5, pet);
                                }
                            }));
                }

                queue.Callback = () =>
                {
                    BaseExplodeEffect e = ExplodeFX.Fire.CreateInstance(
                        endpoint, pet.Map, 2, 0, TimeSpan.FromMilliseconds(1000 - ((10) * 100)), null, () =>
                        {
                            foreach (Mobile mobile in AcquireTargets(pet, endpoint, 2))
                            {
                                mobile.Damage(Level * 3, pet);
                            }
                        });
                    e.Send();
                };


                queue.Process();
                Experience++;

                if (Experience >= NextLevelExperience)
                {
                    LevelUpMoltenBreath(pet.ControlMaster);
                }

                NextUse = DateTime.UtcNow + CoolDown;
            }
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:63,代码来源:MetaSkill.cs

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

示例3: UseBandage

        public static int UseBandage(BaseCreature from, bool healmaster)
        {
            if (from.IsDeadPet)
                return 12;

            var delay = (500 + (50*((120 - from.Dex)/10)))/100;

            if (delay < 3)
                delay = 3;

            if (from.Controlled && from.ControlMaster != null && from.Hits >= (from.Hits/2) && healmaster)
            {
                if (from.InRange(from.ControlMaster, 2) && from.ControlMaster.Alive &&
                    from.ControlMaster.Hits < from.ControlMaster.HitsMax)
                    BandageContext.BeginHeal(from, from.ControlMaster);
            }
            else if (from.Hits < from.HitsMax)
            {
                BandageContext.BeginHeal(from, from);
            }

            return delay + 3;
        }
开发者ID:rokann,项目名称:JustUO,代码行数:23,代码来源:Abilities.cs

示例4: EndStable

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

			if ( pet.Body.IsHuman )
			{
				SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
			}
			else if ( !pet.Controlled )
			{
				SayTo( from, 1048053 ); // You can't stable that!
			}
			else if ( pet.ControlMaster != from )
			{
				SayTo( from, 1042562 ); // You do not own that pet!
			}
			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.Allured )
			{
				SayTo( from, 1048053 ); // You can't stable that!
			}
*/
			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.FindBankNoCreate();

				if ( ( from.Backpack != null && from.Backpack.ConsumeTotal( typeof( Gold ), 30 ) ) || ( 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;
                    pet.StabledBy = from;

					if ( Core.SE )	
						pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy

					from.Stabled.Add( pet );

					SayTo( from, Core.AOS ? 1049677 : 502679 ); // [AOS: Your pet has been stabled.] 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:greeduomacro,项目名称:vivre-uo,代码行数:72,代码来源:AnimalTrainer.cs

示例5: EndPetSale

	//RUFO endfunction


      public void EndPetSale( Mobile from, BaseCreature pet ) 
      { 
         if ( Deleted || !from.CheckAlive() ) 
            return;
            
    if ( !pet.Controlled || pet.ControlMaster != from ) 
		SayTo( from, 1042562 ); // You do not own that pet! 
	else if ( pet.IsDeadPet ) 
		SayTo( from, 1049668 ); // Living pets only, please. 
	else if ( pet.Summoned ) 
		SayTo( from, 502673 ); // I can not PetSale summoned creatures. 
	else if ( pet.Body.IsHuman ) 
		SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
	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 ( pet is Rudolph )
		{
			SellPetForGold( from, pet, 250 );
		    from.AddToBackpack( new ReindeerReward1() );
			this.Say( "Thank you {0}, you have found Rudolph!",from.Name  );
		}
		else if ( pet is Dasher )
		{
			SellPetForGold(from, pet, 250 );
			from.AddToBackpack( new ReindeerReward2() );
			this.Say( "Thank you {0}, you have found Dasher!",from.Name  );
		}
		else if ( pet is Dancer )
		{
			SellPetForGold(from, pet, 250 );
			from.AddToBackpack( new ReindeerReward3() );
			this.Say( "Thank you {0}, you have found Dancer!",from.Name  );
		}
        else if ( pet is Prancer )
        {
			SellPetForGold(from, pet, 250 );
        	from.AddToBackpack( new ReindeerReward4() );
        	this.Say( "Thank you {0}, you have found Prancer!",from.Name  );
        }
        else if ( pet is Vixen )
        {
			SellPetForGold(from, pet, 250 );
        	from.AddToBackpack( new ReindeerReward5() );
        	this.Say( "Thank you {0}, you have found Vixen!",from.Name  );
        }
        else if ( pet is Comet ) 
        {
			SellPetForGold(from, pet, 250 );
        	from.AddToBackpack( new ReindeerReward6() );
        	this.Say( "Thank you {0}, you have found Comet!",from.Name  );
        }
        else if ( pet is Cupid )
        {
			SellPetForGold(from, pet, 250 );
        	from.AddToBackpack( new ReindeerReward7() );
        	this.Say( "Thank you {0}, you have found Cupid!",from.Name  );
        }
        else if ( pet is Donner )
        {
			SellPetForGold(from, pet, 250 );
        	from.AddToBackpack( new ReindeerReward8() );
        	this.Say( "Thank you {0}, you have found Donner!",from.Name  );
        }
		else if ( pet is Blitzen )
		{
			SellPetForGold( from, pet, 250 );
			from.AddToBackpack( new ReindeerReward9() );
			this.Say( "Thank you {0}, you have found Blitzen!",from.Name  );
		}
		else 
		
			this.Say( "{0}, that is not one of my lost reindeer...*sigh*.",from.Name  );
		
	}
			
      }
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:81,代码来源:SantaClaus.cs

示例6: EndStable

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

            if ( !pet.Controlled || pet.ControlMaster != from )
            {
                SayTo( from, true, "You do not own that pet!" ); // You do not own that pet!
            }
            else if ( pet.IsDeadPet )
            {
                SayTo( from, true, "Living pets only, please." ); // Living pets only, please.
            }
            else if ( pet.Summoned )
            {
                SayTo( from, true, "I can not stable summoned creatures." ); // I can not stable summoned creatures.
            }
            else if ( pet.Body.IsHuman )
            {
                SayTo( from, true, "HA HA HA! Sorry, I am not an inn." ); // 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, true, "You need to unload your pet." ); // You need to unload your pet.
            }
            else if ( pet.Combatant != null && pet.InRange( pet.Combatant, 12 ) && pet.Map == pet.Combatant.Map )
            {
                SayTo( from, true, "I'm sorry.  Your pet seems to be busy." ); // I'm sorry.  Your pet seems to be busy.
            }
            else
            {
                Timer.DelayCall( TimeSpan.FromSeconds( 0.5 ), new TimerCallback( pet.Delete ) );
                from.Tag = (Convert(from.Tag) - 1).ToString();
                return;
            }
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:36,代码来源:RabbitHerder.cs

示例7: DoBomber

		public static void DoBomber(BaseCreature mobile, Mobile player)
		{
			Mobile combatant = player;

			if ( combatant == null || combatant.Deleted || combatant.Map != mobile.Map || !mobile.InRange( combatant, 12 ) || !mobile.CanBeHarmful( combatant ) || !mobile.InLOS( combatant ) )
				return;

			if ( DateTime.Now >= m_NextBomb )
			{
				ThrowBomb( combatant, player );

				m_Thrown++;

				if ( 0.75 >= Utility.RandomDouble() && (m_Thrown % 2) == 1 )
					m_NextBomb = DateTime.Now + TimeSpan.FromSeconds( 3.0 );
				else
					m_NextBomb = DateTime.Now + TimeSpan.FromSeconds( 5.0 + (10.0 * Utility.RandomDouble()) );
			}
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:19,代码来源:MobileFeatures.cs

示例8: EndStable

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

            int maxStabled = GetMaxStabled( from );
            int newCount = GetNumStabled( from ) + GetStableSlotsFor( from, pet );

            if ( !pet.Controled || pet.ControlMaster != from )
            {
                SayTo( from, 1042562 ); // You do not own that pet!
            }
            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.Body.IsHuman )
            {
                SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
            }
            else if ( (pet is PackLlama || pet is PackHorse) && (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 ( newCount > maxStabled )
            {
                //SayTo( from, 1042565 ); // You have too many pets in the stables!
                SayTo( from, "There is not enough room in the stable for that!  Claim some of your other animals first." );
            }
            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:FreeReign,项目名称:Rebirth-Repack,代码行数:61,代码来源:AnimalTrainer.cs

示例9: IsProvokable

 public bool IsProvokable( BaseCreature bc )
 {
     return IsTargeteable( bc ) && !bc.BardImmune && !bc.BardPacified && !bc.IsDeadBondedPet && bc.InRange( this, BaseInstrument.GetBardRange( this, SkillName.Provocation ) );
 }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:4,代码来源:BaseBardCreature.cs

示例10: EndStable

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

            else if (!pet.Controlled || pet.ControlMaster != from)
            {
                from.SendLocalizedMessage(1042562); // You do not own that pet!
            }
            else if (pet.IsDeadPet)
            {
                from.SendLocalizedMessage(1049668); // Living pets only, please.
            }
            else if (pet.Summoned)
            {
                from.SendLocalizedMessage(502673); // I can not stable summoned creatures.
            }
            #region Mondain's Legacy
            else if (pet.Allured)
            {
                from.SendLocalizedMessage(1048053); // You can't stable that!
            }
            #endregion
            else if (pet.Body.IsHuman)
            {
                from.SendLocalizedMessage(502672); // HA HA HA! Sorry, I am not an inn.
            }
            else if (pet.Combatant != null && pet.InRange(pet.Combatant, 12) && pet.Map == pet.Combatant.Map)
            {
                from.SendLocalizedMessage(1042564); // I'm sorry.  Your pet seems to be busy.
            }
            else if (from.Stabled.Count >= GetMaxStabled(from))
            {
                from.SendLocalizedMessage(1114325); // There is no more room in your chicken coop!
            }
            else
            {
                Container bank = from.FindBankNoCreate();

                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;

                    if (Core.SE)
                        pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy

                    from.Stabled.Add(pet);

                    from.SendLocalizedMessage(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
                {
                    from.SendLocalizedMessage(502677); // But thou hast not the funds in thy bank account!
                }
            }
        }
开发者ID:suiy187,项目名称:runuocustom,代码行数:63,代码来源:ChickenCoop.cs

示例11: 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!
            }
            else if ( pet.IsDeadPet )
            {
                SayTo( from, 1049668 ); // Living pets only, please.
            }
            else if ( pet.Summoned || pet.VanishTime != DateTime.MinValue )
            {
                SayTo( from, 502673 ); // I can not stable summoned creatures.
            }
            else if ( pet.Body.IsHuman )
            {
                SayTo( from, 502672 ); // HA HA HA! Sorry, I am not an inn.
            }
            else if ( ( pet is WorkHorse || pet is GiantScarab) && (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
            {
                Container bank = from.BankBox;

                if ( bank != null && bank.ConsumeTotal( typeof( Copper ), 1 ) )
                {
                    pet.ControlTarget = null;
                    pet.ControlOrder = OrderType.Stay;
                    pet.StabledOwner = from;
                    pet.Internalize();
                    pet.SetControlMaster( null );
                    pet.SummonMaster = null;
                    pet.IsStabled = true;
                    pet.Loyalty = BaseCreature.MaxLoyalty; // Wonderfully happy
                    this.Stabled.Add( pet );
                    SayTo( from, "Thy pet has been stabled. I will charge you one copper piece every six hours [OOC: two real-life hours]." );
                    SayTo( from, "Here is your ticket. Hand it back to me when you wish to get your animal back, or say just tell me you wish to claim your pets." );
                    StableTicket ticket = new StableTicket();
                    ticket.StabledPet = pet;
                    pet.StableTicket = ticket;

                    if( from.Backpack != null )
                        from.AddToBackpack( ticket );
                }
                else
                {
                    SayTo( from, 502677 ); // But thou hast not the funds in thy bank account!
                }
            }
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:59,代码来源:AnimalTrainer.cs


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