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); } }
public override bool OnMoveInto(Mobile from, Direction d, Point3D newLocation, Point3D oldLocation) { if (!base.OnMoveInto(from, d, newLocation, oldLocation)) { return(false); } if (from is BaseCreature && ((BaseCreature)from).NoHouseRestrictions) { } else if (from is BaseCreature && !((BaseCreature)from).Controlled) // Untamed creatures cannot enter public houses { return(false); } else if (from is BaseCreature && ((BaseCreature)from).IsHouseSummonable && !(BaseCreature.Summoning || m_House.IsInside(oldLocation, 16))) { return(false); } else if (from is BaseCreature && !((BaseCreature)from).Controlled && m_House.IsAosRules && !m_House.Public) { return(false); } else if ((m_House.Public || !m_House.IsAosRules) && m_House.IsBanned(from) && m_House.IsInside(newLocation, 16)) { from.Location = m_House.BanLocation; if (!Core.SE) { from.SendLocalizedMessage(501284); // You may not enter. } return(false); } else if (m_House.IsAosRules && !m_House.Public && !m_House.HasAccess(from) && m_House.IsInside(newLocation, 16)) { if (!Core.SE) { from.SendLocalizedMessage(501284); // You may not enter. } return(false); } else if (m_House.IsCombatRestricted(from) && !m_House.IsInside(oldLocation, 16) && m_House.IsInside(newLocation, 16)) { from.SendLocalizedMessage(1061637); // You are not allowed to access return(false); } else if (m_House is HouseFoundation) { HouseFoundation foundation = (HouseFoundation)m_House; if (foundation.Customizer != null && foundation.Customizer != from && m_House.IsInside(newLocation, 16)) { return(false); } } if (m_House.InternalizedVendors.Count > 0 && m_House.IsInside(from) && !m_House.IsInside(oldLocation, 16) && m_House.IsOwner(from) && from.Alive && !from.HasGump(typeof(NoticeGump))) { /* This house has been customized recently, and vendors that work out of this * house have been temporarily relocated. You must now put your vendors back to work. * To do this, walk to a location inside the house where you wish to station * your vendor, then activate the context-sensitive menu on your avatar and * select "Get Vendor". */ from.SendGump(new NoticeGump(1060635, 30720, 1061826, 32512, 320, 180, null, null)); } if (Core.AOS) { m_House.AddVisit(from); } return(true); }