Skip to content

Commit

Permalink
account for rapid fire when casting fake casts (aimed + multishot)
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Jan 27, 2025
1 parent 809957a commit 6e3f84e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions ElvUI_Libraries/Core/oUF/elements/castbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ local GetUnitEmpowerHoldAtMaxTime = GetUnitEmpowerHoldAtMaxTime
-- GLOBALS: CastingBarFrame, CastingBarFrame_OnLoad, CastingBarFrame_SetUnit

local tradeskillCurrent, tradeskillTotal, mergeTradeskill = 0, 0, false
local specialAuras = {} -- ms modifier
local specialCast = {} -- ms duration
if oUF.isClassic then
specialCast[2643] = 500 -- Multishot R1
Expand All @@ -128,6 +129,24 @@ if oUF.isClassic then
specialCast[20902] = 3000 -- Aimed Shot R4
specialCast[20903] = 3000 -- Aimed Shot R5
specialCast[20904] = 3000 -- Aimed Shot R6

specialAuras[3045] = 0.6 -- Rapid Fire (1 - 0.4, 40%)
end

local function SpecialActive(frame, filter)
if not next(specialAuras) then return end

local index = 1
local name, _, _, _, _, _, _, _, _, spellID = oUF:GetAuraData(frame.unit, index, filter)
while name do
local speedMod = specialAuras[spellID]
if speedMod then
return speedMod
end

index = index + 1
name, _, _, _, _, _, _, _, _, spellID = oUF:GetAuraData(frame.unit, index, filter)
end
end
-- end block

Expand Down Expand Up @@ -253,6 +272,11 @@ local function CastStart(self, real, unit, castGUID, spellID, castTime)
castTime = castDuration -- prefer a real duration time, otherwise use the static duration
end

local speedMod = SpecialActive(self, 'HELPFUL')
if speedMod then
castTime = castTime * speedMod
end

castID = castGUID
startTime = GetTime() * 1000
endTime = startTime + castTime
Expand Down

0 comments on commit 6e3f84e

Please sign in to comment.