Skip to content

Instantly share code, notes, and snippets.

@djsegal
Last active April 29, 2021 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djsegal/097516315d715ed11f74b96f19bbf187 to your computer and use it in GitHub Desktop.
Save djsegal/097516315d715ed11f74b96f19bbf187 to your computer and use it in GitHub Desktop.
Example boomkin simple rotation
function()
local BL = {
Wrath = 190984,
Starfire = 194153,
EclipseSolar = 48517,
EclipseLunar = 48518,
Starsurge = 78674,
Starfall = 191034,
Sunfire = 93402,
SunfireAura = 164815,
Moonfire = 8921,
MoonfireAura = 164812,
StellarFlare = 202347,
StellarDrift = 202354
};
function _BoomkinInstants()
local fd = MaxDps.FrameData;
if fd.isMany and not fd.debuff[BL.SunfireAura].up then
return BL.Sunfire;
end
local canStarfall = fd.lunarPower >= 50;
if fd.isAoe and canStarfall and fd.buff[BL.Starfall].refreshable then
return BL.Starfall;
end
local shouldStarsurge = fd.lunarPower >= 97.5;
local canStarsurge = fd.lunarPower >= 30;
if fd.isAoe then
canStarsurge = fd.lunarPower >= 80;
end
if fd.eclipseInAny then
local starsurgeRequirementsMin =
(
fd.buff[BL.EclipseSolar].remains > 9.5 or
fd.buff[BL.EclipseLunar].remains > 9.5
);
local starsurgeRequirementsMax =
(
fd.buff[BL.EclipseSolar].remains > 4 or
fd.buff[BL.EclipseLunar].remains > 4
);
if canStarsurge and starsurgeRequirementsMin then
return BL.Starsurge;
end
if shouldStarsurge and starsurgeRequirementsMax then
return BL.Starsurge;
end
end
return nil;
end
function _BoomkinEclipse()
local fd = MaxDps.FrameData;
if fd.eclipseInAny then
return nil
end
if fd.wrathCount > 0 and fd.starfireCount > 0 then
if fd.isAoe then
fd.cachedSpell = BL.Starfire;
return BL.Starfire
else
fd.cachedSpell = BL.Wrath;
return BL.Wrath
end
end
if fd.wrathCount == 0 and fd.starfireCount == 0 then
return fd.cachedSpell;
end
if fd.wrathCount > 0 then
fd.cachedSpell = BL.Wrath;
return BL.Wrath
end
if fd.starfireCount > 0 then
fd.cachedSpell = BL.Starfire;
return BL.Starfire
end
return nil
end
function _BoomkinDots()
local fd = MaxDps.FrameData;
local dotRequirementsMin =
(
fd.buff[BL.EclipseSolar].remains > 2 or
fd.buff[BL.EclipseLunar].remains > 2
);
local dotRequirementsMax =
(
fd.buff[BL.EclipseSolar].remains > 9.5 or
fd.buff[BL.EclipseLunar].remains > 9.5
);
if not dotRequirementsMin then return nil end
if dotRequirementsMax then return nil end
if not fd.debuff[BL.SunfireAura].up then return BL.Sunfire end
if not fd.debuff[BL.MoonfireAura].up then return BL.Moonfire end
local canStellarFlare = fd.talents[BL.StellarFlare] and fd.currentSpell ~= BL.StellarFlare;
if canStellarFlare and not fd.debuff[BL.StellarFlare].up then
return BL.StellarFlare;
end
if fd.debuff[BL.SunfireAura].refreshable then return BL.Sunfire end
if fd.debuff[BL.MoonfireAura].refreshable then return BL.Moonfire end
if canStellarFlare and fd.debuff[BL.StellarFlare].refreshable then
return BL.StellarFlare;
end
end
local fd = MaxDps.FrameData;
local targets = MaxDps:SmartAoe();
if fd.talents[BL.StellarDrift] then
fd.isAoe = ( targets > 1 )
else
fd.isAoe = ( targets > 2 )
end
fd.isMany = ( targets > 4 )
local lunarPower = UnitPower('player', LunarPower);
local wrathCount = GetSpellCount(BL.Wrath);
local starfireCount = GetSpellCount(BL.Starfire);
local origWrathCount = wrathCount;
local origStarfireCount = starfireCount;
if fd.currentSpell == BL.Wrath then
lunarPower = lunarPower + 6;
wrathCount = wrathCount - 1;
elseif fd.currentSpell == BL.Starfire then
lunarPower = lunarPower + 8;
starfireCount = starfireCount - 1;
elseif fd.currentSpell == BL.StellarFlare then
lunarPower = lunarPower + 8;
end
fd.lunarPower = lunarPower;
fd.wrathCount = wrathCount;
fd.starfireCount = starfireCount;
fd.eclipseInLunar = fd.buff[BL.EclipseLunar].up or (origStarfireCount == 1 and fd.currentSpell == BL.Starfire);
fd.eclipseInSolar = fd.buff[BL.EclipseSolar].up or (origWrathCount == 1 and fd.currentSpell == BL.Wrath);
fd.eclipseInBoth = fd.eclipseInSolar and fd.eclipseInLunar;
fd.eclipseInAny = fd.eclipseInSolar or fd.eclipseInLunar;
local curSpell = nil
local boomkinTypes = {
_BoomkinInstants,
_BoomkinEclipse,
_BoomkinDots
}
local boomkinTypesCount = #boomkinTypes
for i = 1,boomkinTypesCount do
curSpell = boomkinTypes[i]()
if curSpell ~= nil then break end
end
if curSpell ~= nil then return curSpell end
if fd.eclipseInBoth then
if fd.isAoe then
fd.cachedSpell = BL.Starfire;
return BL.Starfire
else
fd.cachedSpell = BL.Wrath;
return BL.Wrath
end
end
if fd.isMany then
if fd.eclipseInLunar then
fd.cachedSpell = BL.Starfire;
return BL.Starfire
end
return nil
end
if fd.eclipseInLunar then
fd.cachedSpell = BL.Starfire;
return BL.Starfire
end
if fd.eclipseInSolar then
fd.cachedSpell = BL.Wrath;
return BL.Wrath
end
return fd.cachedSpell;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment