|
||
|
|||||||
| Custom Script Release Archive This is a pre-script database archive of what our users had released. |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
|
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;
}
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." );
}
}
__________________
Tides of Magic doc-chaos.dyndns.org - Status: Gathering ideas, working out the concept |
|
|
|
|
#3 (permalink) |
|
Forum Expert
|
Yeah, I know, thats why I used *"Bug"* as a title. I just thought it to be a stupid and not very realistic thing to happen
So now folks know and anyone who agrees with me can change it.
__________________
Tides of Magic doc-chaos.dyndns.org - Status: Gathering ideas, working out the concept |
|
|
|
|
#5 (permalink) |
|
Join Date: Jul 2003
Posts: 24
|
Manu, not that your solution is a bad one, but this also makes it so that it must be in your backpack to use... This way you can't use it from the ground, a secure container, your bank, or if the key is in any other bag in your pack.
A possible better solution would be simple to prevent the key from locking the container if it is inside of the container it is locking. Here is the change needed to prevent that. Change this code: Code:
else if ( targeted is ILockable )
{
number = -1;
ILockable o = (ILockable)targeted;
if ( o.KeyValue == m_Key.KeyValue )
{
if ( o is BaseDoor && !((BaseDoor)o).UseLocks() )
{
number = 501668; // This key doesn't seem to unlock that.
}
Code:
else if ( targeted is ILockable )
{
number = -1;
ILockable o = (ILockable)targeted;
if ( m_Key.IsChildOf( o ) )
{
from.SendMessage( "You cannot lock this container with the key inside of it." );
}
else if ( o.KeyValue == m_Key.KeyValue )
{
if ( o is BaseDoor && !((BaseDoor)o).UseLocks() )
{
number = 501668; // This key doesn't seem to unlock that.
}
|
|
|
|
|
#7 (permalink) |
|
Moderate
Join Date: Nov 2002
Location: USA
Posts: 6,598
|
Karma all around!
__________________
David Forum Moderator The RunUO.com Forum Moderator Team Forum Rules and Guidelines RunUO Forum Search Engine Download RunUO 2.0 RC2 |
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|