From d36618fcdab9dfdd05ed559aa07f4481866684c1 Mon Sep 17 00:00:00 2001 From: Taracque Date: Fri, 13 Mar 2015 17:42:40 +0100 Subject: [PATCH] ***v3.4.2 * Fixed: at least the GCD always calculated as a shift between two spells * Fixed: Liquid Magma not shown if has no 10 sec remaining from the fire totem * Change: Liquid Magma can be removed from the rotation (see /ele Elemental config panel) --- Change_log.txt | 5 +++++ Elementarist.lua | 7 +++++-- Elementarist.toc | 2 +- Localization_enUS.lua | 2 ++ Localization_frFR.lua | 1 + Localization_zhCN.lua | 1 + modules/elemental.lua | 44 ++++++++++++++++++++++++++++++++++---------- 7 files changed, 49 insertions(+), 13 deletions(-) diff --git a/Change_log.txt b/Change_log.txt index 956e6f7..2abc06a 100755 --- a/Change_log.txt +++ b/Change_log.txt @@ -1,4 +1,9 @@ ***v3.4.2 +* Fixed: at least the GCD always calculated as a shift between two spells +* Fixed: Liquid Magma not shown if has no 10 sec remaining from the fire totem +* Change: Liquid Magma can be removed from the rotation (see /ele Elemental config panel) + +***v3.4.2 * Fixed: Various rotation fixes ***v3.4.1 diff --git a/Elementarist.lua b/Elementarist.lua index 0ed1f11..b57ef86 100755 --- a/Elementarist.lua +++ b/Elementarist.lua @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Elementarist 3.4.2 +-- Elementarist 3.4.3 -- -- 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.4.2'; +Elementarist.versionNumber = '3.4.3'; Elementarist.enabled = true; Elementarist.playerName = UnitName("player") Elementarist.playerGUID = UnitGUID("player") @@ -957,6 +957,9 @@ function Elementarist:DecideSpells() else ct1 = (ct1 / 1000) end + if (not ct1) or (ct1 < Elementarist.lastBaseGCD) then + ct2 = Elementarist.lastBaseGCD + end local spell1 = Elementarist:NextSpell(ct1,spell) Elementarist:SetTexture(Elementarist.textureList["next1"],GetSpellTexture(spell1)) diff --git a/Elementarist.toc b/Elementarist.toc index c033e71..d8964a6 100755 --- a/Elementarist.toc +++ b/Elementarist.toc @@ -2,7 +2,7 @@ ## Title: Elementarist ## Notes: Elemental shaman spell rotation helper ## Author: Taracque, Felmosórongy of Arathor -## Version: 3.4.2 +## Version: 3.4.3 ## SavedVariables: ElementaristDB ## OptionalDeps: OmniCC, SpellFlash ## Dependencies: diff --git a/Localization_enUS.lua b/Localization_enUS.lua index 83856f8..c42b5e3 100755 --- a/Localization_enUS.lua +++ b/Localization_enUS.lua @@ -45,4 +45,6 @@ if GetLocale() then L.LAYOUT_GROW_TOP = "Growing icons, misc. on top" L.LAYOUT_RIGHTTOLEFT_WIDE = "Right to left, wide" L.LAYOUT_SINGLE = "Single spell" +-- new for 3.4.3 + L.CONFIG_DISABLE_LM_SPELL = "Disable Liquid Magma in rotation" end \ No newline at end of file diff --git a/Localization_frFR.lua b/Localization_frFR.lua index 84cc066..123c1f7 100755 --- a/Localization_frFR.lua +++ b/Localization_frFR.lua @@ -41,4 +41,5 @@ if GetLocale() then L["LAYOUT_SINGLE"] = "Single spell" -- Requires localization L["THREAT_WARNING_PREFIX"] = "Général" L["THREAT_WARNING_SUFFIX"] = "% de menace!" + L["CONFIG_DISABLE_LM_SPELL"] = "Disable Liquid Magma in rotation" -- Requires localization end \ No newline at end of file diff --git a/Localization_zhCN.lua b/Localization_zhCN.lua index 747e2bf..c8c382a 100755 --- a/Localization_zhCN.lua +++ b/Localization_zhCN.lua @@ -41,4 +41,5 @@ if GetLocale() then L["LAYOUT_SINGLE"] = "Single spell" -- Requires localization L["THREAT_WARNING_PREFIX"] = "" -- Requires localization L["THREAT_WARNING_SUFFIX"] = "% 威胁值过高!" + L["CONFIG_DISABLE_LM_SPELL"] = "Disable Liquid Magma in rotation" -- Requires localization end \ No newline at end of file diff --git a/modules/elemental.lua b/modules/elemental.lua index 8a80878..a385c55 100755 --- a/modules/elemental.lua +++ b/modules/elemental.lua @@ -19,7 +19,11 @@ Elementarist.elemental = { ["ShowHealingStream"] = { ["type"] = "CheckBox", ["label"] = L.CONFIG_ENABLE_HS_TOTEM - } + }, + ["DisableLM"] = { + ["type"] = "CheckBox", + ["label"] = L.CONFIG_DISABLE_LM_SPELL + }, }; Initialize = function(self) Elementarist:LoadSpells({ @@ -40,6 +44,7 @@ Elementarist.elemental = { local s,d,e local name, fsExpiration, unitCaster local lastSpell + local doFS = false local _ if (exspell1) then @@ -121,14 +126,18 @@ Elementarist.elemental = { end -- if Tier7 talent is Liquid Magma and fire totem has 10 sec or more, use it - if (Elementarist.tier7Talent == 21200) then + if (Elementarist.tier7Talent == 21200) and (not ElementaristDB.DisableLM) then if (Elementarist:Count(Elementarist.SpellList["Liquid Magma"],spellInCast,exspell1,exspell2) == 0) then - local haveFireTotem,fireTotemName,d,_ = GetTotemInfo(1); - if (fireTotemName ~= "") and (d-timeshift > 10) then + local haveFireTotem,fireTotemName,fireTotemStart,fireTotemDuration = GetTotemInfo(1); + if (fireTotemName ~= "") and (fireTotemDuration and (fireTotemStart + fireTotemDuration - GetTime() ) >= timeshift + 10) then d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Liquid Magma"]) if (d-timeshift <= 0) then return Elementarist.SpellList["Liquid Magma"] end + else + if (fireTotemName == "") or (fireTotemDuration and (fireTotemStart + fireTotemDuration - GetTime() ) <= timeshift) then + return Elementarist.SpellList["Searing Totem"]; + end end end end @@ -153,7 +162,6 @@ Elementarist.elemental = { d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Flame Shock"]) if ((d - timeshift) <= 0) then flameshockavail = true - local doFS = false if (unitCaster ~= "player") then -- fs debuff is not casted by the player name = false fsExpiration = 0 @@ -239,7 +247,7 @@ Elementarist.elemental = { local haveFireTotem,fireTotemName,fireTotemStart,fireTotemDuration = GetTotemInfo(1); if (fireTotemName == "") or (fireTotemDuration and (fireTotemStart + fireTotemDuration - GetTime() ) <= timeshift) then return Elementarist.SpellList["Searing Totem"]; - end + end end -- refresh FS @@ -274,7 +282,7 @@ Elementarist.elemental = { -- Alchemy Flask of Enhancement if ( - ((GetItemCount(Elementarist.CustomIDs["Whispering Crystal Item"]) ~= 0) and (Elementarist.playerLevel >= 90) ) or + ((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 @@ -294,10 +302,10 @@ Elementarist.elemental = { 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["Whispering Crystal Item"]) ~= 0) then - local itemCooldown = Elementarist:GetItemCooldownRemaining(Elementarist.CustomIDs["Whispering Crystal Item"]); + 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["Whispering Crystal Item"]) + 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"]); @@ -342,6 +350,16 @@ Elementarist.elemental = { 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 -- Healing Stream Totem if (ElementaristDB.ShowHealingStream) and (Elementarist:SpellAvailable(Elementarist.SpellList["Healing Stream Totem"])) then @@ -417,6 +435,12 @@ Elementarist.elemental = { 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 -- 1.7.9.5