Results 1 to 4 of 4

Thread: Ability Behavior Constants

  1. #1
    Basic Member
    Join Date
    Dec 2016
    Posts
    731

    Question Ability Behavior Constants

    Can we get those or are they available?

    We have an ability-scoped GetBehavior() API which will return the integer value of the OR'ed behavior flags, but need a way to check for specific behavior now.

    I'm working on skill-based action queues to execute as combos.. but to generalize the execution of the combos I need to know when an ability is Unit-Targeted vs. Location-Targeted vs. AOE-Location-Targeted, etc. which GetBehavior() should answer once I can check the flags properly.

  2. #2
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    Yep, will do.

  3. #3
    Basic Member
    Join Date
    Mar 2012
    Posts
    2,014
    Code:
    bCanTargetUnit 	= (FlagIsSet(behavior, ABILITY_BEHAVIOR_UNIT_TARGET) == true);
    bCanTargetLocation = (FlagIsSet(behavior, ABILITY_BEHAVIOR_POINT) == true);
    ... where...
    Code:
    local behavior = UnitAbility:GetBehavior();
    ... and ...
    Code:
    function FlagIsSet (BitField, Flag)
      return (BitField % (2 * Flag) >= Flag);
    end
    I think you can take it from here

    P.S. if you use it, don't credit me ... I took it from here
    Last edited by The Nomad; 02-10-2017 at 03:00 PM.
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  4. #4
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Code:
    function U.CheckFlag(bitfield, flag)
        return ((bitfield/flag) % 2) >= 1
    end
    That's what I wrote/use. Same thing really.

Posting Permissions

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