Esempio n. 1
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (info.ButtonID == 0)
            {
                from.SendSound(85);
                from.CloseGump(typeof(HiddenVillageIconHelpGump));
            }
        }
Esempio n. 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);
                            this.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.
                }
            }
        }
Esempio n. 3
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is SmallBOD || dropped is LargeBOD)
            {
                if (!IsValidBulkOrder(dropped) || !SupportsBulkOrders(from))
                {
                    SayTo(from, 1045130);                       // That order is for some other shopkeeper.
                    return(false);
                }
                else if ((dropped is SmallBOD && !((SmallBOD)dropped).Complete) || (dropped is LargeBOD && !((LargeBOD)dropped).Complete))
                {
                    SayTo(from, 1045131);                       // You have not completed the order yet.
                    return(false);
                }

                Item reward;
                int  gold, fame;

                if (dropped is SmallBOD)
                {
                    ((SmallBOD)dropped).GetRewards(out reward, out gold, out fame);
                }
                else
                {
                    ((LargeBOD)dropped).GetRewards(out reward, out gold, out fame);
                }

                from.SendSound(0x3D);

                SayTo(from, 1045132);                   // Thank you so much!  Here is a reward for your effort.

                if (reward != null)
                {
                    from.AddToBackpack(reward);
                }

                if (gold > 1000)
                {
                    from.AddToBackpack(new BankCheck(gold));
                }
                else if (gold > 0)
                {
                    from.AddToBackpack(new Gold(gold));
                }

                Titles.AwardFame(from, fame, true);

                OnSuccessfulBulkOrderRecieve(from);

                dropped.Delete();
                return(true);
            }

            return(base.OnDragDrop(from, dropped));
        }
Esempio n. 4
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            return(base.OnDragDrop(from, dropped));

            if (from == null || dropped == null)
            {
                return(false);
            }

            if (dropped is BaseRanged && !m_ContainsBow)
            {
                m_ContainsBow = true;
                from.SendSound(GetDroppedSound(dropped), GetWorldLocation());

                DropItem(dropped);
                UpdateTotal(dropped, m_type, 0);
            }
            else if (dropped is BaseRanged && m_ContainsBow)
            {
                from.SendMessage("The quiver can only hold one bow!");
                return(false);
            }
            else if (dropped is Arrow || dropped is Bolt)
            {
                from.SendSound(GetDroppedSound(dropped), GetWorldLocation());

                DropItem(dropped);
                UpdateTotal(dropped, m_type, 0);
            }
            else if (dropped is BaseTub)
            {
                from.SendSound(GetDroppedSound(dropped), GetWorldLocation());

                DropItem(dropped);
                UpdateTotal(dropped, m_type, 0);
            }
            else
            {
                from.SendMessage("That is not an arrow, bolt, bow, or dip tub!");
                return(false);
            }
        }
Esempio n. 5
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is LargeBOD || dropped is SmallBOD)
            {
                if (!this.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1062385); // You must have the book in your backpack to add deeds to it.
                    return(false);
                }
                else if (!from.Backpack.CheckHold(from, dropped, true, true))
                {
                    return(false);
                }
                else if (this.m_Entries.Count < 500)
                {
                    if (dropped is LargeBOD)
                    {
                        this.m_Entries.Add(new BOBLargeEntry((LargeBOD)dropped));
                    }
                    else if (dropped is SmallBOD) // Sanity
                    {
                        this.m_Entries.Add(new BOBSmallEntry((SmallBOD)dropped));
                    }

                    this.InvalidateProperties();

                    if (this.m_Entries.Count / 5 > this.m_ItemCount)
                    {
                        this.m_ItemCount++;
                        this.InvalidateItems();
                    }

                    from.SendSound(0x42, this.GetWorldLocation());
                    from.SendLocalizedMessage(1062386); // Deed added to book.

                    if (from is PlayerMobile)
                    {
                        from.SendGump(new BOBGump((PlayerMobile)from, this));
                    }

                    dropped.Delete();

                    return(true);
                }
                else
                {
                    from.SendLocalizedMessage(1062387); // The book is full of deeds.
                    return(false);
                }
            }

            from.SendLocalizedMessage(1062388); // That is not a bulk order deed.
            return(false);
        }
Esempio n. 6
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!from.InRange(GetWorldLocation(), 2))
         from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
     else
     {
         from.CloseGump(typeof(InternalGump));
         from.SendGump(new InternalGump(this));
         from.SendSound(0x55);
     }
 }
Esempio n. 7
0
        public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
        {
            if (!this.CheckHold(from, item, true, true))
            {
                return(false);
            }

            BaseHouse house = BaseHouse.FindHouseAt(this);

            if (house != null && house.IsLockedDown(this))
            {
                if (item is VendorRentalContract || (item is Container && ((Container)item).FindItemByType(typeof(VendorRentalContract)) != null))
                {
                    from.SendLocalizedMessage(1062492); // You cannot place a rental contract in a locked down container.
                    return(false);
                }

                if (!house.LockDown(from, item, false))
                {
                    return(false);
                }
            }

            item.Location = new Point3D(p.X, p.Y, 0);

            this.AddItem(item);

            from.SendSound(this.GetDroppedSound(item), this.GetWorldLocation());

            ItemFlags.SetTaken(item, true);

            if (item.HonestyItem && item.HonestyPickup == DateTime.MinValue)
            {
                item.HonestyPickup = DateTime.UtcNow;
                item.StartHonestyTimer();

                if (item.HonestyOwner == null)
                {
                    Server.Services.Virtues.Honesty.AssignOwner(item);
                }

                from.SendLocalizedMessage(1151536); // You have three hours to turn this item in for Honesty credit, otherwise it will cease to be a quest item.
            }

            if (Siege.SiegeShard && this != from.Backpack && from is PlayerMobile && ((PlayerMobile)from).BlessedItem != null && ((PlayerMobile)from).BlessedItem == item)
            {
                ((PlayerMobile)from).BlessedItem = null;
                item.LootType = LootType.Regular;

                from.SendLocalizedMessage(1075292, item.Name != null ? item.Name : "#" + item.LabelNumber.ToString()); // ~1_NAME~ has been unblessed.
            }

            return(true);
        }
Esempio n. 8
0
            public override void OnResponse(NetState state, RelayInfo info)
            {
                Mobile from = state.Mobile;

                from.SendSound(0x55);

                if (info.ButtonID > 0)
                {
                    from.SendGump(new BoardMessage(from, info.ButtonID));
                }
            }
Esempio n. 9
0
 public virtual void PlaySound(Mobile m)
 {
     if (!m.Hidden || m.IsPlayer())
     {
         Effects.PlaySound(m.Location, m.Map, 0x20E);
     }
     else
     {
         m.SendSound(0x20E);
     }
 }
Esempio n. 10
0
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;

            int turner = MuseumBook.GetNext(m_Book);

            if (info.ButtonID == 901)
            {
                if (turner > 30)
                {
                    turner = 1;
                }
                from.SendSound(0x4A); from.SendGump(new MuseumBookGump(from, m_Book, 1, turner));
            }
            else if (info.ButtonID == 902)
            {
                if (turner < 31)
                {
                    turner = 31;
                }
                from.SendSound(0x4A); from.SendGump(new MuseumBookGump(from, m_Book, 2, turner));
            }
            else if (info.ButtonID == 903)
            {
                from.SendSound(0x4A); from.SendGump(new MuseumBookGump(from, m_Book, 3, 1));
            }
            else if (info.ButtonID > 0)
            {
                from.SendSound(0x4A);
                int page = 1;
                if (info.ButtonID > 30)
                {
                    page = 2;
                }
                from.SendGump(new MuseumBookGump(from, m_Book, page, info.ButtonID));
            }
            else
            {
                from.SendSound(0x55);
            }
        }
Esempio n. 11
0
        public override bool OnDragDropInto(Mobile from, Item dropped, Point3D point3d)
        {
            BaseHouse housefoundation = BaseHouse.FindHouseAt(this);
            Item      item            = dropped as Item;

            if (dropped.Weight + dropped.TotalWeight + this.TotalWeight >= this.MaxWeight)
            {
                if (IsLockedDown)
                {
                    from.SendMessage(38, "Seems to be just a Decoration Mailbox.");
                }

                if (IsSecure)
                {
                    from.SendMessage(38, "This will be to much weight for the Mailbox to hold.");
                }
                return(false);
            }

            if ((housefoundation == null) & (this.PublicCanDrop == true))
            {
                from.SendMessage(68, "You put that into the Mailbox.");
                DropItem(dropped);
                from.SendSound(GetDroppedSound(item), GetWorldLocation());
                AdjustMailboxFlagUp(this);
                return(true);       //false for the moment cause of losing bag
            }
            else if ((housefoundation != null) & (this.IsSecure))
            {
                from.SendMessage(68, "You put that into the Mailbox.");
                DropItem(dropped);
                from.SendSound(GetDroppedSound(item), GetWorldLocation());
                AdjustMailboxFlagUp(this);
                return(true);       //false for the moment cause of losing bag
            }
            else
            {
                from.SendMessage(38, "You can not do that.");
                return(false);
            }
        }
Esempio n. 12
0
        public void OnForensicEval(Mobile m)
        {
            if (!m.Player)
            {
                return;
            }

            var quest = QuestHelper.GetQuest <GoingGumshoeQuest2>((PlayerMobile)m);

            if (quest != null)
            {
                m.PrivateOverheadMessage(MessageType.Regular, 0x47E, 1157722, "Forensics", m.NetState); // *Your proficiency in ~1_SKILL~ reveals more about the item*
                m.SendLocalizedMessage(1158612, null, 0x23);                                            // You have identified a clue! This item seems pertinent to the investigation!

                m.SendSound(quest.UpdateSound);
                m.SendSound(m.Female ? 0x30B : 0x41A);

                m.CloseGump(typeof(GumshoeItemGump));
                m.SendGump(new GumshoeItemGump(m, ItemID, Hue, ItemName, Cliloc, null));
            }
        }
Esempio n. 13
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (info.ButtonID == 0)
            {
                from.SendSound(85);
                from.CloseGump(typeof(ServerBlessBuffIconGump));
                from.CloseGump(typeof(ServerBlessBuffIconHelpGump));
                from.SendGump(new ServerBlessBuffIconGump(from, loop1_intbonustogive, loop1_dexbonustogive, loop1_strbonustogive));
                from.SendGump(new ServerBlessBuffIconHelpGump(from, loop1_intbonustogive, loop1_dexbonustogive, loop1_strbonustogive));
            }
            if (info.ButtonID == 1)
            {
                from.SendSound(85);
                from.CloseGump(typeof(ServerBlessBuffIconGump));
                from.CloseGump(typeof(ServerBlessBuffIconHelpGump));
                from.SendGump(new ServerBlessBuffIconGump(from, loop1_intbonustogive, loop1_dexbonustogive, loop1_strbonustogive));
                from.SendGump(new ServerBlessBuffIconHelpGump(from, loop1_intbonustogive, loop1_dexbonustogive, loop1_strbonustogive));
            }
        }
Esempio n. 14
0
            public void CheckRevealMystery(Mobile from)
            {
                if (m_Discoveries.Count >= DiscoveriesRequired && m_ResearchAdded >= ResearchRequired)
                {
                    int TotalValues = 0;

                    Dictionary <MysteryType, int> DictMysteryTypes = new Dictionary <MysteryType, int>();

                    for (int a = 0; a < DiscoveriesRequired; a++)
                    {
                        MysteryType mysteryType = m_Discoveries[a];

                        if (DictMysteryTypes.ContainsKey(mysteryType))
                        {
                            DictMysteryTypes[mysteryType]++;
                        }
                        else
                        {
                            DictMysteryTypes.Add(mysteryType, 1);
                        }
                    }

                    foreach (KeyValuePair <MysteryType, int> pair in DictMysteryTypes)
                    {
                        TotalValues += pair.Value;
                    }

                    double mysteryCheck = Utility.RandomDouble();

                    double CumulativeAmount = 0.0;
                    double AdditionalAmount = 0.0;

                    //Determine Mystery
                    foreach (KeyValuePair <MysteryType, int> pair in DictMysteryTypes)
                    {
                        AdditionalAmount = (double)pair.Value / (double)TotalValues;

                        if (mysteryCheck >= CumulativeAmount && mysteryCheck < (CumulativeAmount + AdditionalAmount))
                        {
                            m_RevealedMysteryType = pair.Key;
                        }

                        CumulativeAmount += AdditionalAmount;
                    }

                    from.SendSound(0x0F8);
                    m_Revealed = true;

                    MysteryTypeDetail mysteryTypeDetail = AncientMystery.GetMysteryDetails(m_RevealedMysteryType);

                    from.SendMessage("You have revealed the mystery! It is " + mysteryTypeDetail.m_Name + ".");
                }
            }
Esempio n. 15
0
        public static bool ClaimBods(Mobile from, Item bod)
        {
            Item reward;
            int  gold, fame;

            if ((bod is SmallBOD && !((SmallBOD)bod).Complete) || (bod is LargeBOD && !((LargeBOD)bod).Complete))
            {
                from.SendMessage(32, "You have not completed the order yet.");
                return(false);
            }

            if (bod is SmallBOD)
            {
                ((SmallBOD)bod).GetRewards(out reward, out gold, out fame);
            }
            else if (bod is LargeBOD)
            {
                ((LargeBOD)bod).GetRewards(out reward, out gold, out fame);
            }
            else
            {
                from.SendMessage(32, "This isn't an acceptable bod");
                return(false);
            }

            from.SendSound(0x3D);

            from.SendLocalizedMessage(1045132);               // Thank you so much!  Here is a reward for your effort.

            if (reward != null)
            {
                from.AddToBackpack(reward);
            }

            if (gold > 1000)
            {
                from.AddToBackpack(new BankCheck(gold));
            }
            else if (gold > 0)
            {
                from.AddToBackpack(new Gold(gold));
            }

            if (OWLTROptionsManager.IsEnabled(OWLTROptionsManager.OPTIONS_ENUM.BOD_GIVE_TOKENS) && gold > 100)
            {
                GiveTokens.RewardTokens(from, (int)(gold / 100));
            }

            Titles.AwardFame(from, fame, true);

            bod.Delete();
            return(true);
        }
Esempio n. 16
0
        public void RenderString(Mobile from)
        {
            AddHtml(150, 15, 320, 22, string.Format("<BASEFONT COLOR=#D5D52A><DIV ALIGN=CENTER>{0}</DIV>", Title), false, false);
            AddHtml(150, 46, 320, 44, string.Format("<BASEFONT COLOR=#AABFD4><DIV ALIGN=CENTER>{0}</DIV>", Description), false, false);
            AddHtml(150, 99, 320, 98, string.Format("<BASEFONT COLOR=#DFDFDF>{0}", Line1), false, false);
            AddHtml(150, 197, 320, 98, string.Format("<BASEFONT COLOR=#DFDFDF>{0}", Line2), false, false);

            from.CloseGump(typeof(QuestRewardGump));
            from.SendGump(this);
            from.PrivateOverheadMessage(MessageType.Regular, 0x47E, 1157722, "its origin", from.NetState); // *Your proficiency in ~1_SKILL~ reveals more about the item*
            from.SendSound(from.Female ? 0x30B : 0x41A);
        }
Esempio n. 17
0
        public void CompleteCommission(Mobile from)
        {
            if (from == null)
            {
                return;
            }

            from.SendSound(0x5AE);
            from.SendMessage("You fill the fishing commission deed.");

            from.AddToBackpack(new FishCommissionCompletedDeed());
        }
Esempio n. 18
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from is PlayerMobile)
            {
                bool HasTome = false;

                ArrayList targets = new ArrayList();
                foreach (Item item in World.Items.Values)
                {
                    if (item is QuestTome)
                    {
                        if (((QuestTome)item).QuestTomeOwner == from)
                        {
                            targets.Add(item);
                            HasTome = true;
                        }
                    }
                }
                for (int i = 0; i < targets.Count; ++i)
                {
                    Item item = ( Item )targets[i];
                    item.ItemID = ItemID;
                    item.Name   = Name;
                    item.Hue    = Hue;
                    from.AddToBackpack(item);
                    from.SendMessage("You take possession of the book!");
                    from.SendSound(0x3D);
                    this.Delete();
                }

                if (!HasTome)
                {
                    SetupBook(from);
                    from.SendMessage("You take possession of the book!");
                    from.SendSound(0x3D);
                    LoggingFunctions.LogGeneric(from, "has found a Book of Questing.");
                    this.Delete();
                }
            }
        }
Esempio n. 19
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.InRange(this.GetWorldLocation(), 2))
            {
                if (CharacterDatabase.GetBardsTaleQuest(from, "BardsTaleKylearanKey") && CharacterDatabase.GetBardsTaleQuest(from, "BardsTaleSpectreEye"))
                {
                    from.PrivateOverheadMessage(MessageType.Regular, 1150, false, "You find nothing of interest.", from.NetState);
                }
                else
                {
                    CharacterDatabase.SetBardsTaleQuest(from, "BardsTaleKylearanKey", true);
                    CharacterDatabase.SetBardsTaleQuest(from, "BardsTaleSpectreEye", true);
                    from.SendSound(0x3D);
                    from.PrivateOverheadMessage(MessageType.Regular, 1150, false, "You found a key with a symbol of a unicorn on it.", from.NetState);
                    from.CloseGump(typeof(Server.Gumps.ClueGump));
                    from.SendGump(new Server.Gumps.ClueGump("You found a key with a symbol of a unicorn on it, along with a magical book of items.", "Tarjan's Death"));

                    if (!Server.Items.CharacterDatabase.GetSpecialsKilled(from, "Tarjan"))
                    {
                        Server.Items.CharacterDatabase.SetSpecialsKilled(from, "Tarjan", true);
                        ManualOfItems book = new ManualOfItems();
                        book.Hue        = 0x5B7;
                        book.Name       = "Tome of Tarjan Relics";
                        book.m_Charges  = 1;
                        book.m_Skill_1  = 99;
                        book.m_Skill_2  = 32;
                        book.m_Skill_3  = 0;
                        book.m_Skill_4  = 0;
                        book.m_Skill_5  = 0;
                        book.m_Value_1  = 10.0;
                        book.m_Value_2  = 10.0;
                        book.m_Value_3  = 0.0;
                        book.m_Value_4  = 0.0;
                        book.m_Value_5  = 0.0;
                        book.m_Slayer_1 = 11;
                        book.m_Slayer_2 = 0;
                        book.m_Owner    = from;
                        book.m_Extra    = "of the Mad God";
                        book.m_FromWho  = "Taken from Tarjan";
                        book.m_HowGiven = "Acquired by";
                        book.m_Points   = 100;
                        book.m_Hue      = 0x5B7;
                        from.AddToBackpack(book);
                        from.SendMessage("A book has been added to your pack!");
                    }
                }
            }
            else
            {
                from.SendLocalizedMessage(502138);                   // That is too far away for you to use
            }
        }
Esempio n. 20
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (info.ButtonID == 0)
            {
                from.SendSound(85);
                from.CloseGump(typeof(ServerResistanceBuffIconGump));
                from.CloseGump(typeof(ServerResistanceBuffIconHelpGump));
                from.SendGump(new ServerResistanceBuffIconGump(from, loop1_physicalresistancebonustogive, loop1_fireresistancebonusbonustogive, loop1_coldresistancebonusbonustogive, loop1_poisonresistancebonusbonustogive, loop1_energyresistancebonusbonustogive));
                from.SendGump(new ServerResistanceBuffIconHelpGump(from, loop1_physicalresistancebonustogive, loop1_fireresistancebonusbonustogive, loop1_coldresistancebonusbonustogive, loop1_poisonresistancebonusbonustogive, loop1_energyresistancebonusbonustogive));
            }

            if (info.ButtonID == 1)
            {
                from.SendSound(85);
                from.CloseGump(typeof(ServerResistanceBuffIconGump));
                from.CloseGump(typeof(ServerResistanceBuffIconHelpGump));
                from.SendGump(new ServerResistanceBuffIconGump(from, loop1_physicalresistancebonustogive, loop1_fireresistancebonusbonustogive, loop1_coldresistancebonusbonustogive, loop1_poisonresistancebonusbonustogive, loop1_energyresistancebonusbonustogive));
                from.SendGump(new ServerResistanceBuffIconHelpGump(from, loop1_physicalresistancebonustogive, loop1_fireresistancebonusbonustogive, loop1_coldresistancebonusbonustogive, loop1_poisonresistancebonusbonustogive, loop1_energyresistancebonusbonustogive));
            }
        }
Esempio n. 21
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack))
     {
         from.SendLocalizedMessage(1060640);                   // The item must be in your backpack to use it.
     }
     else
     {
         from.SendSound(0x54D);
         from.CloseGump(typeof(MaterialLiquifierGump));
         from.SendGump(new MaterialLiquifierGump(from));
     }
 }
Esempio n. 22
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (info.ButtonID != 1)
            {
                from.SendGump(new WealthBar(from));
            }
            else
            {
                from.SendSound(0x4A);
            }
        }
Esempio n. 23
0
 public override void OnDoubleClick(Mobile e)
 {
     if (e.InRange(this.GetWorldLocation(), 6))
     {
         e.CloseGump(typeof(AdminBoardGump));
         e.SendGump(new AdminBoardGump(e));
         e.SendSound(0x55);
     }
     else
     {
         e.SendLocalizedMessage(502138);                   // That is too far away for you to use
     }
 }
Esempio n. 24
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!from.InRange(GetWorldLocation(), 2))
     {
         from.LocalOverheadMessage(Network.MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
     }
     else
     {
         from.CloseGump(typeof(BaseLocalizedBookGump));
         from.SendGump(new BaseLocalizedBookGump(this));
         from.SendSound(0x55);
     }
 }
Esempio n. 25
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (TryDropItem(from, dropped, true))
            {
                from.SendSound(GetDroppedSound(dropped), GetWorldLocation());

                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 26
0
        public void OnForensicEval(Mobile m)
        {
            if (!m.Player)
            {
                return;
            }

            m.PrivateOverheadMessage(MessageType.Regular, 0x47E, 1157722, "Forensics", m.NetState); // *Your proficiency in ~1_SKILL~ reveals more about the item*
            m.SendSound(m.Female ? 0x30B : 0x41A);

            m.CloseGump(typeof(JackCorpseGump));
            m.SendGump(new JackCorpseGump());
        }
Esempio n. 27
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack))
     {
         from.SendLocalizedMessage(1060640);                   // The item must be in your backpack to use it.
     }
     else
     {
         from.SendSound(0x2D);
         from.CloseGump(typeof(PaganArtifactGump));
         from.SendGump(new PaganArtifactGump(this));
     }
 }
Esempio n. 28
0
        public void AddMessage(Message msg)
        {
            c_Messages.Add(msg);

            if (c_MsgSound)
            {
                c_Mobile.SendSound(GetSound(msg.From));
            }

            if (c_WhenFull && c_Messages.Count > s_MaxMsgs)
            {
                c_Messages.RemoveAt(0);
            }
        }
        public override void OnDoubleClick(Mobile m)
        {
            if (Timer == null)
            {
                m.SendLocalizedMessage(1157631); // Thou shall know the pain of a chained heart...
                m.SendSound(Utility.RandomMinMax(0x423, 0x427));

                Timer = new InternalTimer(m, this);
            }
            else
            {
                m.SendLocalizedMessage(1157630); // You are already bleeding!
            }
        }
Esempio n. 30
0
        public virtual bool OnDragDropInto(Mobile from, Item item, Point3D p)
        {
            if (!CheckHold(from, item, true, true))
            {
                return(false);
            }

            item.Location = new Point3D(p.m_X, p.m_Y, 0);
            AddItem(item);

            from.SendSound(GetDroppedSound(item), GetWorldLocation());

            return(true);
        }
Esempio n. 31
0
            public void AddDiscovery(Mobile from)
            {
                int         mysteryTypeCount = Enum.GetNames(typeof(MysteryType)).Length;
                MysteryType mysteryType      = (MysteryType)Utility.RandomMinMax(0, mysteryTypeCount - 1);

                MysteryTypeDetail mysteryTypeDetail = AncientMystery.GetMysteryDetails(mysteryType);

                m_Discoveries.Add(mysteryType);
                from.SendMessage("You have made a discovery towards the mystery!");

                from.SendSound(0x102);

                CheckRevealMystery(from);
            }
Esempio n. 32
0
		public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
		{
			if ( !CheckHold( from, item, true, true ) )
				return false;

			BaseHouse house = BaseHouse.FindHouseAt( this );

			if ( house != null && house.IsLockedDown( this ) )
			{
				if ( !house.LockDown( from, item, false ) )
					return false;
			}

			item.Location = new Point3D( p.X, p.Y, 0 );
			AddItem( item );

			from.SendSound( GetDroppedSound( item ), GetWorldLocation() );

			return true;
		}
Esempio n. 33
0
        public override bool StackWith(Mobile from, Item dropped)
        {
            if (dropped is ResourceBit)
            {
                ResourceBit newBit = dropped as ResourceBit;
                if (newBit.Resource == Resource)
                {
                    this.Amount += newBit.Amount;
                    newBit.Delete();

                    if (from != null)
                    {
                        from.SendSound(0x42, GetWorldLocation());
                    }
                }
                else
                    return false;
            }

            return false;
        }
Esempio n. 34
0
        public override bool StackWith( Mobile from, Item dropped, bool playSound )
        {
            if ( Stackable && dropped.Stackable && dropped.GetType() == GetType() && dropped.ItemID == ItemID && dropped.Hue == Hue )
            {
                if( (dropped.Amount + Amount) > 5 )
                {
                    from.SendMessage( "You cannot stack more than five of these pieces together." );
                    return false;
                }

                if( ((ItemPiece)dropped).Resource != this.Resource || ((ItemPiece)dropped).Type != this.Type )
                {
                    from.SendMessage( "You cannot stack pieces of different types or resources." );
                    return false;
                }

                if( ((ItemPiece)dropped).Assembled || this.Assembled )
                {
                    from.SendMessage( "You cannot stack pieces that are already assembled." );
                    return false;
                }

                if( ((ItemPiece)dropped).Masterwork != this.Masterwork )
                {
                    from.SendMessage( "You cannot stack pieces of different quality." );
                    return false;
                }

                if ( LootType != dropped.LootType )
                    LootType = LootType.Regular;

                Amount += dropped.Amount;
                dropped.Delete();

                if ( playSound && from != null )
                {
                    int soundID = GetDropSound();

                    if ( soundID == -1 )
                        soundID = 0x42;

                    from.SendSound( soundID, GetWorldLocation() );
                }

                return true;
            }

            return false;
        }
Esempio n. 35
0
        public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
        {
            if (!this.CheckHold(from, item, true, true))
                return false;

            BaseHouse house = BaseHouse.FindHouseAt(this);

            if (house != null && house.IsLockedDown(this))
            {
                if (item is VendorRentalContract || (item is Container && ((Container)item).FindItemByType(typeof(VendorRentalContract)) != null))
                {
                    from.SendLocalizedMessage(1062492); // You cannot place a rental contract in a locked down container.
                    return false;
                }

                if (!house.LockDown(from, item, false))
                    return false;
            }

            item.Location = new Point3D(p.X, p.Y, 0);
            this.AddItem(item);

            from.SendSound(this.GetDroppedSound(item), this.GetWorldLocation());

            ItemFlags.SetTaken(item, true);

            return true;
        }
Esempio n. 36
0
        public override bool OnDragDrop( Mobile from, Item dropped )
        {
            if ( TryDropItem( from, dropped, true ) )
            {
                from.SendSound( GetDroppedSound( dropped ), GetWorldLocation() );

                return true;
            }
            else
            {
                return false;
            }
        }
Esempio n. 37
0
        public virtual bool StackWith(Mobile from, DonatorDeed dropped, bool playSound)
        {
            if (dropped.GetType() == this.GetType() && dropped.ItemID == this.ItemID && dropped.Hue == this.Hue && this.Amount + dropped.Amount <= 65535)
            {
                if (this.LootType != dropped.LootType)
                {
                    this.LootType = dropped.LootType;
                }

                this.Amount += dropped.Amount;
                dropped.Delete();

                if (playSound && from != null)
                {
                    int soundID = this.GetDropSound();

                    if (soundID == -1)
                    {
                        soundID = 0x42;
                    }

                    from.SendSound(soundID, this.GetWorldLocation());
                }

                return true;
            }

            return false;
        }
        //Automatically stack if possible
        public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
        {
            if ( Items.Count < DefaultMaxItems )
                return base.OnDragDropInto( from, item, p );
            else if ( TryDropItem( from, item, false ) )
            {
                int soundID = GetDropSound();

                if ( soundID == -1 )
                    soundID = 0x42;

                from.SendSound( soundID, GetWorldLocation() );

                return true;
            }

            return false;
        }
Esempio n. 39
0
        public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
        {
            if ( !CheckHold( from, item, true, true ) )
                return false;

            item.Location = new Point3D( p.X, p.Y, 0 );
            AddItem( item );

            from.SendSound( GetDroppedSound( item ), GetWorldLocation() );

            return true;
        }
Esempio n. 40
0
		//This is called when an item is placed into an open container
		public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
		{
			// Adam: Disallow dropping on an open Deco container
			if ( base.Deco )
				return false;

            // adam: Don't invoke Use() on this FakeContainer when it's dropped into a container
            if (item is FakeContainer)
                (item as FakeContainer).ClearReadyState();

			if ( !CheckHold( from, item, true, true ) )
				return false;

			//			BaseHouse house = BaseHouse.FindHouseAt( this );

			//			if ( house != null && house.IsLockedDown( this ) && !house.LockDown( from, item, false ) )
			//				return false;

			item.Location = new Point3D( p.X, p.Y, 0 );
			AddItem( item );

			from.SendSound( GetDroppedSound( item ), GetWorldLocation() );

			return true;
		}
Esempio n. 41
0
        public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
        {
            if (mOwner.Owner == from)
            {
                if (!this.CheckHold(from, item, true, true))
                {
                    return false;
                }

                item.Location = new Point3D(p.X, p.Y, 0);
                this.AddItem(item);

                from.SendSound(this.GetDroppedSound(item), this.GetWorldLocation());

                ItemFlags.SetTaken(item, true);

                return true;
            }
            else
            {
                from.SendMessage("Only the Steward's owner may add items to their backpack.");
            }
            return base.OnDragDropInto(from, item, p);
        }
Esempio n. 42
0
		public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
		{
			if ( !CheckHold( from, item, true, true ) )
				return false;

			BaseHouse house = BaseHouse.FindHouseAt( this );

			if ( house != null && house.IsLockedDown( this ) )
			{
				if ( item is VendorRentalContract || ( item is Container && ((Container)item).FindItemByType( typeof( VendorRentalContract ) ) != null ) )
				{
					from.SendLocalizedMessage( 1062492 ); // You cannot place a rental contract in a locked down container.
					return false;
				}

				if ( !house.LockDown( from, item, false ) )
					return false;
			}

			item.Location = new Point3D( p.X, p.Y, 0 );
			AddItem( item );

			from.SendSound( GetDroppedSound( item ), GetWorldLocation() );
			
			// ARTEGORDONMOD
			// Begin mod for spawner release of items
			// set flag to have item taken off spawner list at next defrag
            ItemFlags.SetTaken(item,true);
            // End mod for spawner release of items

			return true;
		}
Esempio n. 43
0
		public override bool OnDragDropInto( Mobile from, Item dropped, Point3D point3d )
		{
			
			BaseHouse housefoundation = BaseHouse.FindHouseAt(this);
        	Item item = dropped as Item;

        	if (dropped.Weight + dropped.TotalWeight + this.TotalWeight >= this.MaxWeight)
        	{
        		if (IsLockedDown)
	        		from.SendMessage(38,"Seems to be just a Decoration Mailbox.");

        		if (IsSecure)
        			from.SendMessage(38,"This will be to much weight for the Mailbox to hold.");
        		return false;
        	}

        	if ((housefoundation == null) & (this.PublicCanDrop == true))
        	{
        		from.SendMessage(68,"You put that into the Mailbox.");
        		DropItem( dropped );
        		from.SendSound( GetDroppedSound( item ), GetWorldLocation() );
        		AdjustMailboxFlagUp(this);        		
        		return true;//false for the moment cause of losing bag
        	}
        	else if((housefoundation != null) & (this.IsSecure))
        	{
        		from.SendMessage(68,"You put that into the Mailbox.");
        		DropItem( dropped );
        		from.SendSound( GetDroppedSound( item ), GetWorldLocation() );
        		AdjustMailboxFlagUp(this);
        		return true;//false for the moment cause of losing bag
        	}
        	else
        	{
        		from.SendMessage(38,"You can not do that.");
        		return false;
        	}
		}        
Esempio n. 44
0
        public override bool OnDragDrop( Mobile from, Item dropped )
        {
            if ( dropped is SmallBOD || dropped is LargeBOD )
            {
                if( Core.ML )
                {
                    if( ((PlayerMobile)from).NextBODTurnInTime > DateTime.Now )
                    {
                        SayTo( from, 1079976 );	//
                        return false;
                    }
                }

                if ( !IsValidBulkOrder( dropped ) || !SupportsBulkOrders( from ) )
                {
                    SayTo( from, 1045130 ); // That order is for some other shopkeeper.
                    return false;
                }
                else if ( ( dropped is SmallBOD && !( (SmallBOD)dropped ).Complete ) || ( dropped is LargeBOD && !( (LargeBOD)dropped ).Complete ) )
                {
                    SayTo( from, 1045131 ); // You have not completed the order yet.
                    return false;
                }

                Item reward;
                int gold, fame;

                if ( dropped is SmallBOD )
                    ( (SmallBOD)dropped ).GetRewards( out reward, out gold, out fame );
                else
                    ( (LargeBOD)dropped ).GetRewards( out reward, out gold, out fame );

                from.SendSound( 0x3D );

                SayTo( from, 1045132 ); // Thank you so much!  Here is a reward for your effort.

                if ( reward != null )
                    from.AddToBackpack( reward );

                if ( gold > 1000 )
                    from.AddToBackpack( new BankCheck( gold ) );
                else if ( gold > 0 )
                    from.AddToBackpack( new Gold( gold ) );

                Titles.AwardFame( from, fame, true );

                OnSuccessfulBulkOrderReceive( from );

                if( Core.ML )
                {
                    ((PlayerMobile)from).NextBODTurnInTime = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
                }

                dropped.Delete();
                return true;
            }

            return base.OnDragDrop( from, dropped );
        }
Esempio n. 45
0
        public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
        {
            if (!this.CheckHold(from, item, true, true))
                return false;

            BaseHouse house = BaseHouse.FindHouseAt(this);

            if (house != null && house.IsLockedDown(this))
            {
                if (item is VendorRentalContract || (item is Container && ((Container)item).FindItemByType(typeof(VendorRentalContract)) != null))
                {
                    from.SendLocalizedMessage(1062492); // You cannot place a rental contract in a locked down container.
                    return false;
                }

                if (!house.LockDown(from, item, false))
                    return false;
            }

            item.Location = new Point3D(p.X, p.Y, 0);
            this.AddItem(item);

            from.SendSound(this.GetDroppedSound(item), this.GetWorldLocation());

            ItemFlags.SetTaken(item, true);

            if (item.HonestyItem && item.HonestyPickup == DateTime.MinValue)
            {
                item.HonestyPickup = DateTime.UtcNow;
                item.StartHonestyTimer();

                from.SendLocalizedMessage(1151536); // You have three hours to turn this item in for Honesty credit, otherwise it will cease to be a quest item.
            }
            return true;
        }
Esempio n. 46
0
		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			if ( dropped is LargeBOD || dropped is SmallBOD )
			{
				if ( !IsChildOf( from.Backpack ) )
				{
					from.SendLocalizedMessage( 1062385 ); // You must have the book in your backpack to add deeds to it.
					return false;
				}
				else if ( !from.Backpack.CheckHold( from, dropped, true, true ) )
					return false;
				else if ( m_Entries.Count < 500 )
				{
					if ( dropped is LargeBOD )
						m_Entries.Add( new BOBLargeEntry( (LargeBOD)dropped ) );
					else if ( dropped is SmallBOD ) // Sanity
						m_Entries.Add( new BOBSmallEntry( (SmallBOD)dropped ) );
					
					InvalidateProperties();
					
					if ( m_Entries.Count / 5 > m_ItemCount )
					{
						m_ItemCount++;
						InvalidateItems();
					}

					from.SendSound(0x42, GetWorldLocation());
					from.SendLocalizedMessage( 1062386 ); // Deed added to book.

					if ( from is PlayerMobile )
						from.SendGump( new BOBGump( (PlayerMobile)from, this ) );

					dropped.Delete();

					return true;
				}
				else
				{
					from.SendLocalizedMessage( 1062387 ); // The book is full of deeds.
					return false;
				}
			}

			from.SendLocalizedMessage( 1062388 ); // That is not a bulk order deed.
			return false;
		}
Esempio n. 47
0
		public override bool OnDragDrop(Mobile m, Item dropped)
		{
			// trigger returns true if returnoverride
			if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) &&
				UberScriptTriggers.Trigger(this, m, TriggerName.onDragDrop, dropped))
			{
				return true;
			}

			/* TODO: Thou art giving me? and fame/karma for gold gifts */

			if (dropped is SmallBOD || dropped is LargeBOD)
			{
				var pm = m as PlayerMobile;

				if (EraML && pm != null && pm.NextBODTurnInTime > DateTime.UtcNow)
				{
					SayTo(m, 1079976); // You'll have to wait a few seconds while I inspect the last order.
				}
				else
				{
					var sbod = dropped as SmallBOD;
					var lbod = dropped as LargeBOD;

					if (!IsValidBulkOrder(dropped) || !SupportsBulkOrders(m))
					{
						SayTo(m, 1045130); // That order is for some other shopkeeper.
					}
					else if ((sbod != null && !sbod.Complete) || (lbod != null && !lbod.Complete))
					{
						SayTo(m, 1045131); // You have not completed the order yet.
					}
					else
					{
						Item reward;
						int currency, fame;

						if (sbod != null)
						{
							sbod.GetRewards(out reward, out currency, out fame);
						}
						else
						{
							lbod.GetRewards(out reward, out currency, out fame);
						}

						if (reward != null || currency > 0)
						{
							Item rewardCurrency = null;

							if (currency > PseudoSeerStone.MaxBODGoldRewardAllowed)
							{
								currency = PseudoSeerStone.MaxBODGoldRewardAllowed;
							}

							if (currency > 1000)
							{
								rewardCurrency = new BankCheck(currency);
							}
							else if (currency > 0)
							{
								rewardCurrency = new Gold(currency);
							}

							/*if ( ( reward != null && !from.Backpack.CheckHold( from, reward, false ) ) || ( rewardgold != null && !from.Backpack.CheckHold( from, rewardgold, false ) ) )*/

							var items = new List<Item>();

							if (reward != null)
							{
								m.SendMessage(String.Format("Attempting to drop a reward {0} ({1})", reward.GetType(), reward.PileWeight));
								items.Add(reward);
							}

							if (rewardCurrency != null)
							{
								m.SendMessage(
									String.Format("Attempting to drop a reward {0} ({1})", rewardCurrency.GetType(), rewardCurrency.PileWeight));
								items.Add(rewardCurrency);
							}

							if (items.Count > 0 && m.Backpack.TryDropItems(m, false, items.ToArray()))
							{
								m.SendSound(0x3D);
								SayTo(m, 1045132); // Thank you so much!  Here is a reward for your effort.

								Titles.AwardFame(m, fame, true);

								OnSuccessfulBulkOrderReceive(m, dropped);

								if (EraML && pm != null)
								{
									pm.NextBODTurnInTime = DateTime.UtcNow + TimeSpan.FromSeconds(10.0);
								}

								dropped.Delete();
								return true;
							}

							SayTo(m, 1045129); // You do not have enough room in your backpack for the bulk request's reward.

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

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

				return false;
			}

			return base.OnDragDrop(m, dropped);
		}
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is SmallBOD || dropped is LargeBOD)
            {
                if (!IsValidBulkOrder(dropped) || !SupportsBulkOrders(from))
                {
                    SayTo(from, 1045130); // That order is for some other shopkeeper.
                    return false;
                }
                else if ((dropped is SmallBOD && !((SmallBOD)dropped).Complete) || (dropped is LargeBOD && !((LargeBOD)dropped).Complete))
                {
                    SayTo(from, 1045131); // You have not completed the order yet.
                    return false;
                }

                Item reward;
                int gold, fame;

                if (dropped is SmallBOD)
                    ((SmallBOD)dropped).GetRewards(out reward, out gold, out fame);
                else
                    ((LargeBOD)dropped).GetRewards(out reward, out gold, out fame);

                from.SendSound(0x3D);

                SayTo(from, 1045132); // Thank you so much!  Here is a reward for your effort.

                if (reward != null)
                    from.AddToBackpack(reward);

                if (gold > 1000)
                    from.AddToBackpack(new BankCheck(gold));
                else if (gold > 0)
                    from.AddToBackpack(new Gold(gold));

                Titles.AwardFame(from, fame, true);

                dropped.Delete();
                return true;
            }

            return base.OnDragDrop(from, dropped);
        }
        public override bool OnDragDrop( Mobile from, Item dropped )
        {
            /* TODO: Thou art giving me? and fame/karma for gold gifts */

            if ( dropped is SmallBOD || dropped is LargeBOD )
            {
                if( Core.ML )
                {
                    if( ((PlayerMobile)from).NextBODTurnInTime > DateTime.Now )
                    {
                        SayTo( from, 1079976 );	//
                        return false;
                    }
                }

                SmallBOD sbod = dropped as SmallBOD;
                LargeBOD lbod = dropped as LargeBOD;

                if ( !IsValidBulkOrder( dropped ) || !SupportsBulkOrders( from ) )
                    SayTo( from, 1045130 ); // That order is for some other shopkeeper.
                else if ( ( sbod != null && !sbod.Complete ) || ( lbod != null && !lbod.Complete ) )
                    SayTo( from, 1045131 ); // You have not completed the order yet.
                else
                {
                    Item reward;
                    int gold, fame;

                    if ( sbod != null )
                        sbod.GetRewards( out reward, out gold, out fame );
                    else
                        lbod.GetRewards( out reward, out gold, out fame );

                    if ( reward != null || gold > 0 )
                    {
                        Item rewardgold = null;

                        if ( gold > 1000 )
                            rewardgold = new BankCheck( gold );
                        else if ( gold > 0 )
                            rewardgold = new Gold( gold );

                        /*if ( ( reward != null && !from.Backpack.CheckHold( from, reward, false ) ) || ( rewardgold != null && !from.Backpack.CheckHold( from, rewardgold, false ) ) )*/

                        if ( reward != null && rewardgold != null && from.Backpack.TryDropItems( from, false, reward, rewardgold ) )
                        {
                            from.SendSound( 0x3D );
                            SayTo( from, 1045132 ); // Thank you so much!  Here is a reward for your effort.

                            Titles.AwardFame( from, fame, true );

                            OnSuccessfulBulkOrderReceive( from, dropped );

                            dropped.Delete();
                            return true;
                        }
                        else
                        {
                            SayTo( from, 1045129 ); // You do not have enough room in your backpack for the bulk request's reward.

                            if ( reward != null )
                                reward.Delete();

                            if ( rewardgold != null )
                                rewardgold.Delete();
                        }
                    }
                }

                return false;
            }

            return base.OnDragDrop( from, dropped );
        }
Esempio n. 50
0
		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			/* TODO: Thou art giving me? and fame/karma for gold gifts */

			if ( dropped is SmallBOD || dropped is LargeBOD )
			{
				PlayerMobile pm = from as PlayerMobile;

				if ( Core.ML && pm != null && pm.NextBODTurnInTime > DateTime.UtcNow )
				{
					SayTo( from, 1079976 ); // You'll have to wait a few seconds while I inspect the last order.
					return false;
				}
				else if ( !IsValidBulkOrder( dropped ) )
				{
					SayTo( from, 1045130 ); // That order is for some other shopkeeper.
					return false;
				}
				else if ( ( dropped is SmallBOD && !( (SmallBOD)dropped ).Complete ) || ( dropped is LargeBOD && !( (LargeBOD)dropped ).Complete ) )
				{
					SayTo( from, 1045131 ); // You have not completed the order yet.
					return false;
				}

				Item reward;
				int gold, fame;

				if ( dropped is SmallBOD )
					( (SmallBOD)dropped ).GetRewards( out reward, out gold, out fame );
				else
					( (LargeBOD)dropped ).GetRewards( out reward, out gold, out fame );

				from.SendSound( 0x3D );

				SayTo( from, 1045132 ); // Thank you so much!  Here is a reward for your effort.

				if ( reward != null )
					from.AddToBackpack( reward );

				if ( gold > 1000 )
					from.AddToBackpack( new BankCheck( gold ) );
				else if ( gold > 0 )
					from.AddToBackpack( new Gold( gold ) );

				Titles.AwardFame( from, fame, true );

				OnSuccessfulBulkOrderReceive( from );

				if ( Core.ML && pm != null )
					pm.NextBODTurnInTime = DateTime.UtcNow + TimeSpan.FromSeconds( 10.0 );

				dropped.Delete();
				return true;
			}

			return base.OnDragDrop( from, dropped );
		}
Esempio n. 51
0
        public override void OnDoubleClick(Mobile from)
        	{
        	SecureLevel securelevel = this.m_Level;
        	BaseHouse housefoundation = BaseHouse.FindHouseAt(this);

        	if (from.InRange( this, 2 ))
        		{
        		if ( housefoundation == null )
        			{
        			if (from.AccessLevel >= AccessLevel.Counselor || this.PublicCanOpen == true )
        				{
        				if (from.AccessLevel >= AccessLevel.Counselor)
        				{//if a GMs opens
        					AdjustMailboxFlagDown(this);
        					from.SendSound (45);
        					base.OnDoubleClick(from);
        					return;
        				}
        				else
        				{//if a regular player opens a public mailbox
        					from.SendMessage("You can look inside the mailbox, but you can not reach anything.");
        					from.SendSound (45);
        					base.OnDoubleClick(from);
        					return;
        				}
        			}
        			else
        			{
        				from.SendMessage("You can not open this mailbox.");
        			}
        		}
        		else if (CheckAccess( from ) && housefoundation.IsFriend( from ) )
        		{
        			base.OnDoubleClick(from);
        			AdjustMailboxFlagDown(this);
					from.SendSound (45);
					}
        		else
        			{
        			from.SendMessage("You are not allowed to open that.");
        			}
        		}
        	else
        		{
        		from.SendLocalizedMessage( 500446 ); // That is too far away.
        		}
        	}