Quantcast

+***V3.6.6

BillLive [01-30-16 - 08:53]
+***V3.6.6
+* Added:    Options to prioritze spells to maximize buffs when applying Flameshock
+* Updated:  How the array for each module loads the configuration option in configuration window

Signed-off-by: BillLive <bill@live.com.au>
Filename
Change_log.txt
Ele_GUI.lua
Elementarist.lua
Localization_enUS.lua
Localization_frFR.lua
Localization_zhCN.lua
modules/elemental.lua
modules/enhancement.lua
modules/restoration.lua
diff --git a/Change_log.txt b/Change_log.txt
index 33a8b92..11e7342 100755
--- a/Change_log.txt
+++ b/Change_log.txt
@@ -1,3 +1,7 @@
+***V3.6.6
+* Added:    Options to prioritze spells to maximize buffs when applying Flameshock
+* Updated:  How the array for each module loads the configuration option in configuration window
+
 ***V3.6.5
 * Updated:  Include Unleash Flame and Elemental Fussion stack display to main Debuff Tracker Icon
 * Updated:  Options to disable DPS and Threat text plus disable new Buff dispaly in Main Debuff Tracker Icon
@@ -5,8 +9,7 @@
 * Updated:  Saves Debug mode between sessions and displays status on Entering World
 * Fixed:    Windshear now shows only on interuptable spells
 * Fixed:    Earthquake shows with Enhanced Lighting Buff in AoE Icon
-* Fixed:    Removed some redundant code, Update Elementarist:detectTalent to remove hard coding of specalisation names (makes frame work more portable - maybe for my mage one day)
-
+* Fixed:    Removed some redundant code, Update Elementarist:detectTalent to remove hard coding of specalisation names (makes frame work more portable - maybe for my mage one day)

 ***V3.6.4
 * Updated:  Spell usability checks before recommending spells to support lower level shamans
diff --git a/Ele_GUI.lua b/Ele_GUI.lua
index 3155762..807b2e0 100755
--- a/Ele_GUI.lua
+++ b/Ele_GUI.lua
@@ -497,7 +497,6 @@ function Elementarist:CreateConfig()
 	-- for each module which registed itself from the modules folder
 	if (Elementarist.modules) then
 		for i,v in pairs(Elementarist.modules) do
-			local vposition = -20;
 			if (Elementarist[i].Configuration) then
 				local childPanel = CreateFrame( "Frame", "ElementaristConfigPanel" .. i, Elementarist.configPanel );
 				childPanel.name = i:gsub("^%l", string.upper);
@@ -512,20 +511,34 @@ function Elementarist:CreateConfig()
 				end
 				-- Create a checkBox to enable/disable each module and save it within ElementaristDB
 				local checkBox = Elementarist:CreateCheckButton(childPanel.name .. " enabled", childPanel, ElementaristDB.modules, i, false);
-				checkBox:SetPoint('TOPLEFT', 10, vposition);
-				vposition = vposition - 40;
+				checkBox:SetPoint('TOPLEFT', 10, -20);

 				-- read in from each file the configuration settings within the file
 				for i2,v2 in pairs(Elementarist[i].Configuration) do
 					if (v2.type == "DropDown") then
 						local dropDown = Elementarist:CreateDropDownMenu(v2.label, childPanel, ElementaristDB, i2, v2.options, 200);
-						dropDown:SetPoint('TOPLEFT', 10, vposition);
-						vposition = vposition - 30;
+						dropDown:SetPoint('TOPLEFT', v2.hposition, v2.vposition)
 					end
 					if (v2.type == "CheckBox") then
 						local checkBox = Elementarist:CreateCheckButton(v2.label, childPanel, ElementaristDB, i2, false);
-						checkBox:SetPoint('TOPLEFT', 10, vposition);
-						vposition = vposition - 30;
+						checkBox:SetPoint('TOPLEFT', v2.hposition, v2.vposition)
+					end
+
+					if (v2.type == "Slider") then
+						local slider = Elementarist:CreateSlider(v2.label, childPanel, v2.low, v2.high, v2.step)
+						slider:SetScript('OnShow', function(self)
+							self.onShow = true
+							self:SetValue(ElementaristDB[i2])
+							self.onShow = nil
+						end)
+						slider:SetScript('OnValueChanged', function(self, value)
+							self.valText:SetText(format('%.1f', value))
+							if not self.onShow then
+								ElementaristDB[i2]=value
+							end
+						end)
+						slider:SetPoint('TOPLEFT', v2.hposition, v2.vposition)
+						slider:Show()
 					end
 				end
 				childPanel.parent = Elementarist.configPanel.name;
diff --git a/Elementarist.lua b/Elementarist.lua
index d339bc1..e037103 100755
--- a/Elementarist.lua
+++ b/Elementarist.lua
@@ -357,11 +357,15 @@ function Elementarist:InitSettings()
 	if ElementaristDB.debuffalpha == nil then ElementaristDB.debuffalpha = 1 end
 	if ElementaristDB.shieldalpha == nil then ElementaristDB.shieldalpha = 1 end
 	if ElementaristDB.ThreatWarning == nil then ElementaristDB.ThreatWarning = true end
-	if ElementaristDB.EnableEQ == nil then ElementaristDB.EnableEQ = false end
+	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.trackAuraBuffs == nil then ElementaristDB.trackAuraBuffs = true end
 	if ElementaristDB.DpsTxtDisabled == nil then ElementaristDB.DpsTxtDisabled = false end
+	if ElementaristDB.maximizeFS == nil then ElementaristDB.maximizeFS = true end
+	if ElementaristDB.doFSThreshold == nil then ElementaristDB.doFSThreshold = 9 end
+	if ElementaristDB.disableLM == nil then ElementaristDB.disableLM = false end
+	if ElementaristDB.showHealingStream == nil then ElementaristDB.showHealingStream = false end
 end

 function Elementarist:HasSetBonus(spellID,minCount)
@@ -423,7 +427,7 @@ function Elementarist:detectTalent()
 	if (talent ~= "") and (talent ~= Elementarist.talent) then
 		if (Elementarist.modules) and (ElementaristDB.modules) and (Elementarist.modules[talent]) and (ElementaristDB.modules[talent]) and (Elementarist[talent].Initialize) then
 			Elementarist.callbacks = {};
-			Elementarist[talent]:Initialize();
+			Elementarist[talent]:Initialize(); -- call initialize section from the file being loaded
 		end;
 		Elementarist.talent = talent;
 	end;
@@ -779,7 +783,7 @@ function Elementarist:UpdateAuraTracker()
 			Elementarist:SetTexture(Elementarist.textureList["debuff"],icon)
 			-- Set text string and format it on mainain frame
 			trackAura_txt = " "
-			if (ElementaristDB.TrackAuraBuffs) then
+			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
 			end
@@ -1003,11 +1007,9 @@ 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.SpellList["Flame Shock"] then 	_, _, _, count = Elementarist:hasBuff("player",Elementarist.SpellList["Elemental Fusion"]) end
-
+		if spell == Elementarist.trackAura and (ElementaristDB.trackAuraBuffs) then count = Elementarist.trackAuraBuffCount1 .. ":" .. Elementarist.trackAuraBuffCount2 end
  		if count then
  			Elementarist.textList["next"]:SetText(count)
  		else
@@ -1028,7 +1030,7 @@ function Elementarist:DecideSpells()

 		count = GetSpellCharges(spell1)
 		if spell1 == Elementarist.SpellList["Earth Shock"] then 	_, _, _, count = Elementarist:hasBuff("player",Elementarist.SpellList["Lightning Shield"]) end
-		if spell1 == Elementarist.SpellList["Flame Shock"] then 	_, _, _, count = Elementarist:hasBuff("player",Elementarist.SpellList["Elemental Fusion"]) end
+		if spell1 == Elementarist.trackAura and (ElementaristDB.trackAuraBuffs) then count = Elementarist.trackAuraBuffCount1 .. ":" .. Elementarist.trackAuraBuffCount2 end
 		if count then
 			Elementarist.textList["next1"]:SetText(count)
 		else
@@ -1049,7 +1051,7 @@ function Elementarist:DecideSpells()

 		count = GetSpellCharges(spell2)
 		if spell2 == Elementarist.SpellList["Earth Shock"] then 	_, _, _, count = Elementarist:hasBuff("player",Elementarist.SpellList["Lightning Shield"]) end
-		if spell2 == Elementarist.SpellList["Flame Shock"] then 	_, _, _, count = Elementarist:hasBuff("player",Elementarist.SpellList["Elemental Fusion"]) end
+		if spell2 == Elementarist.trackAura and (ElementaristDB.trackAuraBuffs) then count = Elementarist.trackAuraBuffCount1 .. ":" .. Elementarist.trackAuraBuffCount2 end
 		if count then
 			Elementarist.textList["next2"]:SetText(count)
 		else
diff --git a/Localization_enUS.lua b/Localization_enUS.lua
index f3dea1a..73993b5 100755
--- a/Localization_enUS.lua
+++ b/Localization_enUS.lua
@@ -15,7 +15,6 @@ if GetLocale() then
 	L.CONFIG_DISABLE_DEBUFF_TRACKER = "Disable debuff tracker"
 	L.CONFIG_DEBUFF_TRACKER_SCALE = "Debuff tracker scale"
 	L.CONFIG_DEBUFF_TRACKER_ALPHA = "Debuff tracker alpha"
-	L.CONFIG_DEBUFF_TRACKER_SHOW_BUFFS = "Debuff tracker shows buffs"
 	L.CONFIG_THREAT_WARNING = "Threat warning"
 	L.CONFIG_RESET_POSITIONS = "Reset frame positions"
 	L.CLSTBEHAVIOR_NONE = "None"
@@ -38,4 +37,7 @@ 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/Localization_frFR.lua b/Localization_frFR.lua
index 3a70a1b..1f91576 100755
--- a/Localization_frFR.lua
+++ b/Localization_frFR.lua
@@ -11,7 +11,6 @@ if GetLocale() then
 	L["CONFIG_CLSTBEHAVIOR"] = "Chain Lightning single target behavior" -- Requires localization
 	L["CONFIG_DEBUFF_TRACKER_ALPHA"] = "Suivi des débuffs alpha"
 	L["CONFIG_DEBUFF_TRACKER_SCALE"] = "échelle du suivi des Debuff"
-	L["CONFIG_DEBUFF_TRACKER_SHOW_BUFFS"] = "Suivi des débuffs montre buffs"
 	L["CONFIG_DISABLE_ADVISOR"] = "Disable spell advisor" -- Requires localization
 	L["CONFIG_DISABLE_DEBUFF_TRACKER"] = "Désactiver le suivi des débuffs"
 	L["CONFIG_DISABLE_MINI"] = "Désactiver les mini cadres"
@@ -39,4 +38,7 @@ if GetLocale() then
 	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
+	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"] = "Suivi des débuffs montre buffs"
 end
\ No newline at end of file
diff --git a/Localization_zhCN.lua b/Localization_zhCN.lua
index 45aa495..61cefcb 100755
--- a/Localization_zhCN.lua
+++ b/Localization_zhCN.lua
@@ -16,7 +16,6 @@ if GetLocale() then
 	L["CONFIG_CLSTBEHAVIOR"] = "单目标闪电链行为"
 	L["CONFIG_DEBUFF_TRACKER_ALPHA"] = "Debuff 追踪器透明度"
 	L["CONFIG_DEBUFF_TRACKER_SCALE"] = "Debuff 追踪器尺寸"
-	L["CONFIG_DEBUFF_TRACKER_SHOW_BUFFS"] = "火焰冲击跟踪显示爱好者"
 	L["CONFIG_DISABLE_ADVISOR"] = "Disable spell advisor" -- Requires localization
 	L["CONFIG_DISABLE_DEBUFF_TRACKER"] = "禁用 debuff 追踪器"
 	L["CONFIG_DISABLE_DPSTXT"] = "Désactiver les nombers des DPS et menace"
@@ -44,4 +43,13 @@ if GetLocale() then
 	L["THREAT_WARNING_PREFIX"] = "" -- Requires localization
 	L["THREAT_WARNING_SUFFIX"] = "% 威胁值过高!"
 	L["CONFIG_DISABLE_LM_SPELL"] = "Disable Liquid Magma in rotation" -- Requires localization
+	L["CONFIG_DOFS_THRESHOLD"] = "优先抛光烈焰震击剩余的法术秒"
+	L["CONFIG_DOFS"] = "优先抛光火焰冲击电流时,法术不充分授权"
+	L["CONFIG_DEBUFF_TRACKER_SHOW_BUFFS"] = "火焰冲击跟踪显示爱好者"
+
+
+
+
+
+
 end
\ No newline at end of file
diff --git a/modules/elemental.lua b/modules/elemental.lua
index 2364d91..a779608 100755
--- a/modules/elemental.lua
+++ b/modules/elemental.lua
@@ -4,22 +4,45 @@ Elementarist:RegisterModule("elemental");

 Elementarist.elemental = {
 	["Configuration"] = {
-		["TrackAuraBuffs"] = {
+		["trackAuraBuffs"] = {
 			["type"]	=	"CheckBox",
+			["vposition"] =  -100,
+			["hposition"] =  10,
 			["label"]	=	L.CONFIG_DEBUFF_TRACKER_SHOW_BUFFS
 		},
-		["EnableEQ"] = {
+		["enableEQ"] = {
 			["type"]	=	"CheckBox",
+			["vposition"] =  -170,
+			["hposition"] =  10,
 			["label"]	=	L.CONFIG_ENABLE_EQ_SPELL
 		},
-		["ShowHealingStream"] = {
+		["showHealingStream"] = {
 			["type"]	=	"CheckBox",
+			["vposition"] =  -200,
+			["hposition"] =  10,
 			["label"]	=	L.CONFIG_ENABLE_HS_TOTEM
 		},
-		["DisableLM"] = {
+		["disableLM"] = {
 			["type"]	=	"CheckBox",
+			["vposition"] =  -140,
+			["hposition"] =  10,
 			["label"]	=	L.CONFIG_DISABLE_LM_SPELL
 		},
+		["maximizeFS"] = {
+			["type"]	=	"CheckBox",
+			["vposition"] =  -60,
+			["hposition"] =  10,
+			["label"]	=	L.CONFIG_DOFS
+		},
+		["doFSThreshold"] = {
+			["type"]	=	"Slider",
+			["vposition"] =  -85,
+			["hposition"] =  350,
+			["label"]	=	L.CONFIG_DOFS_THRESHOLD,
+			["low"]		=	1,
+			["high"]	=	30,
+			["step"]	=	1
+		},
 	};
 	Initialize = function(self)
 		Elementarist:LoadSpells({
@@ -49,6 +72,7 @@ Elementarist.elemental = {
 		local currentTime = GetTime()
 		local s,d,e
 		local haveFireTotem,fireTotemName,fireTotemStart,fireTotemDuration
+		local lastSpell
 		local doFS = false
 		local _
 		local EBTalent = (Elementarist.tier6Talent == 19267)
@@ -60,16 +84,20 @@ Elementarist.elemental = {
 			fsRefreshPercentage=fsRefreshPercentage + 0.48
 			if UFTalent then fsRefreshPercentage=fsRefreshPercentage + 0.22 end
 		end
-
-		local flameshockavail = false
+		if (exspell1) then
+			if (exspell2) then
+				lastSpell = exspell2
+			else
+				lastSpell = exspell1
+			end
+		else
+			lastSpell = Elementarist.lastSpell
+		end

-		-- check current spell
+		-- get current spell and target information
+		tguid = UnitGUID("target")
 		local spellInCast, _, _, _, sICstartTime, sICendTime = UnitCastingInfo("player")

-		-- 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 if (Elementarist:Count(Elementarist.SpellList["Lava Burst"],spellInCast,exspell1,exspell2) >= 1) then efCount = efCount +1 end end

 		-----------------------------------------------------
 		-- Timing calulatutions
@@ -93,7 +121,6 @@ Elementarist.elemental = {

 		if (not timeshift) then	timeshift = 0 end

-
 		-- Adjust current spell to deal with timming issue
 		if (spellInCast) then
 			if ( (sICendTime - sICstartTime) / 1000 ) < Elementarist.lastBaseGCD then
@@ -104,10 +131,10 @@ Elementarist.elemental = {
 		else
 			-- to prevent tick in current spell, check if last one finished in short time
 			if (Elementarist.lastCastTime) and ((Elementarist.lastCastTime / 1000) + Elementarist.lastBaseGCD >= GetTime() ) then
-				spellInCast = Elementarist.lastSpell;
+				spellInCast = Elementarist.lastSpell
 			end

---			-- no spell in cast, check global cd via Ghost Wolf
+			-- 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
@@ -131,9 +158,8 @@ Elementarist.elemental = {
 		name, _, _, _, _, fsDuration,fsExpiration, unitCaster = Elementarist:hasDeBuff("target", Elementarist.SpellList["Flame Shock"], "player");
 		if (not fsExpiration) then fsExpiration = 0 fsDuration = 0 end

-		-- get lava burst charges
+		-- get lava burst charges and adjust Charges based on timeshift
 		local lvbCharges, maxLvbCharges, cdStart, cdLength  = GetSpellCharges(Elementarist.SpellList["Lava Burst"]);
-		local lvbChargesRaw = lvbCharges
 		lvbCharges = lvbCharges - Elementarist:Count(Elementarist.SpellList["Lava Burst"], spellInCast,exspell1,exspell2);
 		if (((cdStart + cdLength)- GetTime()) - timeshift <= 0) then lvbCharges = lvbCharges + 1 end

@@ -143,6 +169,31 @@ 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 doFS = true end
+		if (ElementaristDB.maximizeFS) and (EFTalent) and (Elementarist.auraCooldowns[tguid] and Elementarist.auraCooldowns[tguid]["BuffCount2"] ~= 2 ) then doFS = true end
+		if ElementaristDB.doFSThreshold > (fsExpiration - currentTime - timeshift) then doFS = true end
+		if doFS then Elementarist:Debug("doFS    ufCount:" .. ufCount, " efCount"..efCount)	else Elementarist:Debug("-----    ufCount:" .. ufCount, " efCount"..efCount)	end
+
+
 		-----------------------------------------------------
 		-- Spell Priorities for Next Spell to be recommeneded
 		-----------------------------------------------------
@@ -156,11 +207,12 @@ Elementarist.elemental = {

 		if 	Elementarist.inCombat == false then
 		    -- confirm out of combat
-			if UnitAffectingCombat ("player") then
-				Elementarist.inCombat = true
-			else
+			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
+				if (Elementarist:Count(Elementarist.SpellList["Searing Totem"],spellInCast,exspell1,exspell2) == 0) and
+					Elementarist:SpellAvailable(Elementarist.SpellList["Searing Totem"])then
 					local haveFireTotem,fireTotemName,fireTotemStart,fireTotemDuration = GetTotemInfo(1);
 					if (fireTotemName == "") or (fireTotemDuration and (fireTotemStart + fireTotemDuration - GetTime() ) <= timeshift) then
 						return Elementarist.SpellList["Searing Totem"];
@@ -168,7 +220,8 @@ Elementarist.elemental = {
 				end

 				-- Opening Uleash flame  prior to combat
-				if (Elementarist:ZeroCount(Elementarist.SpellList["Unleash Flame"],spellInCast,exspell1,exspell2)) then
+				if (Elementarist:Count(Elementarist.SpellList["Unleash Flame"],spellInCast,exspell1,exspell2) == 0) and
+					Elementarist:SpellAvailable(Elementarist.SpellList["Unleash Flame"]) then
 					d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Unleash Flame"])
 					if (d-timeshift <= 0) then
 						return Elementarist.SpellList["Unleash Flame"];
@@ -180,8 +233,9 @@ Elementarist.elemental = {

 		-- 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
+		if (LMTalent) and (not ElementaristDB.disableLM) then
+			if (Elementarist:Count(Elementarist.SpellList["Liquid Magma"],spellInCast,exspell1,exspell2) == 0) and
+				Elementarist:SpellAvailable(Elementarist.SpellList["Liquid Magma"])then
 				haveFireTotem,fireTotemName,fireTotemStart,fireTotemDuration = GetTotemInfo(1);
 				if ((fireTotemName ~= "") and (fireTotemDuration and (fireTotemStart + fireTotemDuration - GetTime() ) >= timeshift + 15)) or
 					(Elementarist:Count(Elementarist.SpellList["Searing Totem"],spellInCast,exspell1,exspell2) ~= 0) then
@@ -190,7 +244,8 @@ Elementarist.elemental = {
 						return Elementarist.SpellList["Liquid Magma"]
 					end
 				else
-					if (Elementarist:ZeroCount(Elementarist.SpellList["Searing Totem"],spellInCast,exspell1,exspell2)) and
+					if (Elementarist:Count(Elementarist.SpellList["Searing Totem"],spellInCast,exspell1,exspell2) == 0) and
+						Elementarist:SpellAvailable(Elementarist.SpellList["Searing Totem"])and
 						((fireTotemName == "") or (fireTotemDuration and (fireTotemStart + fireTotemDuration - GetTime() ) <= timeshift))
 					then
 						return Elementarist.SpellList["Searing Totem"];
@@ -202,8 +257,9 @@ Elementarist.elemental = {
 		-- 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
+		if (Elementarist:Count(Elementarist.SpellList["Flame Shock"],spellInCast,exspell1,exspell2) == 0 and
+			Elementarist:Count(Elementarist.SpellList["Earth Shock"],spellInCast,exspell1,exspell2) == 0 and
+			Elementarist:SpellAvailable(Elementarist.SpellList["Earth Shock"])) then
 			d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Earth Shock"])
 			if ( (d) and ((d-timeshift) <= 0) and (lscount) and (lscount>=20)) then
 				return Elementarist.SpellList["Earth Shock"]
@@ -213,16 +269,14 @@ Elementarist.elemental = {
 		-- 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
+		if (Elementarist:Count(Elementarist.SpellList["Flame Shock"],spellInCast,exspell1,exspell2) == 0 and
+			Elementarist:Count(Elementarist.SpellList["Earth Shock"],spellInCast,exspell1,exspell2) == 0 and
+			Elementarist:SpellAvailable(Elementarist.SpellList["Flame Shock"])) then
 			d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Flame Shock"])
 			if ((d - timeshift) <= 0) then
-				if (efCount>=2) then
-					if (Elementarist:hasBuff("player",Elementarist.SpellList["Unleash Flame"]) or Elementarist:Count(Elementarist.SpellList["Unleash Flame"],spellInCast,exspell1,exspell2) > 0)then
+				if (efCount==2) and (ufCount==1)then
 						if (fsExpiration - currentTime - timeshift) < (fsDuration * fsRefreshPercentage ) then
 							return Elementarist.SpellList["Flame Shock"]
-						end
 					end
 				end
 			end
@@ -231,8 +285,6 @@ Elementarist.elemental = {
 		-- Priority 4
 		-- Lava Burst if not on Cooldown
 		-- lava_burst,if=dot.flame_shock.remains>cast_time
-
-
 		if ( (lvbCharges > 0) or((ascendanceExp-GetTime()-timeshift) > 0)  ) and
 			Elementarist:SpellAvailable(Elementarist.SpellList["Lava Burst"])
 		then
@@ -251,8 +303,11 @@ Elementarist.elemental = {
 		-- 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)
-		if (Elementarist:ZeroCount(Elementarist.SpellList["Flame Shock"],spellInCast,exspell1,exspell2) and
-			Elementarist:ZeroCount(Elementarist.SpellList["Earth Shock"],spellInCast,exspell1,exspell2)) then
+		-- Only allow this if we are not boosting Flameshock priority
+		if (Elementarist:Count(Elementarist.SpellList["Flame Shock"],spellInCast,exspell1,exspell2) == 0 and
+			Elementarist:Count(Elementarist.SpellList["Earth Shock"],spellInCast,exspell1,exspell2) == 0)and
+			Elementarist:SpellAvailable(Elementarist.SpellList["Earth Shock"]) and
+			not (doFS) then
 			if ( (fsExpiration - GetTime() - timeshift) > Elementarist.lastShockCD ) then
 				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Earth Shock"])
 				if (
@@ -270,9 +325,10 @@ Elementarist.elemental = {
 		-- 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 	(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 	(Elementarist:Count(Elementarist.SpellList["Flame Shock"],spellInCast,exspell1,exspell2) == 0) and
+			(Elementarist:Count(Elementarist.SpellList["Earth Shock"],spellInCast,exspell1,exspell2) == 0) and
+			Elementarist:SpellAvailable(Elementarist.SpellList["Flame Shock"]) then
+			d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Flame Shock"])
 			if ((d - timeshift) <= 0) then
 				if ((fsExpiration - GetTime() - timeshift) < (9) ) then
 					return Elementarist.SpellList["Flame Shock"]
@@ -291,8 +347,9 @@ Elementarist.elemental = {
 		-- 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
+			if ((Elementarist:Count(Elementarist.SpellList["Elemental Blast"],spellInCast,exspell1,exspell2) == 0) and
+				(IsSpellInRange(Elementarist.SpellList["Elemental Blast"], "target") == 1) and
+				Elementarist:SpellAvailable(Elementarist.SpellList["Elemental Blast"])	) then
 				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Elemental Blast"])
 				if ((d - timeshift) <= 0) then
 					return Elementarist.SpellList["Elemental Blast"]
@@ -301,22 +358,12 @@ Elementarist.elemental = {
 		end

 		-- Priority 8
-		-- 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 9
 		-- 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<gcd)
-
-
-		if (UFTalent)  or
+		if ((UFTalent) and not (doFS))or
 		   (efCount==2 and ( (fsExpiration - currentTime - timeshift) < (fsDuration * fsRefreshPercentage )  and (fsExpiration - currentTime - timeshift) > Elementarist.lastShockCD)    ) then
-			if (Elementarist:ZeroCount(Elementarist.SpellList["Unleash Flame"],spellInCast,exspell1,exspell2)) then
+			if (Elementarist:Count(Elementarist.SpellList["Unleash Flame"],spellInCast,exspell1,exspell2) == 0) and
+				Elementarist:SpellAvailable(Elementarist.SpellList["Unleash Flame"])then
 				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Unleash Flame"])
 				if (d-timeshift <= 0) then
 					return Elementarist.SpellList["Unleash Flame"];
@@ -324,10 +371,19 @@ Elementarist.elemental = {
 			end
 		end

+		-- Priority 9
+		-- Searing Totem
+		if  (Elementarist:Count(Elementarist.SpellList["Searing Totem"],spellInCast,exspell1,exspell2) == 0) and
+			Elementarist:SpellAvailable(Elementarist.SpellList["Searing Totem"]) 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 (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<maxEqCharges) and (((cdStart + cdLength)- GetTime()) - timeshift <= 0) then
@@ -448,7 +504,7 @@ Elementarist.elemental = {
 		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
+		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"])
@@ -459,7 +515,7 @@ Elementarist.elemental = {
 		end

 		-- Healing Stream Totem
-		if (ElementaristDB.ShowHealingStream) and (Elementarist:SpellAvailable(Elementarist.SpellList["Healing Stream Totem"])) then
+		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"]);
diff --git a/modules/enhancement.lua b/modules/enhancement.lua
index 65668c7..9c47277 100755
--- a/modules/enhancement.lua
+++ b/modules/enhancement.lua
@@ -6,6 +6,8 @@ Elementarist.enhancement = {
 	["Configuration"] = {
 		["ShowHealingStream"] = {
 			["type"]	=	"CheckBox",
+			["vposition"] =  -60,
+			["hposition"] =  10,
 			["label"]	=	L.CONFIG_ENABLE_HS_TOTEM
 		}
 	};
diff --git a/modules/restoration.lua b/modules/restoration.lua
index 1b964d6..1103fd6 100755
--- a/modules/restoration.lua
+++ b/modules/restoration.lua
@@ -6,6 +6,8 @@ Elementarist.restoration = {
 	["Configuration"] = {
 		["ShowSearingTotem"] = {
 			["type"]	=	"CheckBox",
+			["vposition"] =  -60,
+			["hposition"] =  10,
 			["label"]	=	L.CONFIG_ENABLE_SEARING_TOTEM
 		}
 	};