local L = Elementarist.Locals; Elementarist:RegisterModule("enhancement"); Elementarist.enhancement = { ["Configuration"] = { ["ShowHealingStream"] = { ["type"] = "CheckBox", ["vposition"] = -60, ["hposition"] = 10, ["label"] = L.CONFIG_ENABLE_HS_TOTEM } }; Initialize = function(self) Elementarist:LoadSpells({ ["Glyph of Flame Shock"] = GetSpellInfo(55447), ["Healing Stream Totem"] = GetSpellInfo(5394), ["Maelstrom Weapon"] = GetSpellInfo(51530), ["Stormstrike"] = GetSpellInfo(17364), ["Windstrike"] = 115357, -- not in spellbook, ID must be used! ["Lava Lash"] = GetSpellInfo(60103), ["Unleash Flame"] = GetSpellInfo(165462), ["Unleash Elements"] = GetSpellInfo(73680), ["Frost Shock"] = GetSpellInfo(8056), ["Flask of Spring Blossoms"] = GetSpellInfo(76084), ["AscendanceEnhancementBuff"] = GetSpellInfo(114051), ["Elemental Fusion"] = GetSpellInfo(157174), ["Ancestral Swiftness"] = GetSpellInfo(16188), ["Feral Spirit"] = GetSpellInfo(51533), ["Fire Nova"] = GetSpellInfo(1535), ["Flametongue"] = GetSpellInfo(193796), ["Boulderfist"] = GetSpellInfo(201897), ["Greater Draenic Agility Flask"] = GetSpellInfo(156064), ["Draenic Agility Flask"] = GetSpellInfo(156073), ["Flask of Spring Blossoms"] = GetSpellInfo(114769), ["Flask of the Winds"] = GetSpellInfo(79471) }); Elementarist.role = "DPS"; Elementarist.trackAura = Elementarist.SpellList["Flame Shock"]; Elementarist.trackFilter = "PLAYER|HARMFUL"; Elementarist.trackDuration = 39; Elementarist.trackSpread = false; Elementarist.debuffCount = 0; Elementarist.exspell1=nil; end; NextSpell = function(self,timeshift,exspell1,exspell2) local guid = UnitGUID("target") local currentTime = GetTime() local s,d,e local name, fsExpiration, unitCaster local lastSpell local haveFireTotem,fireTotemName,fireTotemStart,fireTotemDuration local EBTalent, EETalent, EFTalent, MWcount, EFcount local LLCharges, maxLLCharges, cdLLStart, cdLLLength local SSCharges, maxSSCharges, cdSSStart, cdSSLength local ascendance, ascendanceExp local flameshockavail = false local spellInCast, sICstartTime, sICendTime local _ ascendance, _, _, _, _, _, ascendanceExp = Elementarist:hasBuff("player", Elementarist.SpellList["AscendanceEnhancementBuff"]) if (ascendance == nil) then ascendanceExp = 0 end if (exspell1) then if (exspell2) then lastSpell = exspell2 else lastSpell = exspell1 end else lastSpell = Elementarist.lastSpell end Elementarist.lastBaseGCD = 1.5 - (1.5 * Elementarist.spellHaste * .01) local LvBct = 2 - (2 * Elementarist.spellHaste * .01) -- if target is dead, return "" if (UnitHealth("target")<=0) then return "" end if (not timeshift) then timeshift = 0 end -- check current spell spellInCast, _, _, _, sICstartTime, sICendTime = UnitCastingInfo("player") if (spellInCast) then if ( (sICendTime - sICstartTime) / 1000 ) < Elementarist.lastBaseGCD then sICendTime = sICstartTime + (Elementarist.lastBaseGCD * 1000) end timeshift = timeshift + (sICendTime / 1000) - currentTime else -- no spell in cast, check global cd via Ghost Wolf if (Elementarist.SpellList["Ghost Wolf"]) then local ftcd = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Ghost Wolf"]) if (ftcd) then timeshift = timeshift + Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Ghost Wolf"]) else timeshift = timeshift + Elementarist.lastBaseGCD end else timeshift = timeshift + Elementarist.lastBaseGCD end end -- Maintain Boulderfist and Landslide -- Maintain Hailstorm (if talented) -- Boulderfist if Maelstorm < 130 and 2 charges of Boulderfist -- Maintaint Flametongue -- Feral Spirit -- Crash Lightning if >3 targets -- Stormstrike -- Crash Lightning if Crasging Storm talent -- Lava Lash if Maelstorm > 110 if Elementarist:ZeroCount(Elementarist.SpellList["Lava Lash"],spellInCast,exspell1,exspell2) and Elementarist:SpellAvailable(Elementarist.SpellList["Lava Lash"]) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Lava Lash"]) if (d-timeshift <= 0.5) and (UnitPower("Player",11)>=110) then return Elementarist.SpellList["Boulderfist"] end end -- Boulderfist if Elementarist:ZeroCount(Elementarist.SpellList["Boulderfist"],spellInCast,exspell1,exspell2) and Elementarist:SpellAvailable(Elementarist.SpellList["Boulderfist"]) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Boulderfist"]) if d-timeshift <= 0.5 then return Elementarist.SpellList["Boulderfist"] end end -- Flametongue if Elementarist:ZeroCount(Elementarist.SpellList["Flametongue"],spellInCast,exspell1,exspell2) and Elementarist:SpellAvailable(Elementarist.SpellList["Flametongue"]) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Flametongue"]) if d-timeshift <= 0.5 then return Elementarist.SpellList["Flametongue"] end end -- Lightning Bolt return Elementarist.SpellList["Lightning Bolt"] end; MiscSpell = function(self) -- Miscelaneous spell order: -- Lightning Shield -- Searing Totem -- Berserking troll racial (if available) -- Blood Fury orc racial local d, e local name, expirationTime, _, name2, expirationTime2, name3, expirationTime3 ------ Augment Rune if ( ( ((Elementarist.faction == "Horde") and (GetItemCount(Elementarist.CustomIDs["Empowered Augment Rune Horde"]) ~= 0)) or ((Elementarist.faction == "Alliance") and (GetItemCount(Elementarist.CustomIDs["Empowered Augment Rune Alliance"]) ~= 0)) ) and ( not Elementarist:hasBuff("player", Elementarist.SpellList["Hyper Augmentation"])) ) then if ( ((Elementarist.faction == "Horde") and (Elementarist:GetItemCooldownRemaining(Elementarist.CustomIDs["Empowered Augment Rune Horde"]) < 2)) or ((Elementarist.faction == "Alliance") and (Elementarist:GetItemCooldownRemaining(Elementarist.CustomIDs["Empowered Augment Rune Alliance"]) < 2)) ) then return nil,GetItemIcon(Elementarist.CustomIDs["Empowered Augment Rune Horde"]) end end -- Alchemy Flask of Enhancement if ( ((GetItemCount(Elementarist.CustomIDs["Whispers of Insanity Item"]) ~= 0) and (Elementarist.playerLevel >= 90) ) or ((GetItemCount(Elementarist.CustomIDs["Crystal of Insanity Item"]) ~= 0)and (Elementarist.playerLevel >= 85) ) or ((GetItemCount(Elementarist.CustomIDs["Alchemist's Flask Item"]) ~= 0) and (Elementarist.playerLevel <= 91) ) ) then name = Elementarist:hasBuff("player", Elementarist.SpellList["Greater Draenic Agility Flask"]); if (name == nil) then name = Elementarist:hasBuff("player", Elementarist.SpellList["Draenic Agility Flask"]); end if (name == nil) then name = Elementarist:hasBuff("player", Elementarist.SpellList["Flask of Spring Blossoms"]); end if (name == nil) then name = Elementarist:hasBuff("player", Elementarist.SpellList["Flask of the Winds"]); end if (name == nil) then name, _, _, _, _, _, expirationTime = Elementarist:hasBuff("player", Elementarist.SpellList["Whispers of Insanity"], false, Elementarist.CustomIDs["Whispers of Insanity Spell"]); name2, _, _, _, _, _, expirationTime2 = Elementarist:hasBuff("player", Elementarist.SpellList["Crystal of Insanity"], false, Elementarist.CustomIDs["Crystal of Insanity Spell"]); name3, _, _, _, _, _, expirationTime3 = Elementarist:hasBuff("player", Elementarist.SpellList["Alchemist's Flask"], false, Elementarist.CustomIDs["Alchemist's Flask Spell"]); if ((name == nil) and (name2 == nil) and (name3 == nil)) or (((name ~= nil) and (expirationTime<2)) or ((name2 ~= nil) and (expirationTime2<2)) or ((name3 ~= nil) and (expirationTime3<2))) then if (GetItemCount(Elementarist.CustomIDs["Whispers of Insanity Item"]) ~= 0) then local itemCooldown = Elementarist:GetItemCooldownRemaining(Elementarist.CustomIDs["Whispers of Insanity Item"]); if ((name == nil) or (expirationTime < 2)) and (itemCooldown < 1) then return nil,GetItemIcon(Elementarist.CustomIDs["Whispers of Insanity Item"]) end elseif (GetItemCount(Elementarist.CustomIDs["Crystal of Insanity Item"]) ~= 0) then local itemCooldown = Elementarist:GetItemCooldownRemaining(Elementarist.CustomIDs["Crystal of Insanity Item"]); if ((name == nil) or (expirationTime < 2)) and (itemCooldown < 1) then return nil,GetItemIcon(Elementarist.CustomIDs["Crystal of Insanity Item"]) end elseif (GetItemCount(Elementarist.CustomIDs["Alchemist's Flask Item"]) ~= 0) then local itemCooldown = Elementarist:GetItemCooldownRemaining(Elementarist.CustomIDs["Alchemist's Flask Item"]); if ((name == nil) or (expirationTime < 2)) and (itemCooldown < 1) then return nil,GetItemIcon(Elementarist.CustomIDs["Alchemist's Flask Item"]) end end end end end -- Lightning Shield if Elementarist:SpellAvailable(Elementarist.SpellList["Lightning Shield"]) then name, _, _, _, _, _, expirationTime = Elementarist:hasBuff("player", Elementarist.SpellList["Lightning Shield"]); if (name == nil) or (expirationTime < 1) then return Elementarist.SpellList["Lightning Shield"] end end -- Fire Elemental Totem if Elementarist:SpellAvailable(Elementarist.SpellList["Fire Elemental Totem"]) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Fire Elemental Totem"]) if d <= 0.5 then return Elementarist.SpellList["Fire Elemental Totem"] end end -- Liquid Magma if not in rotation and Tier7 talent is Liquid Magma and fire totem has 10 sec or more if (Elementarist.tier7Talent == 21200) and (ElementaristDB.DisableLM) then local haveFireTotem,fireTotemName,fireTotemStart,fireTotemDuration = GetTotemInfo(1); if (fireTotemName ~= "") and (fireTotemDuration and (fireTotemStart + fireTotemDuration - GetTime() ) >= 10) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Liquid Magma"]) if (d<=0.5) then return Elementarist.SpellList["Liquid Magma"] end end end -- Storm Elemental Totem if (Elementarist.tier7Talent == 21199) then if Elementarist:SpellAvailable(Elementarist.SpellList["Storm Elemental Totem"]) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Storm Elemental Totem"]) if d <= 0.5 then return Elementarist.SpellList["Storm Elemental Totem"] end end end -- Healing Stream Totem if (ElementaristDB.ShowHealingStream) and (Elementarist:SpellAvailable(Elementarist.SpellList["Healing Stream Totem"])) then local haveWaterTotem,waterTotemName,_,_ = GetTotemInfo(3) if (waterTotemName == "") then e = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Healing Stream Totem"]); if (e < 1) then return Elementarist.SpellList["Healing Stream Totem"]; end; end end -- Feral Spirit if Elementarist:SpellAvailable(Elementarist.SpellList["Feral Spirit"]) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Feral Spirit"]) if d <= 0.5 then return Elementarist.SpellList["Feral Spirit"] end end -- Elemental Mastery if Elementarist:SpellAvailable(Elementarist.SpellList["Elemental Mastery"]) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Elemental Mastery"]) if d <= 0.5 then return Elementarist.SpellList["Elemental Mastery"] end end -- Ascendance if Elementarist:SpellAvailable(Elementarist.SpellList["Ascendance"]) then name = Elementarist:hasBuff("player",Elementarist.SpellList["AscendanceElementalBuff"]) if (name == nil) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Ascendance"]) if d <= 0.5 then return Elementarist.SpellList["Ascendance"] end end end -- Berserking if Elementarist:SpellAvailable(Elementarist.SpellList["Berserking"]) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Berserking"]) if d <= 0.5 then return Elementarist.SpellList["Berserking"] end end -- Blood Fury if Elementarist:SpellAvailable(Elementarist.SpellList["Blood Fury"]) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Blood Fury"]) if d <= 0.5 then return Elementarist.SpellList["Blood Fury"] end end return "" end; IntSpell = function(self) -- interruptions, purge, and AoE on target local d Elementarist.trackSpread = (Elementarist.lastSpell == Elementarist.SpellList["Flame Shock"]) -- AOE at least 3 enemies if (Elementarist.person["foeCount"]>=3) then -- Searing Totem if no fire totem or fire totem about to expire local haveFireTotem,fireTotemName,fireTotemStart,fireTotemDuration = GetTotemInfo(1); if ( (fireTotemName == "") or (fireTotemName == "Searing Totem") or (fireTotemDuration and (fireTotemStart + fireTotemDuration - GetTime() ) <= 0) ) then return Elementarist.SpellList["Magma Totem"]; end -- Liquid if not in rotation and Tier7 talent is Liquid Magma and fire totem has 10 sec or more if (Elementarist.tier7Talent == 21200) then if (fireTotemName ~= "") and (fireTotemDuration and (fireTotemStart + fireTotemDuration - GetTime() ) >= 10) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Liquid Magma"]) if (d<=0.5) then return Elementarist.SpellList["Liquid Magma"] end end end -- Flame shock if <9 sec remaining and Unleash Flame is up local name, _, _, _, _, _, fsExpiration, unitCaster = Elementarist:hasDeBuff("target", Elementarist.SpellList["Flame Shock"], "player"); if (not fsExpiration) then fsExpiration = 0 end d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Flame Shock"]) if (d <= 0.5) and (fsExpiration - GetTime() < 9) then return Elementarist.SpellList["Flame Shock"] end if Elementarist.trackSpread then local LLCharges, maxLLCharges, cdLLStart, cdLLLength = GetSpellCharges(Elementarist.SpellList["Lava Lash"]); if (LLCharges > 0) then return Elementarist.SpellList["Lava Lash"] end end d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Fire Nova"]) if ((d ) <= 0.5) then return Elementarist.SpellList["Fire Nova"] end ---- Chain Lightning in place of Lightning Bolt if Elementarist.exspell1 == Elementarist.SpellList["Lightning Bolt"] then if Elementarist:SpellAvailable(Elementarist.SpellList["Chain Lightning"]) then return Elementarist.SpellList["Chain Lightning"] end end return Elementarist.exspell1 end -- Wind Shear if Elementarist:SpellAvailable(Elementarist.SpellList["Wind Shear"]) then if IsSpellInRange(Elementarist.SpellList["Wind Shear"], "target") == 1 then local _, status, threatpct, _, _ = UnitDetailedThreatSituation("player", "target") if ((UnitCastingInfo("target")) or (UnitChannelInfo("target"))) or ((status) and (threatpct>80) and (Elementarist.person["friendCount"]>1) and (Elementarist.inParty>0)) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Wind Shear"]) if (d) and (d<0.5) and (IsSpellInRange(Elementarist.SpellList["Wind Shear"], "target") ) then return Elementarist.SpellList["Wind Shear"] end end if (UnitChannelInfo("target")) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Wind Shear"]) if (d<0.5) and (interruptable) and (IsSpellInRange(Elementarist.SpellList["Wind Shear"], "target") ) then return Elementarist.SpellList["Wind Shear"] end end end end ---------- check if purgeable buff is on target (not sure if this is ok) if Elementarist:SpellAvailable(Elementarist.SpellList["Purge"]) then if IsSpellInRange(Elementarist.SpellList["Purge"], "target") == 1 then if (Elementarist:hasBuff("target", ".", 1)) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Purge"]) if (d) and (d<0.5) then return Elementarist.SpellList["Purge"] end end end end return "" end; ShieldName = function(self) return "Lightning Shield"; end; };