RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Changing range check on moving items

LFFPicard

Sorceror
I had a route around but being no scripter I thought I would check I am even remotely close to what I am looking for.

I want ot be able to change the range check on moving objects, for example I have a range of 2tiles, so have to be 2tiles within an object to pick it up or move it, or even place on the ground. I want to change this to 3 or even 4 tiles so it makes sorting multiple container sin a house easier for example. Now I thought it would be a client limitation, or at least core edit. But I have found these two scripts and want to make sure I am on the right tracks.

Scripts/Targets/MoveTarget.cs
Code:
using System;
using Server;
using Server.Targeting;
using Server.Commands;
using Server.Commands.Generic;
 
namespace Server.Targets
{
public class MoveTarget : Target
{
private object m_Object;
 
public MoveTarget( object o ) : base( -1, true, TargetFlags.None )
{
m_Object = o;
}
 
protected override void OnTarget( Mobile from, object o )
{
IPoint3D p = o as IPoint3D;
 
if ( p != null )
{
if ( !BaseCommand.IsAccessible( from, m_Object ) )
{
from.SendMessage( "That is not accessible." );
return;
}
 
if ( p is Item )
p = ((Item)p).GetWorldTop();
 
CommandLogging.WriteLine( from, "{0} {1} moving {2} to {3}", from.AccessLevel, CommandLogging.Format( from ), CommandLogging.Format( m_Object ), new Point3D( p ) );
 
if ( m_Object is Item )
{
Item item = (Item)m_Object;
 
if ( !item.Deleted )
item.MoveToWorld( new Point3D( p ), from.Map );
}
else if ( m_Object is Mobile )
{
Mobile m = (Mobile)m_Object;
 
if ( !m.Deleted )
m.MoveToWorld( new Point3D( p ), from.Map );
}
}
}
}
}

Scripts/Targets/PickMoveTarget.cs
Code:
using System;
using Server;
using Server.Targeting;
using Server.Commands;
using Server.Commands.Generic;
 
namespace Server.Targets
{
public class PickMoveTarget : Target
{
public PickMoveTarget() : base( -1, false, TargetFlags.None )
{
}
 
protected override void OnTarget( Mobile from, object o )
{
if ( !BaseCommand.IsAccessible( from, o ) )
{
from.SendMessage( "That is not accessible." );
return;
}
 
if ( o is Item || o is Mobile )
from.Target = new MoveTarget( o );
}
}
}

Would changing the values in these scripts produce the desired effect?
I am not looking to be given the answer unless you insist, just want to make sure I am on the right track.

Thanks!
 

daat99

Moderator
Staff member
I think that these are the scripts for the [move command for GMs.
You need to look for the OnDragDrop and OnLift methods.
I don't know if it'll be a 1-place or if you'll have to locate all of them in every script that used them and change them all.
 

LFFPicard

Sorceror
This was mentioned on another forum and it appears it is in every script, painful!

Anyway, glad to see your still around daat, I still remember the help you gave me like 6years ago now!
Thanks!
 

zerodowned

Sorceror
If you use Notepad++ there's a search fuction for Find In Files and Replace In Files.

You'd have to be careful with how you use it, but if you need to change something in 200 scripts, it beats opening up each individual script
 
Top