Beispiel #1
0
        public static bool UnequipPirateItems(Mobile m)
        {
            ArrayList ItemsToMove   = new ArrayList();
            ArrayList ItemsToDelete = new ArrayList();

            Bag     bag     = new Bag();
            BankBox bankBox = m.BankBox;

            if (bankBox == null || !bankBox.TryDropItem(m, bag, false))
            {
                bag.Delete();
                return(false);
            }

            Bag bag2 = new Bag();

            bag2.Name = "Pirate Curse Unequiped Items";
            bag2.Hue  = m.Hue;

            Container pack = m.Backpack;

            if (pack == null && !pack.CheckHold(m, bag2, false, true))
            {
                bag2.Delete();
                return(false);
            }
            pack.AddItem(bag2);

            foreach (Item item in m.Items)
            {
                if (item.Layer != Layer.Bank && item.Layer != Layer.Hair && item.Layer != Layer.FacialHair && item.Layer != Layer.Mount && item.Layer != Layer.Backpack)
                {
                    if (item.Layer == Layer.OneHanded || item.Layer == Layer.Shirt || item.Layer == Layer.Pants || item.Layer == Layer.Helm || item.Layer == Layer.Shoes)
                    {
                        ItemsToDelete.Add(item);
                    }
                    else
                    {
                        ItemsToMove.Add(item);
                    }
                }
            }

            foreach (Item item in ItemsToDelete)
            {
                bag.AddItem(item);
            }
            bag.Delete();

            foreach (Item item in ItemsToMove)
            {
                bag2.AddItem(item);
            }

            RestorePlayerItems(m);

            return(true);
        }
Beispiel #2
0
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack))
            {
                if (Amount > 1)
                {
                    Container pack = from.Backpack;

                    if (pack != null)
                    {
                        Matches match = new Matches();

                        if (pack.CheckHold(from, match, true))
                        {
                            pack.DropItem(match);
                            Amount--;

                            match.ItemID = 2578;
                            from.SendSound(0x047);
                            match.IsLight = true;
                        }
                        else
                        {
                            match.Delete();
                        }
                    }
                }
                else if (!m_IsLight)
                {
                    new InternalTimer(this);
                    from.SendLocalizedMessage(1116114); //You ignite the match.

                    ItemID = 2578;
                    from.SendSound(0x047);
                    m_IsLight = true;
                }
                else
                {
                    from.Target = new InternalTarget(this);
                    from.SendLocalizedMessage(1116113); //Target the cannon whose fuse you wish to light.
                }
            }
        }
Beispiel #3
0
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.IsStaff() || from.InRange(GetWorldLocation(), 2))
            {
                #region Self Looting
                bool selfLoot = (checkSelfLoot && (from == m_Owner));

                if (selfLoot)
                {
                    SetFlag(CorpseFlag.SelfLooted, true);

                    List <Item> items = new List <Item>(Items);

                    bool gathered = false;

                    for (int k = 0; k < EquipItems.Count; ++k)
                    {
                        Item item2 = EquipItems[k];

                        if (!items.Contains(item2) && item2.IsChildOf(from.Backpack))
                        {
                            items.Add(item2);
                            gathered = true;
                        }
                    }

                    bool didntFit = false;

                    Container pack = from.Backpack;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = items[i];
                        Point3D loc  = item.Location;

                        if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable)
                        {
                            continue;
                        }

                        DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

                        if (robe != null)
                        {
                            robe.Delete();
                        }

                        if (m_EquipItems.Contains(item) && from.EquipItem(item))
                        {
                            gathered = true;
                        }
                        else if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);
                            gathered = true;
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    if (gathered && !didntFit)
                    {
                        SetFlag(CorpseFlag.Carved, true);

                        if (ItemID == 0x2006)
                        {
                            ProcessDelta();
                            SendRemovePacket();
                            ItemID = Utility.Random(0xECA, 9); // bone graphic
                            Hue    = 0;
                            ProcessDelta();
                        }

                        from.PlaySound(0x3E3);
                        from.SendLocalizedMessage(1062471); // You quickly gather all of your belongings.
                        items.Clear();
                        m_EquipItems.Clear();
                        return;
                    }

                    if (gathered)
                    {
                        from.SendLocalizedMessage(1062472); // You gather some of your belongings. The rest remain on the corpse.
                    }
                }
                #endregion

                if (!CheckLoot(from, null))
                {
                    return;
                }

                #region Quests
                PlayerMobile player = from as PlayerMobile;

                if (player != null)
                {
                    QuestSystem qs = player.Quest;

                    if (qs is TheSummoningQuest)
                    {
                        VanquishDaemonObjective obj = qs.FindObjective(typeof(VanquishDaemonObjective)) as VanquishDaemonObjective;

                        if (obj != null && obj.Completed && obj.CorpseWithSkull == this)
                        {
                            GoldenSkull sk = new GoldenSkull();

                            if (player.PlaceInBackpack(sk))
                            {
                                obj.CorpseWithSkull = null;
                                player.SendLocalizedMessage(1050022);
                                // For your valor in combating the devourer, you have been awarded a golden skull.
                                qs.Complete();
                            }
                            else
                            {
                                sk.Delete();
                                player.SendLocalizedMessage(1050023); // You find a golden skull, but your backpack is too full to carry it.
                            }
                        }
                    }
                }
                #endregion

                base.OnDoubleClick(from);
            }
            else
            {
                from.SendLocalizedMessage(500446); // That is too far away.
            }
        }
Beispiel #4
0
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2))
            {
                bool selfLoot = (checkSelfLoot && (from == m_Owner));

                if (selfLoot)
                {
                    ArrayList items = new ArrayList(this.Items);

                    bool gathered = false;
                    bool didntFit = false;

                    Container pack = from.Backpack;

                    bool checkRobe = true;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = (Item)items[i];
                        Point3D loc  = item.Location;

                        if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable || !GetRestoreInfo(item, ref loc))
                        {
                            continue;
                        }

                        if (checkRobe)
                        {
                            DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

                            if (robe != null)
                            {
                                Map map = from.Map;

                                if (map != null && map != Map.Internal)
                                {
                                    robe.MoveToWorld(from.Location, map);
                                }
                            }
                        }

                        if (m_EquipItems.Contains(item) && from.EquipItem(item))
                        {
                            gathered = true;
                        }
                        else if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);
                            gathered = true;
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    if (gathered && !didntFit)
                    {
                        m_Carved = true;

                        if (ItemID == 0x2006)
                        {
                            ProcessDelta();
                            SendRemovePacket();
                            ItemID = Utility.Random(0xECA, 9);                               // bone graphic
                            Hue    = 0;
                            ProcessDelta();
                        }

                        from.PlaySound(0x3E3);
                        from.SendLocalizedMessage(1062471);                           // You quickly gather all of your belongings.
                        return;
                    }

                    if (gathered && didntFit)
                    {
                        from.SendLocalizedMessage(1062472);                           // You gather some of your belongings. The rest remain on the corpse.
                    }
                }

                if (!CheckLoot(from))
                {
                    return;
                }

                PlayerMobile player = from as PlayerMobile;

                if (player != null)
                {
                    QuestSystem qs = player.Quest;

                    if (qs is UzeraanTurmoilQuest)
                    {
                        GetDaemonBoneObjective obj = qs.FindObjective(typeof(GetDaemonBoneObjective)) as GetDaemonBoneObjective;

                        if (obj != null && obj.CorpseWithBone == this && (!obj.Completed || UzeraanTurmoilQuest.HasLostDaemonBone(player)))
                        {
                            Item bone = new QuestDaemonBone();

                            if (player.PlaceInBackpack(bone))
                            {
                                obj.CorpseWithBone = null;
                                player.SendLocalizedMessage(1049341, "", 0x22);                                   // You rummage through the bones and find a Daemon Bone!  You quickly place the item in your pack.

                                if (!obj.Completed)
                                {
                                    obj.Complete();
                                }
                            }
                            else
                            {
                                bone.Delete();
                                player.SendLocalizedMessage(1049342, "", 0x22);                                   // Rummaging through the bones you find a Daemon Bone, but can't pick it up because your pack is too full.  Come back when you have more room in your pack.
                            }

                            return;
                        }
                    }
                    else if (qs is TheSummoningQuest)
                    {
                        VanquishDaemonObjective obj = qs.FindObjective(typeof(VanquishDaemonObjective)) as VanquishDaemonObjective;

                        if (obj != null && obj.Completed && obj.CorpseWithSkull == this)
                        {
                            GoldenSkull sk = new GoldenSkull();

                            if (player.PlaceInBackpack(sk))
                            {
                                obj.CorpseWithSkull = null;
                                player.SendLocalizedMessage(1050022);                                   // For your valor in combating the devourer, you have been awarded a golden skull.
                                qs.Complete();
                            }
                            else
                            {
                                sk.Delete();
                                player.SendLocalizedMessage(1050023);                                   // You find a golden skull, but your backpack is too full to carry it.
                            }
                        }
                    }
                }

                base.OnDoubleClick(from);

                if (from != m_Owner)
                {
                    from.RevealingAction();
                }
            }
            else
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return;
            }
        }
Beispiel #5
0
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2))
            {
                #region Self Looting
                bool selfLoot = (checkSelfLoot && (from == m_Owner));

                if (selfLoot)
                {
                    List <Item> items = new List <Item>(this.Items);

                    bool gathered = false;
                    bool didntFit = false;

                    Container pack = from.Backpack;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = items[i];
                        Point3D loc  = item.Location;

                        if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable || !GetRestoreInfo(item, ref loc))
                        {
                            continue;
                        }

                        if (m_EquipItems.Contains(item) && from.EquipItem(item))
                        {
                            gathered = true;
                        }
                        else if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);
                            gathered = true;
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    if (gathered && !didntFit)
                    {
                        SetFlag(CorpseFlag.Carved, true);

                        if (ItemID == 0x2006)
                        {
                            ProcessDelta();
                            SendRemovePacket();
                            ProcessDelta();
                            this.Delete();
                        }

                        from.PlaySound(0x3E3);
                        from.SendLocalizedMessage(1062471); // You quickly gather all of your belongings.
                        return;
                    }

                    if (gathered && didntFit)
                    {
                        from.SendLocalizedMessage(1062472); // You gather some of your belongings. The rest remain on the corpse.
                    }
                }

                #endregion

                if (!CheckLoot(from, null))
                {
                    return;
                }

                base.OnDoubleClick(from);

                if (from != m_Owner)
                {
                    from.RevealingAction();

                    if (from.Player)
                    {
                        EventDispatcher.InvokeCorpseAction(new CorpseActionEventArgs((Player)from, this, CorpseActionEventArgs.CorpseAction.Opened));
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(500446); // That is too far away.
                return;
            }
        }
Beispiel #6
0
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2))
            {
                #region Self Looting
                if (checkSelfLoot && from == m_Owner && !GetFlag(CorpseFlag.SelfLooted) && this.Items.Count != 0)
                {
                    DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

                    if (robe != null)
                    {
                        Map map = from.Map;

                        if (map != null && map != Map.Internal)
                        {
                            robe.MoveToWorld(from.Location, map);
                            robe.BeginDecay();
                        }
                    }

                    Container pack = from.Backpack;

                    if (m_RestoreEquip != null && pack != null)
                    {
                        List <Item> packItems = new List <Item>(pack.Items);                         // Only items in the top-level pack are re-equipped

                        for (int i = 0; i < packItems.Count; i++)
                        {
                            Item packItem = packItems[i];

                            if (m_RestoreEquip.Contains(packItem) && packItem.Movable)
                            {
                                from.EquipItem(packItem);
                            }
                        }
                    }

                    List <Item> items = new List <Item>(this.Items);

                    bool didntFit = false;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = items[i];
                        Point3D loc  = item.Location;

                        if (item.Layer == Layer.Hair || item.Layer == Layer.FacialHair || !item.Movable || !GetRestoreInfo(item, ref loc))
                        {
                            continue;
                        }

                        if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);

                            if (m_RestoreEquip != null && m_RestoreEquip.Contains(item))
                            {
                                from.EquipItem(item);
                            }
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    from.PlaySound(0x3E3);

                    if (this.Items.Count != 0)
                    {
                        from.SendLocalizedMessage(1062472);                           // You gather some of your belongings. The rest remain on the corpse.
                    }
                    else
                    {
                        SetFlag(CorpseFlag.Carved, true);

                        if (ItemID == 0x2006)
                        {
                            ProcessDelta();
                            SendRemovePacket();
                            ItemID = Utility.Random(0xECA, 9);                               // bone graphic
                            Hue    = 0;
                            ProcessDelta();
                        }

                        from.SendLocalizedMessage(1062471);                           // You quickly gather all of your belongings.
                    }

                    SetFlag(CorpseFlag.SelfLooted, true);
                }
                #endregion

                if (!CheckLoot(from, null))
                {
                    return;
                }

                base.OnDoubleClick(from);
            }
            else
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return;
            }
        }
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2))
            {
                #region Self Looting

                bool selfLoot = (checkSelfLoot && (from == m_Owner));

                if (selfLoot)
                {
                    List <Item> items = new List <Item>(this.Items);

                    bool gathered = false;
                    bool didntFit = false;

                    Container pack = from.Backpack;

                    bool checkRobe = true;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = items[i];
                        Point3D loc  = item.Location;

                        if (item.Layer == Layer.Hair)
                        {
                            continue;
                        }
                        if (item.Layer == Layer.FacialHair)
                        {
                            continue;
                        }
                        if (!GetRestoreInfo(item, ref loc))
                        {
                            continue;
                        }

                        if (checkRobe)
                        {
                            DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

                            if (robe != null)
                            {
                                if (Core.SE)
                                {
                                    robe.Delete();
                                }
                                else
                                {
                                    Map map = from.Map;

                                    if (map != null && map != Map.Internal)
                                    {
                                        robe.MoveToWorld(from.Location, map);
                                    }
                                }
                            }
                        }

                        if (m_EquipItems.Contains(item) && from.EquipItem(item))
                        {
                            gathered = true;
                        }

                        else if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);
                            gathered = true;
                        }

                        else
                        {
                            didntFit = true;
                        }
                    }

                    if (gathered && !didntFit)
                    {
                        m_Carved = true;

                        if (ItemID == 0x2006)
                        {
                            ProcessDelta();
                            SendRemovePacket();
                            ItemID = Utility.Random(0xECA, 9); // bone graphic
                            Hue    = 0;
                            ProcessDelta();
                        }

                        from.PlaySound(0x3E3);
                        from.SendLocalizedMessage(1062471); // You quickly gather all of your belongings.

                        return;
                    }

                    if (gathered && didntFit)
                    {
                        from.SendLocalizedMessage(1062472); // You gather some of your belongings. The rest remain on the corpse.
                    }
                }

                #endregion

                if (!CheckLoot(from, null))
                {
                    return;
                }

                base.OnDoubleClick(from);

                if (from != m_Owner)
                {
                    from.RevealingAction();
                }
            }

            else
            {
                from.SendLocalizedMessage(500446); // That is too far away.
                return;
            }
        }
Beispiel #8
0
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2))
            {
                #region Self Looting
                if (checkSelfLoot && from == m_Owner && !GetFlag(CorpseFlag.SelfLooted) && this.Items.Count != 0)
                {
                    DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

                    if (robe != null)
                    {
                        Map map = from.Map;

                        if (map != null && map != Map.Internal)
                        {
                            robe.MoveToWorld(from.Location, map);
                            robe.BeginDecay();
                        }
                    }

                    Container pack = from.Backpack;

                    if (m_RestoreEquip != null && pack != null)
                    {
                        List <Item> packItems = new List <Item>(pack.Items);                         // Only items in the top-level pack are re-equipped

                        for (int i = 0; i < packItems.Count; i++)
                        {
                            Item packItem = packItems[i];

                            if (m_RestoreEquip.Contains(packItem) && packItem.Movable)
                            {
                                from.EquipItem(packItem);
                            }
                        }
                    }

                    List <Item> items = new List <Item>(this.Items);

                    bool didntFit = false;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = items[i];
                        Point3D loc  = item.Location;

                        if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable || !GetRestoreInfo(item, ref loc))
                        {
                            continue;
                        }

                        if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);

                            if (m_RestoreEquip != null && m_RestoreEquip.Contains(item))
                            {
                                from.EquipItem(item);
                            }
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    from.PlaySound(0x3E3);

                    if (this.Items.Count != 0)
                    {
                        from.SendLocalizedMessage(1062472);                           // You gather some of your belongings. The rest remain on the corpse.
                    }
                    else
                    {
                        SetFlag(CorpseFlag.Carved, true);

                        this.Delete();

                        from.SendLocalizedMessage(1062471);                           // You quickly gather all of your belongings.
                    }

                    SetFlag(CorpseFlag.SelfLooted, true);
                }
                #endregion

                if (!CheckLoot(from, null))
                {
                    return;
                }

                #region Quests
                PlayerMobile player = from as PlayerMobile;

                if (player != null)
                {
                    QuestSystem qs = player.Quest;

                    if (qs is UzeraanTurmoilQuest)
                    {
                        GetDaemonBoneObjective obj = qs.FindObjective(typeof(GetDaemonBoneObjective)) as GetDaemonBoneObjective;

                        if (obj != null && obj.CorpseWithBone == this && (!obj.Completed || UzeraanTurmoilQuest.HasLostDaemonBone(player)))
                        {
                            Item bone = new QuestDaemonBone();

                            if (player.PlaceInBackpack(bone))
                            {
                                obj.CorpseWithBone = null;
                                player.SendLocalizedMessage(1049341, "", 0x22);                                   // You rummage through the bones and find a Daemon Bone!  You quickly place the item in your pack.

                                if (!obj.Completed)
                                {
                                    obj.Complete();
                                }
                            }
                            else
                            {
                                bone.Delete();
                                player.SendLocalizedMessage(1049342, "", 0x22);                                   // Rummaging through the bones you find a Daemon Bone, but can't pick it up because your pack is too full.  Come back when you have more room in your pack.
                            }

                            return;
                        }
                    }
                    else if (qs is TheSummoningQuest)
                    {
                        VanquishDaemonObjective obj = qs.FindObjective(typeof(VanquishDaemonObjective)) as VanquishDaemonObjective;

                        if (obj != null && obj.Completed && obj.CorpseWithSkull == this)
                        {
                            GoldenSkull sk = new GoldenSkull();

                            if (player.PlaceInBackpack(sk))
                            {
                                obj.CorpseWithSkull = null;
                                player.SendLocalizedMessage(1050022);                                   // For your valor in combating the devourer, you have been awarded a golden skull.
                                qs.Complete();
                            }
                            else
                            {
                                sk.Delete();
                                player.SendLocalizedMessage(1050023);                                   // You find a golden skull, but your backpack is too full to carry it.
                            }
                        }
                    }
                }

                #endregion

                base.OnDoubleClick(from);
            }
            else
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return;
            }
        }
Beispiel #9
0
        public virtual void Open(Mobile from, bool checkSelfLoot)
        {
            if (from.AccessLevel > AccessLevel.Player || from.InRange(this.GetWorldLocation(), 2))
            {
                #region Self Looting
                bool selfLoot = (checkSelfLoot && (from == m_Owner));

                if (selfLoot)
                {
                    if (from is PlayerMobile && from.NetState != null && from.NetState.Version.IsEnhanced)
                    {
                        PlayerMobile pm = (PlayerMobile)from;

                        pm.Send(new RemoveWaypoint(this.Serial.Value));
                        pm.CheckKRStartingQuestStep(27);
                    }

                    ArrayList items = new ArrayList(this.Items);

                    bool gathered = false;
                    bool didntFit = false;

                    Container pack = from.Backpack;

                    bool checkRobe = true;

                    for (int i = 0; !didntFit && i < items.Count; ++i)
                    {
                        Item    item = (Item)items[i];
                        Point3D loc  = item.Location;

                        if ((item.Layer == Layer.Hair || item.Layer == Layer.FacialHair) || !item.Movable || !GetRestoreInfo(item, ref loc))
                        {
                            continue;
                        }

                        if (checkRobe)
                        {
                            DeathRobe robe = from.FindItemOnLayer(Layer.OuterTorso) as DeathRobe;

                            if (robe != null)
                            {
                                robe.Delete();
                            }
                        }

                        if (m_EquipItems.Contains(item) && from.EquipItem(item))
                        {
                            gathered = true;
                        }
                        else if (pack != null && pack.CheckHold(from, item, false, true))
                        {
                            item.Location = loc;
                            pack.AddItem(item);
                            gathered = true;
                        }
                        else
                        {
                            didntFit = true;
                        }
                    }

                    if (gathered && !didntFit)
                    {
                        SetFlag(CorpseFlag.Carved, true);

                        if (ItemID == 0x2006)
                        {
                            ProcessDelta();
                            SendRemovePacket();
                            ItemID    = Utility.Random(0xECA, 9);                            // bone graphic
                            Hue       = 0;
                            Direction = Direction.North;
                            ProcessDelta();
                        }

                        from.PlaySound(0x3E3);
                        from.SendLocalizedMessage(1062471);                           // You quickly gather all of your belongings.

                        try
                        {
                            if (from is PlayerMobile && m_InsuredItems != null)
                            {
                                ArrayList   bagitems     = new ArrayList(from.Backpack.Items);
                                List <Item> insureditems = m_InsuredItems;

                                foreach (Item item in bagitems)
                                {
                                    if (insureditems.Contains(item))
                                    {
                                        Item move = from.FindItemOnLayer(item.Layer);

                                        if (move == null)
                                        {
                                            from.EquipItem(item);
                                        }
                                    }
                                }

                                m_InsuredItems = null;
                            }
                        }
                        catch
                        {
                        }

                        return;
                    }

                    if (gathered && didntFit)
                    {
                        from.SendLocalizedMessage(1062472);                           // You gather some of your belongings. The rest remain on the corpse.
                    }
                }

                #endregion

                if (!CheckLoot(from))
                {
                    return;
                }

                #region Quests
                PlayerMobile player = from as PlayerMobile;

                if (player != null)
                {
                    QuestSystem qs = player.Quest;

                    if (qs is TheSummoningQuest)
                    {
                        var obj = qs.FindObjective <VanquishDaemonObjective>();

                        if (obj != null && obj.Completed && obj.CorpseWithSkull == this)
                        {
                            var sk = new GoldenSkull();

                            if (player.PlaceInBackpack(sk))
                            {
                                obj.CorpseWithSkull = null;
                                player.SendLocalizedMessage(1050022);                                   // For your valor in combating the devourer, you have been awarded a golden skull.
                                qs.Complete();
                            }
                            else
                            {
                                sk.Delete();
                                player.SendLocalizedMessage(1050023);                                   // You find a golden skull, but your backpack is too full to carry it.
                            }
                        }
                    }
                }

                #endregion

                if (m_Owner is WeakSkeleton && from is PlayerMobile)
                {
                    ((PlayerMobile)from).CheckKRStartingQuestStep(20);
                }

                base.OnDoubleClick(from);

                if (from != m_Owner)
                {
                    from.RevealingAction();
                }
            }
            else
            {
                from.SendLocalizedMessage(500446);                   // That is too far away.
                return;
            }
        }