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


C# Item.GetWorldLocation方法代码示例

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


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

示例1: Target

		public void Target( Item item )
		{
			Type t = item.GetType();

			if ( !Caster.CanSee( item ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( !t.IsDefined( typeof( DispellableFieldAttribute ), false ) )
			{
				Caster.SendLocalizedMessage( 1005049 ); // That cannot be dispelled.
			}
			else if ( item is Moongate && !((Moongate)item).Dispellable )
			{
				Caster.SendLocalizedMessage( 1005047 ); // That magic is too chaotic
			}
			else if ( CheckSequence() )
			{
                // Scriptiz : Si pas joueur, on ne perd pas de karma
                if (!(Caster is PlayerMobile)) Caster.Mana += 14;

				SpellHelper.Turn( Caster, item );

				Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
				Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x201 );

				item.Delete();
			}

			FinishSequence();
		}
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:31,代码来源:DispelField.cs

示例2: Target

        public void Target( Item item )
        {
            Type t = item.GetType();

            if ( !Caster.CanSee( item ) )
            {
                Caster.SendAsciiMessage("Target can not be seen."); // Target can not be seen.
            }
            else if ( !t.IsDefined( typeof( DispellableFieldAttribute ), false ) )
            {
                Caster.SendAsciiMessage("That cannot be dispelled."); // That cannot be dispelled.
            }
            /*else if ( item is Moongate && !((Moongate)item).Dispellable )
            {
                Caster.SendLocalizedMessage( 1005047 ); // That magic is too chaotic
            }*/
            else if ( CheckSequence() )
            {
                SpellHelper.Turn( Caster, item );

                Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
                Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x201 );

                item.Delete();
            }

            FinishSequence();
        }
开发者ID:Godkong,项目名称:Origins,代码行数:28,代码来源:DispelField.cs

示例3: DestroyFurniture

        private void DestroyFurniture(Mobile from, Item item)
        {
            if (!from.InRange(item.GetWorldLocation(), 3))
            {
                from.SendLocalizedMessage(500446); // That is too far away.
                return;
            }
            else if (!item.IsChildOf(from.Backpack) && !item.Movable)
            {
                from.SendLocalizedMessage(500462); // You can't destroy that while it is here.
                return;
            }

            from.SendLocalizedMessage(500461); // You destroy the item.
            Effects.PlaySound(item.GetWorldLocation(), item.Map, 0x3B3);

            if (item is Container)
            {
                if (item is TrapableContainer)
                    (item as TrapableContainer).ExecuteTrap(from);

                ((Container)item).Destroy();
            }
            else
            {
                item.Delete();
            }
        }
开发者ID:mcarriere,项目名称:ServUO,代码行数:28,代码来源:HarvestTarget.cs

示例4: Target

		public void Target( Item item )
		{
			Type t = item.GetType();

			if ( !Caster.CanSee( item ) )
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			else if ( !t.IsDefined( typeof( DispellableFieldAttribute ), false ) )
				Caster.SendLocalizedMessage( 1005049 ); // That cannot be dispelled.
			else if ( item is Moongate && !((Moongate)item).Dispellable )
				Caster.SendLocalizedMessage( 1005047 ); // That magic is too chaotic
			else if ( CheckSequence() )
			{
				SpellHelper.Turn( Caster, item );

				if ( item is ILinkDispel )
				{
					Item second = ((ILinkDispel)item).Link;
					Effects.SendLocationParticles( EffectItem.Create( second.Location, second.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
					Effects.PlaySound( second.GetWorldLocation(), second.Map, 0x201 );

					second.Delete();
				}

				Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
				Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x201 );

				item.Delete();
			}

			FinishSequence();
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:31,代码来源:DispelField.cs

示例5: Target

		public void Target( Item item )
		{
			Type t = item.GetType();

			if ( !Caster.CanSee( item ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( !t.IsDefined( typeof( DispellableFieldAttribute ), false ) )
			{
				Caster.SendLocalizedMessage( 1005049 ); // That cannot be dispelled.
			}
			else if ( item is Moongate && !((Moongate)item).Dispellable )
			{
				Caster.SendLocalizedMessage( 1005047 ); // That magic is too chaotic
			}
            else if (SphereSpellTarget is BaseWand)
            {
                BaseWand bw = SphereSpellTarget as BaseWand;
                bw.RechargeWand(Caster, this);
            }
			else if ( CheckSequence() )
			{

				//Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
				Effects.PlaySound( item.GetWorldLocation(), item.Map, Sound );

				item.Delete();
			}

			FinishSequence();
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:32,代码来源:DispelField.cs

示例6: Resurrect

        public static void Resurrect(Mobile m, Item item)
        {
            if (m.Alive)
                return;

            if (!m.InRange(item.GetWorldLocation(), ResurrectRange))
                m.SendLocalizedMessage(500446); // That is too far away.
            else if (m.Map != null && m.Map.CanFit(m.Location, 16, false, false))
            {
                m.CloseGump(typeof(ResurrectGump));
                m.SendGump(new ResurrectGump(m, ResurrectMessage.VirtueShrine));
            }
            else
                m.SendLocalizedMessage(502391); // Thou can not be resurrected there!
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:15,代码来源:Ankhs.cs

示例7: Target

        public void Target(Item item)
        {
            if (!Caster.CanSee(item))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, item);

                Point3D loc = item.GetWorldLocation();

                Effects.PlaySound(loc, item.Map, 0x10);
                IEntity to = new Entity(Serial.Zero, loc, Caster.Map);
                IEntity from = new Entity(Serial.Zero, new Point3D(loc.X, loc.Y, loc.Z + 50), Caster.Map);
                Effects.SendMovingParticles(from, to, 0x376A, 1, 0, false, false, 33, 3, 1263, 1, 0, EffectLayer.Head, 1263);

                item.Delete();
                Caster.SendMessage("You douse the flames!");
            }

            FinishSequence();
        }
开发者ID:evildude807,项目名称:kaltar,代码行数:23,代码来源:GreaterDouseSpell.cs

示例8: OnSpawn

 public virtual void OnSpawn( Item spawner )
 {
     if( spawner != null )
     {
         _spawner = spawner;
         _spawnerHome = spawner.GetWorldLocation();
     }
 }
开发者ID:ITLongwell,项目名称:Ulmeta,代码行数:8,代码来源:BaseCreature.cs

示例9: LockDown

        public bool LockDown(Mobile m, Item item, bool checkIsInside)
        {
            if (!this.IsCoOwner(m) || !this.IsActive)
                return false;

            if (item is BaseAddonContainer || item.Movable && !this.IsSecure(item))
            {
                int amt = 1 + item.TotalItems;

                Item rootItem = item.RootParent as Item;
                Item parentItem = item.Parent as Item;

                if (checkIsInside && item.RootParent is Mobile)
                {
                    m.SendLocalizedMessage(1005525);//That is not in your house
                }
                else if (checkIsInside && !this.IsInside(item.GetWorldLocation(), item.ItemData.Height))
                {
                    m.SendLocalizedMessage(1005525);//That is not in your house
                }
                else if (Ethics.Ethic.IsImbued(item))
                {
                    m.SendLocalizedMessage(1005377);//You cannot lock that down
                }
                else if (this.IsSecure(rootItem))
                {
                    m.SendLocalizedMessage(501737); // You need not lock down items in a secure container.
                }
                else if (parentItem != null && !this.IsLockedDown(parentItem))
                {
                    m.SendLocalizedMessage(501736); // You must lockdown the container first!
                }
                else if (!(item is VendorRentalContract) && (this.IsAosRules ? (!this.CheckAosLockdowns(amt) || !this.CheckAosStorage(amt)) : (this.LockDownCount + amt) > this.m_MaxLockDowns))
                {
                    m.SendLocalizedMessage(1005379);//That would exceed the maximum lock down limit for this house
                }
                else
                {
                    this.SetLockdown(item, true);
                    return true;
                }
            }
            else if (this.m_LockDowns.IndexOf(item) != -1)
            {
                m.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1005526); //That is already locked down
                return true;
            }
            else if (item is HouseSign || item is Static)
            {
                m.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1005526); // This is already locked down.
            }
            else
            {
                m.SendLocalizedMessage(1005377);//You cannot lock that down
            }

            return false;
        }
开发者ID:Crylian,项目名称:ServUO,代码行数:58,代码来源:BaseHouse.cs

示例10: FindHouseAt

        public static BaseHouse FindHouseAt(Item item)
        {
            if (item == null || item.Deleted)
                return null;

            return FindHouseAt(item.GetWorldLocation(), item.Map, item.ItemData.Height);
        }
开发者ID:Crylian,项目名称:ServUO,代码行数:7,代码来源:BaseHouse.cs

示例11: Lift

        public override void Lift(Item item, int amount, out bool rejected, out LRReason reject)
        {
            rejected = true;
            reject = LRReason.Inspecific;

            if (item == null)
                return;

            Mobile from = this;
            NetState state = NetState;

            if (from.AccessLevel >= AccessLevel.GameMaster || DateTime.Now >= from.NextActionTime)
            {
                if (from.CheckAlive())
                {
                    from.DisruptiveAction();

                    if (from.Holding != null)
                    {
                        reject = LRReason.AreHolding;
                    }
                    else if (from.AccessLevel < AccessLevel.GameMaster && !from.InRange(item.GetWorldLocation(), 3))
                    {
                        reject = LRReason.OutOfRange;
                    }
                    else if (!from.CanSee(item) || !from.InLOS(item))
                    {
                        reject = LRReason.OutOfSight;
                    }
                    else if (!item.VerifyMove(from))
                    {
                        reject = LRReason.CannotLift;
                    }
                    else if (!item.IsAccessibleTo(from))
                    {
                        reject = LRReason.CannotLift;
                    }
                    else if (from.AccessLevel == AccessLevel.Player && (from.Frozen || from.Paralyzed))
                    {
                        reject = LRReason.CannotLift;
                    }
                    else if (!item.CheckLift(from, item, ref reject))
                    {
                    }
                    else
                    {
                        object root = item.RootParent;

                        bool canLoot;
                        if (root is Corpse)
                        {
                            Corpse corpse = (Corpse)root;
                            CustomRegion cs = Region.Find(corpse.Location, corpse.Map) as CustomRegion;

                            if (cs != null)
                            {
                                if (AccessLevel >= AccessLevel.GameMaster || (cs.Controller.CanLootOwnCorpse && cs.Controller.CanLootPlayerCorpse))
                                    canLoot = true;
                                else if (corpse.Owner == this)
                                    canLoot = cs.Controller.CanLootOwnCorpse;
                                else if (corpse.Owner is PlayerMobile)
                                    canLoot = cs.Controller.CanLootPlayerCorpse;
                                else
                                    canLoot = cs.Controller.CanLootNPCCorpse;
                            }
                            else
                                canLoot = true;
                        }
                        else
                            canLoot = true;

                        if (!canLoot)
                        {
                            SendAsciiMessage("You can't loot here.");
                            reject = LRReason.Inspecific;
                        }
                        else if (root != null && root is Mobile && !((Mobile) root).CheckNonlocalLift(from, item))
                        {
                            reject = LRReason.TryToSteal;
                        }
                        else if (!from.OnDragLift(item) || !item.OnDragLift(from))
                        {
                            reject = LRReason.Inspecific;
                        }
                        else if (!from.CheckAlive())
                        {
                            reject = LRReason.Inspecific;
                        }
                        else if (item.EventItem && !IsInEvent && AccessLevel < AccessLevel.GameMaster)
                        {
                            SendAsciiMessage("You can't use event items!");
                            reject = LRReason.Inspecific;
                        }
                        else if (!item.EventItem && IsInEvent && AccessLevel < AccessLevel.GameMaster)
                        {
                            SendAsciiMessage("You can only use event items!");
                            reject = LRReason.Inspecific;
                        }
                        else
                        {
//.........这里部分代码省略.........
开发者ID:FreeReign,项目名称:imaginenation,代码行数:101,代码来源:PlayerMobile.cs

示例12: LockDown

        public bool LockDown( Mobile m, Item item, bool checkIsInside )
        {
            if ( !IsCoOwner( m ) || !IsActive )
            {
                return false;
            }

            if ( item.Movable && !IsSecure( item ) )
            {
                int amt = 1 + item.TotalItems;

                Item rootItem = item.RootParent as Item;

                if ( checkIsInside && item.RootParent is Mobile )
                {
                    m.SendLocalizedMessage( 1005525 ); // That is not in your house
                }
                else if ( checkIsInside && !IsInside( item.GetWorldLocation(), item.ItemData.Height ) )
                {
                    m.SendLocalizedMessage( 1005525 ); // That is not in your house
                }
                else if ( IsSecure( rootItem ) )
                {
                    m.SendLocalizedMessage( 501737 ); // You need not lock down items in a secure container.
                }
                else if ( rootItem != null && !IsLockedDown( rootItem ) )
                {
                    m.SendLocalizedMessage( 501736 ); // You must lockdown the container first!
                }
                else if ( !( item is VendorRentalContract ) && ( !CheckAosLockdowns( amt ) || !CheckAosStorage( amt ) ) )
                {
                    m.SendLocalizedMessage( 1005379 ); //That would exceed the maximum lock down limit for this house
                }
                else
                {
                    SetLockdown( item, true );
                    return true;
                }
            }
            else if ( m_LockDowns.IndexOf( item ) != -1 )
            {
                m.SendLocalizedMessage( 1005526 ); //That is already locked down
                return true;
            }
            else
            {
                m.SendLocalizedMessage( 1005377 ); //You cannot lock that down
            }

            return false;
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:51,代码来源:BaseHouse.cs

示例13: TryStealItem

        private static bool TryStealItem(Item toSteal, object root, Mobile m_Thief)
        {
            PlayerMobile pm = null;

            if (root is PlayerMobile)
                pm = (PlayerMobile)root;

            if (m_Thief.AccessLevel == AccessLevel.Counselor)
                m_Thief.SendAsciiMessage("Naughty counselor!");
            else if (m_Thief.AccessLevel > AccessLevel.Counselor)
                m_Thief.SendAsciiMessage("You don't need to steal anything, just take what you want!");
            else if (m_Thief is PlayerMobile && ((PlayerMobile)m_Thief).Young)
                m_Thief.SendAsciiMessage("You cannot steal anything as a young player.");
            else if (!IsEmptyHanded(m_Thief))
                m_Thief.SendLocalizedMessage(1005584); // Both hands must be free to steal.
            else if (root is BaseVendor && ((BaseVendor)root).IsInvulnerable)
                m_Thief.SendLocalizedMessage(1005598); // You can't steal from shopkeepers.
            else if (root is PlayerVendor)
                m_Thief.SendLocalizedMessage(502709); // You can't steal from vendors.
            else if (!m_Thief.CanSee(toSteal))
                m_Thief.SendLocalizedMessage(500237); // Target can not be seen.
            else if (m_Thief.Backpack == null || !m_Thief.Backpack.CheckHold(m_Thief, toSteal, false, true))
                m_Thief.SendLocalizedMessage(1048147); // Your backpack can't hold anything else.
            //ARTEGORDONMOD
            // allow stealing of STEALABLE items on the ground or in containers
            else if ( (toSteal.Parent == null || !toSteal.Movable) && !ItemFlags.GetStealable(toSteal) )
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!
            else if (toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed(root))
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!
            else if (toSteal is Container)
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!
            else if (!m_Thief.InRange(toSteal.GetWorldLocation(), 1))
                m_Thief.SendLocalizedMessage(502703); // You must be standing next to an item to steal it.
            else if (toSteal.Parent is Mobile)
                m_Thief.SendLocalizedMessage(1005585); // You cannot steal items which are equiped.
            else if (root == m_Thief)
                m_Thief.SendLocalizedMessage(502704); // You catch yourself red-handed.
            else if (root is Mobile && ((Mobile)root).AccessLevel > AccessLevel.Player)
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!
            else if (root is Mobile && !m_Thief.CanBeHarmful((Mobile)root))
                m_Thief.SendAsciiMessage("Something prevents you to steal from that mobile");
            /*else if (root is Corpse)
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!*/
            else if (pm != null && !pm.Snoopers.Contains(m_Thief))
                m_Thief.SendAsciiMessage("You waited too long between snooping and stealing the item");
            else if (m_Thief.SolidHueOverride == 2535)
                m_Thief.SendAsciiMessage("You cannot steal while using the pitsrune");
            else if (toSteal.UnStealable)
                m_Thief.SendLocalizedMessage(502710); // You can't steal that!
            else
            {
                double w = toSteal.Weight + toSteal.TotalWeight;

                if (w > 15)
                {
                    m_Thief.SendMessage("That is too heavy to steal.");
                }
                else
                    return true;
            }

            return false;
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:63,代码来源:Stealing.cs

示例14: TryStealItem

            private Item TryStealItem( Item toSteal, ref bool caught )
            {
                Item stolen = null;

                object root = toSteal.RootParent;

                if( !IsEmptyHanded(m_Thief) )
                {
                    m_Thief.SendLocalizedMessage(1005584); // Both hands must be free to steal.
                }
                /*else if( Server.Multis.BaseHouse.FindHouseAt(m_Thief) != null )
                {
                    m_Thief.SendMessage("You can't steal here!");
                }
                else if( root is Mobile && ((Mobile)root).Player && IsInnocentTo(m_Thief, (Mobile)root) && !IsInGuild(m_Thief) )
                {
                    m_Thief.SendLocalizedMessage(1005596); // You must be in the thieves guild to steal from other players.
                }
                else if( SuspendOnMurder && root is Mobile && ((Mobile)root).Player && IsInGuild(m_Thief) && m_Thief.Kills > 0 )
                {
                    m_Thief.SendLocalizedMessage(502706); // You are currently suspended from the thieves guild.
                }*/
                else if( root is BaseVendor && ((BaseVendor)root).IsInvulnerable )
                {
                    m_Thief.SendLocalizedMessage(1005598); // You can't steal from shopkeepers.
                }
                else if( root is PlayerVendor )
                {
                    m_Thief.SendLocalizedMessage(502709); // You can't steal from vendors.
                }
                else if( !m_Thief.CanSee(toSteal) )
                {
                    m_Thief.SendLocalizedMessage(500237); // Target can not be seen.
                }
                else if( m_Thief.Backpack == null || !m_Thief.Backpack.CheckHold(m_Thief, toSteal, false, true) )
                {
                    m_Thief.SendLocalizedMessage(1048147); // Your backpack can't hold anything else.
                }
                else if( toSteal.Parent == null || !toSteal.Movable )
                {
                    m_Thief.SendLocalizedMessage(502710); // You can't steal that!
                }
                else if( toSteal.LootType == LootType.Newbied || toSteal.CheckBlessed(root) )
                {
                    m_Thief.SendLocalizedMessage(502710); // You can't steal that!
                }
                else if( Core.AOS && toSteal is Container )
                {
                    m_Thief.SendLocalizedMessage(502710); // You can't steal that!
                }
                else if( !m_Thief.InRange(toSteal.GetWorldLocation(), 1) )
                {
                    m_Thief.SendLocalizedMessage(502703); // You must be standing next to an item to steal it.
                }
                else if( toSteal.Parent is Mobile )
                {
                    m_Thief.SendLocalizedMessage(1005585); // You cannot steal items which are equiped.
                }
                else if( root == m_Thief )
                {
                    m_Thief.SendLocalizedMessage(502704); // You catch yourself red-handed.
                }
                else if( root is Mobile && ((Mobile)root).AccessLevel > AccessLevel.Player )
                {
                    m_Thief.SendLocalizedMessage(502710); // You can't steal that!
                }
                else if( root is Mobile && !m_Thief.CanBeHarmful((Mobile)root) )
                {
                }
                else if( (root is Mobile && (((Mobile)root).Player || ((Mobile)root).Body.IsHuman)) &&
                    (toSteal is BaseArmor || toSteal is BaseWeapon) )
                {
                    m_Thief.SendLocalizedMessage(502710); //You can't steal that!
                }
                else
                {
                    double w = toSteal.Weight + toSteal.TotalWeight;

                    if( w > 15.0 )
                    {
                        m_Thief.SendMessage("That is too heavy to steal.");
                    }
                    else
                    {
                        if( toSteal.Stackable && toSteal.Amount > 1 )
                        {
                            //ARTEGORDON
                            // fix for zero-weight stackables
                            int maxAmount = toSteal.Amount;
                            if( toSteal.Weight > 0 )
                                maxAmount = (int)((m_Thief.Skills[SkillName.Stealing].Value / 10.0) / toSteal.Weight);

                            if( maxAmount < 1 )
                                maxAmount = 1;
                            else if( maxAmount > toSteal.Amount )
                                maxAmount = toSteal.Amount;

                            int amount = Utility.RandomMinMax(1, maxAmount);

                            if( amount >= toSteal.Amount )
//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:hubroot,代码行数:101,代码来源:Stealing.cs

示例15: TryStealItem

			private Item TryStealItem(Item toSteal, ref bool caught)
			{
				//Close bank box on steal attempt -Adam
				BankBox box = m_Thief.FindBankNoCreate();

				if (box != null && box.Opened)
				{
					box.Close();
					m_Thief.Send(new MobileUpdate(m_Thief));
				}

				Item stolen = null;

				object root = toSteal.RootParent;

				var contParent = toSteal.Parent as Container;

				StealableArtifactsSpawner.StealableInstance si = null;
				if (toSteal.Parent == null || !toSteal.Movable)
				{
					si = StealableArtifactsSpawner.GetStealableInstance(toSteal);
				}

				BaseAddon addon = null;

				if (toSteal is AddonComponent)
				{
					addon = ((AddonComponent)toSteal).Addon;
				}

				bool stealflag = (addon != null && addon.GetSavedFlag(ItemFlags.StealableFlag)) ||
								 toSteal.GetSavedFlag(ItemFlags.StealableFlag);

				if (!IsEmptyHanded(m_Thief))
				{
					m_Thief.SendLocalizedMessage(1005584); // Both hands must be free to steal.
				}
				else if (root is Mobile && ((Mobile)root).Player && IsInnocentTo(m_Thief, (Mobile)root) && !IsInGuild(m_Thief))
				{
					m_Thief.SendLocalizedMessage(1005596); // You must be in the thieves guild to steal from other players.
				}
				else if (SuspendOnMurder && root is Mobile && ((Mobile)root).Player && IsInGuild(m_Thief) && m_Thief.Kills > 0)
				{
					m_Thief.SendLocalizedMessage(502706); // You are currently suspended from the thieves guild.
				}
				else if (root is BaseVendor && ((BaseVendor)root).IsInvulnerable)
				{
					m_Thief.SendLocalizedMessage(1005598); // You can't steal from shopkeepers.
				}
				else if (root is PlayerVendor)
				{
					m_Thief.SendLocalizedMessage(502709); // You can't steal from vendors.
				}
				else if (!m_Thief.CanSee(toSteal))
				{
					m_Thief.SendLocalizedMessage(500237); // Target can not be seen.
				}
				else if (m_Thief.Backpack == null || !m_Thief.Backpack.CheckHold(m_Thief, toSteal, false, true))
				{
					m_Thief.SendLocalizedMessage(1048147); // Your backpack can't hold anything else.
				}
					#region Sigils
				else if (toSteal is Sigil)
				{
					PlayerState pl = PlayerState.Find(m_Thief);
					Faction faction = (pl == null ? null : pl.Faction);

					var sig = (Sigil)toSteal;

					if (!m_Thief.InRange(toSteal.GetWorldLocation(), 1))
					{
						m_Thief.SendLocalizedMessage(502703); // You must be standing next to an item to steal it.
					}
					else if (root != null) // not on the ground
					{
						m_Thief.SendLocalizedMessage(502710); // You can't steal that!
					}
					else if (faction != null)
					{
						if (!m_Thief.CanBeginAction(typeof(IncognitoSpell)))
						{
							m_Thief.SendLocalizedMessage(1010581); //	You cannot steal the sigil when you are incognito
						}
						else if (DisguiseTimers.IsDisguised(m_Thief))
						{
							m_Thief.SendLocalizedMessage(1010583); //	You cannot steal the sigil while disguised
						}
						else if (!m_Thief.CanBeginAction(typeof(PolymorphSpell)))
						{
							m_Thief.SendLocalizedMessage(1010582); //	You cannot steal the sigil while polymorphed
						}
						else if (TransformationSpellHelper.UnderTransformation(m_Thief))
						{
							m_Thief.SendLocalizedMessage(1061622); // You cannot steal the sigil while in that form.
						}
						else if (m_Thief is PlayerMobile && ((PlayerMobile)m_Thief).SavagePaintExpiration > TimeSpan.Zero)
						{
							m_Thief.SendLocalizedMessage(1114352); // You cannot steal the sigil while disguised in savage paint.
						}
						else if (pl.IsLeaving)
//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:101,代码来源:Stealing.cs


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