tracking fixes
This commit is contained in:
parent
bb71524216
commit
87feddc401
3 changed files with 68 additions and 13 deletions
|
|
@ -138,6 +138,28 @@ namespace Server.Network
|
|||
}
|
||||
}
|
||||
|
||||
public sealed class CancelArrowHS : Packet
|
||||
{
|
||||
public CancelArrowHS( int x, int y, Serial s ) : base( 0xBA, 10 )
|
||||
{
|
||||
m_Stream.Write( (byte) 0 );
|
||||
m_Stream.Write( (short) x );
|
||||
m_Stream.Write( (short) y );
|
||||
m_Stream.Write( (int) s );
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class SetArrowHS : Packet
|
||||
{
|
||||
public SetArrowHS( int x, int y, Serial s ) : base( 0xBA, 10 )
|
||||
{
|
||||
m_Stream.Write( (byte) 1 );
|
||||
m_Stream.Write( (short) x );
|
||||
m_Stream.Write( (short) y );
|
||||
m_Stream.Write( (int) s );
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class DisplaySecureTrade : Packet
|
||||
{
|
||||
public DisplaySecureTrade( Mobile them, Container first, Container second, string name ) : base( 0x6F )
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ namespace Server
|
|||
public class QuestArrow
|
||||
{
|
||||
private Mobile m_Mobile;
|
||||
private Mobile m_Target;
|
||||
private bool m_Running;
|
||||
|
||||
public Mobile Mobile
|
||||
|
|
@ -37,6 +38,14 @@ namespace Server
|
|||
}
|
||||
}
|
||||
|
||||
public Mobile Target
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Target;
|
||||
}
|
||||
}
|
||||
|
||||
public bool Running
|
||||
{
|
||||
get
|
||||
|
|
@ -45,22 +54,49 @@ namespace Server
|
|||
}
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
Update( m_Target.X, m_Target.Y );
|
||||
}
|
||||
|
||||
public void Update( int x, int y )
|
||||
{
|
||||
if ( m_Running )
|
||||
m_Mobile.Send( new SetArrow( x, y ) );
|
||||
if ( !m_Running )
|
||||
return;
|
||||
|
||||
NetState ns = m_Mobile.NetState;
|
||||
|
||||
if ( ns == null )
|
||||
return;
|
||||
|
||||
if ( ns.HighSeas )
|
||||
ns.Send( new SetArrowHS( x, y, m_Target.Serial ) );
|
||||
else
|
||||
ns.Send( new SetArrow( x, y ) );
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
Stop( m_Target.X, m_Target.Y );
|
||||
}
|
||||
|
||||
public void Stop( int x, int y )
|
||||
{
|
||||
if ( !m_Running )
|
||||
return;
|
||||
|
||||
m_Mobile.ClearQuestArrow();
|
||||
|
||||
m_Mobile.Send( new CancelArrow() );
|
||||
m_Running = false;
|
||||
NetState ns = m_Mobile.NetState;
|
||||
|
||||
if ( ns != null ) {
|
||||
if ( ns.HighSeas )
|
||||
ns.Send( new CancelArrowHS( x, y, m_Target.Serial ) );
|
||||
else
|
||||
ns.Send( new CancelArrow() );
|
||||
}
|
||||
|
||||
m_Running = false;
|
||||
OnStop();
|
||||
}
|
||||
|
||||
|
|
@ -72,13 +108,14 @@ namespace Server
|
|||
{
|
||||
}
|
||||
|
||||
public QuestArrow( Mobile m )
|
||||
public QuestArrow( Mobile m, Mobile t )
|
||||
{
|
||||
m_Running = true;
|
||||
m_Mobile = m;
|
||||
m_Target = t;
|
||||
}
|
||||
|
||||
public QuestArrow( Mobile m, int x, int y ) : this( m )
|
||||
public QuestArrow( Mobile m, Mobile t, int x, int y ) : this( m, t )
|
||||
{
|
||||
Update( x, y );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue