Deriving/calculating GCD
Is there a way I can ask the game engine to tell me the current GCD?
I have been using local startTime, duration, enabled = GetSpellCooldown(61304); however this will give me the current/recent GCD only if I call it during the GCD! Otherwise I get 0s. Of course. Any ideas ? |
If you are asking about the global cooldown, that's easy. It is 1.5 seconds less the haste percentage. Each 10% of haste reduces the GCD by 0.1 seconds, therefore 50% haste makes the GCD 1 second. Yes, you can get some really small fractions, but they do count.
Edit: the documentation page goes on to explain how to get the global cooldown using spellID 61304. Now, if you are asking about the recycle cooldown of a spell, that's different. Read the code snippet for the API documentation for GetSpellCooldown() https://wow.gamepedia.com/API_GetSpellCooldown |
Hi, thanks.
I am asking about the GCD and I do not want to presume to calculate it since the game engine knows better. You have hastes and delays, and a million other things, let the engine tell you, if it can. My question is "what is the GCD that will be applied on my next cast after everything is factored in?". I do not want to cast the spell and find out, I want to know before, if possible. I do realise that my spell, if I cast it, might change the GCD, and that a few ticks action delay on my part might cause some game mechanic to change everything and throw my previous GCD calculation out of the window. My workaround : do a "local startTime, duration, enabled = GetSpellCooldown(61304);" pretty often, and its "duration", if not 0, is my "current GCD". |
GetSpellCooldown(61304) is the most accurate way, however it only returns it's value while the GCD is already triggered.
|
On ReadySpells, which I'm working on to release an up to date version (and taking way much longer than I'd initially thought :( ), I came up with this:
Lua Code:
I don't think there's a practical way to achieve what you want. You could cache the results of each spell the first time they're cast, but you'd need to cast each at least once. And then there's all the game mechanics, like e.g. casting a spell while under Heroism/Bloodlust would obviously change the return value of GetSpellCooldown(61304). So... you'd basically have to take into account all the possible factors that might change the GCD every time you did your calculation (for example, last GCD-fetch Heroism was on, now it's not, you'd add 0.3 seconds to your last GCD). And, honestly, to do that, then you'd be better off following myrroddin's suggestion and adding in the other factors... Which still seems like a very bad idea to me (factoring in everythin on top of the calculation myrroddin's calculation). IMHO either do as myrroddin suggested or as you're already doing it. Doesn't look to me that you can feasibly improve on those options. Unless BfA brings some important change to this (of which I'm not aware, nor have I done any testing). |
GetSpellCooldown(61304) after event ACTIONBAR_UPDATE_COOLDOWN will do the trick
also, all spell durations < 1.5 sec are gcd, if you are willing to use GetActionCooldown on your bar actions |
Here's my GCD addon that i've made, hope it can help!
Lua Code:
|
Also, if you ever run into a situation where a spell's cooldown is shorter than the global cooldown, then yes, the spell will finish before the GCD, but you will still need to wait for the GCD to finish before the spell can be used. I can't think of a current example, but there used to be cases on my Shadow Priest where Mind Flay would recycle faster than the GCD, and thus I had to wait to cast again.
This is because the GCD cannot drop below 1 second no matter how much haste you have (thus having more than 50% haste is pointless) unless something has changed during Legion or BfA. Or, think of it this way: Mind Flay has a cast time with 0 haste of 1.5 seconds, with a recycle time of 1.5 seconds, both exactly the same as the GCD. The lowest the GCD can go is 1 second yet I could get 70% or more haste between heroism, buffs, boss debuffs, and my own haste. That knocked Mind Flay to less than a second to cast, but I still had to wait the balance of that second to cast Mind Flay again, and because the GCD was working, neither could I cast any other spell. For between 0.25-0.5 of a second I literally could cast nothing, could not swing my staff, do nothing other than look there looking all priestly. |
All times are GMT -6. The time now is 11:19 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI