From c29f3fa07d8916ccd95027e002b98d81bbececdf Mon Sep 17 00:00:00 2001 From: Taracque Date: Sun, 28 Aug 2016 21:35:45 +0200 Subject: [PATCH] =?UTF-8?q?7.0=20compatible=20version,=20major=20code=20rewr?= =?UTF-8?q?ite=20and=20cleanup=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Change_log.txt | 3 + Ele_GUI.lua | 36 ------- Elementarist.lua | 102 ++---------------- Elementarist.toc | 4 +- Localization_enUS.lua | 3 - modules/elemental.lua | 283 +++++++++---------------------------------------- 6 files changed, 66 insertions(+), 365 deletions(-) diff --git a/Change_log.txt b/Change_log.txt index a86578f..e22ddd6 100755 --- a/Change_log.txt +++ b/Change_log.txt @@ -1,3 +1,6 @@ +** v3.8.0 +* 7.0 compatibility + ***v3.7.0 Code optimization and pre-release testing ***V3.6.6 diff --git a/Ele_GUI.lua b/Ele_GUI.lua index 82f09b1..146bae8 100755 --- a/Ele_GUI.lua +++ b/Ele_GUI.lua @@ -694,42 +694,6 @@ function Elementarist:CreateGUI() t:SetText("") Elementarist.textList["dps"] = t - t = displayFrame_next:CreateFontString("$parent_nextText","OVERLAY","GameFontHighlightLarge"); - t:SetAllPoints(displayFrame_next) - t:SetAlpha(1); - t:SetText(""); - t:SetJustifyH("RIGHT"); - t:SetJustifyV("BOTTOM"); - t:SetTextHeight(16); - Elementarist.textList["next"] = t - - t = displayFrame_next1:CreateFontString("$parent_nextText","OVERLAY","GameFontHighlightLarge"); - t:SetAllPoints(displayFrame_next1) - t:SetAlpha(1); - t:SetText(""); - t:SetJustifyH("RIGHT"); - t:SetJustifyV("BOTTOM"); - t:SetTextHeight(16); - Elementarist.textList["next1"] = t - - t = displayFrame_next2:CreateFontString("$parent_nextText","OVERLAY","GameFontHighlightLarge"); - t:SetAllPoints(displayFrame_next2) - t:SetAlpha(1); - t:SetText(""); - t:SetJustifyH("RIGHT"); - t:SetJustifyV("BOTTOM"); - t:SetTextHeight(16); - Elementarist.textList["next2"] = t - - t = displayFrame_int:CreateFontString("$parent_intText","OVERLAY","GameFontHighlightLarge"); - t:SetAllPoints(displayFrame_int) - t:SetAlpha(1); - t:SetText(""); - t:SetJustifyH("RIGHT"); - t:SetJustifyV("BOTTOM"); - t:SetTextHeight(16); - Elementarist.textList["int"] = t - displayFrame:SetScript("OnUpdate", function(this, elapsed) Elementarist:OnUpdate(elapsed) end) diff --git a/Elementarist.lua b/Elementarist.lua index c9881d9..ddd0830 100755 --- a/Elementarist.lua +++ b/Elementarist.lua @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Elementarist 3.7.0 Release +-- Elementarist 3.8.0 Release -- -- Shows the advised spell for an elemental shaman for optimal DPS output. ------------------------------------------------------------------------------- @@ -8,7 +8,7 @@ Elementarist = {Locals = {}} local L = Elementarist.Locals -Elementarist.versionNumber = '3.7.0'; +Elementarist.versionNumber = '3.8.0'; Elementarist.enabled = true; Elementarist.playerName = UnitName("player") Elementarist.playerGUID = UnitGUID("player") @@ -49,12 +49,6 @@ Elementarist.role = "" Elementarist.faction = nil Elementarist.talentUnsure = true Elementarist.callbacks = {}; -Elementarist.tier4Talent = nil -Elementarist.tier6Talent = nil -Elementarist.tier7Talent = nil -Elementarist.hasT17_4pcs = false -Elementarist.hasT18_4pcs = false -Elementarist.hasT18_Class_Trinket = false Elementarist.lastSpell = "" Elementarist.lastCastTime = 0 Elementarist.CustomIDs = { @@ -71,7 +65,6 @@ Elementarist.CustomIDs = { } Elementarist.SpellList = { ["Ghost Wolf"] = GetSpellInfo(2645), - ["Flame Shock"] = GetSpellInfo(8050), ["Lightning Bolt"] = GetSpellInfo(403), ["Lava Burst"] = GetSpellInfo(51505), ["Chain Lightning"] = GetSpellInfo(421), @@ -132,9 +125,6 @@ Elementarist.ArmorSets = { } Elementarist.textList = { - ["next"] = nil, - ["next1"] = nil, - ["next2"] = nil, ["dps"] = nil, ["debuff"] = nil, ["shield"] = nil @@ -204,9 +194,6 @@ function Elementarist.events.PLAYER_ALIVE() -- check anything Elementarist:detectTalent() Elementarist:detectiLevel(); - Elementarist.hasT17_4pcs = Elementarist:HasSetBonus( 165580, 4 ); - Elementarist.hasT18_4pcs = Elementarist:HasSetBonus( 185872, 4 ); - Elementarist.hasT18_Class_Trinket = Elementarist:HasTrinket(124521); Elementarist:ApplySettings() -- Elementarist.eventFrame:UnregisterEvent("PLAYER_ALIVE") @@ -216,9 +203,6 @@ function Elementarist.events.PLAYER_ENTERING_WORLD() Elementarist:detectTalent(); if Elementarist.isEnabled() then Elementarist:detectiLevel(); - Elementarist.hasT17_4pcs = Elementarist:HasSetBonus( 165580, 4 ); - Elementarist.hasT18_4pcs = Elementarist:HasSetBonus( 185872, 4 ); - Elementarist.hasT18_Class_Trinket = Elementarist:HasTrinket(124521); Elementarist.faction = UnitFactionGroup("player"); if (ElementaristDB.DebugMode) then Elementarist.DebugChat = Elementarist:GetDebugFrame() @@ -231,10 +215,6 @@ end function Elementarist.events.PLAYER_EQUIPMENT_CHANGED() Elementarist:detectiLevel(); - Elementarist.hasT17_4pcs = Elementarist:HasSetBonus( 165580, 4 ); - Elementarist.hasT18_4pcs = Elementarist:HasSetBonus( 185872, 4 ); - Elementarist.hasT18_Class_Trinket = Elementarist:HasTrinket(124521); - end function Elementarist.events.PLAYER_LOGIN() @@ -281,9 +261,6 @@ function Elementarist.events.ADDON_LOADED(addon) -- check class specializations and load any files with that name from modules folder Elementarist:detectTalent() - -- get current buff statuses - Elementarist:TrackAuraSaveBuffStatus () - -- detect equiped item level Elementarist:detectiLevel() @@ -367,10 +344,7 @@ function Elementarist:InitSettings() if ElementaristDB.enableEQ == nil then ElementaristDB.enableEQ = false end if ElementaristDB.advisordisabled == nil then ElementaristDB.advisordisabled = false end if ElementaristDB.DebugMode == nil then ElementaristDB.DebugMode = false end - if ElementaristDB.trackAuraBuffs == nil then ElementaristDB.trackAuraBuffs = true end if ElementaristDB.DpsTxtDisabled == nil then ElementaristDB.DpsTxtDisabled = false end - if ElementaristDB.maximizeFS == nil then ElementaristDB.maximizeFS = false end - if ElementaristDB.doFSThreshold == nil then ElementaristDB.doFSThreshold = 12 end if ElementaristDB.disableLM == nil then ElementaristDB.disableLM = false end if ElementaristDB.showHealingStream == nil then ElementaristDB.showHealingStream = false end end @@ -434,9 +408,6 @@ function Elementarist:detectTalent() -- for first spec use restoration file talent = "restoration" end - _, Elementarist.tier4Talent = GetTalentRowSelectionInfo(4); - _, Elementarist.tier6Talent = GetTalentRowSelectionInfo(6); - _, Elementarist.tier7Talent = GetTalentRowSelectionInfo(7); -- check there is a registed module for the specicilisation and configuration infomration is saved in the ElemenatlistDB varriables if (talent ~= "") and (talent ~= Elementarist.talent) then @@ -562,7 +533,6 @@ function Elementarist.events.COMBAT_LOG_EVENT_UNFILTERED(timestamp, event, hideC if srcName == Elementarist.playerName then if (srcGUID == Elementarist.playerGUID) and (spellName==Elementarist.trackAura) and (Elementarist.auraCooldowns[dstGUID]) then Elementarist.auraCooldowns[dstGUID]["action"] = GetTime() - Elementarist:TrackAuraSaveBuffStatus() end if (event=="SPELL_CAST_START") then Elementarist.SFHistory.spell = nil @@ -582,9 +552,6 @@ function Elementarist.events.COMBAT_LOG_EVENT_UNFILTERED(timestamp, event, hideC Elementarist.auraCooldowns[dstGUID]["start"] = GetTime() Elementarist.auraCooldowns[dstGUID]["duration"] = Elementarist.trackDuration; Elementarist.auraCooldowns[dstGUID]["action"] = GetTime() - -- add saved status of buffs to the auraCooldowns table for this target - Elementarist.auraCooldowns[dstGUID]["BuffCount1"] = Elementarist.trackAuraBuffCount1 - Elementarist.auraCooldowns[dstGUID]["BuffCount2"] = Elementarist.trackAuraBuffCount2 end; end -- main Aura track if needed @@ -730,26 +697,6 @@ function Elementarist:UpdateShieldTracker() end end - -function Elementarist:TrackAuraSaveBuffStatus() - if (Elementarist.trackAuraBuffSpell1) then - buffname, _, _,Elementarist.trackAuraBuffCount1 = Elementarist:hasBuff("player",Elementarist.trackAuraBuffSpell1) - if Elementarist.trackAuraBuffCount1 == nil then Elementarist.trackAuraBuffCount1 = 0 end - if buffname and (Elementarist.trackAuraBuffCount1 == 0) then Elementarist.trackAuraBuffCount1 = 1 end - else - Elementarist.trackAuraBuffCount1 = "" - end - if (Elementarist.trackAuraBuffSpell2) then - buffname, _, _,Elementarist.trackAuraBuffCount2 = Elementarist:hasBuff("player",Elementarist.trackAuraBuffSpell2) - if Elementarist.trackAuraBuffCount2 == nil then Elementarist.trackAuraBuffCount2 = 0 end - if buffname and (Elementarist.trackAuraBuffCount2 == 0) then Elementarist.trackAuraBuffCount2 = 1 end - local spellInCast, _, _, _, sICstartTime, sICendTime = UnitCastingInfo("player") - if spellInCast==Elementarist.trackAuraBuffSpell2 then Elementarist.trackAuraBuffCount2 = Elementarist.trackAuraBuffCount2 +1 end - else - Elementarist.trackAuraBuffCount2 = "" - end -end - function Elementarist:UpdateAuraTracker() if (not Elementarist.trackAura) then return; @@ -806,8 +753,12 @@ function Elementarist:UpdateAuraTracker() -- Set text string and format it on mainain frame trackAura_txt = " " if (ElementaristDB.trackAuraBuffs) then - if Elementarist.auraCooldowns[tguid]["BuffCount1"] then trackAura_txt = Elementarist.auraCooldowns[tguid]["BuffCount1"] end - if Elementarist.auraCooldowns[tguid]["BuffCount2"] then trackAura_txt = trackAura_txt .. ":" .. Elementarist.auraCooldowns[tguid]["BuffCount2"] end + if Elementarist.auraCooldowns[tguid]["BuffCount1"] then + trackAura_txt = Elementarist.auraCooldowns[tguid]["BuffCount1"] + end + if Elementarist.auraCooldowns[tguid]["BuffCount2"] then + trackAura_txt = trackAura_txt .. ":" .. Elementarist.auraCooldowns[tguid]["BuffCount2"] + end end if (not Elementarist.OmniCC) and (not GetCVarBool("countdownForCooldowns")) then trackAura_txt= "|n" .. (format('%.1f', (e - GetTime())).. "|n" .. trackAura_txt) @@ -987,10 +938,6 @@ function Elementarist:EmptyFrames() Elementarist:SetTexture(Elementarist.textureList["next"],"") Elementarist:SetTexture(Elementarist.textureList["next1"],"") Elementarist:SetTexture(Elementarist.textureList["next2"],"") - Elementarist.textList["next"]:SetText("") - Elementarist.textList["next1"]:SetText("") - Elementarist.textList["next2"]:SetText("") - Elementarist.textList["int"]:SetText("") Elementarist:SetTexture(Elementarist.textureList["misc"],"") Elementarist:SetTexture(Elementarist.textureList["int"],"") end @@ -1029,15 +976,6 @@ function Elementarist:DecideSpells() end Elementarist:SetTexture(Elementarist.textureList["next"],GetSpellTexture(spell)) - local count = GetSpellCharges(spell) - if spell == Elementarist.SpellList["Earth Shock"] then _, _, _, count = Elementarist:hasBuff("player",Elementarist.SpellList["Lightning Shield"]) end - if spell == Elementarist.trackAura and (ElementaristDB.trackAuraBuffs) then count = Elementarist.trackAuraBuffCount1 .. ":" .. Elementarist.trackAuraBuffCount2 end - if count then - Elementarist.textList["next"]:SetText(count) - else - Elementarist.textList["next"]:SetText("") - end - local _,_,_,ct1=GetSpellInfo(spell) if (not ct1) then ct1 = 0 @@ -1050,15 +988,6 @@ function Elementarist:DecideSpells() local spell1 = Elementarist:NextSpell(ct1,spell) Elementarist:SetTexture(Elementarist.textureList["next1"],GetSpellTexture(spell1)) - count = GetSpellCharges(spell1) - if spell1 == Elementarist.SpellList["Earth Shock"] then _, _, _, count = Elementarist:hasBuff("player",Elementarist.SpellList["Lightning Shield"]) end - if spell1 == Elementarist.trackAura and (ElementaristDB.trackAuraBuffs) then count = Elementarist.trackAuraBuffCount1 .. ":" .. Elementarist.trackAuraBuffCount2 end - if count then - Elementarist.textList["next1"]:SetText(count) - else - Elementarist.textList["next1"]:SetText("") - end - local _,_,_,ct2=GetSpellInfo(spell1) if (not ct2) then ct2 = 0 @@ -1071,14 +1000,6 @@ function Elementarist:DecideSpells() local spell2 = Elementarist:NextSpell(ct1+ct2,spell,spell1) Elementarist:SetTexture(Elementarist.textureList["next2"],GetSpellTexture(spell2)) - count = GetSpellCharges(spell2) - if spell2 == Elementarist.SpellList["Earth Shock"] then _, _, _, count = Elementarist:hasBuff("player",Elementarist.SpellList["Lightning Shield"]) end - if spell2 == Elementarist.trackAura and (ElementaristDB.trackAuraBuffs) then count = Elementarist.trackAuraBuffCount1 .. ":" .. Elementarist.trackAuraBuffCount2 end - if count then - Elementarist.textList["next2"]:SetText(count) - else - Elementarist.textList["next2"]:SetText("") - end -- Elementarist:Debug(GetTime(), "LastCast " .. Elementarist.lastSpell .. "1:" .. spell .. " 2:" .. spell1 .. " 3:" .. spell2 ) end @@ -1099,12 +1020,6 @@ function Elementarist:DecideSpells() spell = Elementarist:IntSpell() Elementarist:FlashSpell(spell,"int") Elementarist:SetTexture(Elementarist.textureList["int"],GetSpellTexture(spell)) - count = GetSpellCharges(spell) - if count then - Elementarist.textList["int"]:SetText(count) - else - Elementarist.textList["int"]:SetText("") - end end end @@ -1113,7 +1028,6 @@ function Elementarist:OnUpdate(elapsed) Elementarist.timeSinceLastUpdate = Elementarist.timeSinceLastUpdate + elapsed if (Elementarist.timeSinceLastUpdate > (1.5 - (1.5 * Elementarist.spellHaste * .01)) * 0.3) then - Elementarist:TrackAuraSaveBuffStatus() Elementarist:DecideSpells() end diff --git a/Elementarist.toc b/Elementarist.toc index 9e23b50..35e5a97 100755 --- a/Elementarist.toc +++ b/Elementarist.toc @@ -1,8 +1,8 @@ -## Interface: 60200 +## Interface: 70000 ## Title: Elementarist ## Notes: Elemental shaman spell rotation helper ## Author: Taracque, Felmosórongy of Arathor -## Version: 3.5.3 +## Version: 3.8.0 ## SavedVariables: ElementaristDB ## OptionalDeps: OmniCC, SpellFlash ## Dependencies: diff --git a/Localization_enUS.lua b/Localization_enUS.lua index ea22d6b..16f1dc8 100755 --- a/Localization_enUS.lua +++ b/Localization_enUS.lua @@ -40,7 +40,4 @@ if GetLocale() then L.LAYOUT_SINGLE = "Single spell" L.LAYOUT_UPSIDE_DOWN = "Right to left, upside down" L.CONFIG_DISABLE_LM_SPELL = "Disable Liquid Magma in rotation" - L.CONFIG_DOFS_THRESHOLD = "Prioritize Buffing Flameshock with\r seconds remaining on the DOT" - L.CONFIG_DOFS = "Prioritize Buffing Flameshock when\r current DOT is not fully buffed" - L.CONFIG_DEBUFF_TRACKER_SHOW_BUFFS = "Debuff tracker shows buffs applied to DOT" end \ No newline at end of file diff --git a/modules/elemental.lua b/modules/elemental.lua index 4b6a3f6..433d209 100755 --- a/modules/elemental.lua +++ b/modules/elemental.lua @@ -14,12 +14,6 @@ Elementarist.elemental = { {text = L.BEHAVIOR_FS_BEFORE_LVB} } }, - ["trackAuraBuffs"] = { - ["type"] = "CheckBox", - ["vposition"] = -155, - ["hposition"] = 10, - ["label"] = L.CONFIG_DEBUFF_TRACKER_SHOW_BUFFS - }, ["enableEQ"] = { ["type"] = "CheckBox", ["vposition"] = -215, @@ -38,21 +32,6 @@ Elementarist.elemental = { ["hposition"] = 10, ["label"] = L.CONFIG_DISABLE_LM_SPELL }, - ["maximizeFS"] = { - ["type"] = "CheckBox", - ["vposition"] = -110, - ["hposition"] = 10, - ["label"] = L.CONFIG_DOFS - }, - ["doFSThreshold"] = { - ["type"] = "Slider", - ["vposition"] = -135, - ["hposition"] = 350, - ["label"] = L.CONFIG_DOFS_THRESHOLD, - ["low"] = 1, - ["high"] = 30, - ["step"] = 1 - }, }; Initialize = function(self) Elementarist:LoadSpells({ @@ -62,7 +41,8 @@ Elementarist.elemental = { ["Healing Stream Totem"] = GetSpellInfo(5394), ["Liquid Magma"] = GetSpellInfo(152255), ["Enhanced Chain Lightning"] = GetSpellInfo(157766), - ["Storm Elemental Totem"] = GetSpellInfo(152256) + ["Storm Elemental Totem"] = GetSpellInfo(152256), + ["Flame Shock"] = GetSpellInfo(188389) }); Elementarist.role = "DPS"; @@ -85,7 +65,7 @@ Elementarist.elemental = { local lastSpell local boostFSpriority = false local _ - local EBTalent = (Elementarist.tier6Talent == 19267) + local EBTalent = (Elementarist.tier4Talent == 1) local UFTalent = (Elementarist.tier6Talent == 21773) local EFTalent = (Elementarist.tier7Talent == 21198) local LMTalent = (Elementarist.tier7Talent == 21200) @@ -113,17 +93,7 @@ Elementarist.elemental = { -- Timing calulatutions ----------------------------------------------------- - -- check Shock CD - s, d = GetSpellCooldown(Elementarist.SpellList["Flame Shock"]) - if (d) and (d>0) and (s == 0) then - Elementarist.lastShockCD = d - end - s, d = GetSpellCooldown(Elementarist.SpellList["Earth Shock"]) - if (d) and (d>0) and (s == 0) then - Elementarist.lastShockCD = d - end - - -- set minimuim amount of flameshock remaining for a lava burst + -- set minimum amount of flameshock remaining for a lava burst local LvBct = 2 - (2 * Elementarist.spellHaste * .01) -- Set Global Coolodown @@ -161,17 +131,19 @@ Elementarist.elemental = { -- buffs and debuff status ----------------------------------------------------- - -- set lightning shield count - local _, _, _, lscount = Elementarist:hasBuff("player",Elementarist.SpellList["Lightning Shield"]) - -- get targets flame shock debuff information name, _, _, _, _, fsDuration,fsExpiration, unitCaster = Elementarist:hasDeBuff("target", Elementarist.SpellList["Flame Shock"], "player"); - if (not fsExpiration) then fsExpiration = 0 fsDuration = 0 end + if (not fsExpiration) then + fsExpiration = 0 + fsDuration = 0 + end -- get lava burst charges and adjust Charges based on timeshift local lvbCharges, maxLvbCharges, cdStart, cdLength = GetSpellCharges(Elementarist.SpellList["Lava Burst"]); lvbCharges = lvbCharges - Elementarist:Count(Elementarist.SpellList["Lava Burst"], spellInCast,exspell1,exspell2); - if (((cdStart + cdLength)- GetTime()) - timeshift <= 0) then lvbCharges = lvbCharges + 1 end + if (((cdStart + cdLength)- GetTime()) - timeshift <= 0) then + lvbCharges = lvbCharges + 1 + end -- check if assendance active local ascendance, _, _, _, _, _, ascendanceExp = Elementarist:hasBuff("player",Elementarist.SpellList["AscendanceElementalBuff"]); @@ -179,31 +151,6 @@ Elementarist.elemental = { ascendanceExp = 0 end - -- Set elemental fussion buff count - local _, _, _, efCount = Elementarist:hasBuff("player",Elementarist.SpellList["Elemental Fusion"]) - if (efCount == nil) then efCount = 0 end - if (efCount < 2)and (EFTalent) then efCount = efCount +(Elementarist:Count(Elementarist.SpellList["Lava Burst"],spellInCast,exspell1,exspell2) ) end - if (efCount > 2) then efCount = 2 end - - -- get Unleashed Flame buff Status - local ufCount=0 - if (Elementarist:hasBuff("player",Elementarist.SpellList["Unleash Flame"]) or (spellInCast == Elementarist.SpellList["Unleash Flame"])) and - (Elementarist:Count(Elementarist.SpellList["Lava Burst"],spellInCast,exspell1,exspell2) == 0) - then ufCount =1 - elseif exspell1 == Elementarist.SpellList["Unleash Flame"] and exspell1 ~= Elementarist.SpellList["Lava Burst"] then - ufCount=1 - end - Elementarist.ufCount= ufCount - - -- Determine if Flameshock is to be boosted in Priority - -- which occurs if the Boosting checking based on configuration and if they have the relevant talent to boost the DOT, - -- boost if any available boost is missing or if the time remaining is less than the configured threshold - if (ElementaristDB.maximizeFS) and (UFTalent) and (Elementarist.auraCooldowns[tguid] and Elementarist.auraCooldowns[tguid]["BuffCount1"] ~= 1 ) then boostFSpriority = true end - if (ElementaristDB.maximizeFS) and (EFTalent) and (Elementarist.auraCooldowns[tguid] and Elementarist.auraCooldowns[tguid]["BuffCount2"] ~= 2 ) then boostFSpriority = true end - if ElementaristDB.doFSThreshold > (fsExpiration - currentTime - timeshift) then boostFSpriority = true end - if boostFSpriority then Elementarist:Debug("boostFSpriority ufCount:" .. ufCount, " efCount"..efCount) else Elementarist:Debug("----- ufCount:" .. ufCount, " efCount"..efCount) end - - ----------------------------------------------------- -- Spell Priorities for Next Spell to be recommeneded ----------------------------------------------------- @@ -217,8 +164,10 @@ Elementarist.elemental = { if Elementarist.inCombat == false then -- confirm out of combat - if UnitAffectingCombat ("player") then Elementarist.inCombat = true end - if Elementarist.inCombat == false then + if UnitAffectingCombat ("player") then + Elementarist.inCombat = true + end + if Elementarist.inCombat == false then -- Searing Totem if (Elementarist:ZeroCount(Elementarist.SpellList["Searing Totem"],spellInCast,exspell1,exspell2) ) then @@ -238,57 +187,36 @@ Elementarist.elemental = { end end - - -- Priority 1 - -- if Tier7 talent is Liquid Magma and fire totem has 10 sec or more, use it - if (LMTalent) and (not ElementaristDB.disableLM) then - if (Elementarist:ZeroCount(Elementarist.SpellList["Liquid Magma"],spellInCast,exspell1,exspell2) ) then - haveFireTotem,fireTotemName,fireTotemStart,fireTotemDuration = GetTotemInfo(1); - if ((fireTotemName ~= "") and (fireTotemDuration and (fireTotemStart + fireTotemDuration - GetTime() ) >= timeshift + 15)) or - (Elementarist:ZeroCount(Elementarist.SpellList["Searing Totem"],spellInCast,exspell1,exspell2) ~= 0) then - d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Liquid Magma"]) - if (d-timeshift <= 0) then - return Elementarist.SpellList["Liquid Magma"] - end - else - if (Elementarist:ZeroCount(Elementarist.SpellList["Searing Totem"],spellInCast,exspell1,exspell2) ) and - ((fireTotemName == "") or (fireTotemDuration and (fireTotemStart + fireTotemDuration - GetTime() ) <= timeshift)) - then - return Elementarist.SpellList["Searing Totem"]; - end + -- Flame Shock + if (Elementarist:ZeroCount(Elementarist.SpellList["Flame Shock"],spellInCast,exspell1,exspell2)) then + d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Flame Shock"]) + if ((d - timeshift) <= 0) then + if ((fsExpiration - currentTime - timeshift) < 1) then + return Elementarist.SpellList["Flame Shock"] end end end - -- Priority 2 - -- Earth shock if Lightning Shield count >=20 - -- earth_shock,if=buff.lightning_shield.react=buff.lightning_shield.max_stack - if (Elementarist:ZeroCount(Elementarist.SpellList["Flame Shock"],spellInCast,exspell1,exspell2) and - Elementarist:ZeroCount(Elementarist.SpellList["Earth Shock"],spellInCast,exspell1,exspell2)) then + -- Earth Shock if Maelstrom capped + if (UnitPower("player",11)>=100) and (Elementarist:ZeroCount(Elementarist.SpellList["Earth Shock"],spellInCast,exspell1,exspell2)) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Earth Shock"]) - if ( (d) and ((d-timeshift) <= 0) and (lscount) and (lscount>=20)) then + if ((d - timeshift) <= 0) then return Elementarist.SpellList["Earth Shock"] end end - - -- Priority 3 - -- Flame shock if 2 stacks Elemental Fussion and Unleashed Flame buff active - -- flame_shock,cycle_targets=1,if=(talent.elemental_fusion.enabled&buff.elemental_fusion.stack=2&buff.unleash_flame.up&dot.flame_shock.remains<(dot.flame_shock.duration*(0.3+t18_class_trinket*(0.48+talent.unleashed_fury.enabled*0.22)))) - if (Elementarist:ZeroCount(Elementarist.SpellList["Flame Shock"],spellInCast,exspell1,exspell2) and - Elementarist:ZeroCount(Elementarist.SpellList["Earth Shock"],spellInCast,exspell1,exspell2)) then - d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Flame Shock"]) - if ((d - timeshift) <= 0) then - if (efCount==2) and (ufCount==1)then - if (fsExpiration - currentTime - timeshift) < (fsDuration * fsRefreshPercentage ) then - return Elementarist.SpellList["Flame Shock"] - end + + -- Elemental Blast if available + if (EBTalent) then + if ((Elementarist:ZeroCount(Elementarist.SpellList["Elemental Blast"],spellInCast,exspell1,exspell2) ) and + (IsSpellInRange(Elementarist.SpellList["Elemental Blast"], "target") == 1) ) then + d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Elemental Blast"]) + if ((d - timeshift) <= 0) then + return Elementarist.SpellList["Elemental Blast"] end end end - - -- Priority 4 - -- Lava Burst if not on Cooldown - -- lava_burst,if=dot.flame_shock.remains>cast_time + + -- Lava Burst if ( (lvbCharges > 0) or((ascendanceExp-GetTime()-timeshift) > 0) ) and Elementarist:SpellAvailable(Elementarist.SpellList["Lava Burst"]) then @@ -303,105 +231,17 @@ Elementarist.elemental = { end end end - - -- Priority 5 - -- Earth shock if Lightning Shield count >=15 and not on cd, and FS debuff remaining > FS cooldown, or FS debuff remaining between FS and FS cd + 2sec and LS count>=13, or has T17 4pcs and LS Count >= 12 - -- Earth_shock,if=(set_bonus.tier17_4pc&buff.lightning_shield.react>=12&!buff.lava_surge.up)|(!set_bonus.tier17_4pc&buff.lightning_shield.react>15) - -- Only allow this if we are not boosting Flameshock priority - if (Elementarist:ZeroCount(Elementarist.SpellList["Flame Shock"],spellInCast,exspell1,exspell2) and - Elementarist:ZeroCount(Elementarist.SpellList["Earth Shock"],spellInCast,exspell1,exspell2)) and - not (boostFSpriority) then - if ( (fsExpiration - GetTime() - timeshift) > Elementarist.lastShockCD ) then - d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Earth Shock"]) - if ( - ( (d) and ((d-timeshift) <= 0) and (lscount) ) and ( -- Earth Shock is available, and has lightning shield - (lscount>=15) or -- Lightning shield has 17 charge - ( (lscount>=13) and ( (fsExpiration - GetTime() - timeshift) < Elementarist.lastShockCD + 2 ) ) or -- or, has 13 or more charges but FS expiration within 2 secs to FS CD - ( (lscount>=12) and Elementarist.hasT17_4pcs) -- or has T17 4pcs bonus, and 12 or more charges on LS - ) - ) then - return Elementarist.SpellList["Earth Shock"] - end - end - end - - -- Priority 6 - -- Flameshock if not present or at less than 30% duration - -- lame_shock,cycle_targets=1,if=dot.flame_shock.remains<=(dot.flame_shock.duration*0.3) - if (ElementaristDB.Behavior == Elementarist.Behaviors["1"]) or (lvbCharges > 0) then - if (Elementarist:ZeroCount(Elementarist.SpellList["Flame Shock"],spellInCast,exspell1,exspell2) ) and - (Elementarist:ZeroCount(Elementarist.SpellList["Earth Shock"],spellInCast,exspell1,exspell2) ) then - d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Flame Shock"]) - if ((d - timeshift) <= 0) then - if ((fsExpiration - GetTime() - timeshift) < (9) ) then - return Elementarist.SpellList["Flame Shock"] - end - end - end - end - -- Priority 6b - -- Lava Burst if Ascendance but not able to flame shock..you should never get here!!.. Flameshock before you Assend! - if ( (ascendanceExp-GetTime()-timeshift) > 0) and - Elementarist:SpellAvailable(Elementarist.SpellList["Lava Burst"])then - return Elementarist.SpellList["Lava Burst"] - end - - -- Priority 7 - -- if Tier6 talent is Elemental Blast use it - -- elemental_blast - if (EBTalent) then - if ((Elementarist:ZeroCount(Elementarist.SpellList["Elemental Blast"],spellInCast,exspell1,exspell2) ) and - (IsSpellInRange(Elementarist.SpellList["Elemental Blast"], "target") == 1) ) then - d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Elemental Blast"]) - if ((d - timeshift) <= 0) then - return Elementarist.SpellList["Elemental Blast"] - end - end - end - - -- Priority 8 - -- If Tier6 talent is Unleashed Fury cast Unleash Flame or (buffs & cooldowns & reamaining time are correct) - -- Unleash_flame,if=talent.unleashed_fury.enabled&!buff.ascendance.up|(talent.elemental_fusion.enabled&buff.elemental_fusion.stack=2&(dot.flame_shock.remains)<(dot.flame_shock.duration*(0.3+t18_class_trinket*(0.48+talent.unleashed_fury.enabled*0.22)))&cooldown.flame_shock.remains Elementarist.lastShockCD) ) then - if (Elementarist:ZeroCount(Elementarist.SpellList["Unleash Flame"],spellInCast,exspell1,exspell2) ) then - d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Unleash Flame"]) - if (d-timeshift <= 0) then - return Elementarist.SpellList["Unleash Flame"]; - end - end - end - - -- Priority 9 - -- Searing Totem - if (Elementarist:ZeroCount(Elementarist.SpellList["Searing Totem"],spellInCast,exspell1,exspell2) ) then - local haveFireTotem,fireTotemName,fireTotemStart,fireTotemDuration = GetTotemInfo(1); - if (fireTotemName == "") or (fireTotemDuration and (fireTotemStart + fireTotemDuration - GetTime() ) <= timeshift) then - return Elementarist.SpellList["Searing Totem"]; - end - end - - -- Priority 9b (optional) - -- if item level >575 and Earthquake is enabled - if (ElementaristDB.enableEQ) and Elementarist:SpellAvailable(Elementarist.SpellList["Earthquake"])then - if (Elementarist.iLvl>=575) or (Elementarist.person["foeCount"]>1) then - local eqCharges, maxEqCharges, cdStart, cdLength = GetSpellCharges(Elementarist.SpellList["Earthquake"]); - if (eqCharges 0) and (eclBuff) then - d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Earthquake"]) - if (d) and (d<0.5) then - return Elementarist.SpellList["Earthquake"] - end - end - end + + -- Earthquake if 3 or more targets + + -- Earth Shock if Maelstrom > 90 + + -- Chain Lightning for more than 1 targets + if (Elementarist.person["foeCount"]>1) and Elementarist:SpellAvailable(Elementarist.SpellList["Chain Lightning"]) then + return Elementarist.SpellList["Chain Lightning"] end - - -- Priority 10 - -- otherwise lightning bolt + + -- Lightning Bolt if IsSpellInRange(Elementarist.SpellList["Lightning Bolt"], "target") == 1 and Elementarist:SpellAvailable(Elementarist.SpellList["Lightning Bolt"])then return Elementarist.SpellList["Lightning Bolt"] @@ -514,14 +354,6 @@ Elementarist.elemental = { 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"]) @@ -533,6 +365,14 @@ Elementarist.elemental = { 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 + -- Berserking if Elementarist:SpellAvailable(Elementarist.SpellList["Berserking"]) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Berserking"]) @@ -612,23 +452,6 @@ Elementarist.elemental = { end end - ---- Earth shock if Lightning Shield count >=17 and not on cd - if Elementarist:SpellAvailable(Elementarist.SpellList["Earth Shock"]) then - d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Earth Shock"]) - if (d) and (d<0.5) then - local _, _, _, lscount = Elementarist:hasBuff("player",Elementarist.SpellList["Lightning Shield"]) - if (lscount) then - lscount= lscount + (Elementarist:Count(Elementarist.SpellList["Lightning Bolt"],spellInCast,exspell1,exspell2)); - lscount= lscount + (Elementarist:Count(Elementarist.SpellList["Lava Burst"],spellInCast,exspell1,exspell2)); - else - lscount=0; - end - if (lscount>=17) then - return Elementarist.SpellList["Earth Shock"] - end - end - end - ---- Chain Lightning as filler if Elementarist:SpellAvailable(Elementarist.SpellList["Chain Lightning"]) then return Elementarist.SpellList["Chain Lightning"] @@ -650,7 +473,7 @@ Elementarist.elemental = { return "" end; ShieldName = function(self) - return "Lightning Shield"; + return ""; end; }; -- 1.7.9.5