Add on update for Bfa/pre-patch

Questions about addon itself.
97 posts Page 9 of 10
rmilyard
Posts: 7
Joined: 16 May 2018, 05:04


Kaminaris thanks for all the work! Warlock been working pretty good. Can't wait for Mage and Rogue.
Wulfknightz
Posts: 11
Joined: 18 Jul 2018, 17:49


DarkKnight#1283 of i could talk on discord just let me know.
Laag
Posts: 1
Joined: 20 Jul 2018, 12:43


I took the code that Chaldan created for Elemental and Restoration Shamans, and made an attempt at adding Enhancement. I left all of his code for the other two specs untouched.

It's still a work in progress as I get an error when switching in and out of Ascendance. When activated, the Stormstrike spell changes to Windstrike and it complains that it can't find the new spell on the bars. I've tried various uses of timeShift within the MaxDps:Aura function, but haven't been able to avoid the error yet. Any and all suggestions are welcome!
Code: Select all
-- Author             : PreZ, Pawel, Laag
-- Create Date        : 2018-08-05
-- Enhancement Update : 2018-08-08

if not MaxDps then
	return;
end

local Shaman = MaxDps:NewModule('Shaman');

local _LightningBolt = 188196;
local _LavaBurst = 51505;
local _FlameShock = 188389;
local _EarthShock = 8042;
local _Earthquake = 61882;
local _UnleashFlame = 165462;
local _Ascendance = 114050;
local _ElementalBlast = 117014;
local _FireElemental = 198067;
local _EarthElemental = 198103;
local _Stormkeeper = 205495;
local _TotemMastery = 210643;
local _PoweroftheMaelstrom = 191861;
local _Icefury = 210714;
local _FrostShock = 196840;
local _AstralShift = 108271;

-- enh
local _LightningShield = 192106;
local _Boulderfist = 246035;
local _Landslide = 197992;
local _Hailstorm = 210853;
local _Frostbrand = 196834;
local _CrashLightning = 187874;
local _Flametongue = 193796;
local _Stormstrike = 17364;
local _Stormbringer = 201845;
local _FeralSpirit = 51533;
local _CrashingStorm = 192246;
local _LavaLash = 60103;
local _LightningBoltEnh = 187837;
local _Rockbiter = 193786;
local _FuryofAir = 197211;
local _Overcharge = 210727;
local _Windsong = 201898;
local _HotHand = 201900;
local _Windfury = 33757;
local _FeralLunge = 196884;
local _WindRushTotem = 192077;
local _EarthenSpike = 188089;
local _Windstrike = 115356;
local _GatheringStorms = 198300;
local _SearingAssault = 192087;
local _Sundering = 197214;
local _AscendanceEnh = 114051;

-- resto
local _FlameShockResto = 188838;
local _LightningBoltResto = 403;

-- totems
local _SearingTotem = 3599;
local _ResonanceTotem = 202192;
local _StormElementalTotem = 152256;
local _FireElementalTotem = 2894;
local _EarthElementalTotem = 73903;
local _LiquidMagmaTotem = 192222;

-- auras
local _LavaSurge = 77762;
local _ExposedElements = 260694;

-- talents


function Shaman:Enable()
	MaxDps:Print(MaxDps.Colors.Info .. 'Shaman [Elemental, Enhancement, Restoration]')

	if MaxDps.Spec == 1 then
		MaxDps.NextSpell = Shaman.Elemental;
	elseif MaxDps.Spec == 2 then
		MaxDps.NextSpell = Shaman.Enhancement;
	elseif MaxDps.Spec == 3 then
		MaxDps.NextSpell = Shaman.Restoration;
	end

	return true;
end

function Shaman:Elemental(timeShift, currentSpell, gcd, talents)

	local mael = UnitPower('player', Enum.PowerType.Maelstrom);
	local healthPct = UnitHealth('player') / UnitHealthMax('player') * 100;
	local lavaCd, lavaCharges = MaxDps:SpellCharges(_LavaBurst, timeShift);
	local ascendance = MaxDps:Aura(_Ascendance, timeShift);
	local ascendanceCD = MaxDps:SpellAvailable(_Ascendance, timeShift);
	local ashift = MaxDps:SpellAvailable(_AstralShift, timeShift);
	local fet = MaxDps:SpellAvailable(_FireElemental, timeShift);
	local eet = MaxDps:SpellAvailable(_EarthElemental, timeShift);
	local stormk, stormkCD = MaxDps:SpellAvailable(_Stormkeeper, timeShift);
	local fs = MaxDps:TargetAura(_FlameShock, 4 + timeShift);
	local pet = UnitExists('pet');

	if currentSpell == _LavaBurst then
		mael = mael + 10;
		if lavaCharges > 0 then
			lavaCharges = lavaCharges - 1;
		end
	end

	if currentSpell == _LightningBolt then
		mael = mael + 8;
	end

	MaxDps:GlowCooldown(_Ascendance, talents[_Ascendance] and ascendanceCD);
	MaxDps:GlowCooldown(_FireElemental, not pet and fet);
	MaxDps:GlowCooldown(_EarthElemental, not pet and not fet and eet);
	MaxDps:GlowCooldown(_AstralShift, ashift and healthPct < 30);

	if talents[_TotemMastery] then
	    local restotem = MaxDps:Aura(_ResonanceTotem, timeShift);
	    local totemMastery, tmExp = Shaman:TotemMastery();
	    MaxDps:GlowCooldown(_TotemMastery, tmExp < 10 or not restotem);
	end

	-- May as well get a shot off before they run towards you!
	if not UnitAffectingCombat('player') then
		return _LightningBolt;
	end

	if not fs and MaxDps:SpellAvailable(_FlameShock, timeShift) then
		return _FlameShock;
	end

	if ascendance then
		if mael >= 92 then
			return _EarthShock;
		end

		if lavaCd <= 0 then
			return _LavaBurst;
		end
	end

	if talents[_ElementalBlast] and MaxDps:SpellAvailable(_ElementalBlast, timeShift) and
			not currentSpell == _ElementalBlast then
		return _ElementalBlast;
	end

	if talents[_LiquidMagmaTotem] and MaxDps:SpellAvailable(_LiquidMagmaTotem, timeShift) then
		return _LiquidMagmaTotem;
	end

	if not ascendance and stormk and not currentSpell == _Stormkeeper then
		return _Stormkeeper;
	end

	if MaxDps:Aura(_PoweroftheMaelstrom, timeShift) and lavaCharges < 2 then
		return _LightningBolt;
	end

	if talents[_Icefury] and MaxDps:Aura(_Icefury, timeShift) and mael >= 20 then
		return _FrostShock;
	end

	if mael >= 92 and not MaxDps:TargetAura(_ExposedElements, timeShift) then
		return _EarthShock;
	end

	if lavaCd <= 0 then
		return _LavaBurst;
	end

	if mael >= 60 and not MaxDps:TargetAura(_LavaSurge, timeShift) then
		return _EarthShock;
	end

	return _LightningBolt;
end

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) then
		stormstrike = _Windstrike;
	end

	local fs, fsCd = MaxDps:SpellAvailable(_FeralSpirit, timeShift);
	local ftCd = MaxDps:SpellAvailable(_Flametongue, timeShift);

	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));

	-- 1. 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 MaxDps:SpellAvailable(_Rockbiter, timeShift) and rockbCharges >= 2 then
		return _Rockbiter;
	end
	
	-- 2. Cast Fury of Air if it is not present.
	if talents[_FuryofAir] and not MaxDps:PersistentAura(_FuryofAir) then
		return _FuryofAir;
	end

	-- 3. Cast Totem Mastery if not active.
	if talents[_TotemMastery] then
	    local restotem = MaxDps:Aura(_ResonanceTotem, timeShift);
	    local totemMastery, tmExp = Shaman:TotemMastery();
	    MaxDps:GlowCooldown(_TotemMastery, tmExp < 10 or not restotem);
	end

	-- 4. Cast Windstrike during Ascendence with Stormbringer active.
	if talents[_AscendanceEnh] and MaxDps:Aura(_AscendanceEnh) and MaxDps:Aura(_Stormbringer, timeShift) then
		return _Windstrike;
	end

	-- 4a. Cast Windstrike during Ascendence.
	if talents[_AscendanceEnh] and MaxDps:Aura(_AscendanceEnh) and MaxDps:SpellAvailable(_Windstrike, timeShift) and mael >= 30 then
		return _Windstrike;
	end

	-- 5. Cast Flametongue if the buff is not active.
	if not MaxDps:Aura(_Flametongue, timeShift) and ftCd then
		return _Flametongue;
	end

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

	-- 7. 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

	-- 8. Cast Stormstrike with Stormbringer active.
	if not MaxDps:Aura(_AscendanceEnh) and MaxDps:Aura(_Stormbringer, timeShift) then
		return _Stormstrike;
	end

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

	-- 11. Cast Stormstrike.
	if not MaxDps:Aura(_AscendanceEnh) and MaxDps:SpellAvailable(_Stormstrike, timeShift) and mael >= 30  then
		return _Stormstrike;
	end

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

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

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

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

	-- 15. Cast Rockbiter if below 70 Maelstrom and about to reach 2 charges.
	if MaxDps:SpellAvailable(_Rockbiter, timeShift) and rockbCharges >= 2 and mael >= 70 then
		return rockbiter;
	end

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

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

	-- 18. Cast Lava Lash with Fury of Air if above 50 Maelstrom.
	if talents[_FuryofAir] and mael > 50 then
		return _LavaLash;
	end

	-- 18a. Cast Lava Lash if above 40 Maelstrom.
	if not talents[_FuryofAir] and mael > 40 then
		return _LavaLash;
	end

	-- 19. Cast Rockbiter
	if MaxDps:SpellAvailable(_Rockbiter, timeShift) then
		return _Rockbiter;
	end

	-- 20. Cast Flametongue if nothing else
	return _Flametongue;
end

function Shaman:Restoration(timeShift, currentSpell, gcd, talents)
	local healthPct = UnitHealth('player') / UnitHealthMax('player') * 100;
	local lavaCd, lavaCharges = MaxDps:SpellCharges(_LavaBurst, timeShift);
	local ashift = MaxDps:SpellAvailable(_AstralShift, timeShift);
	local eet = MaxDps:SpellAvailable(_EarthElemental, timeShift);
	local fs = MaxDps:TargetAura(_FlameShockResto, 4 + timeShift);

	if currentSpell == _LavaBurst then
		if lavaCharges > 0 then
			lavaCharges = lavaCharges - 1;
		end
	end

	MaxDps:GlowCooldown(_EarthElemental, eet);
	MaxDps:GlowCooldown(_AstralShift, ashift and healthPct < 30);

	-- May as well get a shot off before they run towards you!
	if not UnitAffectingCombat('player') then
		return _LightningBoltResto;
	end

	if not fs and MaxDps:SpellAvailable(_FlameShockResto, timeShift) then
		return _FlameShockResto;
	end

	if MaxDps:Aura(_PoweroftheMaelstrom, timeShift) and lavaCharges < 2 then
		return _LightningBoltResto;
	end

	if lavaCd <= 0 then
		return _LavaBurst;
	end

	return _LightningBoltResto;
end

function Shaman:Totem()
	local have, totemName, startTime, duration = GetTotemInfo(1);
	if not have then
		return '', 0;
	end;
	local expiration = startTime + duration - GetTime();
	return totemName, expiration;
end

function Shaman:TotemMastery()
	local tmName = GetSpellInfo(_TotemMastery);

	for i = 1, 4 do
		local haveTotem, totemName, startTime, duration = GetTotemInfo(i);
		if haveTotem and totemName == tmName then
			return true, startTime + duration - GetTime();
		end
	end
	return false, 0;
end
Kaminaris
Site Admin
Posts: 266
Joined: 25 Jun 2017, 03:45


Since you made some progress this will be next to fix
Kaminaris
Site Admin
Posts: 266
Joined: 25 Jun 2017, 03:45


Shaman module pushed. Both Ele and Enh needs a deep tests
Kaminaris
Site Admin
Posts: 266
Joined: 25 Jun 2017, 03:45


I just pushed a release of main addon. Modules will stay in beta for at least a week.

I am looking for someone good at video editing. Its about time to update videos. I will provide a footage but if you wish to help and know how to make good videos please contact me on PM.
Wulfknightz
Posts: 11
Joined: 18 Jul 2018, 17:49


i main enhance shaman so when i get a chance ill try it out
Chaldan
Posts: 3
Joined: 03 Aug 2018, 18:41


11 Aug 2018, 00:37Kaminaris wrote:
I just pushed a release of main addon. Modules will stay in beta for at least a week.
I'm looking at the source, and I have a few questions. I mainly focused on Elemental,. which is one of my primary specs (the other being Resto, but I don't dmg as resto unless I REALLY need to.)

First, why did you remove the glow on AstralShift if the health percentage is < 30%? This was something I added specifically to ensure that if your health was getting low, you would get a big notification to cast your damn damage reduction cooldown before you die! (You are still even calculating health percentage for enh/resto, but not using it - and you removed this calculation for elem). I didn't put it as part of the rotation, but it DOES address one of the things even Icy Vines states is a pitfall when playing the class - people forget about this buff when their health is low and die because of it, having a glow pop up when health is low will remind people it's there :)

Second, (Elemental) You changed Totem Mastery to again be a required part of the rotation. I changed this (in one of my updates) to make this a glow. There are many times where I don't bother to drop totems when I am either powerful enough or killing on the move where I will frequently go out of range of them. Casting this totem set burns a GCD, which if I have enough power and I'm going to go out of their range frequently. However by having this as part of the rotation instead of a glow, if I DON'T drop it, then my rotation is 'held' until I do. It should be treated more like a buff (which would be a glow) than an essential part of the rotation that prevents other parts being used. Additionally, I am not sure why you changed to checking for the presence of the StormTotem instead of ResonanceTotem, though I guess that doesn't make much difference, the latter just seems a more logical choice to check for.

Third, (Elemental) You are putting a glow on both Fire and Earth elemental at the same time. I mean you could use both at once, but usually you want to prefer the dmg elemental vs. the tank elemental in this spec. And having them both glowing might be a little cluttered. Though I guess this is personal choice.

Fourth, (Elemental) The recommendation I've seen is that Lava Burst (higher dmg vs. cast time) be preferred over Lightning Bolt as a timed cast, I'm not sure if I'm reading the code correctly, but unless I'm mistaken the code currently will only perform Lava Burst is currently instant cast? I'm not sure. (update) I did a quick check, and it appears Lava Burst is indeed being used whenever it's available, so this is probably fine.

Fifth, (Elemental) You removed the 'first strike' lightning bolt, which you left in for Elemental. This is useful for when you are not in combat, you can use a lightning bolt to get some damage on the target before you even pull aggro, and the cast time doesn't matter. Since the next spell is flame shock, which is an instant cast. ie. if out of combat, lightning bolt should be the go to for 'free' damage before your rotation is important.

Sixth, I'm not sure how much efficiency matters in these files. Maybe not at all, but there seems to be a lot of opportunity to skip many evaluations unless necessary. For example, the call to Shaman::TotemMastery() can be avoided completely if talents[_TotemMastery] is false. I'm not sure if this makes a big difference, but it seems common.

I've not yet played with your new beta Shaman module, but these are some observations I had vs. the version I posted. I've yet to try respecing to try out the Storm Elemental or use Ice Fury, they aren't in my current spec.

Thanks for updating the official beta for this class though! :)
Kaminaris
Site Admin
Posts: 266
Joined: 25 Jun 2017, 03:45


First, why did you remove the glow on AstralShift if the health percentage is < 30%?
Because defensive cooldowns are meant to be used when really needed not when you reach 30%. On raids that is for healers to decide. it is much much more complex than just being at 30% hp. And it would be confusing since offensive cooldowns are the same color.

So no defensive cooldowns should ever be inside maxdps.
I don't bother to drop totems when I am either powerful enough or killing on the move where I will frequently go out of range of them
MaxDps is suppose to be used on encounters that last longer than 20 seconds. If you are facing normal mobs you can just slap random buttons. You don't need rotation helper when fighting garbage. You need it when facing ex raid boss and then you need to drop totems, before doing anything else. Not doing that would be a dps loss. And it is not a cooldown.

It doesn't really matter which totem you check.
You are putting a glow on both Fire and Earth elemental at the same time. I mean you could use both at once, but usually you want to prefer the dmg elemental vs. the tank elemental in this spec. And having them both glowing might be a little cluttered. Though I guess this is personal choice.
It shouldn't really matter as you will be using both of them on raid bosses.
ou removed the 'first strike' lightning bolt, which you left in for Elemental.
MaxDps doesn't implement precasting/openers simply because it will hinder normal rotation. Yet again, it is suppose to be used on harder encounters, not when facing shit mobs.

If you want to use MaxDps as rotation helper for questing simply make your adjustments in file or add custom rotation (they work in new release). But remember, I wrote MaxDps to be used on raid bosses.
EnderXi
Posts: 2
Joined: 06 Aug 2018, 18:29


thanks for the update for Shaman, will get testing and let you know if there is any issues, love the work and the addon its much appreciated
97 posts Page 9 of 10
drogie łóżka stolik kawowy stół dębowy rozkładany