Skip to content

Instantly share code, notes, and snippets.

@Romain-P
Created December 6, 2015 03:40
Show Gist options
  • Select an option

  • Save Romain-P/ab6fe8dcda2d735e98a5 to your computer and use it in GitHub Desktop.

Select an option

Save Romain-P/ab6fe8dcda2d735e98a5 to your computer and use it in GitHub Desktop.
function cdRemains(spellid)
if select(2,GetSpellCooldown(spellid)) + (select(1,GetSpellCooldown(spellid)) - GetTime()) > 0
then return select(2,GetSpellCooldown(spellid)) + (select(1,GetSpellCooldown(spellid)) - GetTime())
else return 0
end
end
function castable(totem, spellid)
if UnitName("Mouseover") == totem
and IsSpellInRange(GetSpellInfo(spellid),"Mouseover") == 1
and cdRemains(spellid) == 0 and not PQR_IsOutOfSight("Mouseover")
then return 1
else return 0
end
end
function track(totem)
if castable(totem, 62124) == 1
then
CastSpellByID(62124,"Mouseover")
SendChatMessage(totem .. " broken" ,"PARTY",GetDefaultLanguage("player"),1)
else if castable(totem, 20271) == 1
then
CastSpellByID(20271,"Mouseover")
SendChatMessage(totem .. " broken" ,"PARTY",GetDefaultLanguage("player"),1)
end end
end
track("Earthbind Totem")
track("Tremor Totem")
track("Grounding Totem")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment