public static void VendorSellReply( NetState state, PacketReader pvSrc )
{
Serial serial = pvSrc.ReadInt32();
Mobile vendor = World.FindMobile( serial );
if ( vendor == null )
{
return;
}
else if ( vendor.Deleted || !Utility.RangeCheck( vendor.Location, state.Mobile.Location, 10 ) )
{
state.Send( new EndVendorSell( vendor ) );
return;
}
int count = pvSrc.ReadUInt16();
if ( count < 100 && pvSrc.Size == (1+2+4+2+(count*6)) )
{
List<SellItemResponse> sellList = new List<SellItemResponse>( count );
for (int i=0;i<count;i++)
{
Item item = World.FindItem( pvSrc.ReadInt32() );
int Amount = pvSrc.ReadInt16();
if ( item != null && Amount > 0 )
sellList.Add( new SellItemResponse( item, Amount ) );
}
if ( sellList.Count > 0 )
{
IVendor v = vendor as IVendor;
if ( v != null && v.OnSellItems( state.Mobile, sellList ) )
state.Send( new EndVendorSell( vendor ) );
}
}
}