mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
fix inrange distance measuring, add distance range count threshold for enemy count, add filters for count mode, fix stopattack
This commit is contained in:
+9
-7
@@ -1064,15 +1064,17 @@ end
|
||||
function API.GetSpellRange(spellId)
|
||||
if not spellId or spellId == 0 then return nil end
|
||||
|
||||
-- First try rangeMax (Nampower may provide this as a resolved field)
|
||||
local rangeMax = API.GetSpellField(spellId, "rangeMax")
|
||||
if rangeMax and rangeMax > 0 then
|
||||
return rangeMax / 10 -- Convert from game units to yards
|
||||
end
|
||||
|
||||
-- Fallback: lookup rangeIndex in SpellRange table
|
||||
local rangeIndex = API.GetSpellField(spellId, "rangeIndex")
|
||||
if rangeIndex then
|
||||
-- Prefer GetSpellRangeData (v4.0+) for runtime DBC lookup (covers custom ranges)
|
||||
if API.features.hasGetSpellRangeData and _G.GetSpellRangeData then
|
||||
local minRange, maxRange, flags, name = _G.GetSpellRangeData(rangeIndex)
|
||||
if maxRange and maxRange > 0 then
|
||||
return maxRange
|
||||
end
|
||||
end
|
||||
|
||||
-- Fallback: hardcoded SpellRange table
|
||||
local range = API.SpellRangeTable[rangeIndex]
|
||||
if range then
|
||||
return range
|
||||
|
||||
Reference in New Issue
Block a user