Quantcast

Enhancement cleanup…

Taracque [08-28-16 - 19:56]
Enhancement cleanup…
Filename
modules/enhancement.lua
diff --git a/modules/enhancement.lua b/modules/enhancement.lua
index 9c47277..be08d55 100755
--- a/modules/enhancement.lua
+++ b/modules/enhancement.lua
@@ -29,6 +29,9 @@ Elementarist.enhancement = {
 			["Feral Spirit"] = GetSpellInfo(51533),
 			["Fire Nova"] = GetSpellInfo(1535),

+			["Flametongue"] = GetSpellInfo(193796),
+			["Boulderfist"] = GetSpellInfo(201897),
+
 			["Greater Draenic Agility Flask"] = GetSpellInfo(156064),
 			["Draenic Agility Flask"] = GetSpellInfo(156073),
 			["Flask of Spring Blossoms"] = GetSpellInfo(114769),
@@ -37,8 +40,6 @@ Elementarist.enhancement = {

 		Elementarist.role = "DPS";
 		Elementarist.trackAura = Elementarist.SpellList["Flame Shock"];
-		Elementarist.trackAuraBuffSpell1 = Elementarist.SpellList["Unleash Flame"]  -- buff charge count to display in Aura Tracking Window
-		Elementarist.trackAuraBuffSpell2 = Elementarist.SpellList["Elemental Fusion"] -- buff charge count to display in Aura Tracking Window
 		Elementarist.trackFilter = "PLAYER|HARMFUL";
 		Elementarist.trackDuration = 39;
 		Elementarist.trackSpread = false;
@@ -60,17 +61,10 @@ Elementarist.enhancement = {
 		local spellInCast, sICstartTime, sICendTime
 		local _

-		EETalent = (Elementarist.tier4Talent == 19273)
-		EBTalent = (Elementarist.tier6Talent == 19267)
-
-		 _, _, _, MWcount = Elementarist:hasBuff("player",Elementarist.SpellList["Maelstrom Weapon"])
-		if (MWcount == nil) then MWcount = 0 end
-
-		 _, _, _, EFcount = Elementarist:hasBuff("player",Elementarist.SpellList["Elemental Fusion"])
-		if (EFcount == nil) then EFcount = 0 end
-
 		ascendance, _, _, _, _, _, ascendanceExp = Elementarist:hasBuff("player", Elementarist.SpellList["AscendanceEnhancementBuff"])
-		if (ascendance == nil) then ascendanceExp = 0 end
+		if (ascendance == nil) then
+			ascendanceExp = 0
+		end

 		if (exspell1) then
 			if (exspell2) then
@@ -86,16 +80,14 @@ Elementarist.enhancement = {

 		local LvBct = 2 - (2 * Elementarist.spellHaste * .01)

-		-- check Shock CD
-		s, d = GetSpellCooldown(Elementarist.SpellList["Flame Shock"])
-		if (d) and (d>0) and (s == 0) then 	Elementarist.lastShockCD = d end
-		s, d = GetSpellCooldown(Elementarist.SpellList["Frost Shock"])
-		if (d) and (d>0) and (s == 0) then 	Elementarist.lastShockCD = d end
-
 		-- if target is dead, return ""
-		if (UnitHealth("target")<=0) then return "" end
+		if (UnitHealth("target")<=0) then
+			return ""
+		end

-		if (not timeshift) then timeshift = 0 end
+		if (not timeshift) then
+			timeshift = 0
+		end

 		-- check current spell
 		spellInCast, _, _, _, sICstartTime, sICendTime = UnitCastingInfo("player")
@@ -118,226 +110,48 @@ Elementarist.enhancement = {
 			end
 		end

-		--------------------------- start of priority list ----------------
-
-		----Priority 1 ---  Searing Totem if no fire totem or fire totem about to expire
-		if (Elementarist:ZeroCount(Elementarist.SpellList["Searing Totem"],spellInCast,exspell1,exspell2)) then
-			haveFireTotem,fireTotemName,fireTotemStart,fireTotemDuration = GetTotemInfo(1);
-			if (fireTotemName == "") or (fireTotemDuration and (fireTotemStart + fireTotemDuration - currentTime ) -timeshift <= 0) then
- 				return Elementarist.SpellList["Searing Totem"];
-			end
-		end
-
-		----Priority 2 ---  -- if Tier6 talent is Unleashed Fury then use Unleash Elements
-		if (EFTalent) then
-			if (Elementaris:ZeroCount(Elementarist.SpellList["Unleash Elements"],spellInCast,exspell1,exspell2)) then
-				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Unleash Elements"])
-				if (d-timeshift <= 0) then
-					return Elementarist.SpellList["Unleash Elements"];
-				end
-			end
-		end
-
-		----Priority 3	-- if Tier6 talent is Elemental Blast use it with 5 Maelstrom Weapon stacks (8 with 4 set)
-		if EBTalent then
-			if  ( (  (not Elementarist.hasT18_4pcs) and (MWcount >= 5))  or ( (Elementarist.hasT18_4pcs) and (MWcount >= 8)) )  then
-				if ( Elementarist:ZeroCount(Elementarist.SpellList["Elemental Blast"],spellInCast,exspell1,exspell2) == 0) and
-					(IsSpellInRange(Elementarist.SpellList["Elemental Blast"], "target") == 1) then
-					d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Elemental Blast"])
-					if ((d - timeshift) <= 0) then
-						return Elementarist.SpellList["Elemental Blast"]
-					end
-				end
-			end
-		end
-
-		----Priority 4	---- Load Windstrike and Stormstrike data
-		SSCharges, maxSSCharges, cdSSStart, cdSSLength  = GetSpellCharges(Elementarist.SpellList["Stormstrike"]);
-		if (SSCharges) then
-			if (SSCharges<maxSSCharges) and (((cdSSStart + cdSSLength)- currentTime) - timeshift <= 0) then
-				SSCharges = SSCharges + 1;
-			end
-			SSCharges = SSCharges - Elementarist:Count(Elementarist.SpellList["Stormstrike"],spellInCast,exspell1,exspell2);
-			SSCharges = SSCharges - Elementarist:Count(Elementarist.SpellList["Windstrike"],spellInCast,exspell1,exspell2);
-
-			--------- Windstrike (requires assendance) at max charges of SS/WS
-			if ascendance then
-				if (( (SSCharges >= 1) and (not EETalent) ) or
-					(SSCharges >= 2) ) then
-					return Elementarist.SpellList["Windstrike"]
-				end
-			end
-		end
-
-
-		----Priority 5	-- Cast Lightning Bolt  with 5 Maelstrom Weapon stacks (8 with 4 set)
-		if ( ( (MWcount >= 5) and ( not Elementarist.hasT18_4pcs) ) or
-			(MWcount >= 8)	) then
-			if ((IsSpellInRange(Elementarist.SpellList["Lightning Bolt"], "target") == 1) and
-				(Elementarist:ZeroCount(Elementarist.SpellList["Lightning Bolt"],exspell1,exspell2)) ) then
-				return Elementarist.SpellList["Lightning Bolt"]
-			end
-		end
-
-		----Priority 6	-- stormstrike at max charges of SS/WS
-		-- note:  Stormstrikeo has 100 yrd range and does not return IsSpellInRange correctly so no checking of range
-		if (not ascendance) and (SSCharges) and (IsSpellInRange(Elementarist.SpellList["Lava Lash"], "target") == 1) and
-			Elementarist:SpellAvailable(Elementarist.SpellList["Stormstrike"]) then
-			if (
-				( ( SSCharges >= 1) and (not EETalent) ) or
-				( SSCharges >= 2 )
-			) then
-				return Elementarist.SpellList["Stormstrike"]
-			end
-		end
-
-		----Priority 7	-- Load Lava Lash Data
-		LLCharges, maxLLCharges, cdLLStart, cdLLLength  = GetSpellCharges(Elementarist.SpellList["Lava Lash"]);
-		if (LLCharges<maxLLCharges) and (((cdLLStart + cdLLLength)- currentTime) - timeshift <= 0) then
-			LLCharges = LLCharges + 1;
-		end
-		LLCharges = LLCharges - Elementarist:Count(Elementarist.SpellList["Lava Lash"],spellInCast, exspell1, exspell2);
-
-		-----Lava Lash at max charges of LL
-		if (IsSpellInRange(Elementarist.SpellList["Lava Lash"], "target") == 1) and
-			Elementarist:SpellAvailable(Elementarist.SpellList["Lava Lash"]) then
-			if (
-				( (LLCharges >= 1) and (not EETalent) ) or
-				( (LLCharges >= 2) )
-			) then
-				return Elementarist.SpellList["Lava Lash"]
-			end
-		end
-
-		----Priority 8	-- Flame shock if <9 sec remaining and Unleash Flame is up
-		name, _, _, _, _, _, fsExpiration, unitCaster = Elementarist:hasDeBuff("target", Elementarist.SpellList["Flame Shock"], "player");
-		if (not fsExpiration) then
-			fsExpiration = 0
-		end
-		if (Elementarist:hasBuff("player",Elementarist.SpellList["Unleash Flame"])) and
-			(Elementarist:ZeroCount(Elementarist.SpellList["Frost Shock"],exspell1,exspell2)) and
-			(Elementarist:ZeroCount(Elementarist.SpellList["Flame Shock"],exspell1,exspell2)) then
-			if IsSpellInRange(Elementarist.SpellList["Flame Shock"], "target") == 1 then
-				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Flame Shock"])
-				if (
-					(  ((EFcount >= 2) and (d - timeshift) <= 0) and ((fsExpiration - currentTime - timeshift) < 16)     ) or
-					(  ((EFcount >= 1) and (d - timeshift) <= 0) and ((fsExpiration - currentTime - timeshift) < 9)    )   or
-					(  ((d - timeshift) <= 0) and ((fsExpiration - currentTime - timeshift) < 9)    )
-				    )	then
-					return Elementarist.SpellList["Flame Shock"]
-				end
-			end
-		end
-
-		-- Priority 9 : Unleash Elements
-		if (Elementarist:ZeroCount(Elementarist.SpellList["Unleash Elements"],spellInCast,exspell1,exspell2)) then
-			d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Unleash Elements"])
-			if (d) and ((d - timeshift) <= 0) then
-				return Elementarist.SpellList["Unleash Elements"]
-			end
-		end
-
-		-- Priority 10	: Windstrike (requires assendance) at 1 charges of SS/WS with EETalent
-		-- note:  Stormstrikeo has 100 yrd range and does not return IsSpellInRange correctly so no checking of range
-		if ascendance and SSCharges then
-			if ( (SSCharges >= 1) and (EETalent) ) then
-				return Elementarist.SpellList["Windstrike"]
-			end
-		end
-
-		-- Priority 11 : check Elemental Blast is available first
-		if EBTalent and Elementarist:SpellAvailable(Elementarist.SpellList["Elemental Blast"])  then
-			if 	((Elementarist:Count(Elementarist.SpellList["Elemental Blast"],spellInCast,exspell1,exspell2) == 0) and
-				(IsSpellInRange(Elementarist.SpellList["Elemental Blast"], "target") == 1) ) then
-				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Elemental Blast"])
-				-- Elemental Blast (Tier 6 Talent) with Anscestral Swiftness buff
-				if ((d - timeshift) <= 0) then
-  					if Elementarist:hasBuff("player", Elementarist.SpellList["Ancestral Swiftness"]) then
-						return Elementarist.SpellList["Elemental Blast"]
-					end
-				end
-			end
-
-			-- Elemental Blast (Tier 6 Talent) with T18 4 set and 3 or More Maelstrom Weapon
-			if  ( (Elementarist.hasT18_4pcs) and (MWcount >= 3) ) then
-				if ((d - timeshift) <= 0) then
-					return Elementarist.SpellList["Elemental Blast"]
-				end
-			end
-		end
-
-		-- Priority 12 : lightning bolt near max count or with Ancesteral swiftness (only if not using T18 4 set)
-		if ( not  Elementarist.hasT18_4pcs) and
-			Elementarist:SpellAvailable(Elementarist.SpellList["Lightning Bolt"]) then
-			if ( ((MWcount >=3 ) and (not ascendance)) or Elementarist:hasBuff("player", Elementarist.SpellList["Ancestral Swiftness"]) ) then
-				return Elementarist.SpellList["Lightning Bolt"]
-			end
-		end
-
-		-- Priority 13 : Lava Lash at 1 charge with Echo of the elements
-		if ((  LLCharges >= 1) and EETalent) and
-			(IsSpellInRange(Elementarist.SpellList["Lava Lash"], "target") == 1) and
-			Elementarist:SpellAvailable(Elementarist.SpellList["Lava Lash"]) then
-			return Elementarist.SpellList["Lava Lash"]
-		end
-
-
-		-- Priority 14 : Frost Shock if not using Elemental Fusion or if more than 16 seconds remaining on Flame Shock debuff
-		if Elementarist:SpellAvailable(Elementarist.SpellList["Frost Shock"]) then
-			d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Frost Shock"])
-			if ( d and ((d - timeshift) <= 0) and
-			(Elementarist:ZeroCount(Elementarist.SpellList["Frost Shock"],exspell1,exspell2)) and
-			(Elementarist:ZeroCount(Elementarist.SpellList["Flame Shock"],exspell1,exspell2)) ) then
-				if (EFTalent and ((fsExpiration - currentTime - timeshift) < 16)) or (not EFTalent) then
-					return Elementarist.SpellList["Frost Shock"]
-				end
-			end
-		end
-
-		-- Priority 15 : Elemental Blast if T18 4 piece and 2 or more Maelstom Weapon
-		if EBTalent and Elementarist.hasT18_4pcs and (MWcount >=2) then
-			if 	( (Elementarist:ZeroCount(Elementarist.SpellList["Elemental Blast"],spellInCast,exspell1,exspell2)) and
-				(IsSpellInRange(Elementarist.SpellList["Elemental Blast"], "target") == 1)) then
-				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Elemental Blast"])
-				if ((d - timeshift) <= 0) then
-  					if Elementarist:hasBuff("player", Elementarist.SpellList["Ancestral Swiftness"]) then
-						return Elementarist.SpellList["Elemental Blast"]
-					end
-				end
-			end
-
-		end
+		-- Maintain Boulderfist and Landslide
+
+		-- Maintain Hailstorm (if talented)
+
+		-- Boulderfist if Maelstorm < 130 and 2 charges of Boulderfist
+
+		-- Maintaint Flametongue

-		-- Priority 16
-		if ( EETalent and (not Elementarist.hasT18_4pcs) and (MWcount >=2) ) and
-			Elementarist:SpellAvailable(Elementarist.SpellList["Lighnting Bolt"]) then
-			return Elementarist.SpellList["Lightning Bolt"]
-		end
+		-- Feral Spirit
+
+		-- Crash Lightning if >3 targets
+
+		-- Stormstrike
+
+		-- Crash Lightning if Crasging Storm talent

-		-- Priority 17 : storm strike if using Echo of Elements
-		if (not ascendance) and (SSCharges) and (IsSpellInRange(Elementarist.SpellList["Stormstrike"], "target") == 1) and
-			Elementarist:SpellAvailable(Elementarist.SpellList["Stormstrike"]) then
-			if ((SSCharges >= 1) and EETalent ) then
-				return Elementarist.SpellList["Stormstrike"]
+		-- 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"]
 			end
 		end
-
-		-- Priority 18 : Lighnting bolt at low charges of Maelstrom weapon
-		if ( (Elementarist.hasT18_4pcs and (MWcount >=3)) or (MWcount >= 1) ) and
-			Elementarist:SpellAvailable(Elementarist.SpellList["Lighnting Bolt"]) then
-			if IsSpellInRange(Elementarist.SpellList["Lightning Bolt"], "target") == 1 then
-				return Elementarist.SpellList["Lightning Bolt"]
+
+
+		-- 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
 		end

-		-- Priority 19 : Searing Totem if less than 20 seconds until it expires
-		if (Elementarist:ZeroCount(Elementarist.SpellList["Searing Totem"],spellInCast,exspell1,exspell2)) then
-			if (fireTotemName == "") or (fireTotemDuration and (fireTotemStart + fireTotemDuration - currentTime ) -timeshift <= 20) then
- 				return Elementarist.SpellList["Searing Totem"];
+		-- Flametongue
+		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
-
-		-- Last Priority : if nothing else lighting bolt for the win!
+
+		-- Lightning Bolt
 		return Elementarist.SpellList["Lightning Bolt"]
 	end;
 	MiscSpell = function(self)