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
help with dat reading
Results 1 to 4 of 4

Thread: help with dat reading

  1. #1

    help with dat reading

    As topic I need to reading from memory what title is walkable or not. I don't know why does not work, what is change in structure.

    I'm not sure if these addresses are correct, but i think so.
    Code:
    public readonly static int Start = 0x3D466C; //10.39
    public readonly static int StepItems = 0xA0; //136 from old version
    public readonly static int FlagsOffset = 0x44; //68 from old version
    Here my test code:
    Code:
    int itemid = 284;
    int start = Util.ReadInt32(DatPointer.Start + Util.Base, Util.Tibia.Handle);
    start = Util.ReadInt32(start + 0x8, Util.Tibia.Handle);
    start = start + DatPointer.StepItems * (itemid - 100);
    int flags = Util.ReadInt32(start + DatPointer.FlagsOffset, Util.Tibia.Handle);
    It's working to get name of item, but really I don't know how i can get information about Blocking, BlockingPath.
    Also I was analyzed this code: https://github.com/NeoClone/NeoClone.../datReader.pas

    This is my scratchpad http://oi57.tinypic.com/20sx92b.jpg and I don't know why flag = 4096 only in first position of this screen.

    I hope you understand me and I will grateful if someone help me.
    Thanks.

    edit: Move this topic to correct department if I made wrong.
    Last edited by wgrzelak; 05-15-2014 at 08:49 PM.

  2. #2
    Senior Member
    Join Date
    Dec 2011
    Posts
    249
    The code and addresses looks correct. Just add:
    Code:
    bool walkable = (flags & 4096) == 0;

  3. #3
    Senior Member
    Join Date
    Jan 2012
    Posts
    417
    looking at your code I noticed that you're reading your flag value as 32bit integer, but if I recall correctly, tibia data flags are stored in 64bit range. So, if you don't want to have headaches in the future, it's better to use
    Code:
    long flags = Util.ReadInt64(start + DatPointer.FlagsOffset, Util.Tibia.Handle);
    in the last line

  4. #4
    Working, I lost around 10h to try make this :P
    Thanks

Posting Permissions

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