Example #1
0
		public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
		{
			if ( m_Boat == null || !m_Boat.Contains( from ) || m_Boat.IsMoving )
				return false;

			return base.CheckLift( from, item, ref reject );
		}
Example #2
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (Transport == null || !Transport.IsOnBoard(from) || Transport.IsMoving)
                return false;

            return base.CheckLift(from, item, ref reject);
        }
Example #3
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (LastStolen == DateTime.MinValue)
            {
                from.SendLocalizedMessage(1005225); // You must use the stealing skill to pick up the sigil
                return(false);
            }

            return(base.CheckLift(from, item, ref reject));
        }
Example #4
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (item != this)
            {
                reject = LRReason.CannotLift;
                return(false);
            }

            return(base.CheckLift(from, item, ref reject));
        }
Example #5
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (from.Target is ClothingBlessTarget)
            {
                from.SendMessage("You cannot move that while using it.");
                return(false);
            }

            return(base.CheckLift(from, item, ref reject));
        }
Example #6
0
        public void TestLiftRej(LRReason reason)
        {
            var expected = new LiftRej(reason).Compile();

            using var ns = PacketTestUtilities.CreateTestNetState();
            ns.SendLiftReject(reason);

            var result = ns.SendPipe.Reader.TryRead();

            AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
        }
Example #7
0
        public void TestLiftRej(LRReason reason)
        {
            var data = new LiftRej(reason).Compile();

            Span <byte> expectedData = stackalloc byte[2];
            var         pos          = 0;

            expectedData.Write(ref pos, (byte)0x27); // Packet ID
            expectedData.Write(ref pos, (byte)reason);

            AssertThat.Equal(data, expectedData);
        }
Example #8
0
            public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
            {
                var donationBag = item as DonationBag;

                if (donationBag != null)
                {
                    CheckDonationBagPosition(donationBag);
                    return(false);
                }

                return(base.CheckLift(from, item, ref reject));
            }
Example #9
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if ((int)from.AccessLevel > (int)AccessLevel.Player)
            {
                return(base.CheckLift(from, item, ref reject));
            }
            else
            {
                reject = LRReason.CannotLift;
            }

            return(false);
        }
Example #10
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (!base.CheckLift(from, item, ref reject))
            {
                return(false);
            }
            if (Felladrin.Automations.AutoSplitGold.Split(from, item))
            {
                return(false);
            }

            return(CanLoot(from, item));
        }
Example #11
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            BaseHouse house = BaseHouse.FindHouseAt(this);

            if (house != null)
            {
                var secure = house.GetSecureInfoFor(this);

                return(secure != null && house.HasSecureAccess(from, secure));
            }

            return(base.CheckLift(from, item, ref reject));
        }
Example #12
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {               // Thwart lift macros
            TimeSpan ts = DateTime.Now - lastLift;

            lastLift = DateTime.Now;
            if (ts.TotalSeconds < 1.8)
            {                   // throttle
                from.SendMessage("You thrust your hand into the chest but come up empty handed.");
                reject = LRReason.Inspecific;
                return(false);
            }
            return(CheckLoot(from, true) && base.CheckLift(from, item, ref reject));
        }
Example #13
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (!base.CheckLift(from, item, ref reject))
            {
                return(false);
            }

            if (item != this && from.AccessLevel < AccessLevel.GameMaster && m_Locked)
            {
                return(false);
            }

            return(true);
        }
Example #14
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (!base.CheckLift(from, item, ref reject))
            {
                return(false);
            }

            if (Server.Custom.AutoSplit.Gold(from, item))
            {
                return(false);
            }

            return(CanLoot(from, item));
        }
Example #15
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {               // Thwart lift macros
            if (LiftMemory.Recall(from))
            {           // throttle
                from.SendMessage("You thrust your hand into the chest but come up empty handed.");
                reject = LRReason.Inspecific;
                return(false);
            }
            else
            {
                LiftMemory.Remember(from, 1.8);
            }

            return(CheckLoot(from, true) && base.CheckLift(from, item, ref reject));
        }
Example #16
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (item.GetSavedFlag(0x01))                 //Not lootable
            {
                reject = LRReason.CannotLift;
                return(false);
            }

            if (!base.CheckLift(from, item, ref reject))
            {
                return(false);
            }

            return(CanLoot(from, item));
        }
        public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
        {
            if ( m_Boat == null || !m_Boat.Contains( from ) )
                return false;

            if ( m_Boat.IsMoving )
            {
                if ( m_Boat.TillerMan != null )
                    m_Boat.TillerMan.Say( 502491 ); // I can not open the hold while the ship is moving.

                return false;
            }

            return base.CheckLift( from, item, ref reject );
        }
Example #18
0
        public override bool CheckLift(Mobile m, Item item, ref LRReason reject)
        {
            if (m == null)
            {
                return(false);
            }

            if (m.AccessLevel <= AccessLevel.Counselor && Renaming)
            {
                m.SendMessage(0x22, "You can not move this talisman while the entity is being named.");
                reject = LRReason.CannotLift;
                return(false);
            }

            return(base.CheckLift(m, item, ref reject));
        }
Example #19
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (!base.CheckLift(from, item, ref reject))
            {
                return(false);
            }

            var canLoot = CanLoot(from, item);

            if (canLoot)
            {
                EventSink.InvokeCorpseLoot(new CorpseLootEventArgs(from, this, item));
            }

            return(canLoot);
        }
Example #20
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (Quest == null)
            {
                return(base.CheckLift(from, item, ref reject));
            }

            FishQuestObjective obj = Quest.GetObjective();

            if (obj != null && obj.CheckLift(item))
            {
                reject = LRReason.CannotLift;
                return(false);
            }

            return(true);
        }
Example #21
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (m_Boat == null || !m_Boat.Contains(from))
            {
                return(false);
            }

            if (m_Boat.IsMoving)
            {
                if (m_Boat.TillerMan != null)
                {
                    m_Boat.TillerMan.Say(502491);                       // I can not open the hold while the ship is moving.
                }
                return(false);
            }

            return(base.CheckLift(from, item, ref reject));
        }
Example #22
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            // allow staff to pick it up
            if (from != null && from.AccessLevel > AccessLevel.Player)
            {
                return base.CheckLift(from, item, ref reject);
            }

            // prevent non-participants from picking it up
            XmlPoints afrom = (XmlPoints)XmlAttach.FindAttachment(from, typeof(XmlPoints));
            if (afrom != null && afrom.ChallengeGame != null && ((afrom.ChallengeGame is DeathBallGauntlet && (((DeathBallGauntlet)(afrom.ChallengeGame)).Ball == item)) ||
                                                                 (afrom.ChallengeGame is TeamDeathballGauntlet && (((TeamDeathballGauntlet)(afrom.ChallengeGame)).Ball == item))))
            {
                return base.CheckLift(from, item, ref reject);
            }
            else
                return false;
        }
Example #23
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            // allow staff to pick it up
            if (from != null && from.AccessLevel > AccessLevel.Player)
            {
                return(base.CheckLift(from, item, ref reject));
            }

            // prevent non-participants from picking it up
            XmlPoints afrom = (XmlPoints)XmlAttach.FindAttachment(from, typeof(XmlPoints));

            if (afrom != null && afrom.ChallengeGame != null && ((afrom.ChallengeGame is DeathBallGauntlet && (((DeathBallGauntlet)(afrom.ChallengeGame)).Ball == item)) ||
                                                                 (afrom.ChallengeGame is TeamDeathballGauntlet && (((TeamDeathballGauntlet)(afrom.ChallengeGame)).Ball == item))))
            {
                return(base.CheckLift(from, item, ref reject));
            }
            else
            {
                return(false);
            }
        }
Example #24
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (from.AccessLevel >= AccessLevel.GameMaster)
                return true;

            PlayerMobile player = from as PlayerMobile;

            if (player != null && player.Quest is HaochisTrialsQuest)
            {
                FifthTrialIntroObjective obj = player.Quest.FindObjective(typeof(FifthTrialIntroObjective)) as FifthTrialIntroObjective;

                if (obj != null)
                {
                    if (obj.StolenTreasure)
                        from.SendLocalizedMessage(1063247); // The guard is watching you carefully!  It would be unwise to remove another item from here.
                    else
                        return true;
                }
            }

            return false;
        }
Example #25
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (!base.CheckLift(from, item, ref reject))
            {
                return(false);
            }

            bool canLoot = CanLoot(from, item);

            if (m_HasLooted == null)
            {
                m_HasLooted = new List <Item>();
            }

            if (canLoot && !m_HasLooted.Contains(item))
            {
                m_HasLooted.Add(item);
                EventSink.InvokeCorpseLoot(new CorpseLootEventArgs(from, this, item));
            }

            return(canLoot);
        }
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (from.AccessLevel >= AccessLevel.GameMaster)
            {
                return(true);
            }

            if (from is PlayerMobile player && player.Quest is HaochisTrialsQuest)
            {
                FifthTrialIntroObjective obj = player.Quest.FindObjective <FifthTrialIntroObjective>();
                if (obj?.StolenTreasure == true)
                {
                    from.SendLocalizedMessage(
                        1063247); // The guard is watching you carefully!  It would be unwise to remove another item from here.
                }
                else
                {
                    return(true);
                }
            }

            return(false);
        }
Example #27
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (!base.CheckLift(from, item, ref reject))
            {
                return(false);
            }

            if (item.LootType == Server.LootType.Unlootable)
            {
                return(false);
            }

            TimeSpan lootTime = DateTime.UtcNow - m_TimeOfDeath;

            if (lootTime.TotalSeconds < 0.75)
            {
                Custom.AntiFastLoot.RegisterFastloot(from, lootTime);

                return(false);
            }

            return(CanLoot(from, item));
        }
Example #28
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (item != this)
            {
                if (CheckLocked(from))
                {
                    return(false);
                }
                else
                {
                    if (MustStealItems)
                    {
                        bool mustSteal = false;
                        foreach (Item i in this.Items)
                        {
                            if (i is Spawner)
                            {
                                if (((Spawner)i).SpawnedObject(item))
                                {
                                    mustSteal = true;
                                    break;
                                }
                            }
                        }

                        if (mustSteal)
                        {
                            from.SendAsciiMessage("That item does not belong to you.  You'll have to steal it.");
                            return(from.AccessLevel >= AccessLevel.GameMaster);
                        }
                    }
                }
            }

            return(base.CheckLift(from, item, ref reject));
        }
Example #29
0
 public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
 {
     return base.CheckLift( from, item, ref reject ) && House != null && !House.Deleted && House.IsOwner( from );
 }
Example #30
0
 public virtual bool CheckLift( Mobile from, Item item, ref LRReason reject )
 {
     return true;
 }
Example #31
0
        public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
        {
            if ( !base.CheckLift( from, item, ref reject ) )
                return false;

            return CanLoot( from,item );
        }
Example #32
0
 // called when dragging item that belongs to somebody or some container
 public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
 {
     if (XmlScript.HasTrigger(from, TriggerName.onDragLift) && UberScriptTriggers.Trigger(from, from, TriggerName.onDragLift, item))
     {
         reject = LRReason.Inspecific;
         return false;
     }
     if (XmlScript.HasTrigger(item, TriggerName.onDragLift) && UberScriptTriggers.Trigger(item, from, TriggerName.onDragLift, item))
     {
         reject = LRReason.Inspecific;
         return false;
     }
     
     return base.CheckLift(from, item, ref reject);
 }
Example #33
0
        public void Lift( Item item, int amount, out bool rejected, out LRReason reject )
        {
            rejected = true;
            reject = LRReason.Inspecific;

            if ( item == null )
                return;

            Mobile from = this;
            GameClient state = m_Client;

            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(), 2 ) )
                    {
                        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 ( item.CheckLift( from, item, ref reject ) )
                    {
                        object root = item.RootParent;

                        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.Parent != null && item.Parent is Container )
                                ( (Container) item.Parent ).FreePosition( item.GridLocation );

                            item.SetLastMoved();

                            if ( item.Spawner != null )
                            {
                                item.Spawner.Remove( item );
                                item.Spawner = null;
                            }

                            if ( amount == 0 )
                                amount = 1;

                            if ( amount > item.Amount )
                                amount = item.Amount;

                            int oldAmount = item.Amount;
                            //item.Amount = amount; //Set in LiftItemDupe

                            if ( amount < oldAmount )
                                LiftItemDupe( item, amount );

                            InvokeItemLifted( new ItemLiftedEventArgs( item, amount ) );

                            item.RecordBounce();
                            item.OnItemLifted( from, item );
                            item.Internalize();

                            from.Holding = item;

                            from.NextActionTime = DateTime.Now + TimeSpan.FromSeconds( 0.5 );

                            Point3D fixLoc = item.Location;
                            Map fixMap = item.Map;
                            bool shouldFix = ( item.Parent == null );

                            if ( fixMap != null && shouldFix )
                                fixMap.FixColumn( fixLoc.X, fixLoc.Y );

                            reject = LRReason.Inspecific;
                            rejected = false;
                        }
                    }
                }
                else
                {
                    reject = LRReason.Inspecific;
                }
            }
            else
            {
                SendActionMessage();
                reject = LRReason.Inspecific;
            }

            if ( rejected && state != null )
            {
                state.Send( LiftRej.Instantiate( reject ) );

                if ( item.Parent is Item )
                    state.Send( new ContainerContentUpdate( item ) );
                else if ( item.Parent is Mobile )
                    state.Send( new EquipUpdate( item ) );
                else
                    item.SendInfoTo( state );

                if ( ObjectPropertyListPacket.Enabled && item.Parent != null )
                    state.Send( item.OPLPacket );
            }
        }
		public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
		{
			reject = LRReason.CannotLift;
			return false;
		}
Example #35
0
 public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
 {
     from.SendLocalizedMessage(1005225); // You must use the stealing skill to pick up the sigil
     return(false);
 }
Example #36
0
        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
                        {
                            item.SetLastMoved();

                            if (item.Spawner != null)
                            {
                                item.Spawner.Remove(item);
                                item.Spawner = null;
                            }

                            if (amount == 0)
                                amount = 1;

                            if (amount > item.Amount)
                                amount = item.Amount;

                            int oldAmount = item.Amount;
                            //item.Amount = amount; //Set in LiftItemDupe

                            if (amount < oldAmount)
                                LiftItemDupe(item, amount);
                            //item.Dupe( oldAmount - amount );

                            Map map = from.Map;

                            if (DragEffects && map != null && (root == null || root is Item))
                            {
                                IPooledEnumerable eable = map.GetClientsInRange(from.Location);
                                Packet p = null;

                                foreach (NetState ns in eable)
                                {
                                    if (ns.Mobile != from && ns.Mobile.CanSee(from) && (!ns.Mobile.HasFilter || InLOS(ns.Mobile)))
                                    {
                                        if (p == null)
                                        {
                                            IEntity src;

                                            if (root == null)
                                                src = new Entity(Serial.Zero, item.Location, map);
                                            else
                                                src = new Entity(((Item) root).Serial, ((Item) root).Location, map);

                                            p = Packet.Acquire(new DragEffect(src, from, item.ItemID, item.Hue, amount));
                                        }

                                        ns.Send(p);
                                    }
                                }

                                Packet.Release(p);

                                eable.Free();
                            }

                            Point3D fixLoc = item.Location;
                            Map fixMap = item.Map;
                            bool shouldFix = (item.Parent == null);

                            item.RecordBounce();
                            item.OnItemLifted(from, item);
                            item.Internalize();

                            from.Holding = item;

                            from.NextActionTime = DateTime.Now + TimeSpan.FromSeconds(0.4);

                            if (fixMap != null && shouldFix)
                                fixMap.FixColumn(fixLoc.X, fixLoc.Y);

                            reject = LRReason.Inspecific;
                            rejected = false;
                        }
                    }
                }
                else
                {
                    reject = LRReason.Inspecific;
                }
            }
            else
            {
                SendActionMessage();
                reject = LRReason.Inspecific;
            }

            if (rejected && state != null)
            {
                state.Send(new LiftRej(reject));

                if (item.Parent is Item)
                {
                    if (state.ContainerGridLines)
                        state.Send(new ContainerContentUpdate6017(item));
                    else
                        state.Send(new ContainerContentUpdate(item));
                }
                else if (item.Parent is Mobile)
                    state.Send(new EquipUpdate(item));
                else
                    item.SendInfoTo(state);

                if (ObjectPropertyList.Enabled && item.Parent != null)
                    state.Send(item.OPLPacket);
            }
        }
Example #37
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
		{   // Thwart lift macros
        	TimeSpan ts = DateTime.Now - lastLift;
			lastLift = DateTime.Now;
			if (ts.TotalSeconds < 1.8)
			{	// throttle
				from.SendMessage("You thrust your hand into the chest but come up empty handed.");
				reject = LRReason.Inspecific;
				return false;
			}
		
			// get the normal "it is locked" message
            bool bResult = base.CheckLift (from, item, ref reject);

            // if a Player had the chest open when we auto-load it, prevent them from taking stuff untill it is opened leagally.
            if (bResult == true && item != this)
			    if (from != null && from.AccessLevel == AccessLevel.Player)
				    if ( this.Locked == true || this.TrapPower > 0 )
                    {
                        from.SendMessage("The chest is locked, so you cannot access that.");
                        bResult = false;
                    }

            return bResult;
		}
Example #38
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (m_Quest == null)
                return base.CheckLift(from, item, ref reject);

            FishQuestObjective obj = m_Quest.GetObjective();

            if (obj != null && obj.CheckLift(item))
            {
                reject = LRReason.CannotLift;
                return false;
            }

            return true;
        }
Example #39
0
        public virtual 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 = m_NetState;

            if ( from.AccessLevel >= AccessLevel.GameMaster || Core.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(), 2 ) )
                    {
                        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.InSecureTrade || !item.IsAccessibleTo( from ) )
                    {
                        reject = LRReason.CannotLift;
                    }
                    else if ( !item.CheckLift( from, item ) )
                    {
                        reject = LRReason.Inspecific;
                    }
                    else
                    {
                        object root = item.RootParent;

                        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
                        {
                            item.SetLastMoved();

                            if ( amount == 0 )
                                amount = 1;

                            if ( amount > item.Amount )
                                amount = item.Amount;

                            int oldAmount = item.Amount;
                            item.Amount = amount;

                            if ( amount < oldAmount )
                                item.Dupe( oldAmount - amount );

                            Map map = from.Map;

                            if ( Mobile.DragEffects && map != null && (root == null || root is Item))
                            {
                                IPooledEnumerable eable = map.GetClientsInRange( from.Location );
                                Packet p = null;

                                foreach ( NetState ns in eable )
                                {
                                    if ( ns.Mobile != from && ns.Mobile.CanSee( from ) )
                                    {
                                        if ( p == null )
                                        {
                                            IEntity src;

                                            if ( root == null )
                                                src = new Entity( Serial.Zero, item.Location, map );
                                            else
                                                src = new Entity( ((Item)root).Serial, ((Item)root).Location, map );

                                            p = new DragEffect( src, from, item.ItemID, item.Hue, amount );
                                        }

                                        ns.Send( p );
                                    }
                                }

                                eable.Free();
                            }

                            Point3D fixLoc = item.Location;
                            Map fixMap = item.Map;
                            bool shouldFix = ( item.Parent == null );

                            item.RecordBounce();
                            item.OnItemLifted( from, item );
                            item.Internalize();

                            from.Holding = item;

                            int liftSound = item.GetLiftSound( from );

                            if ( liftSound != -1 )
                                from.Send( new PlaySound( liftSound, from ) );

                            from.NextActionTime = Core.Now + TimeSpan.FromSeconds( 0.5 );

                            if ( fixMap != null && shouldFix )
                                fixMap.FixColumn( fixLoc.m_X, fixLoc.m_Y );

                            reject = LRReason.Inspecific;
                            rejected = false;
                        }
                    }
                }
                else
                {
                    reject = LRReason.Inspecific;
                }
            }
            else
            {
                SendActionMessage();
                reject = LRReason.Inspecific;
            }

            if ( rejected && state != null )
            {
                state.Send( new LiftRej( reject ) );

                if( item.Parent is Item ) {
                    if ( state.IsPost6017 )
                        state.Send( new ContainerContentUpdate6017( item ) );
                    else
                        state.Send( new ContainerContentUpdate( item ) );
                } else if( item.Parent is Mobile )
                    state.Send( new EquipUpdate( item ) );
                else
                    item.SendInfoTo( state );

                if ( ObjectPropertyList.Enabled && item.Parent != null )
                    state.Send( item.OPLPacket );
            }
        }
Example #40
0
        public static LiftRej Instantiate(LRReason reason)
        {
            byte idx = (byte)reason;
            LiftRej p = m_Cache[idx];

            if (p == null)
            {
                m_Cache[idx] = p = new LiftRej((byte)reason);
                p.SetStatic();
            }

            return p;
        }
Example #41
0
		public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            // only allow staff to pick it up when at a base
            if((from != null && from.AccessLevel > AccessLevel.Player) || RootParent != null)
            {
				return base.CheckLift(from, item, ref reject);
            }
            return false;
        }
        public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
        {
            if ( m_Owner != null && m_Owner.Account == null )
                CancelRent();

            return ( m_Owner == null || from.Account.Username == m_Owner.Account.Username ) || base.CheckLift( from, item, ref reject );
        }
Example #43
0
		public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
		{
			return base.CheckLift( from, item, ref reject ) && House != null && !House.Deleted && House.IsOwner( from );
		}
Example #44
0
 public override bool CheckLift(Mobile from, Item item, ref LRReason reject) => CheckLoot(from, true) && base.CheckLift(from, item, ref reject);
Example #45
0
 public LiftRej(LRReason reason) : base(0x27, 2)
 {
     Stream.Write((byte)reason);
 }
Example #46
0
        public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
        {
            if ( !base.CheckLift( from, item, ref reject ) )
                return false;

            if ( item != this && from.AccessLevel < AccessLevel.GameMaster && m_Locked )
                return false;

            return true;
        }
Example #47
0
 public override bool CheckLift(Mobile from, Item item, ref LRReason reject) => House?.Deleted == false &&
 base.CheckLift(from, item, ref reject) && House.IsOwner(from);
Example #48
0
 public LiftRej( LRReason reason )
     : base(0x27, 2)
 {
     m_Stream.Write( (byte) reason );
 }
Example #49
0
 public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
 {
     reject = LRReason.CannotLift;
     return(false);
 }
Example #50
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if ((int)from.AccessLevel > (int)AccessLevel.Player)
                return base.CheckLift(from, item, ref reject);
            else
                reject = LRReason.CannotLift;

            return false;
        }
Example #51
0
        public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
        {
            if (item != this)
            {
                reject = LRReason.CannotLift;
                return false;
            }

            return base.CheckLift(from, item, ref reject);
        }
		public override bool CheckLift(Mobile m, Item item, ref LRReason reject)
		{
			if (m == null)
			{
				return false;
			}

			if (m.AccessLevel <= AccessLevel.Counselor && Renaming)
			{
				m.SendMessage(0x22, "You can not move this talisman while the entity is being named.");
				reject = LRReason.CannotLift;
				return false;
			}

			return base.CheckLift(m, item, ref reject);
		}
Example #53
0
 public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
 {
     return(this.CheckLoot(from, true) && base.CheckLift(from, item, ref reject));
 }
Example #54
0
        public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
        {
            if ( !base.CheckLift( from, item, ref reject ) )
                return false;

            if (Felladrin.Automations.AutoSplitGold.Split(from, item))
                return false;

            return CanLoot( from,item );
        }
Example #55
0
		// called when dragging item that doesn't belong to anything else
		public override bool CheckLiftTrigger(Item item, ref LRReason reject)
		{
			if ((XmlScript.HasTrigger(this, TriggerName.onDragLift) &&
				 UberScriptTriggers.Trigger(this, this, TriggerName.onDragLift, item)) ||
				(XmlScript.HasTrigger(item, TriggerName.onDragLift) &&
				 UberScriptTriggers.Trigger(item, this, TriggerName.onDragLift)))
			{
				reject = LRReason.Inspecific;
				return false;
			}

			return true;
		}
Example #56
0
 public virtual bool CheckLift( Mobile from, Item item, ref LRReason reject )
 {
     if ( m_Parent is Item )
         return ( (Item) m_Parent ).CheckLift( from, item, ref reject );
     else if ( m_Parent is Mobile )
         return ( (Mobile) m_Parent ).CheckLift( from, item, ref reject );
     else
         return true;
 }
		public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
		{
			return CheckLoot( from, true ) && base.CheckLift( from, item, ref reject );
		}
Example #58
0
		// called when dragging item that belongs to somebody or some container
		public override bool CheckLift(Mobile from, Item item, ref LRReason reject)
		{
			if (XmlScript.HasTrigger(from, TriggerName.onDragLift) &&
				UberScriptTriggers.Trigger(from, from, TriggerName.onDragLift, item))
			{
				reject = LRReason.Inspecific;
				return false;
			}

			if (XmlScript.HasTrigger(item, TriggerName.onDragLift) &&
				UberScriptTriggers.Trigger(item, from, TriggerName.onDragLift, item))
			{
				reject = LRReason.Inspecific;
				return false;
			}

			if (item.RootParent is Mobile)
			{
				var parent = item.RootParent as Mobile;

				if (parent.AccessLevel == AccessLevel.Player && from.AccessLevel > AccessLevel.Player)
				{
					CommandLogging.WriteLine(
						from,
						"{0} {1} lifted {3:X} ({4}) from {2}",
						from.AccessLevel,
						CommandLogging.Format(from),
						CommandLogging.Format(parent),
						item.Serial.Value,
						item.GetType().Name);
				}
			}

			return base.CheckLift(from, item, ref reject);
		}
Example #59
0
		public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
		{
			from.SendLocalizedMessage( 1005225 ); // You must use the stealing skill to pick up the sigil
			return false;
		}
Example #60
0
		public override bool CheckLift( Mobile from, Item item, ref LRReason reject )
		{
			return CanLoot( from );
		}