Results 1 to 4 of 4

Thread: Getting Cooldown of an Ability

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

    Getting Cooldown of an Ability

    I'm trying to write my own Estimated Damage simulator and for planning purposes want to know what the cooldown of the ability is.

    I do not want to know if it IS on cooldown or HOW MUCH TIME is remaining on cooldown which the only two functions in the API provide. I want to know HOW LONG WILL COOLDOWN BE if I cast the spell. API gives:
    • ability:IsCooldownReady()
    • ability:GetCooldownTimeRemaining()


    Obviously I could hard-code this, but I think adding an ability:GetCooldown() should be easy as most abilities have an "AbilityCooldown" key-value pair in npc_abilities.txt (same as AbilityManaCost).

    Update:
    Second thing I would like to know is the "Duration" of an ability. We have "AbilityDuration" and in many cases a AbilitySpecial titled "duration_tooltip" which I can probably use, but since info is available outside of AbilitySpecial group, should be easy to write an API for it. Just like GetChannelTime().
    Last edited by nostrademous; 02-01-2017 at 08:52 AM.

  2. #2
    My suggestion to you is the same one I said to Chris, write a damage estimator for abilities and use it to calculate the estimated damage of heroes.
    I'm not sure if there is a direct API function for getting cooldown, but try getting the cooldown via GetSpecialValueInt (I'm not sure if it will work or not).

  3. #3
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Quote Originally Posted by Platinum_dota2 View Post
    My suggestion to you is the same one I said to Chris, write a damage estimator for abilities and use it to calculate the estimated damage of heroes.
    I'm not sure if there is a direct API function for getting cooldown, but try getting the cooldown via GetSpecialValueInt (I'm not sure if it will work or not).
    I don't think it will work as it does not fall in the "AbilitySpecial" section with labelled keys at FIELD_FLOAT or FIELD_INTEGER

  4. #4
    Basic Member
    Join Date
    Dec 2016
    Posts
    731
    Quote Originally Posted by Platinum_dota2 View Post
    My suggestion to you is the same one I said to Chris, write a damage estimator for abilities and use it to calculate the estimated damage of heroes.
    I'm not sure if there is a direct API function for getting cooldown, but try getting the cooldown via GetSpecialValueInt (I'm not sure if it will work or not).
    Also, he did write a GetEstimatedDamage() which is ability-scoped and will return the damage of an ability on a single cast/use in the last patch. That's what I'm using. But to determine how much damage I can really do over a certain duration I need to know how many times I can cast it in said duration so I need to know how long the cooldown is.

Posting Permissions

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