Quantcast

Signed-off-by: BillLive <bill@live.com.au>

BillLive [01-15-16 - 23:50]
Signed-off-by: BillLive <bill@live.com.au>
Filename
Elementarist.lua
modules/elemental.lua
diff --git a/Elementarist.lua b/Elementarist.lua
index 211e879..4963a49 100755
--- a/Elementarist.lua
+++ b/Elementarist.lua
@@ -1020,7 +1020,7 @@ function Elementarist:DecideSpells()
 		else
 			Elementarist.textList["next2"]:SetText("")
 		end
-		Elementarist:Debug(GetTime(), "LastCast " .. Elementarist.lastSpell ..  "1:" .. spell .. " 2:" .. spell1 .. " 3:" .. spell2 )
+--		Elementarist:Debug(GetTime(), "LastCast " .. Elementarist.lastSpell ..  "1:" .. spell .. " 2:" .. spell1 .. " 3:" .. spell2 )
 	end

 	if (not ElementaristDB.disableMini) then
diff --git a/modules/elemental.lua b/modules/elemental.lua
index f786aff..25b5bc5 100755
--- a/modules/elemental.lua
+++ b/modules/elemental.lua
@@ -59,9 +59,10 @@ Elementarist.elemental = {
 		local EFTalent = (Elementarist.tier7Talent == 21198)
 		local LMTalent = (Elementarist.tier7Talent == 21200)
 		local fsRefreshPercentage=0.3
-		if Elementarist.hasT18_Class_Trinket then fsRefreshPercentage=fsRefreshPercentage + 0.48 end
-		if UFTalent then fsRefreshPercentage=fsRefreshPercentage + 0.22 end
-
+		if Elementarist.hasT18_Class_Trinket then
+			fsRefreshPercentage=fsRefreshPercentage + 0.48
+			if UFTalent then fsRefreshPercentage=fsRefreshPercentage + 0.22 end
+		end
 		if (exspell1) then
 			if (exspell2) then
 				lastSpell = exspell2
@@ -74,6 +75,14 @@ Elementarist.elemental = {

 		local flameshockavail = false

+		-- check current spell
+		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) == 0) then efCount = efCount +1 end end
+
 		-----------------------------------------------------
 		-- Timing calulatutions
 		-----------------------------------------------------
@@ -87,9 +96,7 @@ Elementarist.elemental = {
 		if (d) and (d>0) and (s == 0) then
 			Elementarist.lastShockCD = d
 		end
-

-
 		-- set minimuim amount of flameshock remaining for a lava burst
 		local LvBct = 2 - (2 * Elementarist.spellHaste * .01)

@@ -98,9 +105,8 @@ Elementarist.elemental = {

 		if (not timeshift) then	timeshift = 0 end

-		-- check current spell
-		local spellInCast, _, _, _, sICstartTime, sICendTime = UnitCastingInfo("player")

+		-- Adjust current spell to deal with timming issue
 		if (spellInCast) then
 			if ( (sICendTime - sICstartTime) / 1000 ) < Elementarist.lastBaseGCD then
 				sICendTime = sICstartTime + (Elementarist.lastBaseGCD * 1000)
@@ -133,7 +139,6 @@ Elementarist.elemental = {
 		-- 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
@@ -144,12 +149,6 @@ Elementarist.elemental = {
 		lvbCharges = lvbCharges - Elementarist:Count(Elementarist.SpellList["Lava Burst"], spellInCast,exspell1,exspell2);
 		if (((cdStart + cdLength)- GetTime()) - timeshift <= 0) then lvbCharges = lvbCharges + 1 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 if (Elementarist:Count(Elementarist.SpellList["Lava Burst"],spellInCast,exspell1,exspell2) == 0) then efCount = efCount +1 end end
-
 		-- check if assendance active
 		local ascendance, _, _, _, _, _, ascendanceExp = Elementarist:hasBuff("player",Elementarist.SpellList["AscendanceElementalBuff"]);
 		if (ascendance == nil) then
@@ -229,7 +228,7 @@ Elementarist.elemental = {
 		if (Elementarist:Count(Elementarist.SpellList["Flame Shock"],spellInCast,exspell1,exspell2) == 0 and Elementarist:Count(Elementarist.SpellList["Earth Shock"],spellInCast,exspell1,exspell2) == 0) then
 			d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Flame Shock"])
 			if ((d - timeshift) <= 0) then
-				if (efCount==2) 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 (fsExpiration - currentTime - timeshift) < (fsDuration * fsRefreshPercentage ) then
 							return Elementarist.SpellList["Flame Shock"]