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
[Conditions] Mana SHield, Haste any know how to read it?
Results 1 to 4 of 4

Thread: [Conditions] Mana SHield, Haste any know how to read it?

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    21

    [Conditions] Mana SHield, Haste any know how to read it?

    Mana Shield, Haste any know how to read it?

    Enable/Time etc...

  2. #2
    Member
    Join Date
    Dec 2012
    Location
    Poland
    Posts
    47
    It is something like this:

    if readint(playerstatus) and flagMS = 1 then manashield:=true.

    Find values on TibiaApi sources

  3. #3
    Senior Member
    Join Date
    Oct 2010
    Posts
    146
    https://github.com/NeoClone/NeoClone...layer.pas#L506
    I think it's the right one, not sure.
    you have it in TibiaApi anyway as Blue said.
    I'll upload a video to youtube in some days about getting some addresses (player flags is one of those)
    Last edited by Puterin; 05-05-2013 at 10:06 AM.

  4. #4
    Super Moderator
    Join Date
    May 2007
    Posts
    1,191
    Use bitwise and.
    In case you didn't know yet, each bit is a flag. Back in the 7.x days, you could fit all flags in 8 bits (1 byte), like so:
    Code:
    00000001 Poisoned
    00000010 Burning
    00000100 Energized
    00001000 Drunk
    00010000 Manashielded
    00100000 Paralyzed
    01000000 Hasted
    10000000 Battle
    You then compare the player's current flag to the flag want to check, like so:
    Code:
    11010001 & (battle, hasted, manashielded, poisoned)
    00010000 =
    00010000
    Naturally more flags have been added since.

    Protip: when making your flags enum (or whichever type), use bit-shifting, like so:
    Code:
            public enum Flags
            {
                Poisoned = 1,
                Burning = 1 << 1, // 2^1
                Energized = 1 << 2, // 2^2
                Drunken = 1 << 3, // 2^3 etc
                Manashielded = 1 << 4,
                Paralyzed = 1 << 5,
                Hasted = 1 << 6,
                Battle = 1 << 7
            }

Posting Permissions

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