Quantcast

AoE spells shown in the right side now

Taracque [12-19-11 - 09:43]
AoE spells shown in the right side now
Filename
Change_log.txt
Elementarist.lua
Elementarist.toc
diff --git a/Change_log.txt b/Change_log.txt
index e0eea68..155148c 100755
--- a/Change_log.txt
+++ b/Change_log.txt
@@ -1,3 +1,6 @@
+**v2.1.0**
+* Change: AoE spells shown in the right side now
+
 **v2.0.6**
 * Bugfix: When an enemy with FS debuff on it dies, it no longer throws an error

diff --git a/Elementarist.lua b/Elementarist.lua
index 93e0831..9184e28 100755
--- a/Elementarist.lua
+++ b/Elementarist.lua
@@ -1,5 +1,5 @@
 -------------------------------------------------------------------------------
--- Elementarist 2.0.6
+-- Elementarist 2.1.0
 --
 -- 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.0.6'
+Elementarist.versionNumber = '2.1.0'
 Elementarist.playerName = UnitName("player")
 Elementarist.playerGUID = UnitGUID("player")
 Elementarist.targetGUID = nil
@@ -19,6 +19,7 @@ Elementarist.shieldTrackerUpdate = 0
 Elementarist.spellPower = GetSpellBonusDamage(4);	-- nature spell bonus
 Elementarist.lastBaseGCD = 1.5
 Elementarist.lastShockCD = 5
+Elementarist.fsCount = 0
 Elementarist.person = {
 	["foeCount"]	= 0,
 	["friendCount"]	= 0,
@@ -570,7 +571,10 @@ function Elementarist:UpdateDebuffTracker()
 		Elementarist:SetTexture(Elementarist.textureList["debuff"],"")
 		Elementarist.textList["debuff"]:SetText("")
 		Elementarist.debuffCooldownFrame["main"]:SetCooldown(0, 0)
+		m = m - 1
 	end
+
+	Elementarist.fsCount = m
 end

 function Elementarist:GetSpellCooldownRemaining(spell)
@@ -788,32 +792,6 @@ function Elementarist:NextSpell(timeshift,exspell1,exspell2)
 		end
 	end

-	-- if >=4 foes are available, and Earthquake not on cd
-	if (ElementaristDB.EnableEQ) then
-		if (exspell1 ~= Elementarist.SpellList["Earthquake"]) and (exspell2 ~= Elementarist.SpellList["Earthquake"]) then
-			if (Elementarist.person["foeCount"]>=4) then
-				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Earthquake"])
-				if ((d-timeshift) <= 0) then
-					return Elementarist.SpellList["Earthquake"]
-				end
-			end
-		end
-	end
-
-	-- if >=4 foes are available, and Fire Nova enabled in settings, and not in cd (and has Flame Shock applied on target)
-	if (exspell1 ~= Elementarist.SpellList["Fire Nova"]) and (exspell2 ~= Elementarist.SpellList["Fire Nova"]) then
-		if (ElementaristDB.FireNova) and (Elementarist.person["foeCount"]>=4) then
-			-- is Flame Shock on target
-			local f = Elementarist:hasDeBuff("target",Elementarist.SpellList["Flame Shock"],"player")
-			if f then
-	            d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Fire Nova"])
-				if ((d-timeshift) <= 0) then
-					return Elementarist.SpellList["Fire Nova"]
-				end
-			end
-		end
-	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"])
@@ -832,19 +810,6 @@ function Elementarist:NextSpell(timeshift,exspell1,exspell2)
 		end
 	end

-	-- CL if there are multiple targets, (count in a dirty way from combat log, not to accurate!!!)
-	if (exspell1 ~= Elementarist.SpellList["Chain Lightning"]) and (exspell2 ~= Elementarist.SpellList["Chain Lightning"]) then
-		if (Elementarist.person["foeCount"]>2) then
-			if IsSpellInRange(Elementarist.SpellList["Chain Lightning"], "target") == 1 then
-				if ((Elementarist.SpellList["Chain Lightning"]) ~= spellInCast) then
-					d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Chain Lightning"])
-					if ((d-timeshift) <= 0) then
-						return Elementarist.SpellList["Chain Lightning"]
-					end
-				end
-			end
-		end
-	end

 	-- otherwise lightning bolt
 	if IsSpellInRange(Elementarist.SpellList["Lightning Bolt"], "target") == 1 then
@@ -961,19 +926,21 @@ function Elementarist:MiscSpell()
 end

 function Elementarist:IntSpell()
-	-- interruptions, mana recharge wia thunderstorm, and purge on target
+	-- interruptions, mana recharge wia thunderstorm, purge, and AoE on target
+	local d
+
 	if Elementarist:SpellAvailable(Elementarist.SpellList["Wind Shear"]) then
 		if IsSpellInRange(Elementarist.SpellList["Wind Shear"], "target") == 1 then
 			local _, status, threatpct, _, _ = UnitDetailedThreatSituation("player", "target")
 			if ((UnitCastingInfo("target")) or (UnitChannelInfo("target"))) or ((status) and (threatpct>80) and (Elementarist.person["friendCount"]>1) and (Elementarist.inParty>0)) then
-				local d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Wind Shear"])
+				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Wind Shear"])
 				if (d) and (d<0.5) and (IsSpellInRange(Elementarist.SpellList["Wind Shear"], "target") ) then
 					return Elementarist.SpellList["Wind Shear"]
 				end
 			end

 			if (UnitChannelInfo("target")) then
-				local d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Wind Shear"])
+				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Wind Shear"])
 				if (d<0.5) and (interruptable) and (IsSpellInRange(Elementarist.SpellList["Wind Shear"], "target") ) then
 					return Elementarist.SpellList["Wind Shear"]
 				end
@@ -988,12 +955,38 @@ function Elementarist:IntSpell()
 			return Elementarist.SpellList["Thunderstorm"]
 		end
 	end
+
+	-- if >=4 foes are available, and Earthquake not on cd
+	if (ElementaristDB.EnableEQ) then
+		if (exspell1 ~= Elementarist.SpellList["Earthquake"]) and (exspell2 ~= Elementarist.SpellList["Earthquake"]) then
+			if (Elementarist.person["foeCount"]>=4) then
+				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Earthquake"])
+				if (d<0.5) then
+					return Elementarist.SpellList["Earthquake"]
+				end
+			end
+		end
+	end
+
+	-- if >=4 foes are available, and Fire Nova enabled in settings, and not in cd (and has Flame Shock applied to 3 or more targets)
+	if (exspell1 ~= Elementarist.SpellList["Fire Nova"]) and (exspell2 ~= Elementarist.SpellList["Fire Nova"]) and (Elementarist.fsCount >= 3) then
+		if (ElementaristDB.FireNova) and (Elementarist.person["foeCount"]>=4) then
+			-- is Flame Shock on target
+			local f = Elementarist:hasDeBuff("target",Elementarist.SpellList["Flame Shock"],"player")
+			if f then
+	            d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Fire Nova"])
+				if (d<0.5) then
+					return Elementarist.SpellList["Fire Nova"]
+				end
+			end
+		end
+	end

 	-- check if purgeable buff is on target (not sure if this is ok)
 	if Elementarist:SpellAvailable(Elementarist.SpellList["Purge"]) then
 		if IsSpellInRange(Elementarist.SpellList["Purge"], "target") == 1 then
 			if (Elementarist:hasBuff("target", ".", 1)) then
-				local d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Purge"])
+				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Purge"])
 				if (d<0.5) then
 					return Elementarist.SpellList["Purge"]
 				end
@@ -1001,6 +994,20 @@ function Elementarist:IntSpell()
 		end
 	end

+	-- CL if there are multiple targets, (count in a dirty way from combat log, not to accurate!!!)
+	if (exspell1 ~= Elementarist.SpellList["Chain Lightning"]) and (exspell2 ~= Elementarist.SpellList["Chain Lightning"]) then
+		if (Elementarist.person["foeCount"]>2) then
+			if IsSpellInRange(Elementarist.SpellList["Chain Lightning"], "target") == 1 then
+				if ((Elementarist.SpellList["Chain Lightning"]) ~= spellInCast) then
+					d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Chain Lightning"])
+					if (d<0.5) then
+						return Elementarist.SpellList["Chain Lightning"]
+					end
+				end
+			end
+		end
+	end
+
 	return ""
 end

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