\Scripts\Multis\BaseHouse.cs -------------------------------------------------------- public abstract class BaseHouse : BaseMulti { public static bool NewVendorSystem{ get{ return Core.AOS; } } // Is new player vendor system enabled? //House Door Key Mod public uint m_keyvalue = Key.RandomValue(); //House Door Key Mod public const int MaxCoOwners = 15; public static int MaxFriends { get { return !Core.AOS ? 50 : 140; } } public static int MaxBans { get { return !Core.AOS ? 50 : 140; } } -------------------------------------------------------- public BaseDoor AddEastDoor( bool wood, int x, int y, int z, uint k ) { BaseDoor door = MakeDoor( wood, DoorFacing.SouthCW ); door.Locked = true; //House Door Key Mod //door.KeyValue = k; door.KeyValue = m_keyvalue; //House Door Key Mod AddDoor( door, x, y, z ); return door; } -------------------------------------------------------- public BaseDoor AddSouthDoor( bool wood, int x, int y, int z, uint k ) { BaseDoor door = MakeDoor( wood, DoorFacing.WestCW ); door.Locked = true; //House Door Key Mod //door.KeyValue = k; door.KeyValue = m_keyvalue; //House Door Key Mod AddDoor( door, x, y, z ); return door; } -------------------------------------------------------- public BaseDoor[] AddSouthDoors( bool wood, int x, int y, int z, uint k ) { BaseDoor westDoor = MakeDoor( wood, DoorFacing.WestCW ); BaseDoor eastDoor = MakeDoor( wood, DoorFacing.EastCCW ); westDoor.Locked = true; eastDoor.Locked = true; //House Door Key Mod //westDoor.KeyValue = k; //eastDoor.KeyValue = k; eastDoor.KeyValue = m_keyvalue; westDoor.KeyValue = m_keyvalue; //House Door Key Mod westDoor.Link = eastDoor; eastDoor.Link = westDoor; AddDoor( westDoor, x, y, z ); AddDoor( eastDoor, x + 1, y, z ); return new BaseDoor[2]{ westDoor, eastDoor }; } -------------------------------------------------------- public uint CreateKeys( Mobile m ) { uint value = Key.RandomValue(); //House Door Key Mod //if ( !IsAosRules ) //{ Key packKey = new Key( KeyType.Gold ); Key bankKey = new Key( KeyType.Gold ); //packKey.KeyValue = value; //bankKey.KeyValue = value; packKey.KeyValue = m_keyvalue; bankKey.KeyValue = m_keyvalue; packKey.Name = "a house key"; bankKey.Name = "a house key"; //packKey.LootType = LootType.Newbied; //bankKey.LootType = LootType.Newbied; BankBox box = m.BankBox; if ( !box.TryDropItem( m, bankKey, false ) ) bankKey.Delete(); m.AddToBackpack( packKey ); //} return m_keyvalue; //return value; //House Door Key Mod } -------------------------------------------------------- public void Ban( Mobile from, Mobile targ Comment out the following. This makes it so you can ban both public and non-public houses //House ban Mod //else if ( !Public && IsAosRules ) //{ // from.SendLocalizedMessage( 1062521 ); // You cannot ban someone from a private house. Revoke their access instead. //} //House ban Mod -------------------------------------------------------- OPTIONAL.... //This will get rid of the "pedestal with crystal" after house deleat. public override void OnAfterDelete() { //#region Mondain's Legacy //if ( m_Region != null ) //{ // NoHousingItem houseItem = new NoHousingItem( this ); // houseItem.MoveToWorld( m_Region.GoLocation, m_Region.Map ); //} //#endregion -------------------------------------------------------- \Scripts\Items\Construction\Doors\HouseDoors.cs -------------------------------------------------------- Make sure you have all this stuff //Bulk of lockcode by serenadethis using System; using System.Collections; using Server; using Server.Multis; using Server.Gumps; using System.Collections.Generic; using Server.ContextMenus; using Server.Network; using Server.Targeting; -------------------------------------------------------- public override void GetContextMenuEntries( Mobile from, List list ) { //House Door Key Mod //base.GetContextMenuEntries( from, list ); //SetSecureLevelEntry.AddTo( from, this, list ); //House Door Key Mod } -------------------------------------------------------- //House Door Key Mod public bool CheckAccess( Mobile m, BaseHouseDoor door ) //public bool CheckAccess( Mobile m ) //Orignal //House Door Key Mod { BaseHouse house = FindHouse(); if ( house == null ) return false; //House Door Key Mod if ( !door.Locked ) //if ( !house.IsAosRules ) //Orignal return true; //House Door Key Mod if ( house.Public ? house.IsBanned( m ) : !house.HasAccess( m ) ) return false; //House Door Key Mod return false; //return house.HasSecureAccess( m, m_Level ); //Orignal //House Door Key Mod } -------------------------------------------------------- public override bool UseLocks() { //House Door Key Mod return true; //BaseHouse house = FindHouse(); //return ( house == null || !house.IsAosRules ); //House Door Key Mod } -------------------------------------------------------- public override void Use( Mobile from ) { //House Door Key Mod //if ( !CheckAccess( from ) ) // from.SendLocalizedMessage( 1061637 ); // You are not allowed to access this. //else // base.Use( from ); if ( Locked && !Open && UseLocks() ) { if ( from.AccessLevel >= AccessLevel.GameMaster ) { from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 502502 ); // That is locked, but you open it with your godly powers. //from.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, 0x3B2, 3, 502502, "", "" ) ); // That is locked, but you open it with your godly powers. } else { Container pack = from.Backpack; bool found = false; if ( pack != null ) { Item[] items = pack.FindItemsByType( typeof( Key ) ); foreach( Key k in items ) { if ( k.KeyValue == this.KeyValue ) { found = true; from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501282 ); // You quickly unlock, open, and relock the door break; } } } if ( !found && IsInside( from ) ) { from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501280 ); // That is locked, but is usable from the inside. } else if ( !found ) { if ( Hue == 0x44E && Map == Map.Malas ) // doom door into healer room in doom this.SendLocalizedMessageTo( from, 1060014 ); // Only the dead may pass. else from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 502503 ); // That is locked. return; } } } if ( Open && !IsFreeToClose() ) return; if ( Open ) OnClosed( from ); else OnOpened( from ); if ( UseChainedFunctionality ) { bool open = !Open; List list = GetChain(); for ( int i = 0; i < list.Count; ++i ) list[i].Open = open; } else { Open = !Open; BaseDoor link = this.Link; if ( Open && link != null && !link.Open ) link.Open = true; } //House Door Key Mod } -------------------------------------------------------- \Scripts\Multis\HouseTeleporter.cs -------------------------------------------------------- This one need to have the key edits done yet public override void GetContextMenuEntries( Mobile from, List list ) { //House Door Key Mod //base.GetContextMenuEntries( from, list ); //SetSecureLevelEntry.AddTo( from, this, list ); //House Door Key Mod } -------------------------------------------------------- \Scripts\Regions\HouseRegion.cs -------------------------------------------------------- public override void OnLocationChanged( Mobile m, Point3D oldLocation ) look for...... else if ( m_House.IsAosRules && !m_House.Public && !m_House.HasAccess( m ) && m_House.IsInside( m ) ) { //House ban mod //m.Location = m_House.BanLocation; //House ban mod if( !Core.SE ) m.SendLocalizedMessage( 501284 ); // You may not enter. } else if ( m_House.IsCombatRestricted( m ) && m_House.IsInside( m ) && !m_House.IsInside( oldLocation, 16 ) ) { //House ban mod //m.Location = m_House.BanLocation; //House ban mod m.SendLocalizedMessage( 1061637 ); // You are not allowed to access this. } -------------------------------------------------------- public override bool OnMoveInto( Mobile from, Direction d, Point3D newLocation, Point3D oldLocation ) look for....... //This one will let a player walk into a house. 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; //Default return true; } -------------------------------------------------------- OPTIONAL: This one makes you will not have any hosue decay. public override bool OnDecay( Item item ) { if ( (m_House.IsLockedDown( item ) || m_House.IsSecure( item )) && m_House.IsInside( item ) ) return false; else //House ban mod return false; //return base.OnDecay(item ); //Orignal //House ban mod } -------------------------------------------------------- else if ( e.HasKeyword( 0x34 ) ) // I ban thee { if ( !isFriend ) { //House ban mod Start from.SendLocalizedMessage( 501325 ); // Target the individual to ban from this house. from.Target = new HouseBanTarget( true, m_House ); //from.SendLocalizedMessage( 502094 ); // You must be in your house to do this. (Orignal) //House ban mod End } //Makes it so you can Ban people when house is private //House ban mod Start //else if ( !m_House.Public && m_House.IsAosRules ) //{ // from.SendLocalizedMessage( 1062521 ); // You cannot ban someone from a private house. Revoke their access instead. //} //House ban mod End else { from.SendLocalizedMessage( 501325 ); // Target the individual to ban from this house. from.Target = new HouseBanTarget( true, m_House ); } } -------------------------------------------------------- \Scripts\Gumps\HouseGumpAOS.cs -------------------------------------------------------- if ( house.Public ) { AddButtonLabeled( 10, 390, GetButtonID( 0, 0 ), 1060674 ); // Banish 10, 390, AddButtonLabeled( 10, 410, GetButtonID( 0, 1 ), 1011261 ); // Lift a Ban 10, 410, } else { AddButtonLabeled( 10, 390, GetButtonID( 0, 2 ), 1060676 ); // Grant Access AddButtonLabeled( 10, 410, GetButtonID( 0, 3 ), 1060677 ); // Revoke Access //House Ban Mod AddButtonLabeled( 140, 390, GetButtonID( 0, 0 ), 1060674 ); // Banish 10, 390, AddButtonLabeled( 140, 410, GetButtonID( 0, 1 ), 1011261 ); // Lift a Ban 10, 410, //House Ban Mod } -------------------------------------------------------- if ( house.Public ) { AddButtonLabeled( 10, 310, GetButtonID( 3, 8 ), 1011260 ); // View Ban List 10, 310, AddButtonLabeled( 10, 330, GetButtonID( 3, 9 ), 1060698 ); // Clear Ban List 10, 330, AddButtonLabeled( 210, 130, GetButtonID( 3, 12 ), 1060695, isOwner ); // Change to Private AddHtmlLocalized( 245, 150, 240, 20, 1060694, SelectedColor, false, false ); // Change to Public } else { AddButtonLabeled( 10, 310, GetButtonID( 3, 10 ), 1060699 ); // View Access List AddButtonLabeled( 10, 330, GetButtonID( 3, 11 ), 1060700 ); // Clear Access List //House Ban mod AddButtonLabeled( 200, 310, GetButtonID( 3, 8 ), 1011260 ); // View Ban List 10, 310, AddButtonLabeled( 200, 330, GetButtonID( 3, 9 ), 1060698 ); // Clear Ban List 10, 330, //House Ban mod AddHtmlLocalized( 245, 130, 240, 20, 1060695, SelectedColor, false, false ); // Change to Private AddButtonLabeled( 210, 150, GetButtonID( 3, 13 ), 1060694, isOwner ); // Change to Public //House Ban mod AddButtonLabeled( 210, 160, GetButtonID( 3, 14 ), 1011247, isOwner ); // Change the house locks //House Ban mod } -------------------------------------------------------- case 0: { switch ( index ) { case 0: // Banish { //House ban mod if ( m_House.Public || !m_House.Public ) //if ( m_House.Public ) //House ban mod { from.SendLocalizedMessage( 501325 ); // Target the individual to ban from this house. from.Target = new HouseBanTarget( true, m_House ); } break; } case 1: // Lift Ban { //House ban mod if ( m_House.Public || !m_House.Public ) //if ( m_House.Public ) //House ban mod from.SendGump( new HouseGumpAOS( HouseGumpPageAOS.RemoveBan, from, m_House ) ); break; } case 2: // Grant Access { if ( !m_House.Public ) { from.SendLocalizedMessage( 1060711 ); // Target the person you would like to grant access to. from.Target = new HouseAccessTarget( m_House ); } break; } case 3: // Revoke Access { if ( !m_House.Public ) from.SendGump( new HouseGumpAOS( HouseGumpPageAOS.RemoveAccess, from, m_House ) ); break; } } break; -------------------------------------------------------- case 12: // Make Private Look for...... from.SendGump( new NoticeGump( 1060637, 30720, 501888, 32512, 320, 180, new NoticeGumpCallback( PublicPrivateNotice_Callback ), m_House ) ); Region r = m_House.Region; List list = r.GetMobiles(); for ( int i = 0; i < list.Count; ++i ) { Mobile m = (Mobile)list[i]; if ( !m_House.HasAccess( m ) && m_House.IsInside( m ) ) m.Location = m_House.BanLocation; //House ban mod if ( m_House.IsBanned( m ) && m_House.IsInside( m ) ) m.Location = m_House.BanLocation; //House ban mod } } case 13: // Make Public { if ( isOwner ) { m_House.Public = true; //This well keep the key from being removed. //House ban mod //m_House.RemoveKeys( from ); //m_House.RemoveLocks(); //House ban mod if ( BaseHouse.NewVendorSystem ) { // This house is now public. The owner may now place vendors and vendor rental contracts. from.SendGump( new NoticeGump( 1060637, 30720, 501886, 32512, 320, 180, new NoticeGumpCallback( PublicPrivateNotice_Callback ), m_House ) ); } else { from.SendGump( new NoticeGump( 1060637, 30720, "This house is now public. Friends of the house may now have vendors working out of this building.", 0xF8C000, 320, 180, new NoticeGumpCallback( PublicPrivateNotice_Callback ), m_House ) ); } Region r = m_House.Region; List list = r.GetMobiles(); for ( int i = 0; i < list.Count; ++i ) { Mobile m = (Mobile)list[i]; if ( m_House.IsBanned( m ) && m_House.IsInside( m ) ) m.Location = m_House.BanLocation; } } break; } //House ban mod case 14: //Change the house locks edit { if ( m_House.Public ) { from.SendLocalizedMessage( 501669 );// Public houses are always unlocked. } else { if ( isOwner ) { m_House.RemoveKeys( from ); m_House.ChangeLocks( from ); from.SendLocalizedMessage( 501306 ); // The locks on your front door have been changed, and new master keys have been placed in your bank and your backpack. } else { from.SendLocalizedMessage( 501303 ); // Only the house owner may change the house locks. } } break; } //House ban mod } break; } case 5: -------------------------------------------------------- case 1: // Trade House { if ( isOwner ) { if ( BaseHouse.NewVendorSystem && m_House.HasPersonalVendors ) { from.SendLocalizedMessage( 1062467 ); // You cannot trade this house while you still have personal vendors inside. } else if ( m_House.DecayLevel == DecayLevel.DemolitionPending ) { from.SendLocalizedMessage( 1005321 ); // This house has been marked for demolition, and it cannot be transferred. } else { from.SendLocalizedMessage( 501309 ); // Target the person to whom you wish to give this house. from.Target = new HouseOwnerTarget( m_House ); //House ban mod (added Remove Keys) m_House.RemoveKeys( from ); m_House.ChangeLocks( from ); //House ban mod } } break; } --------------------------------------------------------