Quantcast

Bugfix: Earthshock not displayed if FS debuff has 6 or less secs remaining

Taracque [02-13-12 - 10:39]
Bugfix: Earthshock not displayed if FS debuff has 6 or less secs remaining
Filename
Change_log.txt
Elementarist.lua
Elementarist.toc
diff --git a/Change_log.txt b/Change_log.txt
index 155148c..ba9dd26 100755
--- a/Change_log.txt
+++ b/Change_log.txt
@@ -1,3 +1,6 @@
+**v2.1.1**
+* Bugfix: Earthshock not displayed if FS debuff has 6 or less secs remaining
+
 **v2.1.0**
 * Change: AoE spells shown in the right side now

diff --git a/Elementarist.lua b/Elementarist.lua
index 9184e28..6539bc5 100755
--- a/Elementarist.lua
+++ b/Elementarist.lua
@@ -1,5 +1,5 @@
 -------------------------------------------------------------------------------
--- Elementarist 2.1.0
+-- Elementarist 2.1.1
 --
 -- Shows the advised spell for an elemental shaman for optimal DPS output.
 -------------------------------------------------------------------------------
@@ -8,7 +8,7 @@ Elementarist = {Locals = {}}

 local L = Elementarist.Locals

-Elementarist.versionNumber = '2.1.0'
+Elementarist.versionNumber = '2.1.1'
 Elementarist.playerName = UnitName("player")
 Elementarist.playerGUID = UnitGUID("player")
 Elementarist.targetGUID = nil
@@ -18,7 +18,7 @@ Elementarist.debuffTrackerUpdate = 0
 Elementarist.shieldTrackerUpdate = 0
 Elementarist.spellPower = GetSpellBonusDamage(4);	-- nature spell bonus
 Elementarist.lastBaseGCD = 1.5
-Elementarist.lastShockCD = 5
+Elementarist.lastShockCD = 6
 Elementarist.fsCount = 0
 Elementarist.person = {
 	["foeCount"]	= 0,
@@ -673,11 +673,11 @@ function Elementarist:NextSpell(timeshift,exspell1,exspell2)

 	-- check Shock CD
 	local s, d = GetSpellCooldown(Elementarist.SpellList["Flame Shock"])
-	if (d) and (d>0) then
+	if (d) and (d>0) and (s == 0) then
 		Elementarist.lastShockCD = d
 	end
 	local s, d = GetSpellCooldown(Elementarist.SpellList["Earth Shock"])
-	if (d) and (d>0) then
+	if (d) and (d>0) and (s == 0) then
 		Elementarist.lastShockCD = d
 	end

@@ -793,20 +793,18 @@ function Elementarist:NextSpell(timeshift,exspell1,exspell2)
 	end

 	-- Earth shock if Lightning Shield count >=9 and not on cd, and FS debuff remaining > FS cooldown, or FS debuff remaining between FS and FS cd + 2sec and LS count>=7
-	if ( (exspell1 ~= Elementarist.SpellList["Earth Shock"]) and (exspell2 ~= Elementarist.SpellList["Earth Shock"]) ) then
-		d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Earth Shock"])
-		local _, _, _, lscount = Elementarist:hasBuff("player",Elementarist.SpellList["Lightning Shield"])
-		if (
+	if ( (exspell1 ~= Elementarist.SpellList["Earth Shock"]) and (exspell2 ~= Elementarist.SpellList["Earth Shock"]) and (exspell1 ~= Elementarist.SpellList["Flame Shock"]) and (exspell2 ~= Elementarist.SpellList["Flame Shock"]) ) then
+		if ( (fsExpiration - GetTime() - timeshift) > Elementarist.lastShockCD ) then
+			d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Earth Shock"])
+			local _, _, _, lscount = Elementarist:hasBuff("player",Elementarist.SpellList["Lightning Shield"])
+			if (
 				( (d) and ((d-timeshift) <= 0) and (lscount) ) and (	-- Earth Shock is available, and has lightning shield
-					(
-						( (fsExpiration - GetTime() - timeshift) > Elementarist.lastShockCD ) and (	-- Flame Shock debuff expiration time > Flame Shock CD (which is equals to Earth Shock CD)
-							(lscount>=9) or 														-- Lightning shield has 9 charge
-							( (lscount>=7) and ( (fsExpiration - GetTime() - timeshift) < Elementarist.lastShockCD + 2 ) )	-- or, has 7 or more charges but FS expiration within 2 secs to FS CD
-						)
-					)
+					(lscount>=9) or 														-- Lightning shield has 9 charge
+					( (lscount>=7) and ( (fsExpiration - GetTime() - timeshift) < Elementarist.lastShockCD + 2 ) )	-- or, has 7 or more charges but FS expiration within 2 secs to FS CD
 				)
 			) then
-			return Elementarist.SpellList["Earth Shock"]
+				return Elementarist.SpellList["Earth Shock"]
+			end
 		end
 	end

diff --git a/Elementarist.toc b/Elementarist.toc
index d6dfc8f..78fb005 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: 2.1.0
+## Version: 2.1.1
 ## SavedVariables: ElementaristDB
 ## OptionalDeps: OmniCC, SpellFlash
 ## Dependencies: