Quantcast

Some enhancement cleanup

Taracque [08-29-16 - 13:57]
Some enhancement cleanup
Filename
Elementarist.lua
modules/enhancement.lua
diff --git a/Elementarist.lua b/Elementarist.lua
index 35d7587..97b42ac 100755
--- a/Elementarist.lua
+++ b/Elementarist.lua
@@ -703,7 +703,7 @@ function Elementarist:UpdateAuraTracker()
 		return;
 	end;

-	-- if there is a UPdateAuraTracker fucntion in the specialization modulle run it here
+	-- if there is a UpdateAuraTracker fucntion in the specialization modulle run it here
 	Elementarist:CallModule( "UpdateAuraTracker" );

 	local name,tguid,icon,d,e;
diff --git a/modules/enhancement.lua b/modules/enhancement.lua
index be08d55..5216a07 100755
--- a/modules/enhancement.lua
+++ b/modules/enhancement.lua
@@ -13,25 +13,20 @@ Elementarist.enhancement = {
 	};
 	Initialize = function(self)
 		Elementarist:LoadSpells({
-			["Glyph of Flame Shock"] = GetSpellInfo(55447),
-			["Healing Stream Totem"] = GetSpellInfo(5394),
-			["Maelstrom Weapon"] = GetSpellInfo(51530),
 			["Stormstrike"] = GetSpellInfo(17364),
 			["Windstrike"] = 115357,		-- not in spellbook, ID must be used!
 			["Lava Lash"] = GetSpellInfo(60103),
-			["Unleash Flame"] = GetSpellInfo(165462),
-			["Unleash Elements"] = GetSpellInfo(73680),
-			["Frost Shock"] = GetSpellInfo(8056),
 			["Flask of Spring Blossoms"] = GetSpellInfo(76084),
 			["AscendanceEnhancementBuff"] = GetSpellInfo(114051),
-			["Elemental Fusion"] = GetSpellInfo(157174),
 			["Ancestral Swiftness"] = GetSpellInfo(16188),
 			["Feral Spirit"] = GetSpellInfo(51533),
 			["Fire Nova"] = GetSpellInfo(1535),

 			["Flametongue"] = GetSpellInfo(193796),
 			["Boulderfist"] = GetSpellInfo(201897),
-
+			["Frostbrand"] = GetSpellInfo(196834),
+			["Crash Lightning"] = GetSpellInfo(187874),
+
 			["Greater Draenic Agility Flask"] = GetSpellInfo(156064),
 			["Draenic Agility Flask"] = GetSpellInfo(156073),
 			["Flask of Spring Blossoms"] = GetSpellInfo(114769),
@@ -39,9 +34,9 @@ Elementarist.enhancement = {
 		});

 		Elementarist.role = "DPS";
-		Elementarist.trackAura = Elementarist.SpellList["Flame Shock"];
-		Elementarist.trackFilter = "PLAYER|HARMFUL";
-		Elementarist.trackDuration = 39;
+		Elementarist.trackAura = false;
+		Elementarist.trackFilter = nil;
+		Elementarist.trackDuration = 30;
 		Elementarist.trackSpread = false;
 		Elementarist.debuffCount = 0;
 		Elementarist.exspell1=nil;
@@ -77,9 +72,7 @@ Elementarist.enhancement = {
 		end

 		Elementarist.lastBaseGCD = 1.5 - (1.5 * Elementarist.spellHaste * .01)
-
-		local LvBct = 2 - (2 * Elementarist.spellHaste * .01)
-
+
 		-- if target is dead, return ""
 		if (UnitHealth("target")<=0) then
 			return ""
@@ -89,6 +82,14 @@ Elementarist.enhancement = {
 			timeshift = 0
 		end

+		local LvBct = 2 - (2 * Elementarist.spellHaste * .01)
+
+		local bdfCharges, _, cdStart, cdLength  = GetSpellCharges(Elementarist.SpellList["Boulderfist"]);
+		bdfCharges = bdfCharges - Elementarist:Count(Elementarist.SpellList["Boulderfist"], spellInCast,exspell1,exspell2);
+		if (((cdStart + cdLength)- GetTime()) - timeshift <= 0) then
+			bdfCharges = bdfCharges + 1
+		end
+
 		-- check current spell
 		spellInCast, _, _, _, sICstartTime, sICendTime = UnitCastingInfo("player")
 		if (spellInCast) then
@@ -111,36 +112,71 @@ Elementarist.enhancement = {
 		end

 		-- Maintain Boulderfist and Landslide
+		if (not Elementarist:hasBuff("player", Elementarist.SpellList["Boulderfist"])) and (bdfCharges>=1) then
+			if Elementarist:ZeroCount(Elementarist.SpellList["Boulderfist"],spellInCast,exspell1,exspell2) and Elementarist:SpellAvailable(Elementarist.SpellList["Boulderfist"]) then
+				return Elementarist.SpellList["Boulderfist"]
+			end
+		end

 		-- Maintain Hailstorm (if talented)
-
+		if (Elementarist.talents[4] == 3) then
+			if (not Elementarist:hasBuff("player", Elementarist.SpellList["Frostbrand"])) then
+				if Elementarist:ZeroCount(Elementarist.SpellList["Frostbrand"],spellInCast,exspell1,exspell2) and Elementarist:SpellAvailable(Elementarist.SpellList["Frostbrand"]) then
+					d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Frostbrand"])
+					if d-timeshift <= 0.5 then
+						return Elementarist.SpellList["Frostbrand"]
+					end
+				end
+			end
+		end
+
 		-- Boulderfist if Maelstorm < 130 and 2 charges of Boulderfist
-
-		-- Maintaint Flametongue
+		if (UnitPower("player",11)<130) then
+			-- get lava burst charges and adjust Charges based on timeshift
+			if (Elementarist:SpellAvailable(Elementarist.SpellList["Boulderfist"])) and (bdfCharges>=2) then
+				return Elementarist.SpellList["Boulderfist"]
+			end
+		end
+
+		-- Maintain Flametongue
+		if (not Elementarist:hasBuff("player", Elementarist.SpellList["Flametongue"])) then
+			if Elementarist:ZeroCount(Elementarist.SpellList["Flametongue"],spellInCast,exspell1,exspell2) and Elementarist:SpellAvailable(Elementarist.SpellList["Flametongue"]) then
+				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Flametongue"])
+				if d-timeshift <= 0.5 then
+					return Elementarist.SpellList["Flametongue"]
+				end
+			end
+		end

-		-- Feral Spirit
-
-		-- Crash Lightning if >3 targets
-
 		-- Stormstrike
+		if Elementarist:ZeroCount(Elementarist.SpellList["Stormstrike"],spellInCast,exspell1,exspell2) and Elementarist:SpellAvailable(Elementarist.SpellList["Stormstrike"]) then
+			d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Stormstrike"])
+			if d-timeshift <= 0.5 then
+				return Elementarist.SpellList["Stormstrike"]
+			end
+		end

-		-- Crash Lightning if Crasging Storm talent
+		-- Crash Lightning if Crashing Storm talent
+		if (Elementarist.talents[6] == 1) then
+			if Elementarist:ZeroCount(Elementarist.SpellList["Crash Lightning"],spellInCast,exspell1,exspell2) and Elementarist:SpellAvailable(Elementarist.SpellList["Crash Lightning"]) then
+				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Crash Lightning"])
+				if d-timeshift <= 0.5 then
+					return Elementarist.SpellList["Crash Lightning"]
+				end
+			end
+		end

 		-- Lava Lash if Maelstorm > 110
 		if Elementarist:ZeroCount(Elementarist.SpellList["Lava Lash"],spellInCast,exspell1,exspell2) and Elementarist:SpellAvailable(Elementarist.SpellList["Lava Lash"]) then
 			d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Lava Lash"])
 			if (d-timeshift <= 0.5) and (UnitPower("Player",11)>=110) then
-				return Elementarist.SpellList["Boulderfist"]
+				return Elementarist.SpellList["Lava Lash"]
 			end
 		end

-
 		-- Boulderfist
 		if Elementarist:ZeroCount(Elementarist.SpellList["Boulderfist"],spellInCast,exspell1,exspell2) and Elementarist:SpellAvailable(Elementarist.SpellList["Boulderfist"]) then
-			d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Boulderfist"])
-			if d-timeshift <= 0.5 then
-				return Elementarist.SpellList["Boulderfist"]
-			end
+			return Elementarist.SpellList["Boulderfist"]
 		end

 		-- Flametongue