"Bug" with keys
Keys can be used anywhere. Therefore it is possible to place a key in its matching container and use the key to lock the container. The player is now unable to open the container (lockpicking would be a way of getting it open again,though).
To prevent this I modified the key.cs so that keys can only be used while in your backpack. Simply find
and replace it with
or use the attached file.
Keys can be used anywhere. Therefore it is possible to place a key in its matching container and use the key to lock the container. The player is now unable to open the container (lockpicking would be a way of getting it open again,though).
To prevent this I modified the key.cs so that keys can only be used while in your backpack. Simply find
Code:
public override void OnDoubleClick( Mobile from )
{
Target t;
int number;
if ( m_KeyVal != 0 )
{
number = 501662; // What shall I use this key on?
t = new UnlockTarget( this );
}
else
{
number = 501663; // This key is a key blank. Which key would you like to make a copy of?
t = new CopyTarget( this );
}
from.SendLocalizedMessage( number );
from.Target = t;
}
and replace it with
Code:
public override void OnDoubleClick( Mobile from )
{
if ( IsChildOf( from.Backpack ) )
{
Target t;
int number;
if ( m_KeyVal != 0 )
{
number = 501662; // What shall I use this key on?
t = new UnlockTarget( this );
}
else
{
number = 501663; // This key is a key blank. Which key would you like to make a copy of?
t = new CopyTarget( this );
}
from.SendLocalizedMessage( number );
from.Target = t;
}
else
{
from.SendMessage( "That must be in your backpack to use it." );
}
}
or use the attached file.