本文整理汇总了C#中Mobile.FindItemOnLayer方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.FindItemOnLayer方法的具体用法?C# Mobile.FindItemOnLayer怎么用?C# Mobile.FindItemOnLayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile
的用法示例。
在下文中一共展示了Mobile.FindItemOnLayer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsEnemy
public override bool IsEnemy( Mobile m )
{
if ( m.Player && m.FindItemOnLayer( Layer.Helm ) is OrcishKinMask )
return false;
return base.IsEnemy( m );
}
示例2: VerifyCast
public static bool VerifyCast( Mobile Caster, bool messages )
{
if( Caster == null ) // Sanity
return false;
BaseWeapon weap = Caster.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon;
if( weap == null )
weap = Caster.FindItemOnLayer( Layer.TwoHanded ) as BaseWeapon;
if ( weap != null ) {
if ( Core.ML && Caster.Skills[weap.Skill].Base < 50 ) {
if ( messages ) {
Caster.SendLocalizedMessage( 1076206 ); // Your skill with your equipped weapon must be 50 or higher to use Evasion.
}
return false;
}
} else if ( !( Caster.FindItemOnLayer( Layer.TwoHanded ) is BaseShield ) ) {
if ( messages ) {
Caster.SendLocalizedMessage( 1062944 ); // You must have a weapon or a shield equipped to use this ability!
}
return false;
}
if ( !Caster.CanBeginAction( typeof( Evasion ) ) ) {
if ( messages ) {
Caster.SendLocalizedMessage( 501789 ); // You must wait before trying again.
}
return false;
}
return true;
}
示例3: OnDoubleClick
public override void OnDoubleClick(Mobile from)
{
if (from.FindItemOnLayer(Layer.OneHanded) is SmithHammer)
{
bool hasForge, hasAnvil;
DefBlacksmithy.CheckAnvilAndForge(from, 4, out hasAnvil, out hasForge);
if (hasForge && hasAnvil)
{
CraftSubRes subRes = CustomCraftMenu.GetSubRes(DefBlacksmithy.CraftSystem, GetType(), null);
int num = CraftResources.GetIndex(m_Resource);
if (subRes == null || !CustomCraftMenu.ResourceInfoList.ContainsKey(subRes))
{
from.SendAsciiMessage("You can't use that.");
return;
}
if (from.Skills[DefBlacksmithy.CraftSystem.MainSkill].Base < subRes.RequiredSkill)
{
from.SendAsciiMessage("You cannot work this strange and unusual metal.");
return;
}
from.SendGump(new CraftGump(from, DefBlacksmithy.CraftSystem, (BaseTool)from.FindItemOnLayer(Layer.OneHanded), null, num));
}
else
from.SendAsciiMessage("You need to be close to a forge and anvil.");
}
else
from.SendAsciiMessage("You need to equip a smith's hammer.");
base.OnDoubleClick(from);
}
示例4: CheckSpellEvasion
public static bool CheckSpellEvasion( Mobile defender )
{
BaseWeapon weap = defender.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon;
if ( weap == null )
weap = defender.FindItemOnLayer( Layer.TwoHanded ) as BaseWeapon;
if ( Core.ML ) {
if ( defender.Spell != null && defender.Spell.IsCasting ) {
return false;
}
if ( weap != null ) {
if ( defender.Skills[weap.Skill].Base < 50 ) {
return false;
}
} else if ( !( defender.FindItemOnLayer( Layer.TwoHanded ) is BaseShield ) ) {
return false;
}
}
if ( IsEvading( defender ) && BaseWeapon.CheckParry( defender ) ) {
defender.Emote( "*evades*" ); // Yes. Eew. Blame OSI.
defender.FixedEffect( 0x37B9, 10, 16 );
return true;
}
return false;
}
示例5: FullSet
public static bool FullSet( Mobile m )
{
return m.FindItemOnLayer( Layer.Gloves ) is HunterGloves
&& m.FindItemOnLayer( Layer.Pants ) is HunterLeggings
&& m.FindItemOnLayer( Layer.Arms ) is HunterSleeves
&& m.FindItemOnLayer( Layer.InnerTorso ) is HunterTunic;
}
示例6: OnHit
public override void OnHit(Mobile attacker, Mobile defender, int damage)
{
if (!this.Validate(attacker))
return;
ClearCurrentAbility(attacker);
Item toDisarm = defender.FindItemOnLayer(Layer.OneHanded);
if (toDisarm == null || !toDisarm.Movable)
toDisarm = defender.FindItemOnLayer(Layer.TwoHanded);
Container pack = defender.Backpack;
if (pack == null || (toDisarm != null && !toDisarm.Movable))
{
attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent.
}
else if (toDisarm == null || toDisarm is BaseShield || toDisarm is Spellbook && !Core.ML)
{
attacker.SendLocalizedMessage(1060849); // Your target is already unarmed!
}
else if (this.CheckMana(attacker, true))
{
attacker.SendLocalizedMessage(1060092); // You disarm their weapon!
defender.SendLocalizedMessage(1060093); // Your weapon has been disarmed!
defender.PlaySound(0x3B9);
defender.FixedParticles(0x37BE, 232, 25, 9948, EffectLayer.LeftHand);
pack.DropItem(toDisarm);
BaseWeapon.BlockEquip(defender, BlockEquipDuration);
}
}
示例7: 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 != this.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.
}
示例8: OnHit
public override void OnHit(Mobile attacker, Mobile defender, int damage)
{
if (!this.Validate(attacker))
return;
ClearCurrentAbility(attacker);
Item toDisrobe = defender.FindItemOnLayer(Layer.InnerTorso);
if (toDisrobe == null || !toDisrobe.Movable)
toDisrobe = defender.FindItemOnLayer(Layer.OuterTorso);
Container pack = defender.Backpack;
if (pack == null || toDisrobe == null || !toDisrobe.Movable)
{
attacker.SendLocalizedMessage(1004001); // You cannot disarm your opponent.
}
else if (this.CheckMana(attacker, true))
{
//attacker.SendLocalizedMessage( 1060092 ); // You disarm their weapon!
defender.SendLocalizedMessage(1062002); // You can no longer wear your ~1_ARMOR~
defender.PlaySound(0x3B9);
//defender.FixedParticles( 0x37BE, 232, 25, 9948, EffectLayer.InnerTorso );
pack.DropItem(toDisrobe);
BaseWeapon.BlockEquip(defender, BlockEquipDuration);
}
}
示例9: FullSet
public static bool FullSet( Mobile m )
{
return m.FindItemOnLayer( Layer.Gloves ) is AssassinGloves
&& m.FindItemOnLayer( Layer.Pants ) is AssassinLeggings
&& m.FindItemOnLayer( Layer.Arms ) is AssassinSleeves
&& m.FindItemOnLayer( Layer.InnerTorso ) is AssassinTunic;
}
示例10: OnEquip
public override bool OnEquip( Mobile from )
{
Item item = from.FindItemOnLayer( Layer.TwoHanded );
if ( item != null && item.GetType() == typeof( MalekisHonor ) )
{
Effects.PlaySound( from.Location, from.Map, 503 );
from.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
Hue = 0x388;
WeaponAttributes.SelfRepair = 3;
Attributes.WeaponSpeed = 35;
MalekisHonor shield = from.FindItemOnLayer( Layer.TwoHanded ) as MalekisHonor;
shield.Hue = 0x388;
shield.Attributes.BonusStr = 10;
shield.Attributes.DefendChance = 10;
shield.ArmorAttributes.SelfRepair = 3;
from.SendLocalizedMessage( 1072391 );
}
this.InvalidateProperties();
return base.OnEquip( from );
}
示例11: FullSet
public static bool FullSet( Mobile m )
{
return m.FindItemOnLayer( Layer.Gloves ) is AcolyteGloves
&& m.FindItemOnLayer( Layer.Pants ) is AcolyteLeggings
&& m.FindItemOnLayer( Layer.Arms ) is AcolyteSleeves
&& m.FindItemOnLayer( Layer.InnerTorso ) is AcolyteTunic;
}
示例12: ApplyBonus
public static void ApplyBonus( Mobile m )
{
ApplyBonus( m.FindItemOnLayer( Layer.Gloves ) as BaseArmor );
ApplyBonus( m.FindItemOnLayer( Layer.Pants ) as BaseArmor );
ApplyBonus( m.FindItemOnLayer( Layer.Arms ) as BaseArmor );
ApplyBonus( m.FindItemOnLayer( Layer.Helm ) as BaseArmor );
ApplyBonus( m.FindItemOnLayer( Layer.InnerTorso ) as BaseArmor );
List<AttributeMod> mods = new List<AttributeMod>();
mods.Add( new AttributeMod( MagicalAttribute.LowerManaCost, 10 ) );
ApplyMods( m, mods );
m_Bonus[m] = mods;
// +10 necromancy (total)
SkillMod skillmod = new DefaultSkillMod( SkillName.Necromancy, true, 10.0 );
skillmod.ObeyCap = true;
m_Table.Add( m, skillmod );
m.AddSkillMod( skillmod );
m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!
Effects.PlaySound( m.Location, m.Map, 503 );
m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
}
示例13: FullSet
public static bool FullSet( Mobile m )
{
return m.FindItemOnLayer( Layer.Gloves ) is DeathsEssenceGloves
&& m.FindItemOnLayer( Layer.Pants ) is DeathsEssenceLeggings
&& m.FindItemOnLayer( Layer.Arms ) is DeathsEssenceSleeves
&& m.FindItemOnLayer( Layer.Helm ) is DeathsEssenceHelm
&& m.FindItemOnLayer( Layer.InnerTorso ) is DeathsEssenceTunic;
}
示例14: FullSet
public static bool FullSet( Mobile m )
{
if ( m == null )
return false;
return m.FindItemOnLayer( Layer.Bracelet ) is NovoBleue
&& m.FindItemOnLayer( Layer.Ring ) is EtoileBleue;
}
示例15: FullSet
public static bool FullSet( Mobile m )
{
if ( m == null )
return false;
return m.FindItemOnLayer( Layer.Cloak ) is Feathernock
&& m.FindItemOnLayer( Layer.TwoHanded ) is Swiftflight;
}