Skip to content

Commit 922df4f

Browse files
committed
More Druid TBC / Shaman TBC updates
1 parent 93b0ddf commit 922df4f

12 files changed

Lines changed: 1999 additions & 1818 deletions

File tree

Rotations/Druid/Druid/Druid-Classic_TBC.lua

Lines changed: 0 additions & 1474 deletions
This file was deleted.

Rotations/Druid/Druid/Druid-TBC.lua

Lines changed: 1368 additions & 245 deletions
Large diffs are not rendered by default.

Rotations/Shaman/Shaman/Shaman-TBC.lua

Lines changed: 447 additions & 0 deletions
Large diffs are not rendered by default.

System/API/Units.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ br.api.units = function(self)
2525
units[dynString] = thisUnit
2626
return thisUnit -- Backwards compatability for old way
2727
end
28-
28+
2929
--- Custom target weight function that profiles can override to add coefficient bonuses for dynamic targeting.
3030
-- This allows profiles to customize target prioritization beyond the default coefficient system.
3131
-- Return a number to add to the unit's coefficient (higher = more priority).

System/Core.lua

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,20 @@ function engines:Main()
2424
end
2525

2626
-- Object Manager Engine
27-
local function ObjectManagerUpdate(self)
27+
local function ObjectManagerUpdate(self, elapsed)
2828
if br.unlocked then
2929
if br.data ~= nil and br.data.settings ~= nil and br.data.settings[br.loader.selectedSpec] ~= nil
3030
and br.data.settings[br.loader.selectedSpec].toggles ~= nil
3131
then
3232
if br.data.settings[br.loader.selectedSpec].toggles["Power"] ~= nil
3333
and br.data.settings[br.loader.selectedSpec].toggles["Power"] == 1
3434
then
35+
self.omElapsed = (self.omElapsed or 0) + (elapsed or 0)
36+
local omInterval = math.max(0.05, engines:getUpdateRate())
37+
if self.omElapsed < omInterval then
38+
return
39+
end
40+
self.omElapsed = 0
3541
-- attempt to update objects every frame
3642
-- updates for each object will be spread out randomly
3743
engines.enemiesEngineFunctions:updateOM()
@@ -50,14 +56,20 @@ function engines:ObjectManager()
5056
end
5157

5258
-- Object Tracker
53-
local function ObjectTrackerUpdate(self)
59+
local function ObjectTrackerUpdate(self, elapsed)
5460
if br.unlocked then
5561
if br.data ~= nil and br.data.settings ~= nil and br.data.settings[br.loader.selectedSpec] ~= nil
5662
and br.data.settings[br.loader.selectedSpec].toggles ~= nil
5763
then
5864
if br.data.settings[br.loader.selectedSpec].toggles["Power"] ~= nil
5965
and br.data.settings[br.loader.selectedSpec].toggles["Power"] == 1
6066
then
67+
self.trackerElapsed = (self.trackerElapsed or 0) + (elapsed or 0)
68+
local trackerInterval = math.max(0.10, engines:getUpdateRate())
69+
if self.trackerElapsed < trackerInterval then
70+
return
71+
end
72+
self.trackerElapsed = 0
6173
-- Tracker
6274
engines.tracker:objectTracker()
6375
end

System/Functions/Cast.lua

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,30 @@ local function shouldPrintCastDebug()
77
return br.functions.misc and (br.functions.misc:isChecked("Cast Debug") or br.functions.misc:isChecked("Display Failcasts"))
88
end
99

10+
local function setCastIntentLock(spellID, duration)
11+
if spellID == nil then return end
12+
if duration == nil then duration = 0.15 end
13+
castIntentLocks[spellID] = br._G.GetTime() + duration
14+
end
15+
16+
local function isCastIntentLocked(spellID)
17+
if spellID == nil then return false end
18+
return castIntentLocks[spellID] ~= nil and br._G.GetTime() < castIntentLocks[spellID]
19+
end
20+
21+
local function getSameSpellCastRemain(spellID)
22+
local now = br._G.GetTime()
23+
local _, _, _, _, castEndTime, _, _, _, castingSpellID = br._G.UnitCastingInfo("player")
24+
if castingSpellID == spellID and castEndTime and castEndTime > 0 then
25+
return math.max(0, (castEndTime / 1000) - now)
26+
end
27+
local _, _, _, _, channelEndTime, _, _, channelingSpellID = br._G.UnitChannelInfo("player")
28+
if channelingSpellID == spellID and channelEndTime and channelEndTime > 0 then
29+
return math.max(0, (channelEndTime / 1000) - now)
30+
end
31+
return 0
32+
end
33+
1034
local function takeCastStartSnapshot(spellID)
1135
local spellCdBefore = 0
1236
if br.functions.spell and br.functions.spell.getSpellCD then
@@ -1014,12 +1038,12 @@ function cast:createCastFunction(thisUnit, castType, minUnits, effectRng, spellI
10141038
-- Hard CC (stun/fear/silence/etc): don't spam cast attempts for spells that can't be used.
10151039
if br.functions.combat and br.functions.combat.cannotCast and br.functions.combat:cannotCast(spellID) then
10161040
castTimers[spellID] = br._G.GetTime() + 0.50
1017-
castIntentLocks[spellID] = br._G.GetTime() -- Lock intent during hard CC
1041+
setCastIntentLock(spellID, 0.50) -- Lock intent during hard CC
10181042
return printReport(false, "No Control")
10191043
end
10201044

10211045
-- Set cast intent lock to prevent rapid re-casting attempts
1022-
castIntentLocks[spellID] = br._G.GetTime()
1046+
setCastIntentLock(spellID, 0.20)
10231047

10241048
local snapshot = takeCastStartSnapshot(spellID)
10251049

@@ -1042,7 +1066,18 @@ function cast:createCastFunction(thisUnit, castType, minUnits, effectRng, spellI
10421066
if castSucceeded then
10431067
-- add to cast timer
10441068
castTimers[spellID] = br._G.GetTime() + 1
1045-
castIntentLocks[spellID] = br._G.GetTime() -- Lock intent on successful cast
1069+
local sameSpellCastRemain = getSameSpellCastRemain(spellID)
1070+
if sameSpellCastRemain > 0 then
1071+
setCastIntentLock(spellID, sameSpellCastRemain + 0.12)
1072+
else
1073+
local settleLock = 0.12
1074+
if spellType == "Helpful" then
1075+
settleLock = 0.30
1076+
elseif spellType == "Harmful" and not br._G.UnitAffectingCombat("player") then
1077+
settleLock = 0.30
1078+
end
1079+
setCastIntentLock(spellID, settleLock)
1080+
end
10461081
-- change main button icon
10471082
br.ui.toggles.mainButton:SetNormalTexture(icon)
10481083
-- Update Last Cast
@@ -1055,13 +1090,13 @@ function cast:createCastFunction(thisUnit, castType, minUnits, effectRng, spellI
10551090
-- Cast may have been queued/started but signals didn't update yet.
10561091
-- Throttle quick retries, but don't emit CAST_FAILED spam.
10571092
castTimers[spellID] = br._G.GetTime() + 0.10
1058-
castIntentLocks[spellID] = br._G.GetTime() -- Lock intent on inconclusive result
1093+
setCastIntentLock(spellID, 0.20) -- Lock intent on inconclusive result
10591094
return true
10601095
end
10611096

10621097
-- Failed to start casting: allow a quick retry, but don't lock out for 1s.
10631098
castTimers[spellID] = br._G.GetTime() + 0.10
1064-
castIntentLocks[spellID] = br._G.GetTime() -- Lock intent on failed cast
1099+
setCastIntentLock(spellID, 0.20) -- Lock intent on failed cast
10651100
-- if shouldPrintCastDebug() and not debug then
10661101
-- printCastFailedDetails("[CAST FAIL][CAST_FAILED] ", spellID, spellName, snapshot, details)
10671102
-- end
@@ -1093,9 +1128,13 @@ function cast:createCastFunction(thisUnit, castType, minUnits, effectRng, spellI
10931128
br.functions.lastCast.lastCastTable.castTime[spellID] = br._G.GetTime() -
10941129
(br.functions.spell:getGlobalCD(true) + (select(3, br._G.GetNetStats()) / 100))
10951130
end
1131+
-- Never allow same-spell recast while it's currently being cast/channelled.
1132+
if cast:isCastingSpell(spellID, "player") then
1133+
return false
1134+
end
10961135
-- Cast Intent Lock: Prevent multiple cast attempts in rapid succession
10971136
-- Only check when NOT in debug mode (actual casting, not ability checking)
1098-
if not debug and castIntentLocks[spellID] and (br._G.GetTime() - castIntentLocks[spellID]) < 0.15 then
1137+
if not debug and isCastIntentLocked(spellID) then
10991138
return false
11001139
end
11011140
if (baseSpellID == spellID or overrideSpellID == spellID) and (br.empowerID == nil or br.empowerID == 0)

System/Functions/Misc.lua

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,36 +1334,41 @@ function misc:addonDebug(msg, system)
13341334
if msg == nil then
13351335
return
13361336
end
1337+
local msgText = tostring(msg)
13371338
-- Prefer the dropdown value for Addon Debug Messages. Some configs
13381339
-- may not include a separate checkbox, so rely on the dropdown being
1339-
-- set (1=System Only, 2=Profile Only, 3=All).
1340+
-- set.
13401341
local addonDebugValue = br.functions.misc:getValue("Addon Debug Messages")
1341-
if addonDebugValue and addonDebugValue > 0 then
1342+
if br.functions.misc:isChecked("Addon Debug Messages") and addonDebugValue then
1343+
local showSystem = addonDebugValue == 1 or addonDebugValue == 2
1344+
local showProfile = addonDebugValue == 1 or addonDebugValue == 3
1345+
13421346
-- Use a per-message short timer key so different messages printed
13431347
-- within a short interval aren't suppressed by the same global key.
1344-
local msgKey = tostring(msg)
1348+
local msgKey = msgText
13451349
if #msgKey > 40 then msgKey = msgKey:sub(1, 40) end
13461350

13471351
-- Immediate-print for casting-related messages to avoid them being
13481352
-- swallowed by simultaneous 'Combat Started' messages. Use a
13491353
-- short per-message guard so we don't spam identical lines.
1350-
if string.find(msg, "Casting") then
1354+
-- Respect configured channel filtering (System/Profile/All).
1355+
if showProfile and system ~= true and string.find(msgText, "Casting") then
13511356
local castKey = "Casting Immediate:" .. msgKey
13521357
if br.debug.timer:useTimer(castKey, 0.05) then
1353-
print(br.ui.colors.class .. "[BadRotations] Profile Debug: |cffFFFFFF" .. tostring(msg))
1358+
print(br.ui.colors.class .. "[BadRotations] Profile Debug: |cffFFFFFF" .. msgText)
13541359
end
13551360
return
13561361
end
13571362

1358-
if system == true and (addonDebugValue == 1 or addonDebugValue == 3) then
1363+
if system == true and showSystem then
13591364
local timerKey = "System Delay:" .. msgKey
13601365
if br.debug.timer:useTimer(timerKey, 0.1) then
1361-
print(br.ui.colors.class .. "[BadRotations] System Debug: |cffFFFFFF" .. tostring(msg))
1366+
print(br.ui.colors.class .. "[BadRotations] System Debug: |cffFFFFFF" .. msgText)
13621367
end
1363-
elseif system ~= true and (addonDebugValue == 2 or addonDebugValue == 3) then
1368+
elseif system ~= true and showProfile then
13641369
local timerKey = "Profile Delay:" .. msgKey
13651370
if br.debug.timer:useTimer(timerKey, 0.1) then
1366-
print(br.ui.colors.class .. "[BadRotations] Profile Debug: |cffFFFFFF" .. tostring(msg))
1371+
print(br.ui.colors.class .. "[BadRotations] Profile Debug: |cffFFFFFF" .. msgText)
13671372
end
13681373
end
13691374
end

System/Functions/Spell.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ function spell:getRacial(thisRace)
592592
}
593593
local classicRacialSpells = {
594594
-- Alliance
595+
Draenei = DraeneiRacial, -- Gift of the Naaru
595596
-- Dwarf = 20594, -- Stoneform
596597
-- Gnome = 20589, -- Escape Artist
597598
-- Human = 59752, -- Every Man for Himself

0 commit comments

Comments
 (0)