Originally Posted by
manuel43
Sir can u add flag so I can dump only wearable items? Thanks
Initiate a boolean flag at the top, set it to true if Flag_Cloth is read, then check if your flag is true before saving the sprite.
For example, before:
Code:
// Unique value for each .dat file.
UInt32 DatVersion = reader.ReadUInt32();
add your boolean flag.
Code:
// Flag if object is cloth (wearable).
bool IsCloth = false;
// Unique value for each .dat file.
UInt32 DatVersion = reader.ReadUInt32();
Then, inside the check if flag == Flag_Cloth, set your boolean flag to true:
Code:
// Can be placed in an inventory slot. (Helmet, Armor, Legs, etc.)
else if (flag == Flag_Clothes)
{
// Set IsCloth flag to true;
IsCloth = true;
// Inventory slot.
reader.ReadUInt16();
}
Next, in the check if SpriteID > 0, add a check if your boolean flag is true:
Code:
// Make sure the sprites ID is not 0 before calling the function to get its bitmap.
// Also check if IsCloth flag is true;
if (SpriteID > 0 && IsCloth)
Finally, set your boolean flag back to false after the call to the Sprite.Save() function:
Code:
// Save the sprite to the sprites folder in the format: "ItemID (SpriteID).png"
Sprite.Save("Sprites/" + ID.ToString() + " (" + SpriteID.ToString() + ").png", System.Drawing.Imaging.ImageFormat.Png);
// Set IsCloth flag back to false.
IsCloth = false;
Now the Sprite.Save() function will only be called if the object is wearable. Microsoft provides a free, express version of C# that you can download and compile this program, and the changes I've provided, if you don't already have access to a compiler.