From 8542688e2a9b982cd8f71de02fcc043bb585248f Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Mon, 24 Aug 2026 16:15:32 +0200 Subject: [PATCH] Add ClassicAPI action range helpers --- api.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/api.lua b/api.lua index dfd3ec5..af5d9e9 100644 --- a/api.lua +++ b/api.lua @@ -19,6 +19,9 @@ API.casts = type(_G.C_Spell) == "table" and type(_G.C_Spell.UnitCastingInfo) == "function" and type(_G.C_Spell.UnitChannelInfo) == "function" +API.spellrange = type(_G.C_Spell) == "table" + and type(_G.C_Spell.IsSpellInRange) == "function" + API.auras = type(_G.C_UnitAuras) == "table" and type(_G.C_UnitAuras.GetAuraDataByIndex) == "function" and type(_G.C_UnitAuras.GetDebuffDataByIndex) == "function" @@ -27,6 +30,7 @@ API.aurapositional = type(_G.C_UnitAuras) == "table" and type(_G.C_UnitAuras.UnitDebuff) == "function" API.spellinfo = type(_G.GetSpellInfo) == "function" +API.actioninfo = type(_G.GetActionInfo) == "function" API.inventory = type(_G.C_Container) == "table" and type(_G.C_Container.GetContainerNumFreeSlots) == "function" @@ -41,6 +45,7 @@ API.itemquality = API.items and type(_G.C_Item.GetItemQualityByID) == "function" API.itemprice = API.items and type(_G.C_Item.GetItemSellPriceByID) == "function" API.iteminventorytype = API.items and type(_G.C_Item.GetItemInventoryTypeByID) == "function" API.iteminventoryslotkey = API.items and type(_G.C_Item.GetItemInventorySlotKey) == "function" +API.itemrange = API.items and type(_G.C_Item.IsItemInRange) == "function" API.eventutils = type(_G.C_EventUtils) == "table" and type(_G.C_EventUtils.IsEventValid) == "function" @@ -117,6 +122,18 @@ API.GetChannelInfo = function(unit) isTradeSkill, notInterruptible, spellID end +API.IsSpellInRange = function(spell, unit) + if API.spellrange then + return _G.C_Spell.IsSpellInRange(spell, unit) + end +end + +API.GetActionInfo = function(slot) + if API.actioninfo then + return _G.GetActionInfo(slot) + end +end + API.GetAuraDataByIndex = function(unit, index, filter) if API.auras then return _G.C_UnitAuras.GetAuraDataByIndex(unit, index, filter) @@ -261,6 +278,12 @@ API.GetItemInventorySlotKey = function(inventoryType) end end +API.IsItemInRange = function(item, unit) + if API.itemrange then + return _G.C_Item.IsItemInRange(item, unit) + end +end + API.GetNumJunkItems = function() if API.merchant then return _G.C_MerchantFrame.GetNumJunkItems()