tiffanynation
Wanderer
Looking to make a custom script that will let players search for items that other players
are selling... A script like this would be very usefull... Players would no longer have to
visit all of the PlayerVendors in the world and look in each bag, just to see what's available...
So far I've been able to CallFor & Return values for all the PlayerVendors in the world...
How would I CallFor & Return values for all of the VendorItems that they are holding?
Example: (VendorItem) (VendorItemPrice) (VendorItemDescription) ect...
This is the working code that I have so far:
are selling... A script like this would be very usefull... Players would no longer have to
visit all of the PlayerVendors in the world and look in each bag, just to see what's available...
So far I've been able to CallFor & Return values for all the PlayerVendors in the world...
How would I CallFor & Return values for all of the VendorItems that they are holding?
Example: (VendorItem) (VendorItemPrice) (VendorItemDescription) ect...
This is the working code that I have so far:
Code:
///////////////////
//Write Search Results To File
///////////////////
StreamWriter PlayerVendorFile = new StreamWriter("c:\\PlayerVendorFile.txt");
ArrayList list = new ArrayList();
foreach ( Mobile mob in World.Mobiles.Values )
{
if ( mob is PlayerVendor )
{
PlayerVendor pv = mob as PlayerVendor;
list.Add( pv );
PlayerVendorFile.WriteLine( pv );
PlayerVendorFile.WriteLine( pv.ShopName );
PlayerVendorFile.WriteLine( pv.Name );
PlayerVendorFile.WriteLine( pv.Owner.Name );
PlayerVendorFile.WriteLine( pv.Map );
PlayerVendorFile.WriteLine( pv.Backpack );
PlayerVendorFile.WriteLine( pv.AccessLevel );
PlayerVendorFile.WriteLine( pv.Location );
PlayerVendorFile.WriteLine( pv.X );
PlayerVendorFile.WriteLine( pv.Y );
PlayerVendorFile.WriteLine( pv.Z );
PlayerVendorFile.WriteLine( pv.RawName );
PlayerVendorFile.WriteLine( "---------------"
}
}
PlayerVendorFile.Close();