Expose ClassicAPI auto-attack helpers

This commit is contained in:
Dusk-92
2026-08-26 09:27:45 +02:00
parent 81fa03c205
commit a0781c2b86
+24
View File
@@ -31,6 +31,12 @@ API.aurapositional = type(_G.C_UnitAuras) == "table"
API.spellinfo = type(_G.GetSpellInfo) == "function"
API.actioninfo = type(_G.GetActionInfo) == "function"
API.autoattack = type(_G.C_Spell) == "table"
and type(_G.C_Spell.IsAutoAttackSpell) == "function"
and type(_G.C_Spell.IsRangedAutoAttackSpell) == "function"
API.autoattackbook = type(_G.C_SpellBook) == "table"
and type(_G.C_SpellBook.IsAutoAttackSpellBookItem) == "function"
and type(_G.C_SpellBook.IsRangedAutoAttackSpellBookItem) == "function"
API.inventory = type(_G.C_Container) == "table"
and type(_G.C_Container.GetContainerNumFreeSlots) == "function"
@@ -147,6 +153,24 @@ API.GetActionInfo = function(slot)
end
end
API.IsAutoAttackSpell = function(spellID)
return API.autoattack and _G.C_Spell.IsAutoAttackSpell(spellID) or false
end
API.IsRangedAutoAttackSpell = function(spellID)
return API.autoattack and _G.C_Spell.IsRangedAutoAttackSpell(spellID) or false
end
API.IsAutoAttackSpellBookItem = function(slot, bookType)
return API.autoattackbook
and _G.C_SpellBook.IsAutoAttackSpellBookItem(slot, bookType) or false
end
API.IsRangedAutoAttackSpellBookItem = function(slot, bookType)
return API.autoattackbook
and _G.C_SpellBook.IsRangedAutoAttackSpellBookItem(slot, bookType) or false
end
API.GetAuraDataByIndex = function(unit, index, filter)
if API.auras then
return _G.C_UnitAuras.GetAuraDataByIndex(unit, index, filter)