Quantcast

More tune on rotation, iLVL detection added.

Taracque [10-18-14 - 13:41]
More tune on rotation, iLVL detection added.
Earthquake is now in single target rotation, if iLVL>=575 and enabled in the configuration
Filename
Elementarist.lua
modules/elemental.lua
diff --git a/Elementarist.lua b/Elementarist.lua
index 5396334..28893d3 100755
--- a/Elementarist.lua
+++ b/Elementarist.lua
@@ -41,6 +41,7 @@ Elementarist.SFHistory = {
 	["misc"] = nil,
 	["int"] = nil
 }
+Elementarist.iLvl = 0;
 Elementarist.talent = ""
 Elementarist.role = ""
 Elementarist.talentUnsure = true
@@ -132,6 +133,7 @@ Elementarist.eventFrame:RegisterEvent("ADDON_LOADED");
 Elementarist.eventFrame:RegisterEvent("PLAYER_LOGIN");
 Elementarist.eventFrame:RegisterEvent("PLAYER_ALIVE");
 Elementarist.eventFrame:RegisterEvent("PLAYER_ENTERING_WORLD");
+Elementarist.eventFrame:RegisterEvent("PLAYER_EQUIPMENT_CHANGED");

 -- Define our Event Handlers here
 Elementarist.events = {}
@@ -169,6 +171,7 @@ end
 function Elementarist.events.PLAYER_ALIVE()
 	-- check anything
 	Elementarist:detectTalent()
+	Elementarist:detectiLevel();
 	Elementarist:ApplySettings()

 	-- Elementarist.eventFrame:UnregisterEvent("PLAYER_ALIVE")
@@ -176,6 +179,11 @@ end

 function Elementarist.events.PLAYER_ENTERING_WORLD()
 	Elementarist:detectTalent()
+	Elementarist:detectiLevel();
+end
+
+function Elementarist.events.PLAYER_EQUIPMENT_CHANGED()
+	Elementarist:detectiLevel();
 end

 function Elementarist.events.PLAYER_LOGIN()
@@ -225,6 +233,9 @@ function Elementarist.events.ADDON_LOADED(addon)

 	-- check if talent is elemental
 	Elementarist:detectTalent()
+
+	-- detect equiped item level
+	Elementarist:detectiLevel()

 	Elementarist.playerLevel = UnitLevel("player")

@@ -306,6 +317,11 @@ function Elementarist:InitSettings()
 	if not ElementaristDB.shieldrelativePoint then ElementaristDB.shieldrelativePoint = "CENTER" end
 end

+function Elementarist:detectiLevel()
+	local _,ilvl = GetAverageItemLevel();
+	Elementarist.iLvl = ilvl;
+end
+
 function Elementarist:detectTalent()
 	local spec = GetSpecialization()
 	local _,playerClass;
diff --git a/modules/elemental.lua b/modules/elemental.lua
index 24ff341..ada7c16 100755
--- a/modules/elemental.lua
+++ b/modules/elemental.lua
@@ -98,6 +98,16 @@ Elementarist.elemental = {
 			end
 		end

+		-- if item level >575 and Earthquake is enabled
+		if ((ElementaristDB.EnableEQ) and (Elementarist.iLvl>=575)) or (Elementarist.person["foeCount"]>1) then
+			if (exspell1 ~= Elementarist.SpellList["Earthquake"]) and (exspell2 ~= Elementarist.SpellList["Earthquake"]) and ((Elementarist.SpellList["Earthquake"]) ~= spellInCast) then
+				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Earthquake"])
+				if (d) and (d<0.5) then
+					return Elementarist.SpellList["Earthquake"]
+				end
+			end
+		end
+
 		-- if Tier6 talent is Unleashed Fury Unleash Flame
 		if (Elementarist.tier6Talent == 21773) then
 			if (exspell1 ~= Elementarist.SpellList["Unleash Flame"]) and (exspell2 ~= Elementarist.SpellList["Unleash Flame"]) then
@@ -134,7 +144,7 @@ Elementarist.elemental = {
 							doFS = true
 						end
 					end
-					if (doFS) and ((fsExpiration - GetTime() - timeshift) < 0) then
+					if (doFS) and ((fsExpiration - GetTime() - timeshift) < 9) then
 						return Elementarist.SpellList["Flame Shock"]
 					end
 				end
@@ -351,16 +361,6 @@ Elementarist.elemental = {
 			end
 		end

-		-- if >=4 foes are available, and Earthquake not on cd
-		if (ElementaristDB.EnableEQ) then
-			if (Elementarist.person["foeCount"]>=4) then
-				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Earthquake"])
-				if (d) and (d<0.5) then
-					return Elementarist.SpellList["Earthquake"]
-				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