Skip to content

Commit 59db7e2

Browse files
committed
More Updates
1 parent 65e6681 commit 59db7e2

30 files changed

Lines changed: 1938 additions & 2756 deletions

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ Settings/*
3333
Unlockers/mmb.lua
3434
Unlockers/daemonic.lua
3535
Unlockers/icc.lua
36-
Rotations/Rogue/Outlaw/OutlawRavens\.lua
36+
Rotations/Rogue/Outlaw/OutlawRavens\.lua
37+
Deprecated/*

BadRotations.toc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ misc.xml
5858
System\Unlockers.lua
5959
System\Core.lua
6060
System\Debugging.lua
61-
System\LootManager.lua
62-
System\UsefulFeatures.lua
6361
System\SlashCommands.lua
6462

6563
## Functions
@@ -118,12 +116,15 @@ System\Engines\HealingEngineFrame.lua
118116
System\Engines\HealingEngineFunctions.lua
119117
#System\Engines\InterruptsFrame.lua -- Unused
120118
System\Engines\Interrupts.lua
119+
System\Engines\LootEngine.lua
120+
System\Engines\LootEngineFunctions.lua
121121
System\Engines\ttdTable.lua
122122
System\Engines\QuestTracker.lua
123123
System\Engines\Tracker.lua
124124

125125
## BadRotations UI
126126

127+
System\UI\Tooltips.lua
127128
System\UI\Colors.lua
128129
System\UI\DropOptions.lua
129130
System\UI\SettingsManagement.lua
@@ -205,8 +206,6 @@ System\Updater.lua
205206
# System\Unlockers.lua
206207
# System\Core.lua
207208
# System\Debugging.lua
208-
# System\LootManager.lua
209-
# System\UsefulFeatures.lua
210209
# System\SlashCommands.lua
211210

212211
# ## Functions
@@ -283,12 +282,15 @@ System\Updater.lua
283282
# System\Engines\HealingEngineFunctions.lua
284283
# #System\Engines\InterruptsFrame.lua -- Unused
285284
# System\Engines\Interrupts.lua
285+
# System\Engines\LootEngine.lua
286+
# System\Engines\LootEngineFunctions.lua
286287
# System\Engines\ttdTable.lua
287288
# System\Engines\QuestTracker.lua
288289
# System\Engines\Tracker.lua
289290

290291
# ## BadRotations UI
291292

293+
# System\UI\Tooltips.lua
292294
# System\UI\SettingsManagement.lua
293295
# System\UI\ChatOverlay.lua
294296
# System\UI\MinimapButton.lua

Rotations/Druid/Feral/FeralCuteOne.lua

Lines changed: 485 additions & 380 deletions
Large diffs are not rendered by default.

Rotations/Hunter/Support/PetCuteOne.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ br.loader.rotations.support["PetCuteOne"] = {
149149
enemies.yards40r = enemies.rect.get(10, 40, false)
150150

151151
-- Loot Count
152-
lootCount = br.lootManager:lootCount()
152+
lootCount = br.engines.lootEngine:lootCount()
153153

154154
-- Pet Target Modes
155155
if br.petTarget == nil then br.petTarget = "target" end

Rotations/Monk/Windwalker/WindwalkerCuteOne.lua

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ local function createOptions()
7070
br.ui:createCheckbox(section, "Crackling Jade Lightning")
7171
br.ui:createSpinnerWithout(section, "Cancel CJL Range", 10, 5, 40, 5,
7272
"|cffFFFFFFCancels Crackling Jade Lightning below this range in yards.")
73+
-- Grapple Weapon
74+
br.ui:createCheckbox(section, "Grapple Weapon", "|cffFFFFFFAutomatically disarms dangerous melee enemies in PvE.")
7375
-- Legacy of the Emperor
7476
br.ui:createCheckbox(section, "Legacy of the Emperor")
7577
-- Legacy of the White Tiger
@@ -99,10 +101,12 @@ local function createOptions()
99101
{ "|cff00FF00Player", "|cffFFFF00Target", "|cffFF0000Mouseover" }, 1, "|cffFFFFFFTarget to cast on")
100102
-- Disable
101103
br.ui:createCheckbox(section, "Disable", "|cffFFFFFFDisables all defensive abilities.")
102-
-- Expel Harm
104+
-- Expel Harm
103105
br.ui:createSpinner(section, "Expel Harm", 40, 0, 100, 5, "|cffFFFFFFHealth Percent to Cast At")
104106
-- Fortifying Brew
105107
br.ui:createSpinner(section, "Fortifying Brew", 30, 0, 100, 5, "|cffFFFFFFHealth Percent to Cast At")
108+
-- Healing Sphere
109+
br.ui:createSpinner(section, "Healing Sphere", 50, 0, 100, 5, "|cffFFFFFFHealth Percent to Cast At")
106110
-- Leg Sweep
107111
br.ui:createSpinner(section, "Leg Sweep - HP", 50, 0, 100, 5, "|cffFFFFFFHealth Percent to Cast At")
108112
br.ui:createSpinner(section, "Leg Sweep - AoE", 5, 0, 10, 1, "|cffFFFFFFNumber of Units in 5 Yards to Cast At")
@@ -175,6 +179,8 @@ local var = {}
175179
var.getFacingDistance = br.functions.range.getFacingDistance
176180
var.haltProfile = false
177181
var.profileStop = false
182+
var.grappleWeaponBlacklist = {} -- Stores NPC IDs that don't have weapons
183+
var.lastGrappleTarget = nil
178184

179185
--------------------
180186
--- Action Lists ---
@@ -206,7 +212,7 @@ actionList.Extra = function()
206212
end
207213
-- Single / AOE follow-up on current target
208214
if unit.exists("target") then
209-
if not ui.useAOE(8,2) then
215+
if not ui.useAOE(8,3) then
210216
if cast.able.jab("target") then
211217
if cast.jab("target") then
212218
ui.debug("Casting Jab [Death Monk]")
@@ -243,6 +249,26 @@ actionList.Extra = function()
243249
return true
244250
end
245251
end
252+
-- * Grapple Weapon
253+
if ui.checked("Grapple Weapon")then
254+
for i = 1, #enemies.yards40 do
255+
local thisUnit = enemies.yards40[i]
256+
if cast.able.grappleWeapon(thisUnit) and unit.exists(thisUnit) and unit.distance(thisUnit) <= 40
257+
and not debuff.grappleWeapon.exists(thisUnit)
258+
then
259+
-- Get NPC ID to check blacklist
260+
local npcID = br.functions.unit:GetObjectID(thisUnit)
261+
-- Skip if this NPC type is blacklisted (known to not have weapons)
262+
if not var.grappleWeaponBlacklist[npcID] then
263+
var.lastGrappleTarget = thisUnit
264+
if cast.grappleWeapon(thisUnit) then
265+
ui.debug("Casting Grapple Weapon on " .. unit.name(thisUnit) .. " [Extra]")
266+
return true
267+
end
268+
end
269+
end
270+
end
271+
end
246272
-- * Legacy of the Emperor
247273
if ui.checked("Legacy of the Emperor") and cast.able.legacyOfTheEmperor() and not buff.legacyOfTheEmperor.exists() then
248274
if cast.legacyOfTheEmperor() then
@@ -331,7 +357,7 @@ actionList.Defensive = function()
331357
end
332358
end
333359
if ui.checked("Leg Sweep - AoE") and cast.able.legSweep()
334-
and #enemies.yards5 >= ui.value("Leg Sweep - AoE [Defensive]")
360+
and #enemies.yards5 >= ui.value("Leg Sweep - AoE")
335361
then
336362
if cast.legSweep() then
337363
ui.debug("Casting Leg Sweep - AoE [Defensive]")
@@ -392,6 +418,15 @@ actionList.Defensive = function()
392418
end
393419
end
394420
end
421+
-- * Healing Sphere
422+
if ui.checked("Healing Sphere") and cast.able.healingSphere("player","ground",0)
423+
and unit.hp() <= ui.value("Healing Sphere") and energy() >= 40
424+
then
425+
if cast.healingSphere("player","ground",0) then
426+
ui.debug("Casting Healing Sphere [Defensive]")
427+
return true
428+
end
429+
end
395430
end
396431
end -- End Action List - Defensive
397432

@@ -743,6 +778,25 @@ end -- End Action List - Combat
743778
----------------
744779
--- ROTATION ---
745780
----------------
781+
-- Event frame for error detection
782+
var.grappleWeaponErrorFrame = var.grappleWeaponErrorFrame or CreateFrame("Frame")
783+
784+
var.grappleWeaponErrorFrame:RegisterEvent("UI_ERROR_MESSAGE")
785+
var.grappleWeaponErrorFrame:SetScript("OnEvent", function(self, event, errorType, message)
786+
if message and var.lastGrappleTarget and var.grappleWeaponBlacklist then
787+
-- Check for weapon-related errors (common messages: "Target has no weapons", "Can't do that")
788+
local weaponError = message:lower():find("weapon") or message:lower():find("disarm")
789+
if weaponError then
790+
local npcID = br.functions.unit:GetObjectID(var.lastGrappleTarget)
791+
if npcID and not var.grappleWeaponBlacklist[npcID] then
792+
var.grappleWeaponBlacklist[npcID] = true
793+
print("|cff8000FFBadRotations|r: Blacklisted " .. (UnitName(var.lastGrappleTarget) or "Unknown") .. " (ID: " .. npcID .. ") - No weapons to grapple")
794+
end
795+
end
796+
var.lastGrappleTarget = nil
797+
end
798+
end)
799+
746800
local function runRotation()
747801
---------------------
748802
--- Define Locals ---
@@ -765,13 +819,15 @@ local function runRotation()
765819
-- General Locals
766820
var.haltProfile = (unit.inCombat() and var.profileStop) or unit.mounted() or ui.pause() or ui.mode.rotation == 2
767821
-- Dynamic Units
768-
-- Units (throttled)
822+
-- Units
769823
units.get(5)
770824
units.get(40)
771-
-- Enemies (throttled)
825+
-- Enemies
772826
enemies.get(5)
773827
enemies.get(8)
828+
-- enemies.get(8,"player",true) -- No Combat
774829
enemies.get(20)
830+
enemies.get(40)
775831

776832
-- Cancel Crackling Jade Lightning
777833
if cast.current.cracklingJadeLightning() and unit.distance("target") < ui.value("Cancel CJL Range") then
@@ -781,6 +837,8 @@ local function runRotation()
781837
end
782838
end
783839

840+
-- ui.chatOverlay("AOE: "..tostring(ui.useAOE(8,3)).." - C: "..#enemies.yards8.. " - NC: "..#enemies.yards8nc)
841+
784842
---------------------
785843
--- Begin Profile ---
786844
---------------------

System/API/Debuff.lua

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ local function getSnapshotValue(dot)
1515
if br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()) == 103 then
1616
local multiplier = 1.00
1717
local DreamOfCenarius = 1.30
18-
local SavageRoar = 1.40
18+
local SavageRoar = 1.45
1919
local TigersFury = 1.15
2020
local RakeMultiplier = 1
2121
-- * Tigers Fury
@@ -24,20 +24,29 @@ local function getSnapshotValue(dot)
2424
if br.player.buff.dreamOfCenarius.exists() then multiplier = multiplier * DreamOfCenarius end
2525
-- * Savage Roar
2626
if br.player.buff.savageRoar.exists() then multiplier = multiplier * SavageRoar end
27+
28+
-- Get Attack Power for actual damage calculations
29+
local UnitAttackPower = br._G["UnitAttackPower"]
30+
local base, posBuff, negBuff = UnitAttackPower("player")
31+
local ap = base + posBuff + negBuff
32+
2733
-- * Rip
2834
if dot == br.player.spells.debuffs.rip then
29-
return 5 * multiplier
35+
-- Rip: 768% AP over 16 seconds (8 ticks, one every 2 seconds)
36+
local ripTickDamage = (7.68 * ap) / 8
37+
return ripTickDamage * multiplier
3038
end
3139
-- * Rake
3240
if dot == br.player.spells.debuffs.rake then
41+
-- Rake: 155% AP over 15 seconds (9 ticks, one every 3 seconds)
42+
local rakeTickDamage = (0.155 * ap) / 9
3343
-- Incarnation/Prowl/Shadowmeld
34-
if br.player.buff.incarnation.exists() or br.player.buff.prowl.exists()
35-
or br.player.buff.shadowmeld.exists() --or br.player.buff.suddenAmbush.exists()
36-
then
37-
RakeMultiplier = 2.0
38-
end
39-
-- return rake
40-
return multiplier * RakeMultiplier
44+
-- if br.player.buff.incarnation.exists() or br.player.buff.prowl.exists()
45+
-- or br.player.buff.shadowmeld.exists() --or br.player.buff.suddenAmbush.exists()
46+
-- then
47+
-- RakeMultiplier = 2.0
48+
-- end
49+
return rakeTickDamage * multiplier * RakeMultiplier
4150
end
4251
end
4352
-- Assassination Bleeds

System/API/Module.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ br.api.module = function(self)
9797
local itemName, _, _, itemLevel, itemMinLevel, itemType, itemSubType, _, _, _, _, _, _, _, _, _, _ =
9898
C_Item.GetItemInfo(itemInfo.itemID)
9999
if itemType == "Consumable" and itemSubType == "Potions" then
100-
if string.find(itemName, "Heal", 0, true) then
100+
if string.find(itemName, "Heal", 1, true) then
101101
table.insert(Consumables, #Consumables + 1, {
102102
itemID = itemInfo.itemID,
103103
spellId = spellID,

System/API/UI.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ br.api.ui = function(self)
9292
-- @function ui.fullBags
9393
-- @return boolean - Returns true if bags are full
9494
ui.fullBags = function()
95-
return br.lootManager:emptySlots() == 0
95+
return br.engines.lootEngine:emptySlots() == 0
9696
end
9797
end
9898

System/API/Unit.lua

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,4 +673,40 @@ br.api.unit = function(self)
673673
if not offHand and unit.weaponImbue.exists(imbueId) then return mainCharges end
674674
return 0
675675
end
676+
677+
----------------------
678+
--- Combat Stats API ---
679+
----------------------
680+
681+
--- Get player's attack power
682+
-- @function unit.attackPower
683+
-- @param thisUnit The unit to check, defaults to "player" if nil
684+
-- @return number Total attack power (base + positive buffs + negative buffs)
685+
unit.attackPower = function(thisUnit)
686+
if thisUnit == nil then thisUnit = "player" end
687+
local UnitAttackPower = br._G["UnitAttackPower"]
688+
local base, posBuff, negBuff = UnitAttackPower(thisUnit)
689+
return base + posBuff + negBuff
690+
end
691+
692+
--- Get player's critical strike chance
693+
-- @function unit.critChance
694+
-- @param thisUnit The unit to check, defaults to "player" if nil
695+
-- @return number Critical strike chance percentage
696+
unit.critChance = function(thisUnit)
697+
if thisUnit == nil then thisUnit = "player" end
698+
local GetCritChance = br._G["GetCritChance"]
699+
return GetCritChance()
700+
end
701+
702+
--- Get player's average weapon damage
703+
-- @function unit.weaponDamage
704+
-- @param thisUnit The unit to check, defaults to "player" if nil
705+
-- @return number Average weapon damage
706+
unit.weaponDamage = function(thisUnit)
707+
if thisUnit == nil then thisUnit = "player" end
708+
local UnitDamage = br._G["UnitDamage"]
709+
local minDmg, maxDmg = UnitDamage(thisUnit)
710+
return (minDmg + maxDmg) / 2
711+
end
676712
end

System/Core.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ function engines:Update(self)
225225
br.engines.healingEngine.friend:Update()
226226
end
227227
-- Auto Loot
228-
br.lootManager:autoLoot()
228+
br.engines.lootEngine:autoLoot()
229229
-- Close windows and swap br.loader.selectedSpec on Spec Change
230230
local thisSpec = select(2, br._G.C_SpecializationInfo.GetSpecializationInfo(br._G.C_SpecializationInfo.GetSpecialization()))
231231
if thisSpec ~= "" and thisSpec ~= br.loader.selectedSpec then

0 commit comments

Comments
 (0)