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
Scripts/Targets/PickMoveTarget.cs
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!
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!