Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Release Archive

Custom Script Release Archive This is a pre-script database archive of what our users had released.

 
 
Thread Tools Display Modes
Old 05-10-2006, 07:06 AM   #1 (permalink)
Forum Expert
 
Manu's Avatar
 
Join Date: Jul 2005
Location: München/Deutschland (Munich/Germany)
Age: 27
Posts: 1,948
Send a message via ICQ to Manu Send a message via Skype™ to Manu
Default "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

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.
Attached Files
File Type: cs Key.cs (7.5 KB, 11 views)
__________________
Tides of Magic
doc-chaos.dyndns.org - Status: Gathering ideas, working out the concept
Manu is offline  
Old 05-10-2006, 07:16 AM   #2 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

This isn't exactly a bug :-)

I think its possible to do this on the official servers, of course lockpicking is alot better, lets just say that skill has alot of work ahead of it.
Phantom is offline  
Old 05-10-2006, 07:21 AM   #3 (permalink)
Forum Expert
 
Manu's Avatar
 
Join Date: Jul 2005
Location: München/Deutschland (Munich/Germany)
Age: 27
Posts: 1,948
Send a message via ICQ to Manu Send a message via Skype™ to Manu
Default

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
Manu is offline  
Old 05-10-2006, 08:10 AM   #4 (permalink)
Forum Expert
 
DaZiL's Avatar
 
Join Date: Mar 2005
Location: 192.168.0.10
Posts: 319
Send a message via ICQ to DaZiL Send a message via AIM to DaZiL Send a message via MSN to DaZiL
Default

*downloads attached file..

ignores useless information manu posted.

types the letters ' jk ' and places a '.' after it. *

jk.
__________________
Zelda Freak ^^
Quote:
Originally Posted by DaZiL
TBCHWY...TBH=PlaceAt(#EndOfPost)
DaZiL is offline  
Old 05-10-2006, 11:25 AM   #5 (permalink)
 
Join Date: Jul 2003
Posts: 24
Default

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.
		}
To this:
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.
		}
This works if the key is inside the target, or any sub containers of the target lockable container.
Sathallrin is offline  
Old 05-10-2006, 01:40 PM   #6 (permalink)
Forum Expert
 
Manu's Avatar
 
Join Date: Jul 2005
Location: München/Deutschland (Munich/Germany)
Age: 27
Posts: 1,948
Send a message via ICQ to Manu Send a message via Skype™ to Manu
Thumbs up

Yeah, that is even better. Thanks!
__________________
Tides of Magic
doc-chaos.dyndns.org - Status: Gathering ideas, working out the concept
Manu is offline  
Old 05-11-2006, 01:19 AM   #7 (permalink)
Moderate
 
David's Avatar
 
Join Date: Nov 2002
Location: USA
Posts: 6,598
Default

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
David is offline  
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5