ServUO - A way to prevent friends from refreshing houses?

Falkor

Squire
Apr 11, 2018
303
106
43
wpshard.com
Shard Name
Whispering Pines
Looks like it's handled in at least three places.

HouseSign.cs
Code:
        public void ShowSign(Mobile m)
        {
            if (this.m_Owner != null)
            {
                if (this.m_Owner.IsFriend(m) && m.AccessLevel < AccessLevel.GameMaster)
                {
                    #region Mondain's Legacy
                    if ((Core.ML && this.m_Owner.IsOwner(m)) || !Core.ML)
                        this.m_Owner.RefreshDecay();
                    #endregion
-chop-
I think changing
Code:
if (this.m_Owner.IsFriend(m) && m.AccessLevel < AccessLevel.GameMaster)
to
Code:
if (this.m_Owner.IsOwner(m) && m.AccessLevel < AccessLevel.GameMaster)
would do the trick.

HouseDoors.cs
Code:
        public override void OnOpened(Mobile from)
        {
            BaseHouse house = FindHouse();

            if (house != null && house.IsFriend(from) && from.IsPlayer() && house.RefreshDecay())
                from.SendLocalizedMessage(1043293); // Your house's age and contents have been refreshed.

            if (!Core.AOS && house != null && house.Public && !house.IsFriend(from))
                house.AddVisit(from);
        }
The part that needs to be changed is
Code:
&& house.IsFriend(from) &&
but I didn't do any digging to see what other checks are valid here; I'm not sure if house.IsOwner is acceptable.

HouseRegion.cs
Code:
        public override void OnEnter(Mobile m)
        {
            if (m.AccessLevel == AccessLevel.Player && m_House != null && m_House.IsFriend(m))
            {
                if (Core.AOS && m_House is HouseFoundation)
                {
                    m_House.RefreshDecay();
                }
            }
Changing that last check
Code:
&& m_House.IsFriend(m)
to
Code:
m_House.IsOwner(m)
would probably do the trick. This is for custom houses.
 
  • Like
Reactions: ronfellows