public virtual void VendorSell( Mobile from )
{
if ( !IsActiveBuyer )
return;
if ( !from.CheckAlive() )
return;
if ( !CheckVendorAccess( from ) )
{
Say( 501522 ); // I shall not treat with scum like thee!
return;
}
Container pack = from.Backpack;
if ( pack != null )
{
IShopSellInfo[] info = GetSellInfo();
Dictionary<Item, SellItemState> table = new Dictionary<Item, SellItemState>();
foreach ( IShopSellInfo ssi in info )
{
Item[] items = pack.FindItemsByType( ssi.Types );
foreach ( Item item in items )
{
if ( item is Container && ( (Container)item ).Items.Count != 0 )
continue;
if ( item.IsStandardLoot() && item.Movable && ssi.IsSellable( item ) )
table[item] = new SellItemState( item, ssi.GetSellPriceFor( item ), ssi.GetNameFor( item ) );
}
}
if ( table.Count > 0 )
{
SendPacksTo( from );
from.Send( new VendorSellList( this, table.Values ) );
}
else
{
Say( true, "You have nothing I would be interested in." );
}
}
}