예제 #1
0
        public override void OnDoubleClick(Mobile m)
        {
            // housing inheritance - from one character to the next (of kin)
            if (Core.UOMO)
            {
                BaseHouse house = m_Structure;
                if (house != null && (house.Owner == null || house.Owner.Deleted))
                {                       // a new character on this account gets the house
                    if (house.CheckInheritance(m))
                    {
                        // final sanity
                        if (house.Deleted || !m.CheckAlive())
                        {
                            return;
                        }

                        house.Owner = m;
                        if (house.Public == false)
                        {
                            house.ChangeLocks(m);
                        }
                    }
                }
                /* fall through */
            }

            if (m_Structure != null)
            {
                if (m_Structure.IsFriend(m))
                {
                    m.SendLocalizedMessage(501293);    // Welcome back to the house, friend!

                    if (Core.UOSP)                     //refresh house
                    {
                        double dms = m_Structure.DecayMinutesStored;
                        m_Structure.Refresh();

                        //if we're more than one day (less than 14 days) from the max stored (15 days),
                        //then tell the friend that the house is refreshed
                        if (dms < TimeSpan.FromDays(14.0).TotalMinutes)
                        {
                            m.SendMessage("You refresh the house.");
                        }
                    }
                }

                if (m_Structure.IsAosRules)
                {
                    m.SendGump(new HouseGumpAOS(HouseGumpPageAOS.Information, m, m_Structure));
                }
                else
                {
                    m.SendGump(new HouseGump(m, m_Structure));
                }
            }
        }