Enhancement Update

2 posts Page 1 of 1
Laag
Posts: 3
Joined: 20 Jul 2018, 12:43


I found a few things wrong with the Enhancement spec and also added a check on targets within melee range to trigger Crash Lightning in the rotation.
  • Added variable "_FlametongueAura" to use correct spell ID. (previous checks for the aura were using the spell ID for the castable spell instead of the aura)
  • Added variable "_CrashLightningAura" with proper spell ID
  • Added variable "targets" to check for multiple targets within melee range.
  • Added Crash Lightning usage into the rotation depending on talent, aura, and number of targets in melee range
  • Fixed Flametongue usage in rotation. (was not properly identifying aura and returned Flametongue too often)
  • Fixed Windstrike usage with Ascendency to only require 10 maelstrom. (previously required 30, but Ascendency reduces its cost to 10)
  • Fixed catchall and end of rotation to just return Rockbiter. (previously returned Flametongue)
Code: Select all
local _CrashLightningAura = 187878;
local _FlametongueAura = 194084;

function Shaman:Enhancement(timeShift, currentSpell, gcd, talents)
	local healthPct = UnitHealth('player') / UnitHealthMax('player') * 100;
	local mael = UnitPower('player', Enum.PowerType.Maelstrom);
	local rockbCd, rockbCharges = MaxDps:SpellCharges(_Rockbiter, timeShift);
	local stormstrike = _Stormstrike;

	if MaxDps:Aura(_AscendanceEnh, timeShift) and not MaxDps:FindSpell(_Stormstrike) then
		stormstrike = _Windstrike;
	end

	local fs, fsCd = MaxDps:SpellAvailable(_FeralSpirit, timeShift);
	local ft, ftCd = MaxDps:SpellAvailable(_Flametongue, timeShift);
	local targets = MaxDps:TargetsInRange(_LavaLash);

	MaxDps:GlowCooldown(_FeralSpirit, fs);
	MaxDps:GlowCooldown(_AscendanceEnh, talents[_AscendanceEnh] and MaxDps:SpellAvailable(_AscendanceEnh, timeShift));
	MaxDps:GlowCooldown(_LightningShield, talents[_LightningShield] and not MaxDps:Aura(_LightningShield, timeShift + 4));

	-- 0. Cast Rockbiter with Landslide if the buff is not currently active and you are about to reach 2 charges.
	if talents[_Landslide] and not MaxDps:Aura(_Landslide, timeShift) and rockbCharges >= 1.7 then
		return _Rockbiter;
	end

	-- 1. Cast Fury of Air if it is not present.
	if talents[_FuryofAir] and not MaxDps:Aura(_FuryofAir) then
		return _FuryofAir;
	end

	-- 2. Cast Totem Mastery if not active.
	if talents[_TotemMastery] then
		local totemMastery, tmExp = Shaman:TotemMastery();
		if tmExp < 10 or not MaxDps:Aura(_StormTotem, timeShift) then
			return _TotemMastery;
		end
	end
	
	-- 3. Cast Crash Lighting if 2 targets are in range and buff is not present
	if MaxDps:SpellAvailable(_CrashLightning, timeShift) and not MaxDps:Aura(_CrashLightningAura, timeShift) and targets >= 2 then
		return _CrashLightning;
	end
	
	-- 4. Cast Windstrike during Ascendence with Stormbringer active.
	if talents[_AscendanceEnh] and MaxDps:Aura(_AscendanceEnh) and (
		MaxDps:Aura(_Stormbringer, timeShift) or
		(MaxDps:SpellAvailable(_Windstrike, timeShift) and mael >= 10)
	) then
		return _Windstrike;
	end

	-- 5. Cast Flametongue if the buff is not active.
	if not MaxDps:Aura(_FlametongueAura, timeShift) and ft then
		return _Flametongue;
	end
	
	-- 6. Cast Feral Spirit on cooldown (glow effect)

	-- 7. Cast Earthen Spike.
	if talents[_EarthenSpike] and MaxDps:SpellAvailable(_EarthenSpike, timeShift) and mael >= 20 then
		return _EarthenSpike;
	end

	-- 8. Cast Frostbrand with Hailstorm to maintain the Hailstorm buff.
	if talents[_Hailstorm] and not MaxDps:Aura(_Frostbrand, timeShift) and mael >= 20 then
		return _Frostbrand;
	end
	
	-- 9. Cast Ascendance on cooldown (glow effect)

	-- 10. Cast Stormstrike with Stormbringer active.
	if MaxDps:Aura(_Stormbringer, timeShift) then
		return stormstrike;
	end

	-- 11. Cast Lava Lash with Hot Hand procs.
	if talents[_HotHand] and MaxDps:Aura(_HotHand, timeShift) then
		return _LavaLash;
	end

	-- 12. Cast Stormstrike.
	if MaxDps:SpellAvailable(_Stormstrike, timeShift) and mael >= 30  then
		return stormstrike;
	end
	
	-- 13 Cast Crash Lightning if 3 targets are in range
	if MaxDps:SpellAvailable(_CrashLightning, timeShift) and mael >= 20 and targets >= 3 then
		return _CrashLightning;
	end

	-- 14. Cast Lightning Bolt with Fury of Air and Overcharge if above 50 Maelstrom.
	if talents[_Overcharge] and MaxDps:SpellAvailable(_LightningBoltEnh, timeShift) and (
		(mael >= 50 and talents[_FuryofAir]) or
		(mael >= 40 and not talents[_FuryofAir])
	) then
		return _LightningBoltEnh;
	end

	-- 15. Cast Flametongue to trigger Searing Assault.
	if talents[_SearingAssault] and not MaxDps:TargetAura(_SearingAssault, timeShift) and ft then
		return _Flametongue;
	end

	-- 16. Cast Sundering
	if talents[_Sundering] and MaxDps:SpellAvailable(_Sundering, timeShift) and mael >= 20 then
		return _Sundering;
	end

	-- 17. Cast Rockbiter if below 70 Maelstrom and about to reach 2 charges.
	if rockbCharges >= 1.7 and mael < 70 then
		return _Rockbiter;
	end

	-- 18. Cast Frostbrand with Hailstorm if buff is about to expire.
	if talents[_Hailstorm] and not MaxDps:Aura(_Frostbrand, timeShift + 4) then
		return _Frostbrand;
	end

	-- 19 Cast Crash Lightning if 2 targets are in range
	if MaxDps:SpellAvailable(_CrashLightning, timeShift) and mael >= 20 and targets >= 2 then
		return _CrashLightning;
	end

	-- 20. Cast Crash Lighting on cooldown (if talented for Crashing Storm)
	if talents[_CrashingStorm] and MaxDps:SpellAvailable(_CrashLightning, timeShift) and mael >= 20 then
		return _CrashLightning;
	end
	
	-- 21. Cast Lava Lash with Fury of Air if above 50 Maelstrom.
	if ((mael >= 50 and talents[_FuryofAir]) or
		(mael >= 40 and not talents[_FuryofAir])
	) then
		return _LavaLash;
	end

	-- (Extra) Cast Flametongue if the buff is about to expire.
	if not MaxDps:Aura(_FlametongueAura, timeShift + 4) and ft then
		return _Flametongue;
	end

	-- 22. Cast Rockbiter
	return _Rockbiter;

end
Kaminaris
Site Admin
Posts: 350
Joined: 25 Jun 2017, 03:45


I will take a look at it when i finish working on AuctionFaster
2 posts Page 1 of 1
drogie łóżka stolik kawowy stół dębowy rozkładany