@@ -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 = {}
175179var .getFacingDistance = br .functions .range .getFacingDistance
176180var .haltProfile = false
177181var .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
396431end -- 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+
746800local 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 ---- -----------------
0 commit comments