Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Destro Warlock Script by demisehi
- --
- --Table of Contents:
- --
- --Common - line
- --Lock lists - line
- --Buffs - line
- --Offensive CDs - line
- --Defensive CDs - line
- --MultiDot - line
- --Rotation start - line
- --AoEMode - line
- --Single Target - line
- --
- -- COMMON
- local lastimmo = 0;
- local immoDelay = 0;
- local lastdsm = 0;
- local lastfbimmo = 0;
- local destrohasFocus = false;
- local havocExists = 0;
- local lastcote = 0;
- maxEnemies = 0;
- function _destrolockLists()
- local highDuration,highDPS,lowUnits = {},{},{};
- for index=1, #enemiesList do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- --HighDuration-- and _LoS("_bgTar")
- if not _immuneMagic("_bgTar") and not _immuneCheck("_bgTar") and _LoS("_bgTar") and not _isPlayer("_bgTar") then
- table.insert(highDuration,{guid=UnitGUID("_bgTar"),duration=_destrototalDotDuration("_bgTar"),dps=_pDestroDotDPS("_bgTar")});
- --Highest DPS List--
- --Lowest Units List--
- table.insert(highDPS,{guid=UnitGUID("_bgTar"),duration=_destrototalDotDuration("_bgTar"),dps=_pDestroDotDPS("_bgTar")});
- table.insert(lowUnits,{guid=UnitGUID("_bgTar"),duration=_destrototalDotDuration("_bgTar"),dps=_pDestroDotDPS("_bgTar")});
- end
- end
- table.sort(highDuration, function(x,y) return x.duration > y.duration end)
- table.sort(highDPS, function(x,y) return x.dps > y.dps end)
- table.sort(lowUnits, function(x,y) return x.duration < y.duration end)
- return highDuration,highDPS,lowUnits;
- end
- function warlockDestructionBuffs(buffInCombat)
- if buffInCombat == nil then buffInCombat = false; end
- if IsMounted() ~= 1 or not fawHasBuff("Zen Flight") then
- -- Check Alchemy Flask
- if GetItemCount(75525, false, true) > 0 then
- if not fawHasBuff("Enhanced Intellect") and not fawHasBuff("Flask of the Warm Sun") then
- UseItemByName("Alchemist's Flask");
- end
- end
- if not fawHasBuffAny("Dark Intent") and not fawHasBuffAny("Arcane Brilliance") and not fawHasBuffAny("Burning Wrath") then
- if fawCastSelf("Dark Intent") then return; end
- end
- end
- return false;
- end
- function warlockDestroOffensiveCooldowns()
- if UseCooldowns and not fawAmIChanneling() and fawIsBoss() then
- if not fawHasBuff("Dark Soul: Instability") and (GetTime() - lastdsm > 3) then
- if fawHasTalent("Archimonde's Darkness") then
- if GetSpellCharges("Dark Soul: Instability") >= 2 then
- if fawCastSelf("Dark Soul: Instability") then
- lastdsm = GetTime();
- return;
- end
- elseif GetSpellCharges("Dark Soul: Instability") > 0 and mySpellPower > 47000 then
- if fawCastSelf("Dark Soul: Instability") then
- lastdsm = GetTime();
- return;
- end
- end
- else
- if fawCastSelf("Dark Soul: Instability") and (mySpellPower > 47000 or _getHp("target") <= 10) then
- lastdsm = GetTime();
- return;
- end
- end
- end
- if fawIsBoss() and (fawHasPewPew() or fawHealth("target") <= 20) and GetItemCooldown(76093) == 0 then
- UseItemByName("Potion of the Jade Serpent");
- end
- if (fawHealth("target") < 20 or fawCalculateTimeToDie("target") < 61) and fawIsBoss() then
- if fawCast("Summon Doomguard") then return; end
- end
- fawUseCooldowns();
- end
- end
- function warlockDestroDefensiveCooldowns()
- if UseDefensiveCooldowns then
- --Dark Bargain--
- if fawHasTalent("Dark Bargain") then
- if _getHp("player") <= 25 then
- _Cast(110913);
- end
- end
- --Dark Regen
- if fawHasTalent("Dark Regeneration") then
- if _getHp("player") <= 35 then
- _Cast(108359);
- end
- end
- --SacrificialPact--
- if fawHasTalent("Sacrificial Pact") then
- if _getHp("player") <= 40 then
- _Cast(108416);
- end
- end
- --Unending resolve--
- if not fawHasGlyph("Glyph of Eternal Resolve") then
- if _getHp("player") <= 50 then
- _Cast(104773);
- end
- end
- --Healthstone
- if GetItemCount(5512, false, true) > 0 and fawHealth("player") < math.random(20,30) and GetItemCooldown(5512) == 0 then
- UseItemByName("Healthstone");
- end
- --Ember Tap
- if myEmbers >= 12 and _getHp("player") <= 20 then
- _Cast(114635);
- end
- end
- end
- function warlockDestroShadowburn()
- for index=1, #enemiesList do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- --Shadowburn and Cbolt logic
- if _getHp("_bgTar") <= 20 and _amIfacing("_bgTar") and _enemyincombat("_bgTar") and not UnitIsDeadOrGhost("_bgTar") and not UnitIsUnit("target","_bgTar") then
- if _getHp("_bgTar") <= 10 and myEmbers >= 11 then
- TargetUnit("_bgTar");
- _Cast(17877,"target");
- TargetLastTarget();
- elseif _getHp("_bgTar") > 10 and myEmbers >= 11 and mySpellPower > 47000 then
- TargetUnit("_bgTar");
- _Cast(17877,"target");
- TargetLastTarget();
- elseif myEmbers >= 35 then
- TargetUnit("_bgTar");
- _Cast(17877,"target");
- TargetLastTarget();
- end
- end
- end
- for index=1, #enemiesList do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- --Shadowburn and Cbolt logic
- if _getHp("target") <= 20 and _amIfacing("target") and _enemyincombat("target") then
- if _getHp("target") <= 10 and myEmbers >= 11 then
- _Cast(17877,"target");
- elseif _getHp("target") > 10 and myEmbers >= 11 and mySpellPower > 47000 then
- _Cast(17877,"target");
- elseif myEmbers >= 35 then
- _Cast(17877,"target");
- end
- end
- end
- end
- function warlockDestroAOE()
- warlockDestroShadowburn();
- if UnitExists("target") and not UnitBuffID("player",108683,"player") and myEmbers >= 25 then
- _Cast(108683);
- end
- if UnitBuffID("player",108683,"player") then
- --FnB Immolate
- if myEmbers >= 25 and _debuffRemains("target",348,"player") <= 3 and not UnitDebuffID("target",172,"player") and not _immuneCheck("target") and not _immuneMagic("target") and _getHp("_bgTar") >= 5 and UnitHealthMax("target") > 2000000 then
- if not fnbimmoDelay or GetTime() - fnbimmoDelay > 0.8 then
- _Cast(172,"target",true);
- end
- end
- if _enemyincombat("target") and not UnitDebuffID("target",104225) and not UnitDebuffID("target",58410) and not UnitDebuffID("target",1490) and (GetTime() - lastcote > 1) then
- _Cast(1490,"target");
- lastcote = GetTime();
- end
- --Conflagrate
- if myEmbers >= 21 and _spellCooldown(17962) == 0 and GetSpellCharges(17962) > 0 and not UnitDebuffID("target",80240,"player") then
- _Cast(17962,"target",true);
- end
- if myEmbers > 11 then
- _Cast(686,"target",true);
- end
- end
- for index=1,maxEnemies do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- --Rain of Fire Target
- if not UnitDebuffID("target",104232,"player") and _getMana("player") > 30 then
- _AeCast(104232,"target",true)
- end
- end
- for index=1,maxEnemies do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- if _spellCooldown(80240) == 0 and not UnitIsUnit("target","_bgTar") and myEmbers >= 15 and _amIfacing("_bgTar") and _enemyincombat("_bgTar") then
- _Cast(80240,"_bgTar",true);
- end
- end
- if UnitBuffID("player",80240,"player") then
- for index=1,maxEnemies do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- if _getHp("_bgTar") <= 20 and not UnitDebuffID("_bgTar",80240,"player") and _amIfacing("_bgTar") and _LoS("_bgTar") and myEmbers >= 11 and _enemyincombat("_bgTar") then
- TargetUnit("_bgTar");
- _Cast(17877,"target");
- TargetLastTarget();
- end
- end
- for index=1,maxEnemies do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- if not UnitDebuffID("target",80240,"player") and myEmbers >= 11 and _getHp("_bgTar") > 20 and (not cboltDelay or GetTime() - cboltDelay > 0.5) and _enemyincombat("_bgTar") then
- _Cast(116858,"target");
- end
- end
- end
- for index=1,maxEnemies do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- --Immolate on Target (3 sec refresh regardless)
- if _debuffRemains("target",348,"player") <= 3 and _enemyincombat("target") and not _immuneCheck("target") and not _immuneMagic("target") and _getHp("target") >= 5 and UnitHealthMax("target") > 2000000 then
- if not immoDelay or GetTime() - immoDelay > 0.5 then
- _Cast(348,"target",true);
- end
- end
- end
- for index=1,maxEnemies do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- --Immolate on Target (3 sec refresh regardless)
- if _debuffRemains("_bgTar",348,"player") <= 3 and _enemyincombat("_bgTar") and _amIfacing("_bgTar") and not _immuneCheck("_bgTar") and not _immuneMagic("_bgTar") and _getHp("_bgTar") >= 5 and UnitHealthMax("target") > 2000000 then
- if not immoDelay or GetTime() - immoDelay > 0.5 then
- _Cast(348,"_bgTar",true);
- end
- end
- end
- for index=1,maxEnemies do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- --Conflagrate
- if _spellCooldown(17962) == 0 and GetSpellCharges(17962) > 0 and not UnitBuffID("player",117828,"player") then
- _Cast(17962,"target",true);
- end
- --Incinerate
- _Cast(29722);
- --Fel Flame
- if not UnitDebuffID("target",104232,"player") and _getMana("player") > 25 then
- _AeCast(104232,"target",true)
- end
- if _isMoving("player") then
- _Cast(77799)
- end
- end
- end
- function warlockDestroMDOT()
- --Havoc _bgTar
- for index=1, #enemiesList do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- if _spellCooldown(80240) == 0 and not UnitIsUnit("target","_bgTar") and myEmbers >= 15 and _amIfacing("_bgTar") and _enemyincombat("_bgTar") then
- _Cast(80240,"_bgTar",true);
- end
- end
- --Shadowburn or Chaos Bolt a target while Havoc is on another
- if UnitBuffID("player",80240,"player") then
- for index=1, #enemiesList do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- if _getHp("_bgTar") <= 20 and not UnitDebuffID("_bgTar",80240,"player") and _amIfacing("_bgTar") and _LoS("_bgTar") and myEmbers >= 11 and _enemyincombat("_bgTar") then
- TargetUnit("_bgTar");
- _Cast(17877,"target");
- TargetLastTarget();
- end
- end
- for index=1, #enemiesList do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- if not UnitDebuffID("target",80240,"player") and myEmbers >= 11 and _getHp("_bgTar") > 20 and (not cboltDelay or GetTime() - cboltDelay > 0.5) and _enemyincombat("_bgTar") then
- _Cast(116858,"target");
- end
- end
- end
- --Shadowburn low health
- warlockDestroShadowburn();
- --MultiDot code
- for index=1, #enemiesList do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- --Immolate and _getHp("target") >= 1
- if _destroDotDPS(348) > _immolatePower("target")*1.20 and _enemyincombat("target") and _amIfacing("target") and not _immuneCheck("target") and not _immuneMagic("target") and not UnitDebuffID("target",80240,"player") and not UnitBuffID("player",80240,"player") and UnitHealthMax("target") > 2000000 then
- if not immoDelay or GetTime() - immoDelay > 0.5 then
- _Cast(348,"target",true);
- end
- end
- --Immolate on Target (3 sec refresh regardless) and _getHp("target") >= 1
- if _debuffRemains("target",348,"player") <= 3 and _enemyincombat("target") and _amIfacing("target") and not _immuneCheck("target") and not _immuneMagic("target") and not UnitDebuffID("target",80240,"player") and not UnitBuffID("player",80240,"player") and UnitHealthMax("target") > 2000000 then
- if not immoDelay or GetTime() - immoDelay > 0.5 then
- _Cast(348,"target",true);
- end
- end
- end
- for index=1, #enemiesList do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- --and UnitAffectingCombat("_bgTar") and _getHp("_bgTar") >= 1
- if _destroDotDPS(348) > _immolatePower("_bgTar")*1.20 and _enemyincombat("_bgTar") and _amIfacing("_bgTar") and not _immuneCheck("_bgTar") and not _immuneMagic("_bgTar") and UnitHealthMax("_bgTar") > 2000000 then
- if not immoDelay or GetTime() - immoDelay > 0.5 then
- _Cast(348,"_bgTar",true);
- end
- end
- --Immolate on Target (3 sec refresh regardless) and UnitAffectingCombat("_bgTar") and _getHp("_bgTar") >= 1
- if _debuffRemains("_bgTar",348,"player") <= 3 and _enemyincombat("_bgTar") and _amIfacing("_bgTar") and not _immuneCheck("_bgTar") and not _immuneMagic("_bgTar") and UnitHealthMax("_bgTar") > 2000000 then
- if not immoDelay or GetTime() - immoDelay > 0.5 then
- _Cast(348,"_bgTar",true);
- end
- end
- --Curse of the Elements and UnitAffectingCombat("_bgTar")
- if destrohasAllDots("_bgTar") and _amIfacing("_bgTar") and not UnitDebuffID("_bgTar",104225) and _enemyincombat("_bgTar") and not UnitDebuffID("_bgTar",58410) and not UnitDebuffID("_bgTar",1490) and UnitHealthMax("_bgTar") > 2000000 then
- _Cast(1490,"_bgTar");
- end
- end
- for index=1, #enemiesList do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- if not UnitDebuffID("_bgTar",104232,"player") and _enemyincombat("_bgTar") and _getMana("player") > 40 and _amIfacing("_bgTar") then
- _AeCast(104232,"_bgTar",true)
- end
- end
- for index=1, #enemiesList do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- --Conflag
- if destrohasAllDots("target") and _spellCooldown(17962) == 0 and GetSpellCharges(17962) > 0 and fawBuffStacks("Backdraft","player") < 3 and not UnitDebuffID("target",80240,"player") then
- _Cast(17962,"target");
- end
- --Chaos Bolt and not UnitBuffID("player",117828,"player")
- if myEmbers >= 11 and mySpellPower > 47000 and not _isMoving("player") and not UnitDebuffID("target",80240,"player") and _getHp("target") > 20 then
- if not cboltDelay or GetTime() - cboltDelay > 0.5 then
- _Cast(116858,"target");
- end
- end
- if myEmbers >= 35 and not _isMoving("player") and not UnitDebuffID("target",80240,"player") and _getHp("target") > 20 then
- if not cboltDelay or (GetTime() - cboltDelay > 0.5) then
- _Cast(116858,"target");
- end
- end
- end
- for index=1, #enemiesList do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- --Incinerate
- if destrohasAllDots("target") and not UnitDebuffID("target",80240,"player") and _enemyincombat("target") then
- _Cast(29722);
- end
- if _isMoving("player") and not UnitDebuffID("target",80240,"player") then
- if not UnitDebuffID("_bgTar",104232,"player") and _enemyincombat("_bgTar") and _getMana("player") > 40 and _amIfacing("_bgTar") then
- _AeCast(104232,"_bgTar",true)
- end
- _Cast(77799);
- end
- end
- end
- function warlockDestructionRotation()
- enemiesList = GetEnemies("player",40);
- if #enemiesList > 6 then
- maxEnemies = 6;
- else
- maxEnemies = #enemiesList;
- end
- --highDuration,highDPS,lowUnits = _destrolockLists();
- if UnitCastingInfo("player") == GetSpellInfo(116858) then cboltDelay = GetTime(); end
- if UnitCastingInfo("player") == GetSpellInfo(348) then immoDelay = GetTime(); end
- if UnitCastingInfo("player") == GetSpellInfo(172) then fnbimmoDelay = GetTime(); end
- if not fawGCDDone() then return; end
- if fawAmICasting() then return; end
- if warlockDestructionBuffs(true) then return; end
- myEmbers = UnitPower("player", 14, true)
- local immolateCastTime = fawSpellCastTime("Immolate");
- local chaosBoltCastTime = fawSpellCastTime("Chaos Bolt");
- mySpellPower = GetSpellBonusDamage(6);
- myCrit = GetSpellCritChance(6);
- fawInterrupt("Command Demon");
- fawInterrupt("Spell Lock");
- fawInterruptPet("Spell Lock");
- if fawValidEnemy("target", "Chaos Bolt") then
- warlockDestroOffensiveCooldowns();
- warlockDestroDefensiveCooldowns();
- if not fawValidFriend("pet") and not fawHasTalent("Grimoire of Sacrifice") and fawHasTalent("Grimoire of Supremacy") then
- if UnitAffectingCombat("player") ~= 1 then
- if fawCastSelf("Summon Fel Imp", fawSpellCastTime("Summon Fel Imp")*1000) then return; end
- else
- _Cast(120451);
- end
- end
- if not UnitExists("pet") and myEmbers >= 11 and UnitAffectingCombat("player") and not fawHasTalent("Grimoire of Sacrifice") then
- _Cast(120451);
- end
- if sweep then
- if fawHasTalent("Shadowfury") and fawSpellCooldown("Shadowfury") == 0 then
- fawCastSelf("Shadowfury")
- if AreaSpellIsPending() then
- CastAtLocation(Target:GetLocation())
- end
- elseif fawHasTalent("Demonic Breath") and fawSpellCooldown("Demonic Breath") == 0 then
- if fawCastSelf("Demonic Breath", 2500) then return; end
- end
- end
- if fawAmICasting() or fawAmIChanneling() then return; end
- if aoem then
- warlockDestroAOE();
- else
- if not aoem and UnitBuffID("player",108683,"player") then
- CancelUnitBuff("player","Fire and Brimstone");
- end
- if mdot then
- warlockDestroMDOT();
- else
- warlockDestroShadowburn();
- for index=1, #enemiesList do
- ISetAsUnitID(enemiesList[index],"_bgTar");
- if destrohasAllDots("target") and _amIfacing("target") and not UnitDebuffID("target",104225) and _enemyincombat("target") and not UnitDebuffID("target",58410) and not UnitDebuffID("target",1490) then
- _Cast(1490,"target");
- end
- --Immolate with power
- if _destroDotDPS(348) > _immolatePower("target")*1.20 and _enemyincombat("target") and not _immuneCheck("target") and not _immuneMagic("target") and _getHp("target") >= 1 and (GetTime() - lastimmo > 1.7) then
- if not immoDelay or GetTime() - immoDelay > 0.5 then
- _Cast(348,"target",true);
- end
- end
- --Immolate on Target (3 sec refresh regardless)
- if _debuffRemains("target",348,"player") <= 3 and _enemyincombat("target") and not _immuneCheck("target") and not _immuneMagic("target") and _getHp("target") >= 1 and (GetTime() - lastimmo > 1.7) then
- if not immoDelay or GetTime() - immoDelay > 0.5 then
- _Cast(348,"target",true);
- end
- end
- --Curse of the Elements
- if destrohasAllDots("target") and _enemyincombat("target") and not UnitDebuffID("target",104225) and not UnitDebuffID("target",58410) and not UnitDebuffID("target",1490) then
- _Cast(1490,"target");
- end
- --Conflagrate
- if destrohasAllDots("target") and _spellCooldown(17962) == 0 and GetSpellCharges(17962) >= 2 and not UnitDebuffID("target",80240,"player") then
- _Cast(17962,"target",true);
- end
- --Rain of fire
- --if not UnitDebuffID("target",104232,"player") and destrohasAllDots("target") and _getMana("player") > 25 then
- -- _AeCast(104232,"target",true)
- --end
- --Chaos Bolt and not UnitBuffID("player",117828,"player")
- if _getHp("target") > 20 and _amIfacing("target") and _enemyincombat("target") and myEmbers >= 11 and not _isMoving("player") and not UnitDebuffID("target",80240,"player") and (mySpellPower > 47000 or UnitBuffID("player",114207) or UnitBuffID("player",113858)) then
- if not cboltDelay or GetTime() - cboltDelay > 0.5 then
- _Cast(116858,"target");
- end
- end
- if _getHp("target") > 20 and _amIfacing("target") and _enemyincombat("target") and myEmbers >= 33 and not _isMoving("player") and not UnitBuffID("player",117828,"player") and not UnitDebuffID("target",80240,"player") then
- if not cboltDelay or GetTime() - cboltDelay > 0.5 then
- _Cast(116858,"target");
- end
- end
- --Conflagrate
- if destrohasAllDots("target") and _spellCooldown(17962) == 0 and GetSpellCharges(17962) > 0 and not UnitDebuffID("target",80240,"player") then
- _Cast(17962,"target",true);
- end
- --Incinerate
- if destrohasAllDots("target") then
- _Cast(29722);
- end
- --Fel Flame
- if _isMoving("player") then
- if not UnitDebuffID("target",104232,"player") and destrohasAllDots("target") and _getMana("player") > 25 then
- _AeCast(104232,"target",true)
- end
- _Cast("77799")
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement