Example #1
0
        public void TryAddEntry(Item item, Mobile from)
        {
            if (!CanUse(from) || item == null)
            {
                return;
            }

            if (!CheckRange(from))
            {
                from.SendLocalizedMessage(3000268); // that is too far away.
            }
            else if (!(item is TreasureMap || item is SOS || item is MessageInABottle))
            {
                from.SendLocalizedMessage(1153564); // That is not a treasure map or message in a bottle.
            }
            else if (!item.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1054107); // This item must be in your backpack.
            }
            else if (Entries.Count >= 500)
            {
                from.SendLocalizedMessage(1153565); // The locker is full
            }
            else
            {
                DaviesLockerEntry entry = null;

                if (item is TreasureMap)
                {
                    entry = new TreasureMapEntry((TreasureMap)item);
                }
                else if (item is SOS)
                {
                    entry = new SOSEntry((SOS)item);
                }
                else if (item is MessageInABottle)
                {
                    entry = new SOSEntry((MessageInABottle)item);
                }

                if (entry != null)
                {
                    Entries.Add(entry);
                    from.CloseGump(typeof(DaviesLockerGump));
                    from.SendGump(new DaviesLockerGump(from, this));

                    item.Delete();

                    UpdateProperties();
                }
            }
        }
Example #2
0
        private Item Construct(SOSEntry entry)
        {
            if (entry == null)
            {
                return(null);
            }

            if (entry.Opened)
            {
                SOS sos = new SOS(entry.Map, entry.Level);

                sos.MessageIndex   = entry.MessageIndex;
                sos.TargetLocation = entry.Location;
                return(sos);
            }
            else
            {
                return(new MessageInABottle(entry.Map, entry.Level));
            }
        }
Example #3
0
        private Item Construct(SOSEntry entry)
        {
            if (entry == null)
            {
                return(null);
            }

            if (entry.Opened)
            {
                SOS sos;

                if (entry.QuestItem)
                {
                    sos = new SaltySeaSOS(entry.Map, entry.Level);
                }
                else
                {
                    sos = new SOS(entry.Map, entry.Level);
                }

                sos.MessageIndex   = entry.MessageIndex;
                sos.TargetLocation = entry.Location;
                return(sos);
            }
            else
            {
                MessageInABottle mib;

                if (entry.QuestItem)
                {
                    mib = new SaltySeaMIB(entry.Map, entry.Level);
                }
                else
                {
                    mib = new MessageInABottle(entry.Map, entry.Level);
                }

                return(mib);
            }
        }
Example #4
0
        private int GetStatus(DaviesLockerEntry entry)
        {
            if (entry is SOSEntry)
            {
                SOSEntry sosEntry = (SOSEntry)entry;

                if (!sosEntry.Opened)
                {
                    return(1153570); // Unopened
                }
                if (sosEntry.IsAncient)
                {
                    return(1153572); // Ancient
                }
                return(1153571);     // Opened
            }
            else if (entry is TreasureMapEntry)
            {
                TreasureMapEntry mapEntry = (TreasureMapEntry)entry;

                if (mapEntry.Completed)
                {
                    return(1153582); // Completed
                }
                else if (mapEntry.Decoder != null)
                {
                    return(1153581); // Decoded
                }
                else
                {
                    return(1153580); // Not Decoded
                }
            }

            return(1153569); // Unknown
        }
Example #5
0
        public void TryAddEntry(Item item, Mobile from)
        {
            if (!CanUse(from) || item == null)
                return;

            if (!CheckRange(from))
                from.SendLocalizedMessage(3000268); // that is too far away.
            else if (!(item is TreasureMap || item is SOS || item is MessageInABottle))
                from.SendLocalizedMessage(1153564); // That is not a treasure map or message in a bottle.
            else if (!item.IsChildOf(from.Backpack))
                from.SendLocalizedMessage(1054107); // This item must be in your backpack.
            else if (m_Entries.Count >= 500)
                from.SendLocalizedMessage(1153565); // The locker is full
            else
            {
                DaviesLockerEntry entry = null;

                if (item is TreasureMap)
                    entry = new TreasureMapEntry((TreasureMap)item);
                else if (item is SOS)
                    entry = new SOSEntry((SOS)item);
                else if (item is MessageInABottle)
                    entry = new SOSEntry((MessageInABottle)item);

                if (entry != null)
                {
                    m_Entries.Add(entry);
                    from.CloseGump(typeof(DaviesLockerGump));
                    from.SendGump(new DaviesLockerGump(from, this));

                    item.Delete();

                    InvalidateProperties();
                }
            }
        }
Example #6
0
        private Item Construct(SOSEntry entry)
        {
            if (entry == null)
                return null;

            if (entry.Opened)
            {
                SOS sos = new SOS(entry.Map, entry.Level);

                sos.MessageIndex = entry.MessageIndex;
                sos.TargetLocation = entry.Location;
                return sos;
            }
            else
            {
                return new MessageInABottle(entry.Map, entry.Level);
            }
        }