+ RunUO 2.7 with initial TOL expansion support.
This commit is contained in:
parent
64272798c3
commit
7af0579875
41 changed files with 3181 additions and 499 deletions
|
|
@ -9660,6 +9660,45 @@ namespace Server
|
|||
{
|
||||
return true;
|
||||
}
|
||||
public bool OpenTrade(Mobile from)
|
||||
{
|
||||
return OpenTrade(from, null);
|
||||
}
|
||||
|
||||
public virtual bool OpenTrade(Mobile from, Item offer)
|
||||
{
|
||||
if (!from.Player || !Player || !from.Alive || !Alive)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
NetState ourState = m_NetState;
|
||||
NetState theirState = from.m_NetState;
|
||||
|
||||
if (ourState == null || theirState == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
SecureTradeContainer cont = theirState.FindTradeContainer(this);
|
||||
|
||||
if (!from.CheckTrade(this, offer, cont, true, true, 0, 0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cont == null)
|
||||
{
|
||||
cont = theirState.AddTrade(ourState);
|
||||
}
|
||||
|
||||
if (offer != null)
|
||||
{
|
||||
cont.DropItem(offer);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overridable. Event invoked when a Mobile (<paramref name="from" />) drops an <see cref="Item"><paramref name="dropped" /></see> onto the Mobile.
|
||||
|
|
@ -9675,27 +9714,9 @@ namespace Server
|
|||
|
||||
return false;
|
||||
}
|
||||
else if( from.Player && this.Player && from.Alive && this.Alive && from.InRange( Location, 2 ) )
|
||||
else if( from.InRange( Location, 2 ) )
|
||||
{
|
||||
NetState ourState = m_NetState;
|
||||
NetState theirState = from.m_NetState;
|
||||
|
||||
if( ourState != null && theirState != null )
|
||||
{
|
||||
SecureTradeContainer cont = theirState.FindTradeContainer( this );
|
||||
|
||||
if( !from.CheckTrade( this, dropped, cont, true, true, 0, 0 ) )
|
||||
return false;
|
||||
|
||||
if( cont == null )
|
||||
cont = theirState.AddTrade( ourState );
|
||||
|
||||
cont.DropItem( dropped );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return OpenTrade( from, dropped );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue