I am using Knives' Town House script instead of the traditional housing system. The script is amazing and runs quite well. My problem is that I want to make BaseDoors lockable for owned/rented houses (rooms) within other buildings (rooms in inns, for example) , but likewise want to avoid potential abuse by allowing them to be opened from within the room/house without the key. I noticed that rooms located within other buildings can be opened from either side without the key due to this code in BaseDoor:
I attempted a fix (after countless failed attempts) using the following:
Unlike my other attempts, this actually loads. My reasoning was that the only time such interior doors would need to be unlocked on my shard is when they are part of a house, and that, since the region for each house seems to be converted to "HouseRegion" upon purchase, that this would solve the problem. Unfortunately, it merely causes the door to be locked on both sides.
I attempted another fix by creating a region, "InsideRegion" and using it for the area within the building directly outside the door to the room(s):
This likewise resulted in both sides of the door being locked. Does anyone perhaps have any ideas as to what I am doing wrong? Any help would be much appreciated. Thanks in advance.
Code:
if ( m_Locked && !m_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 if ( Key.ContainsKey( from.Backpack, this.KeyValue ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501282 ); // You quickly unlock, open, and relock the door
}
else if ( IsInside( from ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501280 ); // That is locked, but is usable from the inside.
}
else
{
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;
}
}
I attempted a fix (after countless failed attempts) using the following:
Code:
else if ( IsInside( from ) && from.Region != null && from.Region.IsPartOf( "HouseRegion" ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501280 ); // That is locked, but is usable from the inside.
}
Unlike my other attempts, this actually loads. My reasoning was that the only time such interior doors would need to be unlocked on my shard is when they are part of a house, and that, since the region for each house seems to be converted to "HouseRegion" upon purchase, that this would solve the problem. Unfortunately, it merely causes the door to be locked on both sides.
I attempted another fix by creating a region, "InsideRegion" and using it for the area within the building directly outside the door to the room(s):
Code:
else if ( IsInside( from ) && from.Region != null && !from.Region.IsPartOf( "InsideRegion" ) )
{
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 501280 ); // That is locked, but is usable from the inside.
}
This likewise resulted in both sides of the door being locked. Does anyone perhaps have any ideas as to what I am doing wrong? Any help would be much appreciated. Thanks in advance.