diff --git a/main.lua b/main.lua index 8d5765b..3f70bd6 100644 --- a/main.lua +++ b/main.lua @@ -100,7 +100,7 @@ local function gt(percent, value, max) return false end -local function attack() +local function target() if GetUnitName('target') == nil then TargetNearestEnemy() return @@ -111,133 +111,98 @@ local function attack() elseif UnitIsDead('target') == 1 then ClearTarget() return - -- elseif UnitIsPlayer('target') == 1 then - -- ClearTarget() - -- return end + end +end - local mana = UnitMana('player') - local health = UnitHealth('player') +local function dps(cp) + local mana = UnitMana('player') + local health = UnitHealth('player') - if (not PlayerFrame.inCombat) then - AttackTarget() - else - cast('Faerie Fire (Feral)') - -- if isUsable('Reshift') and mana <= 60 and not buffed('Tiger\'s Fury', 'player') then - -- cast('Reshift') + if (not PlayerFrame.inCombat) then + AttackTarget() + else + if comboPoints() < cp then if isUsable('Faerie Fire (Feral)') and not buffed('Faerie Fire (Feral)', 'target') and not onCooldown('Faerie Fire (Feral)') then cast('Faerie Fire (Feral)()') elseif isUsable('Tiger\'s Fury') and not buffed('Tiger\'s Fury', 'player') then cast('Tiger\'s Fury') - elseif isUsable('Ferocious Bite') and comboPoints() > 2 then - cast('Ferocious Bite') elseif isUsable('Rake') and not buffed('Rake', 'target') then cast('Rake') elseif isUsable('Rip') and comboPoints() > 0 and not buffed('Rip', 'target') then cast('Rip') - -- elseif isUsable('Shred') then - -- cast('Shred') elseif isUsable('Claw') then cast('Claw') - -- elseif isUsable('Blood Fury') and not onCooldown('Blood Fury') then - -- cast('Blood Fury') - -- elseif not IsAutoRepeatAction(47) then - -- cast('Auto Shot') - -- elseif isUsable('Multi-Shot') and not onCooldown('Multi-Shot') then - -- cast('Multi-Shot') - -- elseif isUsable('Steady Shot') and not onCooldown('Steady Shot') then - -- cast('Steady Shot') - -- elseif isUsable('Baited Shot') and not onCooldown('Baited Shot') then - -- cast('Baited Shot') - -- elseif isUsable('Kill Command') and not onCooldown('Kill Command') then - -- cast('Kill Command') - -- elseif isUsable('Arcane Shot') and not onCooldown('Arcane Shot') then - -- cast('Arcane Shot(Rank 1)') - -- elseif isUsable('Serpent Sting') and not buffed('Serpent Sting', 'target') and - -- healthGtThan(25, UnitHealth('target'), UnitHealthMax('target')) then - -- cast('Serpent Sting') - -- elseif isUsable('Concussive Shot') and not onCooldown('Concussive Shot') then - -- cast('Concussive Shot') + end + elseif comboPoints() >= cp then + if isUsable('Ferocious Bite') then + cast('Ferocious Bite') end end end end -local function bear_solo() - if GetUnitName('target') == nil then - TargetNearestEnemy() - return +local function tank() + local mana = UnitMana('player') + local health = UnitHealth('player') + + if (not PlayerFrame.inCombat) then + AttackTarget() else - if UnitCanAttack('player', 'target') == nil then - ClearTarget() - return - elseif UnitIsDead('target') == 1 then - ClearTarget() - return - end - - local mana = UnitMana('player') - local health = UnitHealth('player') - - if (not PlayerFrame.inCombat) then - AttackTarget() - else + if mana < 10 then if isUsable('Reshift') and mana <= 10 then cast('Reshift') - elseif isUsable('Savage Bite') and not onCooldown('Savage Bite') then - cast('Savage Bite') elseif isUsable('Enrage') and not buffed('Enrage', 'player') and not onCooldown('Enrage') then cast('Enrage') - elseif isUsable('Faerie Fire (Feral)') and not buffed('Faerie Fire (Feral)', 'target') and + end + end + if mana > 60 then + if isUsable('Faerie Fire (Feral)') and not buffed('Faerie Fire (Feral)', 'target') and not onCooldown('Faerie Fire (Feral)') then cast('Faerie Fire (Feral)()') elseif isUsable('Demoralizing Roar') and not buffed('Demoralizing Roar', 'target') then cast('Demoralizing Roar') - elseif isUsable('Maul') then - cast('Maul') end end + if isUsable('Maul') then + cast('Maul') + end end end -local function bear_aoe() - if GetUnitName('target') == nil then - TargetNearestEnemy() - return - else - if UnitCanAttack('player', 'target') == nil then - ClearTarget() - return - elseif UnitIsDead('target') == 1 then - ClearTarget() - return - end +local function dps_st() + target() + dps(5) +end +local function dps_trash() + target() + dps(3) +end - local mana = UnitMana('player') - local health = UnitHealth('player') +local function tank_st() + target() + tank() + if isUsable('Savage Bite') and not onCooldown('Savage Bite') then + cast('Savage Bite') + end +end - if (not PlayerFrame.inCombat) then - AttackTarget() - else - if isUsable('Reshift') and mana <= 10 then - cast('Reshift') - elseif isUsable('Enrage') and not buffed('Enrage', 'player') and not onCooldown('Enrage') then - cast('Enrage') - elseif isUsable('Demoralizing Roar') and not buffed('Demoralizing Roar', 'target') then - cast('Demoralizing Roar') - elseif isUsable('Swipe') then - cast('Swipe') - end - end +local function tank_aoe() + target() + tank() + if isUsable('Swipe') then + cast('Swipe') end end function obd_onLoad() - SlashCmdList['OBD'] = attack - SlashCmdList['OBDBS'] = bear_solo - SlashCmdList['OBDBA'] = bear_aoe - SLASH_OBD1 = '/obd_lvl' - SLASH_OBDBS1 = '/obd_bear_solo' - SLASH_OBDBA1 = '/obd_bear_aoe' + SlashCmdList['DPS_ST'] = dps_st + SlashCmdList['DPS_TRASH'] = dps_trash + SlashCmdList['TANK_ST'] = tank_st + SlashCmdList['TANK_AOE'] = tank_aoe + SLASH_DPS_ST1 = '/dps_st' + SLASH_DPS_TRASH1 = '/dps_trash' + SLASH_TANK_ST1 = '/tank_st' + SLASH_TANK_AOE1 = '/tank_aoe' end