Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function PQR_SpellAvailable(SpellID)
- local GCDSpell = PQR_GCDSpell()
- if GetSpellCooldown ~= nil then
- local GCDstartTime, GCDduration = GetSpellCooldown(GCDSpell)
- local startTime, duration, enabled = GetSpellCooldown(SpellID)
- local usableName, _, _, spellCost = GetSpellInfo(SpellID)
- local spellUsable = nil
- local _, build = GetBuildInfo()
- If tonumber(build) <= 12340 Then
- spellUsable = IsUsableSpell(usableName)
- else
- spellUsable = IsUsableSpell(SpellID)
- end
- pq_SpellAvailable = "false"
- if startTime ~= nil and GCDstartTime ~= nil then
- local timeLeft = startTime + duration - GetTime()
- local GCDtimeLeft = GCDstartTime + GCDduration - GetTime()
- If GCDtimeLeft <= 0 Then
- If timeLeft <= 0.25 Then
- if spellUsable ~= nil then
- pq_SpellAvailable = "true"
- end
- end
- else
- If timeLeft <= GCDtimeLeft + 0.25 Then
- if spellUsable ~= nil then
- pq_SpellAvailable = "true"
- end
- end
- end
- else
- pq_SpellAvailable = "false"
- end
- else
- pq_SpellAvailable = "false"
- end
- if pq_SpellAvailable == nil or pq_SpellAvailable == "false" then
- return false
- else
- return true
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement