Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 98.60 KB | None | 0 0
  1. local rotationName = "immy8.2"
  2. local fhbossPool = false
  3. local br = br
  4. br.rogueTables = {}
  5. local rogueTables = br.rogueTables
  6. rogueTables.enemyTable5, rogueTables.enemyTable20, rogueTables.burnTable20, rogueTables.burnTable5 = {}, {}, {}, {}
  7. local enemyTable5, enemyTable20, burnTable20, burnTable5 = rogueTables.enemyTable5, rogueTables.enemyTable20, rogueTables.burnTable20, rogueTables.burnTable5
  8. local keepbteEmissary = false
  9. local poolForBTE = false
  10. local forcekill = {
  11. [120651]=true, -- Explosive
  12. [136330]=true, -- Soul Thorns Waycrest Manor
  13. [134388]=true -- A Knot of Snakes ToS
  14. }
  15. local dispellList = {
  16.  
  17. }
  18. local pvpforcekill = {
  19. [101398] = true -- shadowpriest menthal shit
  20. }
  21. local cloakPlayerlist = {
  22. [256106] = true, -- FH 1st boss
  23. [261440] = true, -- Virulent Pathogen WM
  24. [265773] = true -- Spit Gold KR
  25. }
  26. local evasionPlayerlist = {
  27. -- [256979] = true, -- pewpew council boss
  28. [266231] = true -- Severing Axe KR
  29. -- [256106] = true
  30. }
  31. local feintPlayerList = {
  32. [256979] = true -- Powder shot FH 2nd
  33. }
  34. local cloaklist = {
  35. [119300] = true --test rfc 2
  36. }
  37. local evasionlist = {
  38. }
  39. local feintlist = {
  40. -- [2561066] = true -- FH 1st boss
  41. }
  42. local turtleBuffs = {
  43.  
  44. }
  45. local pveDR = {
  46. [272659] = true -- ToS lighningh shield thrash
  47. }
  48. local torrentDispell = {
  49.  
  50. }
  51. local vanishList = {
  52. [260551] = true, -- Soul Thorns WM
  53. [261440] = true, -- Virulent Pathogen WM
  54. [266231] = true, --Severing Axe KR
  55. [258338] = true, --Barrel fh 2nd boss
  56. [263371] = true, --conduction
  57. [260741] = true --nettles wm
  58. }
  59. local stunList = { -- Stolen from feng pala
  60. [274400] = true, -- Duelist Dash fh
  61. -- [274383] = true, -- Rat Traps fh
  62. [276292] = true, -- Whirling Slam SotS
  63. [268273] = true, -- Deep Smash SotS
  64. [256897] = true, -- Clamping Jaws SoB
  65. [256957] = true,
  66. [272542] = true, -- Ricochet SoB
  67. [272888] = true, -- Ferocity SoB
  68. --[269266] = true, -- Slam SoB ????????? tentacle last bos?
  69. [258864] = true, -- Suppression Fire TD
  70. -- [259711] = true, -- Lockdown TD
  71. [264038] = true, -- Uproot WM
  72. [256849] = true, -- Dino Heal AD
  73. [269931] = true, -- Gust Slash KR ????????
  74. [270084] = true, -- Axe Barrage KR
  75. [270506] = true, -- Deadeye Shot KR
  76. [270507] = true, -- Poison Barrage KR
  77. -- [267433] = true, -- Activate Mech ML ????????????
  78. -- [267354] = true, -- Hail of Flechettes ML
  79. [269302] = true, -- Poison thrash ML
  80. [268702] = true, -- Furious Quake ML
  81. [268846] = true, -- Echo Blade ML
  82. [268865] = true, -- Force Cannon ML
  83. [258908] = true, -- Blade Flurry ToS
  84. [264574] = true, -- Power Shot ToS
  85. [272659] = true, -- Electrified Scales ToS
  86. [272655] = true, -- Scouring Sand ToS
  87. -- [277567] = true, -- infest
  88. [265542] = true, -- Rotten Bile UR
  89. [265540] = true, -- Rotten Bile UR
  90. [257641] = true, -- molten slug
  91. [265376] = true, -- FH Krag Channel heal
  92. [257736] = true, -- Thundering Squall FH
  93. [257870] = true, -- Blade Barrage FH
  94. [268797] = true, -- ML Transmute: Enemy to Goo
  95. [263066] = true, -- ML Transfiguration Serum
  96. [265089] = true, -- Dark Reconstitution UR
  97. [272183] = true, -- Raise Dead UR
  98. [258153] = true, -- Watery Dome Td
  99. [278504] = true, -- Ritual WM
  100. [258153] = true, -- Watery Dome Td
  101. [258153] = true, -- Watery Dome Td
  102. [258153] = true, -- Watery Dome Td
  103. [258153] = true, -- Watery Dome Td
  104. [258153] = true, -- Watery Dome Td
  105. [257397] = true -- Healing Balm AD
  106. }
  107. -- local kickList = {
  108. -- }
  109. local channelAsapList = {
  110. [257756] = true, -- Goin' Bananas FH
  111. [253721] = true, -- Bulwark of Juju AD
  112. [259572] = true, -- 2nd AD channel
  113. [258317] = true, --Riot Shield TD ???? only magic
  114. [258917] = true, -- Righteous Flames TD
  115. [267357] = true, -- Hail of Flechettes ML
  116. [267237] = true, -- Drain ToS
  117. [265568] = true, -- Dark Omen UR
  118. [250368] = true, -- Vol’kaal AD
  119. [265540] = true, -- Rotten Bile UR
  120. [257641] = true, -- molten slug
  121. [265542] = true, -- Rotten Bile UR
  122. [265376] = true, -- FH Krag Channel heal
  123. [267354] = true, -- Hail of Flechettes ML
  124. [256060] = true
  125. }
  126. local channelLateList = {
  127. [257739] = true, -- Fixate FH
  128. [270839] = true -- test
  129. }
  130.  
  131. -- local frame = CreateFrame("FRAME")
  132. -- frame:RegisterEvent("CHAT_MSG_MONSTER_SAY")
  133. -- function frame:OnEvent(event, ...)
  134. -- print(...)
  135. -- frame:SetScript("OnEvent", frame.OnEvent)
  136. local frame = CreateFrame("FRAME")
  137. frame:RegisterEvent("CHAT_MSG_MONSTER_SAY")
  138. function frame:OnEvent(event, arg1, arg2, arg3)
  139. if arg2 == "Гаргток" or arg2 == "Gurgthock" and not piggiecatch then
  140. piggiecatch = true
  141. end
  142. end
  143. frame:SetScript("OnEvent", frame.OnEvent)
  144. ---------------
  145. --- Toggles ---
  146. ---------------
  147. local function createToggles()
  148. -- Rotation Button
  149. RotationModes = {
  150. [1] = { mode = "", value = 1 , overlay = "", tip = "", highlight = 1, icon = br.player.spell.dispatch},
  151. [2] = { mode = "", value = 2 , overlay = "", tip = "", highlight = 0, icon = br.player.spell.crimsonVial}
  152. };
  153. CreateButton("Rotation",1,0)
  154. BtEHoldCastModes = {
  155. [1] = { mode = "", value = 1 , overlay = "", tip = "", highlight = 1, icon = br.player.spell.betweenTheEyes},
  156. [2] = { mode = "", value = 2 , overlay = "", tip = "", highlight = 0, icon = br.player.spell.dispatch}
  157. };
  158. CreateButton("BtEHoldCast",1,1)
  159. -- Blade Flurry Button
  160. BladeFlurryModes = {
  161. [1] = { mode = "", value = 1 , overlay = "", tip = "", highlight = 1, icon = br.player.spell.bladeFlurry},
  162. [2] = { mode = "", value = 2 , overlay = "", tip = "", highlight = 0, icon = br.player.spell.bladeFlurry}
  163. };
  164. CreateButton("BladeFlurry",2,0)
  165. NoBTEModes = {
  166. [1] = { mode = "best", value = 1 , overlay = "", tip = "", highlight = 1, icon = br.player.spell.betweenTheEyes},
  167. [2] = { mode = "target", value = 2 , overlay = "", tip = "", highlight = 1, icon = br.player.spell.betweenTheEyes},
  168. [3] = { mode = "off", value = 3 , overlay = "", tip = "", highlight = 0, icon = br.player.spell.betweenTheEyes}
  169. };
  170. CreateButton("NoBTE",2,1)
  171. -- Defensive Button
  172. SpecialModes = {
  173. [1] = { mode = "", value = 1 , overlay = "", tip = "", highlight = 1, icon = br.player.spell.adrenalineRush},
  174. [2] = { mode = "", value = 2 , overlay = "", tip = "", highlight = 0, icon = br.player.spell.adrenalineRush},
  175. };
  176. CreateButton("Special",4,0)
  177. TiersevenModes = {
  178. [1] = { mode = "", value = 1 , overlay = "", tip = "", highlight = 1, icon = br.player.spell.bladeRush},
  179. [2] = { mode = "", value = 2 , overlay = "", tip = "", highlight = 0, icon = br.player.spell.bladeRush},
  180. };
  181. CreateButton("Tierseven",4,1)
  182. -- Interrupt Button
  183. InterruptModes = {
  184. [1] = { mode = "", value = 1 , overlay = "", tip = "", highlight = 1, icon = br.player.spell.kick},
  185. [2] = { mode = "", value = 2 , overlay = "", tip = "", highlight = 0, icon = br.player.spell.kick}
  186. };
  187. CreateButton("Interrupt",3,0)
  188. StunModes = {
  189. [1] = { mode = "", value = 1 , overlay = "", tip = "", highlight = 1, icon = br.player.spell.gouge},
  190. [2] = { mode = "", value = 2 , overlay = "", tip = "", highlight = 0, icon = br.player.spell.gouge}
  191. };
  192. CreateButton("Stun",3,1)
  193. BoteForceModes = {
  194. [1] = { mode = "On", value = 1 , overlay = "", tip = "", highlight = 1, icon = br.player.spell.vanish},
  195. [2] = { mode = "Off", value = 2 , overlay = "", tip = "", highlight = 0, icon = br.player.spell.crimsonVial}
  196. };
  197. CreateButton("BoteForce",5,0)
  198. RollforoneModes = {
  199. [1] = { mode = "any", value = 1 , overlay = "", tip = "", highlight = 0, icon = br.player.spell.rollTheBones},
  200. [2] = { mode = "simc", value = 2 , overlay = "", tip = "", highlight = 1, icon = br.player.spell.rollTheBones}
  201. };
  202. CreateButton("Rollforone",5,1)
  203. MFDModes = {
  204. [1] = { mode = "Tar", value = 1 , overlay = "", tip = "", highlight = 1, icon = br.player.spell.markedForDeath},
  205. [2] = { mode = "Adds", value = 2 , overlay = "", tip = "", highlight = 1, icon = br.player.spell.markedForDeath},
  206. [3] = { mode = "reset", value = 3 , overlay = "", tip = "", highlight = 1, icon = br.player.spell.markedForDeath},
  207. [4] = { mode = "Off", value = 4 , overlay = "", tip = "", highlight = 0, icon = br.player.spell.markedForDeath}
  208. };
  209. CreateButton("MFD",6,0)
  210.  
  211. RitzaNishModes = {
  212. [1] = { mode = "On", value = 1 , overlay = "", tip = "", highlight = 1, icon = br.player.spell.vanish},
  213. [2] = { mode = "Off", value = 2 , overlay = "", tip = "", highlight = 0, icon = br.player.spell.crimsonVial}
  214. };
  215. CreateButton("RitzaNish",6,1)
  216. end
  217. -- if strmatch(select(2,BNGetInfo()), '(%d+)') == "1628" then
  218. forpro = true
  219. -- else
  220. -- forpro = false
  221. -- end
  222.  
  223.  
  224.  
  225. ---------------
  226. --- OPTIONS ---
  227. ---------------
  228. local function createOptions()
  229. local optionTable
  230.  
  231. local function rotationOptions()
  232. -----------------------
  233. --- GENERAL OPTIONS ---
  234. -----------------------
  235. section = br.ui:createSection(br.ui.window.profile, "General")
  236. -- br.ui:createCheckbox(section, "Opener")
  237. -- br.ui:createCheckbox(section, "RTB Prepull")
  238. br.ui:createDropdown(section, "Stealth", {"|cff00FF00Always", "|cffFF000020Yards"}, 2, "Stealthing method.")
  239. br.ui:createCheckbox(section, "Wownish")
  240. br.ui:checkSectionState(section)
  241. ------------------------
  242. --- OFFENSIVE OPTIONS ---
  243. ------------------------
  244. section = br.ui:createSection(br.ui.window.profile, "Offensive")
  245. br.ui:createCheckbox(section, "Trinkets")
  246. br.ui:createCheckbox(section, "Vanish")
  247. br.ui:createCheckbox(section, "Racial")
  248. br.ui:createSpinnerWithout(section, "BF HP Limit", 15, 0, 105, 1, "|cffFFFFFFHP *10k hp for Blade FLurry to be used")
  249. br.ui:createCheckbox(section, "Dont BTE kickable")
  250. br.ui:createSpinner(section, "Pistol Shot out of range", 85, 5, 100, 5, "|cffFFFFFFCheck to use Pistol Shot out of range and energy to use at.")
  251. -- br.ui:createSpinnerWithout(section, "MFD Sniping", 1, 0.5, 3, 0.1, "|cffFFBB00Increase to have BR cast MFD on dying units quicker, too high might cause suboptimal casts")
  252. br.ui:checkSectionState(section)
  253. section = br.ui:createSection(br.ui.window.profile, "Targeting Settings")
  254. br.ui:createCheckbox(section, "Burn some stuff")
  255. br.ui:createCheckbox(section, "M+")
  256. br.ui:createCheckbox(section, "Prey on the Weak Sorting")
  257. br.ui:createCheckbox(section, "Coral Sort")
  258. br.ui:checkSectionState(section)
  259. section = br.ui:createSection(br.ui.window.profile, "PvP Abuse")
  260. br.ui:createCheckbox(section, "Auto FLag WSG/2Peaks/")
  261. br.ui:createCheckbox(section, "hz")
  262. br.ui:checkSectionState(section)
  263.  
  264. section = br.ui:createSection(br.ui.window.profile, "Special")
  265.  
  266. br.ui:createCheckbox(section, "AutoBtE", "|cffFFFFFF Auto BtE dangerous casts")
  267. br.ui:createCheckbox(section, "AutoGouge", "|cffFFFFFF Auto Gouge dangerous casts")
  268. br.ui:createCheckbox(section, "AutoBlind", "|cffFFFFFF Auto Blind dangerous casts")
  269. br.ui:createCheckbox(section, "AutoKick", "|cffFFFFFF Auto Kick dangerous casts")
  270. br.ui:createCheckbox(section, "Any Cast", "|cffFFFFFF Auto CC any cast")
  271. br.ui:createSpinnerWithout(section, "Delay Interrupt for", 0.5, 0, 1, 0.1, "Delay for x sec")
  272. br.ui:createSpinner(section, "Arcane Torrent Dispel Count", 1, 0, 20, 1, "", "|cffFFFFFFMinimum Torrent Targets")
  273. br.ui:createSpinner(section, "Dispell from List")
  274. br.ui:createCheckbox(section, "|cffFF0000Force Burn Stuff", "Ghuunies/explosives orb = rip or hold shift")
  275. br.ui:createCheckbox(section, "Pool for BTE")
  276. br.ui:createCheckbox(section, "Force 6cp BTE")
  277. br.ui:createCheckbox(section, "DontWasteDeadShotOnOrbs")
  278. br.ui:createCheckbox(section, "|cffFFBB00Encounter Logic", "Use PvE Logic")
  279. br.ui:createCheckbox(section, "Ambush Opener", "Will use ambush as soon as target is in range")
  280. br.ui:createCheckbox(section, "PickPocket", "Will PickPocket before ambush ^^ for tmog")
  281. br.ui:checkSectionState(section)
  282. section = br.ui:createSection(br.ui.window.profile, "Essences")
  283. br.ui:createCheckbox(section, "AutoBeam", "Iris Beam")
  284. br.ui:createCheckbox(section, "RotateBeam", "Rotate this shit")
  285. br.ui:createCheckbox(section, "AutoBotE", "Blood of the Enemy")
  286. br.ui:createCheckbox(section, "AutoCrucible", "Crucible Of Flames")
  287. br.ui:createCheckbox(section, "AutoStrife", "Strife Stack ooc with detection")
  288. br.ui:checkSectionState(section)
  289. section = br.ui:createSection(br.ui.window.profile, "Mythic+ Stuff")
  290. br.ui:createCheckbox(section, "Piggie FH")
  291. br.ui:createCheckbox(section, "Void-Touched Emissary LoS")
  292. br.ui:createCheckbox(section, "BtE Sanguine check")
  293. br.ui:createCheckbox(section, "BtE giga feature")
  294. br.ui:createCheckbox(section, "Coral Abuse")
  295. br.ui:checkSectionState(section)
  296.  
  297. -------------------------
  298. --- INTERRUPT OPTIONS ---
  299. -------------------------
  300. section = br.ui:createSection(br.ui.window.profile, "Interrupts")
  301. -- Kick
  302. br.ui:createCheckbox(section, "Kick")
  303. -- Gouge
  304. br.ui:createCheckbox(section, "Gouge")
  305. -- Blind
  306. br.ui:createCheckbox(section, "Blind")
  307. -- Between the Eyes
  308. br.ui:createCheckbox(section, "Between the Eyes")
  309. -- Interrupt Percentage
  310. br.ui:createSpinner(section, "Interrupt At", 0, 0, 100, 5, "|cffFFBB00Cast Percentage to use at.")
  311. br.ui:checkSectionState(section)
  312. -------------------------
  313. --- Lazy OPTIONS ---
  314. -------------------------
  315. section = br.ui:createSection(br.ui.window.profile, "Lazy Stuff")
  316. br.ui:createDropdown(section, "Auto Tricks", {"|cff00FF00Focus", "|cffFF0000Tank"}, 1, "Tricks of the Trade target." )
  317. br.ui:createCheckbox(section, "Keep BTE For CC Emissary")
  318. br.ui:createCheckbox(section, "FastBladeFlurry", "Will Use Blade Flurry only with >=2 targets check")
  319. br.ui:createCheckbox(section, "AutoTargetInMelee", "Will Auto target anything in melee if no valid target")
  320. br.ui:createDropdown(section, "Pots with AR", {"Unbridled Fury", "Agility", "Empowered Proximity"}, 1, "|cffFFFFFFPotion to use")
  321. br.ui:checkSectionState(section)
  322.  
  323. -------------------------
  324. --- DEFENSIVE OPTIONS ---
  325. -------------------------
  326. section = br.ui:createSection(br.ui.window.profile, "Defensive")
  327. br.ui:createSpinner(section, "Healing Potion/Healthstone", 60, 0, 100, 5, "|cffFFBB00Health Percentage to use at.")
  328. br.ui:createSpinner(section, "Crimson Vial", 10, 0, 100, 5, "|cffFFBB00Health Percentage to use at.")
  329. br.ui:createSpinner(section, "Feint", 10, 0, 100, 5, "|cffFFBB00Health Percentage to use at.")
  330. br.ui:createSpinner(section, "Riposte", 10, 0, 100, 5, "|cffFFBB00Health Percentage to use at.")
  331. br.ui:createSpinner(section, "Engineer's' Belt", 10, 0, 100, 5, "|cffFFBB00Health Percentage to use at.")
  332. br.ui:checkSectionState(section)
  333.  
  334. ----------------------
  335. --- TOGGLE OPTIONS ---
  336. ----------------------
  337. section = br.ui:createSection(br.ui.window.profile, "Toggle Keys")
  338. -- Single/Multi Toggle
  339. br.ui:createDropdown(section, "Rotation Mode", br.dropOptions.Toggle, 4)
  340. --Cooldown Key Toggle
  341. br.ui:createDropdown(section, "Cooldown Mode", br.dropOptions.Toggle, 3)
  342. --Defensive Key Toggle
  343. br.ui:createDropdown(section, "Defensive Mode", br.dropOptions.Toggle, 6)
  344. -- Interrupts Key Toggle
  345. br.ui:createDropdown(section, "Interrupt Mode", br.dropOptions.Toggle, 6)
  346. -- Cleave Toggle
  347. br.ui:createDropdown(section, "BladeFlurry Mode", br.dropOptions.Toggle, 6)
  348. br.ui:createDropdown(section, "MFD Mode", br.dropOptions.Toggle, 6)
  349. -- Pause Toggle
  350. br.ui:createDropdown(section, "Pause Mode", br.dropOptions.Toggle, 6)
  351. br.ui:checkSectionState(section)
  352. end
  353. optionTable = {{
  354. [1] = "Rotation Options",
  355. [2] = rotationOptions,
  356. }}
  357. return optionTable
  358. end
  359.  
  360.  
  361.  
  362. ----------------
  363. --- ROTATION ---
  364. ----------------
  365. local function runRotation()
  366. local profile = br.debug.cpu.rotation.profile
  367. local startTime = debugprofilestop()
  368. -- WriteFile("countvisible.txt", countvisible .. "\n", true)
  369. -- print(countvisible)
  370. -- countvisible = 0
  371.  
  372. --Print("Running: "..rotationName)
  373.  
  374. ---------------
  375. --- Toggles ---
  376. ---------------
  377. UpdateToggle("Rotation",0.25)
  378. UpdateToggle("Interrupt",0.25)
  379. UpdateToggle("BladeFlurry",0.25)
  380. UpdateToggle("MFD",0.25)
  381. UpdateToggle("Rollforone",0.25)
  382. UpdateToggle("Special",0.25)
  383. UpdateToggle("NoBTE",0.25)
  384. UpdateToggle("Tierseven",0.25)
  385. UpdateToggle("BtEHoldCast",0.25)
  386. UpdateToggle("RitzaNish",0.25)
  387. UpdateToggle("BoteForce",0.25)
  388. br.player.mode.bladeflurry = br.data.settings[br.selectedSpec].toggles["BladeFlurry"]
  389. br.player.mode.stun = br.data.settings[br.selectedSpec].toggles["Stun"]
  390. br.player.mode.mfd = br.data.settings[br.selectedSpec].toggles["MFD"]
  391. br.player.mode.rollforone = br.data.settings[br.selectedSpec].toggles["Rollforone"]
  392. br.player.mode.special = br.data.settings[br.selectedSpec].toggles["Special"]
  393. br.player.mode.tierseven = br.data.settings[br.selectedSpec].toggles["Tierseven"]
  394. br.player.mode.nobte = br.data.settings[br.selectedSpec].toggles["NoBTE"]
  395. br.player.mode.btehold = br.data.settings[br.selectedSpec].toggles["BtEHoldCast"]
  396. br.player.mode.ritzanish = br.data.settings[br.selectedSpec].toggles["RitzaNish"]
  397. br.player.mode.boteforce = br.data.settings[br.selectedSpec].toggles["BoteForce"]
  398. --------------
  399. --- Locals ---
  400. --------------
  401. -- print(br.DBM:getTimer(13892))
  402. -- print(IsItemInRange(44915)) --20
  403. -- print(tostring(br.BossMods:getPulltimer()))
  404. ---------------------------------------------------------
  405. if profileStop == nil then profileStop = false end
  406. local attacktar = UnitCanAttack("target","player")
  407. local charges = br.player.charges
  408. local buff = br.player.buff
  409. local cast = br.player.cast
  410. local cd = br.player.cd
  411. local combo, comboDeficit, comboMax = br.player.power.comboPoints.amount(), br.player.power.comboPoints.deficit(), br.player.power.comboPoints.max()
  412. local debuff = br.player.debuff
  413. -- local pullTimer = br.BossMods:getPulltimer()
  414. local enemies = br.player.enemies
  415. local essence = br.player.essence
  416. local gcd = getSpellCD(61304)
  417. local gcdMax = br.player.gcdMax
  418. local hastar = GetObjectExists("target")
  419. local has = br.player.has
  420. local healPot = getHealthPot()
  421. local inCombat = isInCombat("player")
  422. local lastSpell = lastSpellCast
  423. local level = br.player.level
  424. local mode = br.player.mode
  425. local moving = isMoving("player") ~= false or br.player.moving
  426. local php = br.player.health
  427. local power, powerDeficit, powerRegen, powerMax = br.player.power.energy.amount(), br.player.power.energy.deficit(), br.player.power.energy.regen(), br.player.power.energy.max()
  428. local race = br.player.race
  429. local racial = br.player.getRacial()
  430. local solo = #br.friend < 2
  431. local spell = br.player.spell
  432. local stealth = select(2,GetShapeshiftFormInfo(1))
  433. local stealthingAll = stealth or br.player.buff.vanish.exists() or br.player.buff.shadowmeld.exists()
  434. local stealthingRogue = stealth or br.player.buff.vanish.exists()
  435. local talent = br.player.talent
  436. local targetDistance = getDistance("target")
  437. local traits = br.player.traits
  438. local ttm = br.player.power.energy.ttm()
  439. local units = br.player.units
  440. local use = br.player.use
  441. local validTarget = isValidUnit("target")
  442. local lootDelay = getOptionValue("LootDelay")
  443. local ispvp = (br.instance == "pvp" or br.instance == "arena") and true or false
  444. local coralFirst = (canUse(169311) and coralFirst and true) or false
  445. -- if select(2,GetShapeshiftFormInfo(1)) then
  446. -- print("stealth")
  447. -- else
  448. -- print("123")
  449. -- end
  450. -- print(power/powerMax*100)
  451. LibDraw.clearCanvas()
  452. -- print(checkDR(199804,"target"))
  453. -- print(UnitClassification("target"))
  454. if not UnitAffectingCombat("player") then
  455. if fhbossPool then fhbossPool = false end
  456. if not talent.markedForDeath then
  457. if mode.mfd ~= 4 then ToggleToValue("MFD", 4) end -- turn MFD off
  458. if buttonMFD:IsShown() then buttonMFD:Hide() end
  459. else
  460. if not buttonMFD:IsShown() then buttonMFD:Show() end
  461. end
  462. if not isChecked("Dont BTE kickable") then
  463. if buttonBtEHoldCast:IsShown() then buttonBtEHoldCast:Hide() end
  464. else
  465. if not buttonBtEHoldCast:IsShown() then buttonBtEHoldCast:Show() end
  466. end
  467. if not talent.killingSpree and not talent.bladeRush then
  468. if mode.tierseven ~= 2 then ToggleToValue("Tierseven", 2) end -- turn Tierseven off
  469. if buttonTierseven:IsShown() then buttonTierseven:Hide() end
  470. else
  471. if not buttonTierseven:IsShown() then buttonTierseven:Show() end
  472. end
  473. if isChecked("Wownish") and GetMinimapZoneText() ~= "R&D" then
  474. if mode.ritzanish ~= 2 then ToggleToValue("RitzaNish", 2) end
  475. if buttonRitzaNish:IsShown() then buttonRitzaNish:Hide() end
  476. else
  477. if not buttonRitzaNish:IsShown() then buttonRitzaNish:Show() end
  478. end
  479. end
  480.  
  481. local spread = false
  482.  
  483. -- local forceroll
  484. SLASH_FORCEROLL1 = "/forceroll"
  485. SlashCmdList["FORCEROLL"] = function()
  486. if forceroll then
  487. forceroll = false
  488. else
  489. forceroll = true
  490. end
  491. end
  492. SLASH_STOPFINISH1 = "/stopfinish"
  493. SlashCmdList["STOPFINISH"] = function()
  494. if stopfinish then
  495. stopfinish = false
  496. else
  497. stopfinish = true
  498. end
  499. end
  500. SLASH_FORCEBOTE1 = "/forcebote"
  501. SlashCmdList["FORCEBOTE"] = function()
  502. forcebote = true
  503. end
  504.  
  505. SLASH_FORCEUSETOPTRINK1 = "/forceuse13"
  506. SlashCmdList["FORCEUSETOPTRINK"] = function()
  507. forceuse13 = true
  508. end
  509.  
  510. SLASH_FORCEUSELOWTRINK1 = "/forceuse14"
  511. SlashCmdList["FORCEUSELOWTRINK"] = function()
  512. forceuse14 = true
  513. end
  514.  
  515. if forceroll then
  516. ChatOverlay("Reroll forced")
  517. end
  518. --Tricks from sir fisker
  519. local tricksUnit
  520. if isChecked("Auto Tricks") and GetSpellCooldown(spell.tricksOfTheTrade) == 0 and inCombat then
  521. if getOptionValue("Auto Tricks") == 1 and GetUnitIsFriend("player", "focus") and getLineOfSight("player", "focus") then
  522. tricksUnit = "focus"
  523. elseif getOptionValue("Auto Tricks") == 2 then
  524. for i = 1, #br.friend do
  525. local thisUnit = br.friend[i].unit
  526. if UnitGroupRolesAssigned(thisUnit) == "TANK" and not UnitIsDeadOrGhost(thisUnit) and getLineOfSight("player", thisUnit) then
  527. tricksUnit = thisUnit
  528. break
  529. end
  530. end
  531. end
  532. end
  533. dotHPLimit = getOptionValue("BF HP Limit") * 10000
  534.  
  535.  
  536.  
  537.  
  538. --______________________________________
  539.  
  540. enemies.get(20,nil,nil,nil,spell.pistolShot)
  541. enemies.get(20,nil,true,nil,spell.pistolShot)
  542. enemies.get(8)
  543.  
  544. local function PickPocketable(Unit)
  545. if Unit == nil then Unit = "target" end
  546. local unitType = UnitCreatureType(Unit)
  547. local types = {
  548. "Humanoid",
  549. "Humanoid",
  550. "Humanoide",
  551. "Humanoide",
  552. "Humanoïde",
  553. "Umanoide",
  554. "Humanoide",
  555. "Гуманоид",
  556. "인간형",
  557. "人型生物",
  558. "人型生物"
  559. }
  560. for i = 1, #types do
  561. if unitType == types[i] then return true end
  562. end
  563. return false
  564. end
  565.  
  566. local function ttd(unit)
  567. if UnitIsPlayer(unit) then return 999 end
  568. local ttdSec = getTTD(unit)
  569. if getOptionCheck("Enhanced Time to Die") then return ttdSec end
  570. if ttdSec == -1 then return 999 end
  571. return ttdSec
  572. end
  573.  
  574. local function getapdmg(offHand)
  575. local useOH = offHand or false
  576. local wdpsCoeff = 6
  577. local ap = UnitAttackPower("player")
  578. local minDamage, maxDamage, minOffHandDamage, maxOffHandDamage, physicalBonusPos, physicalBonusNeg, percent = UnitDamage("player")
  579. local speed, offhandSpeed = UnitAttackSpeed("player")
  580. if useOH and offhandSpeed then
  581. local wSpeed = offhandSpeed * (1 + GetHaste() / 100)
  582. local wdps = (minOffHandDamage + maxOffHandDamage) / wSpeed / percent - ap / wdpsCoeff
  583. return (ap + wdps * wdpsCoeff) * 0.5
  584. else
  585. local wSpeed = speed * (1 + GetHaste() / 100)
  586. local wdps = (minDamage + maxDamage) / 2 / wSpeed / percent - ap / wdpsCoeff
  587. return ap + wdps * wdpsCoeff
  588. end
  589. end
  590.  
  591.  
  592. local function rtdamage()
  593. local apMod = getapdmg()
  594. local rtcoef = 0.35
  595. local auramult = 1.13
  596. local versmult = (1 + ((GetCombatRatingBonus(CR_VERSATILITY_DAMAGE_DONE) + GetVersatilityBonus(CR_VERSATILITY_DAMAGE_DONE)) / 100))
  597. if talent.deeperStratagem then dsmod = 1.05 else dsmod = 1 end
  598. return(
  599. apMod * combo * rtcoef * auramult * dsmod * versmult
  600. )
  601. end
  602.  
  603. -- local function isTotem(unit)
  604. -- local eliteTotems = { -- totems we can dot
  605. -- [125977] = "Reanimate Totem",
  606. -- [127315] = "Reanimate Totem",
  607. -- [146731] = "Zombie Dust Totem"
  608. -- }
  609. -- local creatureType = UnitCreatureType(unit)
  610. -- local objectID = GetObjectID(unit)
  611. -- if creatureType ~= nil and eliteTotems[objectID] == nil then
  612. -- if creatureType == "Totem" or creatureType == "Tótem" or creatureType == "Totém" or creatureType == "Тотем" or creatureType == "토템" or creatureType == "图腾" or creatureType == "圖騰" then return true end
  613. -- end
  614. -- return false
  615. -- end
  616.  
  617. -- local function noDotCheck(unit)
  618. -- if isChecked("Dot Blacklist") and (noDotUnits[GetObjectID(unit)] or UnitIsCharmed(unit)) then return true end
  619. -- if isTotem(unit) then return true end
  620. -- local unitCreator = UnitCreator(unit)
  621. -- if unitCreator ~= nil and UnitIsPlayer(unitCreator) ~= nil and UnitIsPlayer(unitCreator) == true then return true end
  622. -- if GetObjectID(unit) == 137119 and getBuffRemain(unit, 271965) > 0 then return true end
  623. -- return false
  624. -- end
  625. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  626.  
  627.  
  628.  
  629. local function clearTable(t)
  630. local count = #t
  631. for i=0, count do t[i]=nil end
  632. end
  633. -- local sortingorbs = false
  634. -- local sort5 = false
  635. local bftargets = 0
  636. local targetsort = false
  637.  
  638. local function tableSkip(unitcheck)
  639. if br.instance == "pvp" or br.instance == "arena" then
  640. local unitCreator = UnitCreator(unitcheck.unit)
  641. if unitCreator ~= nil and UnitIsPlayer(unitCreator) ~= nil and UnitIsPlayer(unitCreator) == true then return true end
  642. end
  643. -- if br.instance == "party" then
  644. -- if UnitIsDeadOrGhost(unitcheck.unit) or
  645. -- ((unitcheck.id == 155432 or unitcheck.id == 155434 or unitcheck.id == 155433) and isCasting(302415, unitcheck.unit)) then
  646. -- return true
  647. -- end
  648. -- end
  649. -- if isLongTimeCCed(unitcheck.unit) then
  650. -- -- print("123")
  651. -- end
  652. if UnitIsDeadOrGhost(unitcheck.unit) or
  653. -- no TOUCH
  654. not isSafeToAttack(unitcheck.unit) or
  655. isShieldedTarget(unitcheck.unit) ~= 0 or
  656. isLongTimeCCed(unitcheck.unit) then
  657. return true end
  658. -- if GetRaidTargetIndex(unitcheck.unit) ~= nil then return true end
  659. return false
  660. end
  661. clearTable(enemyTable5)
  662. -- clearTable(enemyTable15)
  663. clearTable(enemyTable20)
  664. clearTable(burnTable20)
  665. clearTable(burnTable5)
  666.  
  667. -- ?? mfd nill
  668. if #enemies.yards20 > 0 then
  669. local highestHP
  670. local lowestHP
  671.  
  672. --------- Filling enemyTable20
  673. for i = 1, #enemies.yards20 do
  674. local thisUnit = enemies.yards20[i]
  675. local enemyUnit = {}
  676. enemyUnit.unit = thisUnit
  677. enemyUnit.ttd = ttd(thisUnit)
  678. enemyUnit.hpabs = UnitHealth(thisUnit)
  679. enemyUnit.id = GetObjectID(enemyUnit.unit)
  680. if not tableSkip(enemyUnit)
  681. -- if enemyUnit.hpabs > 0 then
  682. -- and GetRaidTargetIndex(thisUnit) == nil then
  683. then
  684.  
  685. -- Emissary remove
  686. -- if enemyUnit.id == 144081 or enemyUnit.id == 155434 or enemyUnit.id == 155433 then
  687. -- if enemyUnit.hpabs > 0 then
  688. -- if GetRaidTargetIndex(thisUnit) ~= nil then return false end
  689. -- end
  690. -- end
  691. -- else
  692. if (isChecked("Void-Touched Emissary LoS") and enemyUnit.id == 131997) then
  693.  
  694. local unitX, unitY, unitZ = GetObjectPosition(thisUnit)
  695. if getLineOfSight("player",thisUnit) then
  696. LibDraw.SetColor(0, 255, 0)
  697. else
  698. LibDraw.SetColor(255, 0, 0)
  699. end
  700. return LibDraw.Line(br.player.posX, br.player.posY, br.player.posZ, unitX, unitY, unitZ)
  701. end
  702. if IsSpellInRange(GetSpellInfo(1766), enemyUnit.unit) == 1 then
  703. -- sort5 = true
  704. if enemyUnit.hpabs >= dotHPLimit and not forcekill[enemyUnit.id] then
  705. bftargets = bftargets + 1
  706. end
  707. enemyUnit.distance = 5
  708. -- enemyUnit.facing = getFacing(thisUnit,"player")
  709. elseif IsSpellInRange(GetSpellInfo(2094), enemyUnit.unit) == 1 then
  710. enemyUnit.distance = 15
  711. else
  712. enemyUnit.distance = 19
  713. end
  714. if forcekill[enemyUnit.id] or (ispvp and pvpforcekill[enemyUnit.id]) then
  715. if enemyUnit.distance <= 5 then
  716. tinsert(burnTable5, enemyUnit)
  717. end
  718. tinsert(burnTable20,enemyUnit)
  719. end
  720. tinsert(enemyTable20, enemyUnit)
  721. if highestHP == nil or highestHP < enemyUnit.hpabs then highestHP = enemyUnit.hpabs end
  722. if lowestHP == nil or lowestHP > enemyUnit.hpabs then lowestHP = enemyUnit.hpabs end
  723. if enemyTable20.lowestTTDUnit == nil or enemyTable20.lowestTTD > enemyUnit.ttd then
  724. enemyTable20.lowestTTDUnit = enemyUnit.unit
  725. enemyTable20.lowestTTD = enemyUnit.ttd
  726. end
  727. if talent.markedForDeath and enemyUnit.hpabs <= rtdamage() then mfdtarget = thisUnit end
  728. -- end
  729. end
  730. end
  731. ----------------Enemy Score + Sorting
  732. -- enemyTable20.target = nil
  733. if #enemyTable20 > 1 then
  734. for i = 1, #enemyTable20 do
  735. -- local hpNorm = (10-1)/(highestHP-lowestHP)*(enemyTable20[i].hpabs-highestHP)+10 -- normalization of HP value, high is good
  736. -- if hpNorm ~= hpNorm or tostring(hpNorm) == tostring(0/0) then hpNorm = 0 end -- NaN check
  737. local enemyScore = 0--hpNorm
  738. -- if enemyTable20[i].facing then enemyScore = enemyScore + 30 end -- ??
  739. -- if enemyTable20[i].ttd > 1.5 then enemyScore = enemyScore + 5 end
  740. -- if enemyTable20[i].distance <= 5 then enemyScore = enemyScore + 30 end
  741. -- local raidTarget = GetRaidTargetIndex(enemyTable20[i].unit)
  742. -- if raidTarget ~= nil then
  743. -- enemyScore = enemyScore + raidTarget * 3
  744. -- if raidTarget == 8 then enemyScore = enemyScore + 5 end
  745. -- end
  746. if GetUnitIsUnit(enemyTable20[i].unit, "target") then
  747. enemyScore = enemyScore + 1
  748. -- enemyTable20.target = enemyTable20[i].unit
  749. end
  750.  
  751. if isChecked("Prey on the Weak Sorting") and talent.preyOnTheWeak and UnitDebuffID(enemyTable20[i].unit, 255909) then
  752. -- targetsort = true
  753. enemyScore = enemyScore + 5
  754. end
  755. --coral
  756.  
  757. if isChecked("Coral Sort") and (hasEquiped(169311, 13) or hasEquiped(169311, 14)) and UnitDebuffID(enemyTable20[i].unit, 303568) then
  758. if isChecked("Coral Sort") then
  759. -- targetsort = true
  760. enemyScore = enemyScore + 3
  761. end
  762. end
  763. if isChecked("Low prio for - dmg buffs") and br.instance == "party" then--GetUnitIsUnit
  764. enemyScore = enemyScore - 10
  765. end
  766. --if UnitBuffID(enemyTable30[i].unit, 277242) then enemyScore = enemyScore + 50 end -- ghuun check
  767. -- MfD Priority
  768. -- if UnitBuffID(enemyTable30[i].unit, 137619) then enemyScore = enemyScore + 50 end --vend score
  769. enemyTable20[i].enemyScore = enemyScore
  770. end
  771. table.sort(enemyTable20, function(x,y)
  772. return x.enemyScore > y.enemyScore
  773. end)
  774. end
  775.  
  776. ------ Filling other range tables
  777. for i = 1, #enemyTable20 do
  778. local thisUnit = enemyTable20[i]
  779. --Emissary
  780. if isChecked("Keep BTE For CC Emissary") and thisUnit.id == 155434 and thisUnit.hpabs >= 50000 then
  781. keepbteEmissary = true
  782. else
  783. keepbteEmissary = false
  784. end
  785.  
  786. -- local fokIgnore = {
  787. -- -- [120651]=true -- Explosive
  788. -- }
  789. -- if thisUnit.distance <= 20 then
  790. -- if fokIgnore[objectID] == nil and not isTotem(thisUnit.unit) then
  791. -- tinsert(enemyTable20, thisUnit)
  792. -- --if deadlyPoison10 and not debuff.deadlyPoison.exists(thisUnit.unit) then deadlyPoison10 = false end
  793. -- end
  794. --if debuff.garrote.remain(thisUnit.unit) > 0.5 then garroteCount = garroteCount + 1 end
  795. -- if enemyTable20[i].distance <= 15 then
  796. -- tinsert(enemyTable15, thisUnit)
  797. -- end
  798. if enemyTable20[i].distance <= 5 then
  799. -- local objectID = GetObjectID(thisUnit.unit)
  800. -- local x,y,z = ObjectPosition(thisUnit.unit)
  801. -- if forcekill[objectID] then sortingorbs = true end
  802. -- LibDraw.Circle(x,y,z,2)
  803. tinsert(enemyTable5, thisUnit)
  804. -- libdra
  805. end
  806. -- end
  807. end
  808. -- if #enemyTable5 > 1 then
  809. -- if talent.markedForDeath and mode.mfd == 3 and mfdtarget ~= nil then
  810. -- table.sort(enemyTable5, function(x)
  811. -- if GetUnitIsUnit(x.unit, "mfdtarget") then
  812. -- return true
  813. -- else
  814. -- return false
  815. -- end
  816. -- end)
  817. -- end
  818. -- if targetsort then
  819. -- table.sort(enemyTable5, function(x)
  820. -- if GetUnitIsUnit(x.unit, "target") then
  821. -- return true
  822. -- else
  823. -- return false
  824. -- end
  825. -- end)
  826. -- table.sort(enemyTable20, function(x)
  827. -- if GetUnitIsUnit(x.unit, "target") then
  828. -- return true
  829. -- else
  830. -- return false
  831. -- end
  832. -- end)
  833. -- end
  834.  
  835. -- end
  836. -- print(keepbteEmissary)
  837. if isChecked("AutoTargetInMelee") and inCombat and #enemyTable5 > 0 and ((GetUnitExists("target") and UnitIsDeadOrGhost("target") and not GetUnitIsUnit(enemyTable5[1].unit, "target")) or not GetUnitExists("target")) then
  838. TargetUnit(enemyTable5[1].unit)
  839. end
  840. end
  841. --Just nil fixes
  842. if enemyTable20.lowestTTD == nil then enemyTable20.lowestTTD = 999 end
  843. if enemyTable20.coralTargetTTD == nil then enemyTable20.coralTargetTTD = 999 end
  844. -- print(bftargets)
  845. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  846. -- Arcane Torrent
  847. if isChecked("Arcane Torrent Dispel") and race == "BloodElf" then
  848. local torrentUnit = 0
  849. for i=1, #enemies.yards8 do
  850. local thisUnit = enemies.yards8[i]
  851. if canDispel(thisUnit, select(7, GetSpellInfo(GetSpellInfo(69179)))) then
  852. torrentUnit = torrentUnit + 1
  853. if torrentUnit >= getOptionValue("Arcane Torrent Dispel") then
  854. if castSpell("player",racial,false,false,false) then return true end
  855. break
  856. end
  857. end
  858. end
  859. end
  860.  
  861.  
  862. -- if inCombat and #br.player.enemies.yards5 > 1 then
  863. -- -- table.sort(br.player.enemies.yards5, function(x,y)
  864. -- -- return UnitHealth(x) > UnitHealth(y)
  865. -- -- end)
  866. -- if GetUnitExists(mfdunit) then
  867. -- table.sort(br.player.enemies.yards5, function(x)
  868. -- if GetUnitIsUnit(x, mfdunit) then
  869. -- return true
  870. -- else
  871. -- return false
  872. -- end
  873. -- end)
  874. -- end
  875. -- if GetUnitExists("target") then
  876. -- table.sort(br.player.enemies.yards5, function(x)
  877. -- if GetUnitIsUnit(x, "target") then
  878. -- return true
  879. -- else
  880. -- return false
  881. -- end
  882. -- end)
  883. -- end
  884. -- if isChecked("|cffFF0000Force Burn Stuff") then
  885. -- table.sort(br.player.enemies.yards5, function(x,y)
  886. -- if UnitHealth(x) < UnitHealth(y) and forcekill[GetObjectID(x)] and forcekill[GetObjectID(y)] then
  887. -- --print(UnitName(x).."true")
  888. -- return true
  889. -- else
  890. -- --print(UnitName(x).."false")
  891. -- return false
  892. -- end
  893. -- end)
  894. -- -- table.sort(br.player.enemies.yards5, function(x,y)
  895. -- -- return UnitHealth(x) < UnitHealth(y) and forcekill[GetObjectID(x)] and forcekill[GetObjectID(y)]
  896. -- -- end)
  897. -- end
  898. -- end
  899. local function IrisBest()
  900.  
  901. if not isChecked("RotateBeam") then return end
  902. -- if ispvp and talent.killingSpree then
  903.  
  904. if not IrisTime then
  905. IrisTime = br.time
  906. elseif br.time <= IrisTime + 0.5 then
  907. return
  908. end
  909.  
  910. local function getRectUnit(facing)
  911. width = 5
  912. length = 30
  913. local x, y, z = ObjectPosition("player")
  914. local facing = facing or 0
  915. local halfWidth = width/2
  916. -- Near Left
  917. local nlX, nlY, nlZ = GetPositionFromPosition(x, y, z, halfWidth, facing + rad(90), 0)
  918. -- Near Right
  919. local nrX, nrY, nrZ = GetPositionFromPosition(x, y, z, halfWidth, facing + rad(270), 0)
  920. -- Far Left
  921. local flX, flY, flZ = GetPositionFromPosition(nlX, nlY, nlZ, length, facing, 0)
  922. -- Far Right
  923. local frX, frY, frZ = GetPositionFromPosition(nrX, nrY, nrZ, length, facing, 0)
  924. return nlX, nlY, nrX, nrY, frX, frY, flX, flY, flZ, nlZ, nrZ, frZ
  925. end
  926. local function isInside(x,y,ax,ay,bx,by,dx,dy)
  927. local bax = bx - ax
  928. local bay = by - ay
  929. local dax = dx - ax
  930. local day = dy - ay
  931. if ((x - ax) * bax + (y - ay) * bay <= 0.0) then return false end
  932. if ((x - bx) * bax + (y - by) * bay >= 0.0) then return false end
  933. if ((x - ax) * dax + (y - ay) * day <= 0.0) then return false end
  934. if ((x - dx) * dax + (y - dy) * day >= 0.0) then return false end
  935. return true
  936. end
  937.  
  938. local curFacing = ObjectFacing("player")
  939. local x, y, z = ObjectPosition("player")
  940.  
  941. local facing, bestAngle, bestAngleUnitsHit = 0.1, 0, 0
  942. while facing <= 6.2 do
  943. local unitsInRect = 0
  944. local nlX, nlY, nrX, nrY, frX, frY, flX, flY, flZ, nlZ, nrZ, frZ = getRectUnit(facing)
  945. for i = 1, #enemies.yards20 do
  946. local uX, uY, uZ = ObjectPosition(enemies.yards20[i])
  947. if isInside(uX,uY,nlX,nlY,nrX,nrY,frX,frY) then
  948. -- if not UnitAffectingCombat(enemies.yards40nc[i]) and TraceLine(x, y, z, uX, uY, uZ , 0x10) then
  949. -- unitsInRect = 0
  950. -- facing = facing + 0.05
  951. -- break
  952. -- end
  953. unitsInRect = unitsInRect + 1
  954. end
  955. end
  956. if unitsInRect > bestAngleUnitsHit then
  957. bestAngleUnitsHit = unitsInRect
  958. bestAngle = facing
  959. end
  960. facing = facing + 0.05
  961. end
  962. --print(bestAngleUnitsHit)
  963. -- local nlX, nlY, nrX, nrY, frX, frY, flX, flY, flZ, nlZ, nrZ, frZ = getRectUnit(bestAngle)
  964. -- LibDraw.clearCanvas()
  965. -- LibDraw.Line(flX, flY, z, nlX, nlY, z)
  966. -- LibDraw.Line(frX, frY, z, nrX, nrY, z)
  967. -- LibDraw.Line(frX, frY, z, flX, flY, z)
  968. -- LibDraw.Line(nlX, nlY, z, nrX, nrY, z)
  969. -- print(bestAngleUnitsHit)
  970. FaceDirection(bestAngle, true)
  971. return
  972. -- FaceDirection(curFacing)
  973. end
  974. -- print(UnitCastingInfo("player"))
  975. -- print(UnitChannelInfo("player"))
  976. local function shouldFinish()
  977. -- if=combo_points>=cp_max_spend-(buff.broadside.up+buff.opportunity.up)*(talent.quick_draw.enabled&(!talent.marked_for_death.enabled|cooldown.marked_for_death.remains>1))
  978. if not stopfinish then
  979. if combo >= comboMax - ((buff.broadside.exists("player") or buff.opportunity.exists("player")) and 1 or 0) then --((buff.broadside.exists("player") and 1 or 0) + ((buff.opportunity.exists("player") and 1 or 0))) then
  980. return true
  981. else
  982. return false
  983. end
  984. end
  985. end
  986.  
  987. if leftCombat == nil then leftCombat = br.time end
  988. if vanishTime == nil then vanishTime = br.time end
  989.  
  990.  
  991. --print(viabletargetcount())
  992.  
  993. if buff.rollTheBones == nil then buff.rollTheBones = {} end
  994. buff.rollTheBones.count = 0
  995. buff.rollTheBones.duration = 0
  996. buff.rollTheBones.remain = 0
  997. for k,v in pairs(spell.buffs.rollTheBones) do
  998. if UnitBuffID("player",v) ~= nil then
  999. buff.rollTheBones.count = buff.rollTheBones.count + 1
  1000. buff.rollTheBones.duration = getBuffDuration("player",v)
  1001. buff.rollTheBones.remain = getBuffRemain("player",v)
  1002. end
  1003. end
  1004.  
  1005.  
  1006.  
  1007. local function rtbReroll()
  1008. if mode.rollforone == 1 then
  1009. if buff.rollTheBones.count > 0 then return false end
  1010. elseif bftargets >= 3 then
  1011. local skull
  1012. if buff.skullAndCrossbones.exists("player") then skull = 1 else skull = 0 end
  1013. -- print("aoe roll")
  1014. -- print("1"..(buff.rollTheBones.count - skull))
  1015. -- print("ld"..buff.loadedDice.exists())
  1016. -- print("rp"..buff.ruthlessPrecision.exists("player"))
  1017. -- print("gm"..buff.grandMelee.exists("player"))
  1018. -- print("br"..buff.broadside.exists("player"))
  1019. return ((buff.rollTheBones.count - skull) < 2 and (buff.loadedDice.exists("player") or not (buff.ruthlessPrecision.exists("player") or buff.grandMelee.exists("player") or (talent.deeperStratagem and buff.broadside.exists("player"))))) and true or false
  1020. --# Reroll for 2+ buffs or Ruthless Precision with Deadshot or Ace up your Sleeve.
  1021. --actions+=/variable,name=rtb_reroll,op=set,if=azerite.deadshot.enabled|azerite.ace_up_your_sleeve.enabled,value=rtb_buffs<2&(buff.loaded_dice.up|buff.ruthless_precision.remains<=cooldown.between_the_eyes.remains)
  1022. elseif traits.deadshot.rank > 0 or traits.aceupyoursleeve.rank > 0 then
  1023. -- print("bteroll")
  1024. return (buff.rollTheBones.count < 2 and (buff.loadedDice.exists() or (buff.ruthlessPrecision.remain() <= cd.betweenTheEyes.remain()))) and true or false
  1025. --rtb_reroll,value=rtb_buffs<2&(buff.loaded_dice.up|!buff.grand_melee.up&!buff.ruthless_precision.up)
  1026. else
  1027. -- print("last roll")
  1028. return (buff.rollTheBones.count < 2 and (buff.loadedDice.exists() or not buff.grandMelee.exists() or not buff.ruthlessPrecision.exists())) and true or false
  1029. end
  1030. end
  1031. --actions+=/variable,name=ambush_condition,value=combo_points.deficit>=2+2*(talent.ghostly_strike.enabled&cooldown.ghostly_strike.remains<1)+buff.broadside.up&energy>60&!buff.skull_and_crossbones.up&!buff.keep_your_wits_about_you.up
  1032.  
  1033.  
  1034.  
  1035. local function bladeFlurrySync()
  1036. return not mode.bladeflurry == 1 or bftargets < 2 or buff.bladeFlurry.exists()
  1037. end
  1038. -- finish,if=combo_points>=cp_max_spend-(buff.broadside.up+buff.opportunity.up)*(talent.quick_draw.enabled&(!talent.marked_for_death.enabled|cooldown.marked_for_death.remains>1))
  1039.  
  1040. -- # Finish at maximum CP. Substract one for each Broadside and Opportunity when Quick Draw is selected and MfD is not ready after the next second.
  1041. -- actions+=/call_action_list,name=finish,if=combo_points>=cp_max_spend-(buff.broadside.up+buff.opportunity.up)*(talent.quick_draw.enabled&(!talent.marked_for_death.enabled|cooldown.marked_for_death.remains>1))
  1042.  
  1043. -- print(shouldFinish())
  1044. local function courtcheck(skill)
  1045. if br.player.eID == 2311 then
  1046. if UnitDebuffID("player","304409") then
  1047. if br.player.spell.abilities[skill] == br.lastCast.tracker[1] then
  1048. if ttm <= 2 then
  1049. if cast.sprint() then return true end
  1050. if cast.riposte() then return true end
  1051. -- if cast.vanish() then return true end
  1052. end
  1053. if cast.detection() then return true end
  1054. end
  1055. end
  1056. end
  1057. end
  1058. local function sanguineCheck(unit)
  1059. if UnitHealth(unit) <= 25000 then return false end
  1060. local x, y, z = ObjectPosition(unit)
  1061. for i = 1, #enemyTable5 do
  1062. local thisUnit = enemyTable5[i].unit
  1063. local ttd = enemyTable5[i].ttd
  1064. if thisUnit ~= unit then
  1065. local posX, posY, posZ = ObjectPosition(thisUnit)
  1066. if ttd <= 2 then
  1067. if sqrt(((x - posX) ^ 2) + ((y - posY) ^ 2) + ((z - posZ) ^ 2)) < 4.5 then
  1068. return true
  1069. end
  1070. end
  1071. end
  1072. end
  1073. if br.sanguineCheck(unit) then return true end
  1074. return false
  1075. end
  1076. local function coralCheck()
  1077. -- print(coralFirst)
  1078. if coralFirst and #enemyTable20 > 0 then
  1079. -- print(coralFirst)
  1080. local razorTime = buff.razorCoral.remain("player")
  1081. for i = 1, #enemyTable20 do
  1082. local thisUnit = enemyTable20[i]
  1083. -- print("123")
  1084. if thisUnit.ttd > 0 and (thisUnit.ttd < 20 or thisUnit.ttd < razorTime) then
  1085. if enemyTable20.coralTarget == nil or enemyTable20.coralTargetTTD < thisUnit.ttd then
  1086. enemyTable20.coralTarget = thisUnit.unit
  1087. enemyTable20.coralTargetTTD = thisUnit.ttd
  1088. end
  1089. end
  1090. end
  1091. -- if enemyTable20.coralTargetTTD <= 20 then
  1092. -- -- print(enemyTable20.coralTargetTTD)
  1093. -- end
  1094. -- if enemyTable20.coralTargetTTD < razorTime then
  1095. -- print(enemyTable20.coralTargetTTD)
  1096. -- end
  1097. if enemyTable20.coralTarget ~= nil then
  1098. local firsttarget = GetObjectWithGUID(ObjectGUID("target"))
  1099. TargetUnit(enemyTable20.coralTarget)
  1100. UseItemByName(169311, enemyTable20.coralTarget)
  1101. TargetUnit(firsttarget)
  1102. enemyTable20.coralTarget = nil
  1103. end
  1104. end
  1105. end
  1106. -- local function shit(skill, stuff, yards)
  1107. -- -- local shitty = ["rogueTables.enemyTable"..yards]
  1108. -- -- for i = 1, #shitty do
  1109. -- -- local thisUnit = shitty[i].unit
  1110. -- -- if stuff then
  1111. -- -- if cast[skill](thisUnit) then return true end
  1112. -- -- end
  1113. -- -- end
  1114. -- -- print("rogueTables.enemyTable" .. yards)
  1115. -- for k,v in pairs("rogueTables.enemyTable" .. yards]) do
  1116. -- print(k)
  1117. -- print(v)
  1118. -- end
  1119. -- end
  1120. -- shit("sinisterStrike", true, 5)
  1121. local function customCast(skill, stuff, yards)
  1122. courtcheck(skill)
  1123. if yards == 5 then
  1124. if isChecked("|cffFF0000Force Burn Stuff") or spread then
  1125. for i = 1, #burnTable5 do
  1126. local thisUnit = burnTable5[i].unit
  1127. if stuff then
  1128. if cast[skill](thisUnit) then return true end
  1129. end
  1130. end
  1131. end
  1132.  
  1133. for i = 1, #enemyTable5 do
  1134. local thisUnit = enemyTable5[i].unit
  1135. if stuff then
  1136. if cast[skill](thisUnit) then return true end
  1137. end
  1138. end
  1139. else
  1140. if skill == "betweenTheEyes" and (mode.nobte == 3 or keepbteEmissary or spread) then return end
  1141. if isChecked("|cffFF0000Force Burn Stuff") or spread then
  1142. for i = 1, #burnTable20 do
  1143. if burnTable20[i].id == 120651 then
  1144. if skill == "betweenTheEyes" then return end
  1145. if isChecked("DontWasteDeadShotOnOrbs") and skill == "pistolShot" and buff.deadShot.exists("player") then return end
  1146. end
  1147. local thisUnit = burnTable20[i].unit
  1148. if stuff then
  1149. if cast[skill](thisUnit) then return true end
  1150. end
  1151. end
  1152. end
  1153. if skill == "betweenTheEyes" then
  1154. if not cast.able.betweenTheEyes(enemyTable20[1]) then return end
  1155. local function bte20()
  1156. for i = 1, #enemyTable20 do
  1157. if enemyTable20[i].id == 120651 then return end
  1158. local thisUnit = enemyTable20[i].unit
  1159. if isChecked("BtE Sanguine check") then
  1160. if sanguineCheck(thisUnit) then return end
  1161. end
  1162. if isChecked("DRTracker") then
  1163. if stuff and canCC(199804, thisUnit) and (select(5,UnitCastingInfo(thisUnit)) ~= nil or select(5,UnitChannelInfo(thisUnit)) ~= nil) and (mode.btehold == 2 or select(8, UnitCastingInfo(thisUnit))) then
  1164. if cast[skill](thisUnit) then return true end
  1165. end
  1166. else
  1167. if stuff and (select(5,UnitCastingInfo(thisUnit)) ~= nil or select(5,UnitChannelInfo(thisUnit)) ~= nil) and (mode.btehold == 2 or select(8, UnitCastingInfo(thisUnit))) then
  1168. if cast[skill](thisUnit) then return true end
  1169. end
  1170. end
  1171. end
  1172. for i = 1, #enemyTable20 do
  1173. if enemyTable20[i].id == 120651 then return end
  1174. local thisUnit = enemyTable20[i].unit
  1175. --sanguine check
  1176. --if getBuffRemain(thisUnit,226510) ~= 0 then return end
  1177. if isChecked("DRTracker") then
  1178. if stuff and canCC(199804, thisUnit) and (mode.btehold == 2 or select(8, UnitCastingInfo(thisUnit))) then
  1179. if cast[skill](thisUnit) then return true end
  1180. end
  1181. else
  1182. if stuff then
  1183. if cast[skill](thisUnit) then return true end
  1184. end
  1185. end
  1186. end
  1187. end
  1188. if isChecked("Force 6cp BTE") then
  1189. -- print("cp = "..combo..", max = "..comboMax)
  1190. if combo < comboMax then
  1191. print("check ok")
  1192. if cast.pool.sinisterStrike() then print("pooling for ss");return true end
  1193. print("ss cast")
  1194. customCast("sinisterStrike", true, 5)
  1195. end
  1196. end
  1197. if combo == comboMax then
  1198. if forcebote or mode.boteforce == 1 or (isChecked("AutoBotE") and not cd.betweenTheEyes.exists() and buff.bladeFlurry.exists("player") and bftargets >= 4 and not rtbReroll() and buff.adrenalineRush.exists("player")) then
  1199. if cast.bloodOfTheEnemy() then forcebote = false; return true end
  1200. end
  1201. end
  1202. if mode.nobte == 1 then
  1203. bte20()
  1204. elseif mode.nobte == 2 and UnitIsVisible("target") and not UnitIsDeadOrGhost("target") then
  1205. -- if getBuffRemain(thisUnit,226510) ~= 0 then return end
  1206. if isChecked("BtE Sanguine check") then
  1207. if sanguineCheck(ObjectPointer("target")) then
  1208. if isChecked("BtE giga feature") then
  1209. bte20()
  1210. end
  1211. return end
  1212. end
  1213. if (mode.btehold == 2 or (select(8, UnitCastingInfo("target")) or UnitCastingInfo("target") == nil )) then
  1214. if cast[skill]("target") then return true end
  1215. end
  1216. end
  1217. else
  1218. for i = 1, #enemyTable20 do
  1219. local thisUnit = enemyTable20[i].unit
  1220. if stuff then
  1221. if cast[skill](thisUnit) then return true end
  1222. end
  1223. end
  1224. end
  1225. end
  1226. end
  1227. -- customCast("sinisterStrike", true, 5)
  1228. --------------------
  1229. --- Action Lists ---
  1230. --------------------
  1231. -- Action List - Extras
  1232. --[[local function actionList_Extras()
  1233. end -- End Action List - Extras]]
  1234. -- Action List - DefensiveModes
  1235. local function actionList_Defensive()
  1236. -- SLASH_FEINT1 = "/feinterino"
  1237. -- SlashCmdList["FEINT"] = function(_)
  1238. -- if not buff.feint.exists() or (buff.feint.exists() and buff.feint.remain() <= 0.8) or isDeBuffed("player", 230139) and mode.feint == 2 then
  1239. -- if toggle("Feint", 1) then
  1240. -- return true
  1241. -- end
  1242. -- end
  1243. -- end
  1244. -- -- Feint
  1245. -- if mode.feint == 1 and not buff.feint.exists() then
  1246. -- if cast.feint() and toggle("Feint", 2) then
  1247. -- return true
  1248. -- end
  1249. -- end
  1250.  
  1251. if not stealth then
  1252. -- Health Pot/Healthstone
  1253. if isChecked("Healing Potion/Healthstone") and (use.able.healthstone() or canUse(169451)) and php <= getOptionValue("Healing Potion/Healthstone") and inCombat and (hasItem(169451) or has.healthstone()) then
  1254. if use.able.healthstone() then
  1255. use.healthstone()
  1256. elseif canUse(169451) then
  1257. useItem(169451)
  1258. end
  1259. end
  1260. if isChecked("Wownish") and mode.ritzanish == 1 and UnitCastingInfo("target") == GetSpellInfo(259856) then
  1261. if CastSpellByID(1856) then return end
  1262. end
  1263. -- Crimson Vial
  1264. if isChecked("Crimson Vial") and php < getOptionValue("Crimson Vial") then
  1265. if cast.crimsonVial() then
  1266. return true
  1267. end
  1268. end
  1269. -- Feint
  1270. if isChecked("Feint") and php <= getOptionValue("Feint") and inCombat and not buff.feint.exists() then
  1271. if cast.feint() then
  1272. return true
  1273. end
  1274. end
  1275. -- Evasion
  1276. if isChecked("Riposte") and php <= getOptionValue("Riposte") and inCombat then
  1277. if cast.riposte() then
  1278. return true
  1279. end
  1280. end
  1281. if isChecked("Engineer's Belt") and php <= getOptionValue("Engineer's Belt") and inCombat then
  1282. if canUse(6) then
  1283. useItem(6)
  1284. end
  1285. end
  1286. end
  1287. end -- End Action List - Defensive
  1288. -- Action List - Interrupts
  1289. local function actionList_Interrupts()
  1290. if useInterrupts() then
  1291. for i=1, #enemyTable5 do
  1292. local thisUnit = enemyTable5[i].unit
  1293. if canInterrupt(thisUnit,getOptionValue("Interrupt At")) then
  1294. -- kick
  1295. if isChecked("Kick") then
  1296. if cast.kick(thisUnit) then end
  1297. end
  1298. end
  1299. end
  1300. end -- End Interrupt and No Stealth Check
  1301. end -- End Action List - Interrupts
  1302. -- Action List - Cooldowns
  1303. local function actionList_Cooldowns()
  1304. local startTime = debugprofilestop()
  1305. -- Trinkets
  1306. if isChecked("Trinkets") then
  1307. if hasBloodLust() or (ttd("target") <= 20 and isBoss("target")) then
  1308. if canUse(13) then
  1309. useItem(13)
  1310. end
  1311. if canUse(14) then
  1312. useItem(14)
  1313. end
  1314. end
  1315. end
  1316.  
  1317. -- Non-NE Racial
  1318. --blood_fury
  1319. --berserking
  1320. --arcane_torrent,if=energy.deficit>40
  1321. if mode.special == 1 and isChecked("Racial") and (race == "Orc" or race == "MagharOrc" or race == "DarkIronDwarf" or race == "Troll") then
  1322. if cast.racial("player") then return true end
  1323. end
  1324.  
  1325. if mode.special == 1 and not buff.adrenalineRush.exists() and ttd("target") >= 10 then
  1326. if cast.adrenalineRush("player") then
  1327. if isChecked("Trinkets") then
  1328. if canUse(13) then
  1329. useItem(13)
  1330. end
  1331. if canUse(14) then
  1332. useItem(14)
  1333. end
  1334. end
  1335. if isChecked("Pots with AR") then
  1336. if isChecked("Pots with AR") and (hasBloodLust() or buff.adrenalineRush.exists()) and targetDistance < 5 then
  1337. if ttd("target") > 15 then
  1338. if getOptionValue("Pots with AR") == 1 and hasItem(169299) and canUse(169299) then useItem(169299)
  1339. elseif getOptionValue("Pots with AR") == 2 and hasItem(168489) and canUse(168489) then useItem(168489)
  1340. elseif getOptionValue("Pots with AR") == 3 and hasItem(168529) and canUse(168529) then useItem(168529)
  1341. end
  1342. end
  1343. end
  1344. end
  1345. return true end
  1346. end
  1347. if talent.ghostlyStrike and bladeFlurrySync() and comboDeficit >= (1 + (buff.broadside.exists() and 1 or 0)) then
  1348. if cast.ghostlyStrike("target") then return true end
  1349. end
  1350.  
  1351. if talent.killingSpree and mode.tierseven == 1 and bladeFlurrySync() and (ttm > 5 or power < 15) then
  1352. if cast.killingSpree("target") then return true end
  1353. end
  1354. -- Blade Rush
  1355. -- blade_rush,if=variable.blade_flurry_sync&energy.time_to_max>1
  1356. if mode.tierseven == 1 and bladeFlurrySync() and targetDistance < 5 and ttm > 1 then
  1357. if cast.bladeRush("target") then return true end
  1358. end
  1359.  
  1360. if isChecked("Debug Timers") then
  1361. if profile.Cooldowns == nil then profile.Cooldowns = {} end
  1362. local section = profile.Cooldowns
  1363. if section.totalIterations == nil then section.totalIterations = 0 end
  1364. if section.elapsedTime == nil then section.elapsedTime = 0 end
  1365. section.currentTime = debugprofilestop()-startTime
  1366. section.totalIterations = section.totalIterations + 1
  1367. section.elapsedTime = section.elapsedTime + debugprofilestop()-startTime
  1368. section.averageTime = section.elapsedTime / section.totalIterations
  1369. end
  1370. end -- End Action List - Cooldowns
  1371. -- Action List - PreCombat
  1372. local function actionList_PreCombat()
  1373. -- Stealth
  1374. if not inCombat then
  1375. if forceroll then forceroll = false end
  1376. if stopfinish then stopfinish = false end
  1377. if not stealthingAll and IsUsableSpell(1784) then
  1378. if isChecked("Stealth") then
  1379. if getOptionValue("Stealth") == 1 or #enemies.yards20nc > 0 then
  1380. if cast.stealth("player") then end
  1381. end
  1382. end
  1383. end
  1384. if isChecked("PickPocket") then
  1385. if #enemyTable5 > 0 and stealthingRogue then
  1386. for i = 1, #enemyTable5 do
  1387. local thisUnit = enemyTable5[i].unit
  1388. if isChecked("PickPocket") then
  1389. if PickPocketable(thisUnit) then
  1390. if cast.pickPocket(thisUnit) then
  1391. CastSpellByID(8676, thisUnit)
  1392. end
  1393. end
  1394. end
  1395.  
  1396. end
  1397. -- if GetUnitExists("target") then if cast.ambush("target") then return true end end
  1398. end
  1399. elseif isChecked("Ambush Opener") then
  1400. if #enemyTable5 > 0 and stealthingRogue then
  1401. for i = 1, #enemyTable5 do
  1402. if cast.ambush(enemyTable5[i].unit) then return true end
  1403. end
  1404. end
  1405. end
  1406. end
  1407. if isChecked("AutoStrife") and stealth then
  1408. if cast.detection() then return true end
  1409. end
  1410. end -- End Action List - PreCombat
  1411. -- Action List - Finishers
  1412. local function actionList_Finishers()
  1413. local startTime = debugprofilestop()
  1414. if isChecked("Pool for BTE") then
  1415. if ttm > cd.betweenTheEyes.remain() and cd.betweenTheEyes.exists() then
  1416. if isChecked("Force 6cp BTE") then
  1417. if combo < comboMax then
  1418. if ttm >= 3 and buff.opportunity.exists("player") then
  1419. customCast("pistolShot", true, 20)
  1420. end
  1421. customCast("sinisterStrike", true, 5)
  1422. end
  1423. end
  1424. return true end
  1425. end
  1426. if forceroll then
  1427. -- print("forcerolled")
  1428. if cast.rollTheBones("player") then forceroll = false; return true end
  1429. return true
  1430. end
  1431. -- actions.finish=between_the_eyes,if=buff.ruthless_precision.up|(azerite.deadshot.rank>=2&buff.roll_the_bones.up)
  1432. if (buff.ruthlessPrecision.exists() or ((traits.deadshot.rank > 0 or traits.aceupyoursleeve.rank > 0) and buff.rollTheBones.count > 0)) then
  1433. --print("626")
  1434. customCast("betweenTheEyes",true, 20)
  1435. end
  1436.  
  1437.  
  1438. if not talent.sliceAndDice then
  1439. if buff.rollTheBones.remain < 3 or rtbReroll() then
  1440. if cast.rollTheBones("player") then return true end
  1441. end
  1442. else
  1443. if buff.sliceAndDice.remain() < ttd("target") and buff.sliceAndDice.refresh() then
  1444. if cast.sliceAndDice("player") then return true end
  1445. end
  1446. end
  1447.  
  1448. if (traits.deadshot.rank > 0 or traits.aceupyoursleeve.rank > 0) then
  1449. --print("643")
  1450. customCast("betweenTheEyes",true, 20)
  1451. end
  1452. -- cast20yards("deathFromAbove",true)
  1453. if cd.betweenTheEyes.exists() then
  1454. customCast("dispatch",true, 5)
  1455. end
  1456.  
  1457. if isChecked("Debug Timers") then
  1458. if profile.Finishers == nil then profile.Finishers = {} end
  1459. local section = profile.Finishers
  1460. if section.totalIterations == nil then section.totalIterations = 0 end
  1461. if section.elapsedTime == nil then section.elapsedTime = 0 end
  1462. section.currentTime = debugprofilestop()-startTime
  1463. section.totalIterations = section.totalIterations + 1
  1464. section.elapsedTime = section.elapsedTime + debugprofilestop()-startTime
  1465. section.averageTime = section.elapsedTime / section.totalIterations
  1466. end
  1467. end
  1468.  
  1469. local hastecd = (buff.adrenalineRush.exists("player") or hasBloodLust()) and true or false
  1470.  
  1471. local function actionList_Build()
  1472. local startTime = debugprofilestop()
  1473.  
  1474. if hastecd then
  1475. if #enemyTable5 >= 4 and not buff.deadShot.exists() and buff.bladeFlurry.exists() then
  1476. customCast("sinisterStrike",true, 5)
  1477. end
  1478. end
  1479.  
  1480. if comboDeficit >= (1 + (buff.broadside.exists() and 1 or 0) + (talent.quickDraw and 1 or 0)) and buff.opportunity.exists() and (buff.wits.stack() < 14 or power < 45 or buff.deadShot.exists()) then
  1481. customCast("pistolShot",true, 20)
  1482. end
  1483.  
  1484.  
  1485. -- if UnitBuffID("player", 213995) then
  1486. -- cast20yards("pistolShot",true)
  1487. -- end
  1488.  
  1489. customCast("sinisterStrike",true, 5)
  1490.  
  1491. if UnitBuffID("player", 213995) then
  1492. customCast("pistolShot",true, 20)
  1493. end
  1494. if isChecked("Debug Timers") then
  1495. if profile.Builder == nil then profile.Builder = {} end
  1496. local section = profile.Builder
  1497. if section.totalIterations == nil then section.totalIterations = 0 end
  1498. if section.elapsedTime == nil then section.elapsedTime = 0 end
  1499. section.currentTime = debugprofilestop()-startTime
  1500. section.totalIterations = section.totalIterations + 1
  1501. section.elapsedTime = section.elapsedTime + debugprofilestop()-startTime
  1502. section.averageTime = section.elapsedTime / section.totalIterations
  1503. end
  1504. end -- End Action List - Build
  1505.  
  1506. local function actionList_CC()
  1507.  
  1508.  
  1509. local willkick = nil
  1510. -- LibDraw.clearCanvas()
  1511. function canInterruptshit(unit, hardinterrupt, gouge)
  1512.  
  1513. local hardinterrupt = hardinterrupt or false
  1514. local timeforcc = (hardinterrupt and 2) or 1
  1515. local interruptTarget = getOptionValue("Interrupt Target")
  1516. if interruptTarget == 2 and not GetUnitIsUnit(unit, "target") then
  1517. return false
  1518. elseif interruptTarget == 3 and not GetUnitIsUnit(unit, "focus") then
  1519. return false
  1520. end
  1521. local castStartTime, castEndTime, interruptID, interruptable, castLeft = 0, 0, 0, false, 999
  1522. if GetUnitExists(unit)
  1523. and UnitCanAttack("player",unit)
  1524. and not UnitIsDeadOrGhost(unit)
  1525. then
  1526. -- Get Cast/Channel Info
  1527. if select(5,UnitCastingInfo(unit)) and (not select(8,UnitCastingInfo(unit)) or hardinterrupt) then --Get spell cast time
  1528. castStartTime = select(4,UnitCastingInfo(unit))
  1529. castEndTime = select(5,UnitCastingInfo(unit))
  1530. castLeft = castEndTime/1000 - br.time
  1531. interruptID = select(9,UnitCastingInfo(unit))
  1532. if stunList[interruptID] or isChecked("Any Cast") then interruptable = true end
  1533. elseif select(5,UnitChannelInfo(unit)) and (not select(7,UnitChannelInfo(unit)) or hardinterrupt) then -- Get spell channel time
  1534. castStartTime = select(4,UnitChannelInfo(unit))
  1535. castEndTime = select(5,UnitChannelInfo(unit))
  1536. castLeft = castEndTime/1000 - br.time
  1537. interruptID = select(8,UnitChannelInfo(unit))
  1538. if channelAsapList[interruptID] or channelLateList[interruptID] or isChecked("Any Cast") then interruptable = true end
  1539. end
  1540. if interruptable or isChecked("Any Cast") then
  1541. if not cd.kick.exists() and not hardinterrupt then
  1542. if willkick == nil then
  1543. willkick = unit
  1544. local wx,wy,wz = ObjectPosition(willkick)
  1545. if getDistance(unit) > 5 then
  1546. LibDraw.SetColor(255,0,0)
  1547. else
  1548. LibDraw.SetColor(0,0,0)
  1549. end
  1550. end
  1551. end
  1552. if gouge and (willkick == nil or willkick ~= unit) then
  1553. local ux, uy, uz = ObjectPosition(unit)
  1554. local truefacing = ObjectFacing(unit)
  1555. if not getFacing(unit, "player") or getDistance(unit) > 8 then
  1556. LibDraw.SetColor(255,0,0)
  1557. LibDraw.Arc(ux, uy, uz, 7, 210, truefacing)
  1558. else
  1559. LibDraw.SetColor(0,0,0)
  1560. end
  1561.  
  1562. LibDraw.Text("CC SHIT", "GameFontNormal", ux,uy,uz+2)
  1563. end
  1564. if willkick == unit and hardinterrupt then return false end
  1565. if castLeft <= timeforcc or channelAsapList[interruptID] ~= nil then
  1566. -- print(forpro)
  1567. if (br.time - castStartTime/1000) >= getOptionValue("Delay Interrupt for") then
  1568. return true
  1569. end
  1570. end
  1571. end
  1572. return false
  1573. end
  1574. end
  1575. for i = 1, #enemyTable20 do
  1576. local thisUnit = enemyTable20[i].unit
  1577. local distance = enemyTable20[i].distance
  1578. if isChecked("AutoKick") and distance <= 5 and not cd.kick.exists() then
  1579. if canInterruptshit(thisUnit, false) then
  1580. if cast.kick(thisUnit) then
  1581. return true
  1582. end
  1583. end
  1584. end
  1585. if isBoss(thisUnit) then return end
  1586. if isChecked("AutoGouge") and not cd.gouge.exists() and getFacing(thisUnit, "player") then
  1587. if canInterruptshit(thisUnit, true , true) then
  1588. if distance <= 5 then
  1589. if cast.gouge(thisUnit) then return true end
  1590. end
  1591. end
  1592. elseif isChecked("AutoBtE") and distance <= 20 and combo >= 4 and not cd.betweenTheEyes.exists() and not spread then
  1593. if canInterruptshit(thisUnit, true) then
  1594. if cast.betweenTheEyes(thisUnit) then return true end
  1595. end
  1596. elseif isChecked("AutoBlind") and distance <= 15 and not cd.blind.exists() then
  1597. if canInterruptshit(thisUnit, true) then
  1598. if cast.blind(thisUnit) then return true end
  1599. end
  1600. end
  1601. end
  1602. -- if isChecked("AutoKick") and not cd.kick.exists() then
  1603. -- for i = 1, #enemyTable5 do
  1604. -- local thisUnit = enemyTable5[i].unit
  1605. -- if canInterruptshit(thisUnit, nil , true) then
  1606. -- if cast.kick(thisUnit) then end
  1607. -- end
  1608. -- end
  1609. -- end
  1610. -- if isChecked("AutoBtE") and combo > 4 and not cd.betweenTheEyes.exists() then
  1611. -- for i = 1, #enemyTable20 do
  1612. -- local thisUnit = enemyTable20[i].unit
  1613. -- if canInterruptshit(thisUnit, true , true) then
  1614. -- if cast.betweenTheEyes(thisUnit) then return true end
  1615. -- end
  1616. -- end
  1617. -- end
  1618. -- if isChecked("AutoGouge") and not cd.gouge.exists() then
  1619. -- for i = 1, #enemyTable5 do
  1620. -- local thisUnit = enemyTable5[i].unit
  1621. -- if canInterruptshit(thisUnit, true , true) and thisUnit.facing then
  1622. -- if cast.gouge(thisUnit) then return true end
  1623. -- end
  1624. -- end
  1625. -- end
  1626. -- if isChecked("AutoBtE") and combo > 0 and not cd.betweenTheEyes.exists() then
  1627. -- for i = 1, #enemyTable20 do
  1628. -- local thisUnit = enemyTable20[i].unit
  1629. -- if canInterruptshit(thisUnit, true , true) then
  1630. -- if cast.betweenTheEyes(thisUnit) then return true end
  1631. -- end
  1632. -- end
  1633. -- end
  1634. -- if isChecked("AutoBlind") and not cd.blind.exists() then
  1635. -- for i = 1, #enemyTable15 do
  1636. -- local thisUnit = enemyTable15[i].unit
  1637. -- if canInterruptshit(thisUnit, true , true) then
  1638. -- if cast.blind(thisUnit) then return true end
  1639. -- end
  1640. -- end
  1641. -- end
  1642.  
  1643.  
  1644. end
  1645.  
  1646.  
  1647. local function actionList_Opener()
  1648. end
  1649.  
  1650. local function MythicStuff()
  1651. if isChecked("Piggie FH") and piggiecatch then
  1652. if br.eID == 2095 then
  1653. piggiecatch = false
  1654. end
  1655. for i = 1, GetObjectCount() do
  1656. local ID = ObjectID(GetObjectWithIndex(i))
  1657. local object = GetObjectWithIndex(i)
  1658. if ID == 130099 and getDistance(object) <= 5 then
  1659. InteractUnit(object)
  1660. RunMacroText("/follow")
  1661. InteractUnit("target")
  1662. return
  1663. end
  1664. end
  1665. end
  1666. -- WriteFile("GetMinimapZoneText.txt", tostring(GetMinimapZoneText()) .. "\n", true)
  1667.  
  1668.  
  1669. if br.player.eID then
  1670. -- fh 1st boss feint, fisker (c)
  1671. if br.player.eID == 2093 then
  1672. local a, b, c, d = UnitCastID("boss1")
  1673. if a == 256106 then
  1674. fhbossPool = false
  1675. if c == ObjectPointer("player") then
  1676. CastSpellByID(1966)
  1677. end
  1678. end
  1679. if br.DBM:getTimer(256106) <= 1.5 and not cd.feint.exists() then -- pause 1 sec before cast for pooling
  1680. -- if GetUnitIsUnit("player", UnitTarget("boss1")) then
  1681. fhbossPool = true
  1682. end
  1683. if fhbossPool then return true end
  1684. end
  1685. --WM gorak cc
  1686. if br.player.eID == 2117 then
  1687. if enemyTable20 ~= nil then
  1688. for i = 1, #enemyTable20 do
  1689. local thisUnit = enemyTable20[i]
  1690. if thisUnit.id == 135552 and UnitCastingInfo(thisUnit) ~= nil then
  1691. if (select(6, UnitCastingInfo(thisUnit)) - br.time) <= 1 then
  1692. if not cd.gouge.exists() and getFacing(thisUnit,"player") then
  1693. if cast.gouge(thisUnit) then return true end
  1694. elseif not cd.betweenTheEyes.exists() and comboDeficit <= 2 then
  1695. if cast.betweenTheEyes(thisUnit) then return true end
  1696. elseif not cd.blind.exists() then
  1697. if cast.blind(thisUnit) then return true end
  1698. end
  1699. end
  1700. end
  1701. end
  1702. end
  1703. end
  1704. -- if br.player.eID == 2093 and isCastingSpell(256106, "boss1") then
  1705. -- fhbossPool = false
  1706. -- if GetUnitIsUnit("player", UnitTarget("boss1")) then
  1707. -- if cast.feint() then print("feint gone");return true end
  1708. -- end
  1709. -- end
  1710. -- if fhbossPool then return true end
  1711. -- print(eID)
  1712. local bosscount = 0
  1713. for i = 1, 5 do
  1714. if GetUnitExists("boss" .. i) then
  1715. bosscount = bosscount + 1
  1716. end
  1717. end
  1718. for i = 1, bosscount do
  1719. local spellname, castEndTime,interruptID, spellnamechannel, castorchan, spellID
  1720. thisUnit = tostring("boss" .. i)
  1721. -- if select(3, UnitCastID(thisUnit)) == ObjectPointer("player") and select(9, UnitCastingInfo(thisUnit)) then
  1722. -- print(select(9, UnitCastingInfo(thisUnit)))
  1723. -- end
  1724. if UnitCastingInfo(thisUnit) then
  1725. spellname = UnitCastingInfo(thisUnit)
  1726. -- castStartTime = select(4,UnitCastingInfo(thisUnit)) / 1000
  1727. castEndTime = select(5, UnitCastingInfo(thisUnit)) / 1000
  1728. interruptID = select(9,UnitCastingInfo(thisUnit))
  1729. castorchan = "cast"
  1730. elseif UnitChannelInfo(thisUnit) then
  1731. spellname = UnitChannelInfo(thisUnit)
  1732. -- castStartTime = select(4,UnitChannelInfo(thisUnit)) / 1000
  1733. castEndTime = select(5,UnitChannelInfo(thisUnit)) / 1000
  1734. interruptID = select(9,UnitChannelInfo(thisUnit))
  1735. castorchan = "channel"
  1736. end
  1737. if spellname ~= nil then
  1738. -- print(spellname)
  1739. local castleft = castEndTime - br.time
  1740. -- WriteFile("encountertest.txt", tostring(ObjectName("boss"..i)) .. "," .. tostring(castleft) .. " left," .. tostring(spellname) .. ", spellid =" .. tostring(interruptID) .. "\n", true)
  1741. -- print(castleft.." cast left"..spellname)
  1742. -- print(castleft.." channel left"..spellname)
  1743. -- if castleft <= 3 then
  1744. if (select(3, UnitCastID(thisUnit)) == ObjectPointer("player") or select(4, UnitCastID(thisUnit)) == ObjectPointer("player")) and castleft <= 1.5 then--GetUnitIsUnit("player", "boss"..i.."target") or then
  1745. if cloakPlayerlist[interruptID] then
  1746. if br.player.eID == 2093 then
  1747. if not cd.feint.exists() or buff.feint.exists() then return end
  1748. end
  1749. if cast.cloakOfShadows("player") then return true end
  1750. elseif evasionPlayerlist[interruptID] then
  1751. if cast.riposte("player") then return true end
  1752. elseif br.player.talent.elusiveness and feintPlayerList[interruptID] then
  1753. if cast.pool.feint("player") and cd.feint.remain() <= castleft then return true end
  1754. if cast.feint("player") then return true end
  1755. elseif vanishList[interruptID] then
  1756. if cast.vanish("player") then return true end
  1757. end
  1758. else
  1759. if cloaklist[interruptID] then
  1760. if cast.cloakOfShadows("player") then return true end
  1761. elseif evasionlist[interruptID] then
  1762. if cast.riposte("player") then return true end
  1763. elseif feintlist[interruptID] then
  1764. if cast.pool.feint("player") and cd.feint.remain() <= castleft then return true end
  1765. if cast.feint("player") then return true end
  1766. end
  1767. end
  1768. -- end
  1769. end
  1770. end
  1771. --CC units
  1772. -- for i=1, #enemies.yards20 do
  1773. -- local thisUnit = enemies.yards20[i]
  1774. -- local distance = getDistance(thisUnit)
  1775. -- if isChecked("AutoBtE") or isChecked("AutoGouge") or isChecked("AutoBlind") then
  1776. -- local interruptID, castStartTime, spellname, castEndTime
  1777. -- if UnitCastingInfo(thisUnit) then
  1778. -- spellname = UnitCastingInfo(thisUnit)
  1779. -- -- castStartTime = select(4,UnitCastingInfo(thisUnit)) / 1000
  1780. -- castEndTime = select(5, UnitCastingInfo(thisUnit)) / 1000
  1781. -- interruptID = select(9,UnitCastingInfo("player"))
  1782. -- elseif UnitChannelInfo(thisUnit) then
  1783. -- spellname = UnitChannelInfo(thisUnit)
  1784. -- -- castStartTime = select(4,UnitChannelInfo(thisUnit)) / 1000
  1785. -- castEndTime = select(5,UnitChannelInfo(thisUnit)) / 1000
  1786. -- interruptID = select(8,UnitChannelInfo(thisUnit))
  1787. -- end
  1788. -- if isChecked("AutoBtE") and interruptID ~= nil and combo > 0 and not spread and
  1789. -- ((stunList[interruptID] and castEndTime - GetTime() <= 2 ) or
  1790. -- channelAsapList[interruptID] or
  1791. -- channelLateList[interruptID] and castEndTime - GetTime() <= 2)
  1792. -- then
  1793. -- if cast.betweenTheEyes(thisUnit) then print("bte stun on"..spellname); return true end
  1794. -- end
  1795. -- if isChecked("AutoGouge") and interruptID ~= nil and getFacing(thisUnit,"player") and
  1796. -- ((stunList[interruptID] and castEndTime - GetTime() <= 2 ) or
  1797. -- channelAsapList[interruptID] or
  1798. -- channelLateList[interruptID] and castEndTime - GetTime() <= 2)
  1799. -- then
  1800. -- if cast.gouge(thisUnit) then print("gouge on"..spellname) return true end
  1801. -- end
  1802. -- if isChecked("AutoBlind") and interruptID ~= nil and
  1803. -- ((stunList[interruptID] and castEndTime - GetTime() <= 2 ) or
  1804. -- channelAsapList[interruptID] or
  1805. -- (channelLateList[interruptID] and castEndTime - GetTime() <= 2)) then
  1806. -- if cast.blind(thisUnit) then print("blind on "..spellname) return true end
  1807. -- end
  1808. -- end
  1809. -- end
  1810. end
  1811. end
  1812. --`````````````````````````````````````````````````STARTING SHIT```````````````````````````````````````````````
  1813. -- if not cast.current.focusedAzeriteBeam() then
  1814. -- profileStop = false
  1815. -- elseif cast.current.focusedAzeriteBeam() then
  1816. -- return true
  1817. -- end
  1818. ---```````````````````````````````````````````````````Essences```````````````````````````````````````````````````````````
  1819.  
  1820. ---``````````````````````````````````````````````````````````````````````````````````````````````````````````````````````
  1821. -- if select(8,UnitChannelInfo("player")) == 295258 then
  1822. -- return true
  1823. -- end
  1824.  
  1825. -- if UnitCastingInfo("player") then return true end
  1826.  
  1827. -- print(UnitCastingInfo("player"))
  1828. if forceambush and stealthingAll then
  1829. if cast.ambush("target") then forceambush = false; return true end
  1830. end
  1831. if isChecked("RotateBeam") and (select(8, UnitChannelInfo("player")) == 295258 or select(9, UnitCastingInfo("player")) == 295258) then
  1832. IrisBest()
  1833. end
  1834. if UnitChannelInfo("player") or UnitCastingInfo("player") then return true end
  1835.  
  1836. -- if #enemyTable5 > 0 then
  1837. -- if isChecked("Arcane Torrent Dispel Count") then
  1838. -- local torrentUnit = 0
  1839. -- for i=1, #enemyTable5 do
  1840. -- local thisUnit = enemyTable5[i].unit
  1841. -- if canDispel(thisUnit, select(7, GetSpellInfo(GetSpellInfo(69179)))) then
  1842. -- torrentUnit = torrentUnit + 1
  1843. -- if torrentUnit >= getOptionValue("Arcane Torrent Dispel Count") then
  1844. -- if castSpell("player",racial,false,false,false) then return true end
  1845. -- break
  1846. -- end
  1847. -- end
  1848. -- end
  1849. -- end
  1850. -- if isChecked("Dispell from List") then
  1851. -- for i=1, #enemyTable5 do
  1852. -- local thisUnit = enemyTable5[i].unit
  1853. -- local thisID = enemyTable5[i].id
  1854. -- for k,v in pairs(dispellList) do
  1855. -- if thisID == k then
  1856. -- if UnitBuffID(thisUnit, v) then
  1857. -- if castSpell("player",racial,false,false,false) then return true end
  1858. -- break
  1859. -- end
  1860. -- end
  1861. -- end
  1862. -- end
  1863. -- end
  1864. -- end
  1865.  
  1866. if actionList_PreCombat() then return true end
  1867. -- print(GetItemInfoInstant(GetInventoryItemLink("player",13)))
  1868.  
  1869. if isChecked("|cffFFBB00Encounter Logic") then
  1870. if MythicStuff() then return true end
  1871. end
  1872. if mode.stun == 1 then
  1873. if actionList_CC() then return true end
  1874. end
  1875. -- print(UnitThreatSituation("player"))
  1876. if (inCombat and profileStop == true) or not inCombat or pause() or (IsMounted() or IsFlying()) or mode.rotation == 2 then
  1877. return true
  1878. else
  1879. -- if not cast.able.detection('player') then return true end
  1880. if isChecked("Coral Abuse") then
  1881. coralCheck()
  1882. end
  1883.  
  1884. if forceuse13 then
  1885. useItem(13)
  1886. local itemLink = GetInventoryItemLink("player",13)
  1887. local itemid = select(3, strfind(itemLink, "item:(%d+)"))
  1888. local startTime, duration, enable = GetItemCooldown(itemid)
  1889. if duration > 2 then
  1890. forceuse13 = false
  1891. return
  1892. end
  1893. return true
  1894. end
  1895. if forceuse14 then
  1896. useItem(14)
  1897. local itemLink = GetInventoryItemLink("player",14)
  1898. local itemid = select(3, strfind(itemLink, "item:(%d+)"))
  1899. local startTime, duration, enable = GetItemCooldown(itemid)
  1900. if duration > 2 then
  1901. forceuse13 = false
  1902. return
  1903. end
  1904. return true
  1905. end
  1906. if #enemyTable5 >= 1 then
  1907. -- Crucible of flame
  1908. if isChecked("AutoCrucible") and essence.theCrucibleOfFlame.active then
  1909. if buff.concentratedFlame.stack() > 0 and buff.concentratedFlame.remain() <= 5 then
  1910. if cast.concentratedFlame("player") then return true end
  1911. else
  1912. if essence.theCrucibleOfFlame.rank < 3 then
  1913. if php <= 60 then
  1914. if cast.concentratedFlame("player") then return true end
  1915. else
  1916. if cast.concentratedFlame(enemyTable5[1].unit) then return true end
  1917. end
  1918. elseif essence.theCrucibleOfFlame.rank == 3 then
  1919. if ttm >= 1 and not buff.bladeFlurry.exists() and not UnitDebuffID("target", 295368) then
  1920. customCast("concentratedFlame", true, 5)
  1921. end
  1922. end
  1923. end
  1924. end
  1925.  
  1926. -- if isChecked("AutoBotE") and essence.bloodOfTheEnemy.active then
  1927. -- if bftargets >= 2 and cd.betweenTheEyes.remain() <= ttm and buff.bladeFlurry.remain() >= cd.betweenTheEyes.remain() and shouldFinish() and buff.rollTheBones.remain >= 5 then
  1928. -- if ttm >= 5 then return true
  1929. -- else
  1930. -- if cast.bloodOfTheEnemy() then return true end
  1931. -- end
  1932. -- end
  1933. -- end
  1934. -- -- actions.essences+=/guardian_of_azeroth
  1935. -- if essence..active
  1936. -- if cast.guardian_of_azeroth("player") then return true end
  1937. -- end
  1938.  
  1939. -- focusedAzeriteBeam
  1940. if isChecked("AutoBeam") then
  1941. if essence.essenceOfTheFocusingIris.active and #enemyTable5 >= 2 then
  1942. if not moving or essence.essenceOfTheFocusingIris.rank >= 3 then
  1943. if cast.focusedAzeriteBeam() then return true end
  1944. end
  1945. end
  1946. end
  1947. -- /purifying_blast,if=spell_targets.blade_flurry>=2|raid_event.adds.in>60
  1948. if essence.purificationProtocol.active and #enemyTable5 >= 2 then
  1949. if cast.purifyingBlast() then return true end
  1950. end
  1951.  
  1952. -- actions.essences+=/the_unbound_force,if=buff.reckless_force.up|buff.reckless_force_counter.stack<10 ????
  1953. if essence.theUnboundForce.active and buff.recklessForce.exists() or buff.recklessForce.stack() < 10 then
  1954. if cast.theUnboundForce() then return true end
  1955. end
  1956. -- actions.essences+=/ripple_in_space
  1957. if essence.purificationProtocol.active and #enemyTable5 >= 2 then
  1958. if cast.purifyingBlast() then return true end
  1959. end
  1960. --???????????????????????????????????????????????????????????????????????
  1961. if essence.worldveinResonance.active then
  1962. if buff.lifeBlood.stack() <= 3 then
  1963. if cast.worldveinResonance("player") then return true end
  1964. end
  1965. end
  1966. --actions.essences+=/memory_of_lucid_dreams,if=energy<45
  1967. if essence.purificationProtocol.active and #enemyTable5 >= 2 then
  1968. if cast.purifyingBlast() then return true end
  1969. end
  1970. if essence.memoryOfLucidDreams.active and power <= 45 then
  1971. if cast.memoryOfLucidDreams() then return true end
  1972. end
  1973. end
  1974.  
  1975.  
  1976.  
  1977. --print(rtbReroll())
  1978. --print(br.player.power.energy.ttm())
  1979. -- if cast.sinisterStrike() then return end
  1980. -- print(getDistance("target"))
  1981. --print(inRange(193315,"target"))
  1982. -- print(IsSpellInRange(193315,"target"))
  1983. --if castSpell("target",193315,true,false,false,true,false,true,false,false) then return end
  1984. --RunMacroText("/cast Коварный удар")
  1985. --if actionList_Extras() then return end
  1986.  
  1987. if actionList_Defensive() then return true end
  1988. --ty mr fisker
  1989. if tricksUnit ~= nil and UnitThreatSituation("player") and UnitThreatSituation("player") >= 2 and validTarget and targetDistance < 5 then
  1990. cast.tricksOfTheTrade(tricksUnit)
  1991. end
  1992. -- if isValidUnit("target") and isChecked("Opener") then
  1993. -- if actionList_Opener() then return end
  1994. -- end
  1995.  
  1996. -- if mode.mfd == 3 and rtuseon ~= nil then
  1997. -- if UnitIsDeadOrGhost(rtuseon) then rtuseon = nil return true end
  1998. -- print("trying dispatch")
  1999. -- if cast.dispatch(rtuseon) then
  2000. -- print("rt on mfd")
  2001. -- rtuseon = nil
  2002. -- return true end
  2003. -- end
  2004.  
  2005. if mode.bladeflurry == 1 and not buff.bladeFlurry.exists() and (((buff.rollTheBones.remain >= 5 and charges.bladeFlurry.frac() >= 1.5) or isChecked("FastBladeFlurry")) and bftargets >= 2) then
  2006. if cast.bladeFlurry("player") then return true end
  2007. end
  2008.  
  2009.  
  2010. if not isSafeToAttack("target") or isLongTimeCCed("target") then
  2011. RunMacroText("/stopattack")
  2012. end
  2013.  
  2014. if not IsCurrentSpell(6603) and inCombat and not stealth and validTarget and targetDistance <= 5 and getFacing("player", "target") then
  2015. StartAttack("target")
  2016. end
  2017.  
  2018. if mode.stun == 1 then
  2019. if actionList_CC() then return true end
  2020. end
  2021.  
  2022. if talent.markedForDeath and mode.mfd == 3 and combo < comboMax and cd.markedForDeath.remain() <= 0 then
  2023. if mfdtarget ~= nil and not UnitIsDeadOrGhost(mfdtarget) then
  2024. if cast.markedForDeath(mfdtarget) then end
  2025. end
  2026. end
  2027.  
  2028.  
  2029.  
  2030. if actionList_Interrupts() then end
  2031.  
  2032. if isChecked("Vanish") and cd.vanish.remain() <= 0.2 and targetDistance <= 5 and (not solo or isDummy("target")) then
  2033. local function ambushCondition()
  2034. if comboDeficit >= 2 + (buff.broadside.exists() and 1 or 0) and power > 60 and not buff.skullAndCrossbones.exists("player") and not buff.wits.exists("player") then
  2035. return true
  2036. end
  2037. return false
  2038. end
  2039. if ambushCondition() then
  2040. if gcd > 0.1 then return true end
  2041. forceambush = true
  2042. if CastSpellByID(1856) then end
  2043. end
  2044. end
  2045.  
  2046. if (mode.special == 1 or mode.tierseven == 1) and #enemyTable5 >= 1 then
  2047. if actionList_Cooldowns() then return true end
  2048. end
  2049.  
  2050. -- if stealthingAll then
  2051. -- if actionList_Stealth() then return end
  2052. -- end
  2053.  
  2054. if talent.markedForDeath and mode.mfd == 1 and cd.markedForDeath.remain() <= 0.2 then
  2055. if comboDeficit >= comboMax - 1 then
  2056. CastSpellByID(137619,"target")
  2057. return true
  2058. end
  2059. end
  2060. if talent.markedForDeath and mode.mfd == 2 and cd.markedForDeath.remain() <= 0.2 then
  2061. local thisUnit = enemies.yards20[i]
  2062. if ttd(thisUnit) < comboDeficit then
  2063. if CastSpellByID(137619,thisUnit) then return true end
  2064. end
  2065. end
  2066. if shouldFinish() then
  2067. if actionList_Finishers() then return true end
  2068. end
  2069. if actionList_Build() then return end
  2070.  
  2071. if isChecked("Pistol Shot out of range") and #enemyTable5 == 0 and not stealthingAll and power/powerMax*100 >= getOptionValue("Pistol Shot out of range") and (comboDeficit >= 1 or ttm <= 1.2) then
  2072. customCast("pistolShot", true, 20)
  2073. end
  2074. if mode.special == 1 and isChecked("Racial") then
  2075. if race == "BloodElf" and powerDeficit >= (15 + powerRegen) then
  2076. if cast.racial("player") then return true end
  2077. elseif race == "Nightborne" then
  2078. if cast.racial("player") then return true end
  2079. elseif race == "LightforgedDraenei" then
  2080. if cast.racial("target","ground") then return true end
  2081. end
  2082. end
  2083.  
  2084. end
  2085.  
  2086. if isChecked("Debug Timers") then
  2087. if profile.totalIterations == nil then profile.totalIterations = 0 end
  2088. if profile.elapsedTime == nil then profile.elapsedTime = 0 end
  2089. profile.currentTime = debugprofilestop()-startTime
  2090. profile.totalIterations = profile.totalIterations + 1
  2091. profile.elapsedTime = profile.elapsedTime + debugprofilestop()-startTime
  2092. profile.averageTime = profile.elapsedTime / profile.totalIterations
  2093. end
  2094. end
  2095. local id = 260
  2096. if br.rotations[id] == nil then br.rotations[id] = {} end
  2097. tinsert(br.rotations[id],{
  2098. name = rotationName,
  2099. toggles = createToggles,
  2100. options = createOptions,
  2101. run = runRotation,
  2102. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement