本文整理汇总了C#中Server.Mobiles.BaseCreature.InRange方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCreature.InRange方法的具体用法?C# BaseCreature.InRange怎么用?C# BaseCreature.InRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobiles.BaseCreature
的用法示例。
在下文中一共展示了BaseCreature.InRange方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EndStable
public void EndStable(Mobile from, BaseCreature pet)
{
if (this.Deleted || !from.CheckAlive())
return;
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 is PackLlama || pet is PackHorse || pet is Beetle) && (pet.Backpack != null && pet.Backpack.Items.Count > 0))
{
from.SendLocalizedMessage(1042563); // You need to unload your pet.
}
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(1042565); // You have too many pets in the stables!
}
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);
this.UsesRemaining -= 1;
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!
}
}
}
示例2: 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 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.AccessLevel >= AccessLevel.GameMaster || Banker.WithdrawPackAndBank(from, TypeOfCurrency, StablePrice))
{
if (from is PlayerMobile)
{
((PlayerMobile)from).StablePet(pet, true);
}
SayTo(
from,
"Very well, thy pet is stabled. Thou mayst recover it by saying 'claim' to me. " +
"Thou mayst pay outstanding charges when thy pet is claimed.");
}
else
{
SayTo(from, 502677); // But thou hast not the funds in thy bank account!
}
}
}
示例3: EndStable
public void EndStable( Mobile from, BaseCreature pet )
{
if ( Deleted || !from.CheckAlive() )
return;
if ( !pet.Controlled || pet.ControlMaster != from )
{
Say( 1042562 ); // You do not own that pet!
}
else if ( pet.IsDeadPet )
{
Say( 1049668 ); // Living pets only, please.
}
else if ( pet.Summoned )
{
Say( 502673 ); // I can not stable summoned creatures.
}
else if ( pet.Body.IsHuman )
{
Say( 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) )
{
Say( 1042563 ); // You need to unload your pet.
}
else if ( pet.Combatant != null && pet.InRange( pet.Combatant, 12 ) && pet.Map == pet.Combatant.Map )
{
Say( 1042564 ); // I'm sorry. Your pet seems to be busy.
}
else if ( from.Stabled.Count >= GetMaxStabled( from ) )
{
Say( 1042565 ); // You have too many pets in the stables!
}
else
{
if ( Banker.Withdraw( from, 30 ) )
{
if ( m_Sign != null )
m_Sign.Stone.CityTreasury += 30;
pet.ControlTarget = null;
pet.ControlOrder = OrderType.Stay;
pet.Internalize();
pet.SetControlMaster( null );
pet.SummonMaster = null;
pet.IsStabled = true;
from.Stabled.Add( pet );
Say( 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
{
Say( 502677 ); // But thou hast not the funds in thy bank account!
}
}
}
示例4: GetSecondTarget
/// <summary>
/// Used for second Provocation target.
/// </summary>
/// <param name="first"></param>
/// <returns></returns>
public virtual Mobile GetSecondTarget(BaseCreature first)
{
if (first == null)
return null;
int range = BaseInstrument.GetBardRange(this, SkillName.Provocation);
IPooledEnumerable eable = this.Map.GetMobilesInRange(Location, range);
List<Mobile> possibles = new List<Mobile>();
foreach (Mobile m in eable)
{
if (m != first && m != this && first.InRange(m.Location, range))
{
if (this.CanBeHarmful(m, false) && first.CanBeHarmful(m, false))
possibles.Add(m);
}
}
eable.Free();
Mobile t = null;
if (possibles.Count > 0)
t = possibles[Utility.Random(possibles.Count)];
possibles.Clear();
possibles.TrimExcess();
return t;
}
示例5: 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 if ((from.Backpack != null && from.Backpack.ConsumeTotal(typeof(Gold), 30)) || Banker.Withdraw(from, 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 = 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!
}
}