fix fallback movement conditional and update nampower support to 2_38

This commit is contained in:
Jrc13245
2026-02-18 17:18:48 -05:00
parent ec43a636d6
commit 15091a867b
4 changed files with 81 additions and 23 deletions
+34 -1
View File
@@ -109,7 +109,19 @@
- SetMouseoverUnit(unitToken) - Programmatically set the mouseover unit.
Previously only available via SuperWoW; now also provided by Nampower.
Current version: v2.37.0
Spell Duration & Enhanced SPELL_START (v2.38+):
- GetSpellDuration(spellId, [ignoreModifiers]) - Returns duration in ms.
For channeling spells: channel duration. For others: first aura effect duration.
Pass ignoreModifiers=1 to get base duration (ignores talents/buffs).
Returns 0 if spell has no duration, nil if spellId invalid.
- SPELL_START_SELF / SPELL_START_OTHER now include two new parameters:
arg7 = duration (ms) - channel duration for channeling spells, 0 otherwise
arg8 = spellType - 0=Normal, 1=Channeling, 2=Autorepeating
Use spellType to distinguish channeling spells (SPELL_START_OTHER carries both
cast-time and channeling spells since there is no separate SPELL_CHANNEL_START
packet for other players).
Current version: v2.38.0
]]
local _G = _G or getfenv(0)
@@ -283,6 +295,10 @@ API.VERSION_REQUIREMENTS = {
-- v2.37+ - Unit token cast support and SetMouseoverUnit
["CastSpellByNameUnitToken"]= { 2, 37, 0 }, -- CastSpellByName accepts unit token strings as 2nd param
["SetMouseoverUnit"] = { 2, 37, 0, "SetMouseoverUnit" },
-- v2.38+ - GetSpellDuration and enhanced SPELL_START parameters
["GetSpellDuration"] = { 2, 38, 0, "GetSpellDuration" },
["SpellStartSpellType"] = { 2, 38, 0 }, -- duration + spellType params added to SPELL_START events
}
-- Check if a specific feature is available
@@ -440,6 +456,10 @@ local function InitializeFeatures()
f.hasCastSpellByNameUnitToken = API.HasFeature("CastSpellByNameUnitToken")
f.hasSetMouseoverUnit = API.HasFeature("SetMouseoverUnit")
-- v2.38+ GetSpellDuration and enhanced SPELL_START parameters
f.hasGetSpellDuration = API.HasFeature("GetSpellDuration")
f.hasSpellStartSpellType = API.HasFeature("SpellStartSpellType")
-- Runtime detection for enhanced spell functions (verify by testing)
if f.hasEnhancedSpellFunctions and GetSpellTexture then
local success, result = pcall(function()
@@ -3040,6 +3060,19 @@ function API.GetSpellPower(mode)
return _G.GetSpellPower(mode)
end
-- Get duration of a spell in milliseconds (v2.38+)
-- For channeling spells: returns the channel duration.
-- For non-channeling spells: returns the first aura effect duration.
-- spellId: spell ID to look up
-- ignoreModifiers: pass 1 to ignore talent/buff modifiers (returns base duration)
-- Returns: duration in ms (0 if spell has no duration), or nil if spellId invalid
function API.GetSpellDuration(spellId, ignoreModifiers)
if not API.features.hasGetSpellDuration or not _G.GetSpellDuration then
return nil
end
return _G.GetSpellDuration(spellId, ignoreModifiers)
end
--------------------------------------------------------------------------------
-- AURA CANCEL FUNCTIONS (v2.34+)
--------------------------------------------------------------------------------