Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
[Request] SpriteDump
Results 1 to 7 of 7

Thread: [Request] SpriteDump

  1. #1
    Administrator
    Join Date
    Mar 2007
    Posts
    1,723

    [Request] SpriteDump

    As requested by Warlockx, here is a program that will parse the .dat file and export every sprite for each object. I commented it as well as I could, so I hope it makes sense. If you have any questions, feel free to ask.

    Code is too long to post here (because of all my comments), so here is a link to it on my Pastebin: http://pastebin.com/YMz5p299
    Alternately, you can download the Visual Studio project source here: http://www.mediafire.com/download/ib...SpriteDump.rar
    And, of course, just the executable for anyone who doesn't want to compile: http://www.mediafire.com/download/du...SpriteDump.exe

  2. #2
    ty



    really cool
    Last edited by Warlockx; 11-22-2013 at 10:55 AM.

  3. #3
    Junior Member
    Join Date
    Jan 2009
    Posts
    13
    Sir can u add flag so I can dump only wearable items? Thanks

  4. #4
    Administrator
    Join Date
    Mar 2007
    Posts
    1,723
    Quote Originally Posted by manuel43 View Post
    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.
    Last edited by jo3bingham; 11-24-2013 at 11:56 PM.

  5. #5
    Senior Member
    Join Date
    Sep 2007
    Posts
    230
    Quote Originally Posted by Jo3Bingham View Post
    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.
    Just wanted to say an alternative to this is using the free open source SharpDevelop IDE which is only a 15.1 MB download. It of course doesn't support C++ and does lack features that are in Visual Studio, it also doesn't come with the .NET reference assemblies which you probably want if you are going to release your applications which you can get from the Windows SDKs. Considering its small size though it works great using less resources than VS and can be made portable with ease, if you are using VS Express I would suggest giving SD a try and even if you are using a full VS version I would still suggest checking it out for the portability aspect which would be useful if you have to do some .NET coding on a system without VS installed (SD uses the same project file format as VS).

  6. #6
    Administrator
    Join Date
    Mar 2007
    Posts
    1,723
    Quote Originally Posted by Sketchy View Post
    Just wanted to say an alternative to this is using the free open source SharpDevelop IDE which is only a 15.1 MB download. It of course doesn't support C++ and does lack features that are in Visual Studio, it also doesn't come with the .NET reference assemblies which you probably want if you are going to release your applications which you can get from the Windows SDKs. Considering its small size though it works great using less resources than VS and can be made portable with ease, if you are using VS Express I would suggest giving SD a try and even if you are using a full VS version I would still suggest checking it out for the portability aspect which would be useful if you have to do some .NET coding on a system without VS installed (SD uses the same project file format as VS).
    Thanks. I'll check it out.

  7. #7
    Junior Member
    Join Date
    Jan 2014
    Posts
    10
    Awesome program, but doesn't work on latest TibiaVersion. Could u update it please?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •