本文整理汇总了C#中Server.Mobile.FindItemOnLayer方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.FindItemOnLayer方法的具体用法?C# Mobile.FindItemOnLayer怎么用?C# Mobile.FindItemOnLayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Mobile
的用法示例。
在下文中一共展示了Mobile.FindItemOnLayer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1040019 ); // The bola must be in your pack to use it.
}
else if ( !from.CanBeginAction( typeof( Bola ) ) )
{
from.SendLocalizedMessage( 1049624 ); // You have to wait a few moments before you can use another bola!
}
else if ( from.Target is BolaTarget )
{
from.SendLocalizedMessage( 1049631 ); // This bola is already being used.
}
else if ( from.FindItemOnLayer( Layer.OneHanded ) != null || from.FindItemOnLayer( Layer.TwoHanded ) != null )
{
from.SendLocalizedMessage( 1040015 ); // Your hands must be free to use this
}
else if ( from.Mounted )
{
from.SendLocalizedMessage( 1040016 ); // You cannot use this while riding a mount
}
else
{
from.Target = new BolaTarget( this );
from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...*
from.NonlocalOverheadMessage( MessageType.Emote, 0x3B2, 1049633, from.Name ); // ~1_NAME~ begins to menacingly swing a bola...
}
}
示例2: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if( from.Mounted )
{
from.SendMessage( "You cannot harvest crops while mounted." );
}
else
{
Item oneHanded = from.FindItemOnLayer( Layer.OneHanded );
Item twoHanded = from.FindItemOnLayer( Layer.TwoHanded );
if( oneHanded != null && oneHanded is Server.Items.BaseAxe )
{
Chop( from );
}
else if( twoHanded != null && twoHanded is Server.Items.BaseAxe )
{
Chop( from );
}
else
{
from.SendMessage( "You need an axe to cut down this sapling!" );
}
}
}
示例3: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( !from.InRange( this.GetWorldLocation(), 1 ) )
{
from.SendLocalizedMessage( 502138 ); // That is too far away for you to use
return;
}
else if ( from != m_Caster )
{
// from.SendLocalizedMessage( ); //
return;
}
BaseWeapon weapon = from.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon;
if ( weapon == null )
weapon = from.FindItemOnLayer( Layer.TwoHanded ) as BaseWeapon;
if ( weapon != null )
{
from.SendLocalizedMessage( 1080116 ); // You must have a free hand to use a Healing Stone.
}
else if ( from.BeginAction( typeof( BaseHealPotion ) ) )
{
from.Heal( Utility.RandomMinMax( BasePotion.Scale( from, 13 ) , BasePotion.Scale( from, 16 ) ) );
this.Consume();
Timer.DelayCall( TimeSpan.FromSeconds( 8.0 ), new TimerStateCallback( ReleaseHealLock ), from );
}
else
from.SendLocalizedMessage( 1095172 ); // You must wait a few seconds before using another Healing Stone.
}
示例4: OnDamage
public override void OnDamage( int amount, Mobile from, bool willKill )
{
base.OnDamage( amount, from, willKill );
if( from == null || !from.Alive || from.Map != this.Map )
return;
Item i = from.FindItemOnLayer( Layer.FirstValid );
Item ii = from.FindItemOnLayer( Layer.TwoHanded );
if( i != null && i is BaseWeapon )
{
if( i is BaseRanged )
{
if( 0.40 > Utility.RandomDouble() )
FireBullets( from );
}
}
else if( ii != null && ii is BaseWeapon )
{
if( ii is BaseRanged )
{
if( 0.45 > Utility.RandomDouble() )
FireBullets( from );
}
}
}
示例5: DisRobe
private static void DisRobe( Mobile m_from, Layer layer )
{
if ( m_from.FindItemOnLayer( layer ) != null )
{
Item item = m_from.FindItemOnLayer( layer );
m_from.PlaceInBackpack( item ); // Place in a bag first?
}
}
示例6: DisRobe
private static void DisRobe( Mobile m_from, Container cont, Layer layer )
{
if ( m_from.FindItemOnLayer( layer ) != null )
{
Item item = m_from.FindItemOnLayer( layer );
cont.AddItem( item );
}
}
示例7: IsEmptyHanded
public static bool IsEmptyHanded( Mobile from )
{
if ( from.FindItemOnLayer( Layer.OneHanded ) != null )
return false;
if ( from.FindItemOnLayer( Layer.TwoHanded ) != null )
return false;
return true;
}
示例8: HasFreeHand
public static bool HasFreeHand( Mobile m )
{
Item handOne = m.FindItemOnLayer( Layer.OneHanded );
Item handTwo = m.FindItemOnLayer( Layer.TwoHanded );
if ( handTwo is BaseWeapon )
handOne = handTwo;
return ( handOne == null || handTwo == null );
}
示例9: UnMorph
public bool UnMorph(Mobile from)
{
if (from.FindItemOnLayer(Layer.OuterTorso) == null || from.FindItemOnLayer(Layer.OuterTorso).Name != "a Shroud of Phasing")
{
this.Hue = 1153;
}
else
{
}
return true;
}
示例10: CheckTool
public static bool CheckTool( Item tool, Mobile m )
{
Item check = m.FindItemOnLayer( Layer.OneHanded );
if ( check is BaseTool && check != tool && !(check is AncientSmithyHammer) )
return false;
check = m.FindItemOnLayer( Layer.TwoHanded );
if ( check is BaseTool && check != tool && !(check is AncientSmithyHammer) )
return false;
return true;
}
示例11: ApplyEffect
public override void ApplyEffect( Mobile to, Mobile source, int intensity, Item itemSource )
{
if ( source != to )
source.DoHarmful( to );
int chance = Utility.RandomMinMax( 1, 8 );
string sundname = "";
BaseArmor sundered = null;
Layer layer = Layer.FirstValid;
switch( chance )
{
case 1: layer = Layer.InnerTorso; sundname = "armour"; break;
case 2: layer = Layer.InnerLegs; sundname = "leggings"; break;
case 3: layer = Layer.TwoHanded; sundname = "shield"; break;
case 4: layer = Layer.Neck; sundname = "gorget"; break;
case 5: layer = Layer.Gloves; sundname = "gauntlets"; break;
case 6: layer = Layer.Helm; sundname = "helm"; break;
case 7: layer = Layer.Arms; sundname = "arm pads"; break;
case 8: layer = Layer.OneHanded; sundname = "weapon"; break;
}
if( to.FindItemOnLayer( layer ) != null && to.FindItemOnLayer( layer ) is BaseArmor )
sundered = to.FindItemOnLayer( layer ) as BaseArmor;
if( sundered != null )
{
int amt = (int)(intensity * Divisor);
if ( amt <= 0 )
amt = 0;
sundered.HitPoints -= Utility.Random( amt ) + 1;
if( sundered.HitPoints < 0 )
{
sundered.MaxHitPoints += sundered.HitPoints;
sundered.HitPoints = 0;
if( sundered.MaxHitPoints < 0 )
{
sundered.Delete();
to.Emote( "*got {0} {1} destroyed by {2}*", to.Female == true ? "her" : "his", sundname, source.Name );
}
}
to.Emote( "*got {0} {1} damaged by {2}*", to.Female == true ? "her" : "his", sundname, source.Name );
}
}
示例12: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
{
if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) )
{
from.SendLocalizedMessage( 501698 ); // You cannot disguise yourself while incognitoed.
}
else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) )
{
from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
}
else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask )
{
from.SendLocalizedMessage( 501605 ); // You are already disguised.
}
else
{
from.BodyMod = ( from.Female ? 184 : 183 );
from.HueMod = 0;
if ( from is PlayerMobile )
((PlayerMobile)from).SavagePaintExpiration = TimeSpan.FromDays( 7.0 );
from.SendLocalizedMessage( 1042537 ); // You now bear the markings of the savage tribe. Your body paint will last about a week or you can remove it with an oil cloth.
Consume();
}
}
else
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
示例13: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
{
if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) )
from.SendLocalizedMessage( 501698 ); // You cannot disguise yourself while incognitoed.
else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) )
from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
else if ( Spells.Necromancy.TransformationSpell.UnderTransformation( from ) )
from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask )
from.SendLocalizedMessage( 501605 ); // You are already disguised.
else
{
/* TODO: Desde el Publish 37 OSI no modifica el body del personaje al
* usar la TribalPaint, para que los elfos se sigan viendo con body
* de elfo. No obstante, no podemos eliminar esto ya que RunUO basa
* todo el código del efecto en si el personaje tiene este body o no.
*/
from.BodyMod = ( from.Female ? 184 : 183 );
from.HueMod = 0;
if ( from is PlayerMobile )
( (PlayerMobile) from ).SavagePaintExpiration = TimeSpan.FromDays( 7.0 );
from.SendLocalizedMessage( 1042537 ); // You now bear the markings of the savage tribe. Your body paint will last about a week or you can remove it with an oil cloth.
Consume();
}
}
else
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
}
示例14: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
// Scriptiz : gestion du double clic pour équipper un objet
if (from.FindItemOnLayer(this.Layer) != this)
{
base.OnDoubleClick(from);
return;
}
if (HarvestSystem == null || Deleted)
return;
Point3D loc = GetWorldLocation();
if (!from.InLOS(loc) || !from.InRange(loc, 2))
{
from.LocalOverheadMessage(Server.Network.MessageType.Regular, 0x3E9, 1019045); // I can't reach that
return;
}
else if (!this.IsAccessibleTo(from))
{
this.PublicOverheadMessage(MessageType.Regular, 0x3E9, 1061637); // You are not allowed to access this.
return;
}
if (!(this.HarvestSystem is Mining))
from.SendLocalizedMessage(1010018); // What do you want to use this item on?
HarvestSystem.BeginHarvesting(from, this);
}
示例15: IsMonk
public static bool IsMonk( Mobile m )
{
if ( m is BaseCreature )
return true;
else
return (m.FindItemOnLayer( Layer.Gloves ) is MonkFists);
}