Last active
May 3, 2021 11:04
-
-
Save djsegal/6b232dbcae1b8222368da6650096abc8 to your computer and use it in GitHub Desktop.
Example resto druid file for maxdps addon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function() | |
local BL = { | |
Wrath = 5176, | |
Starfire = 197628, | |
EclipseLunar = 48518, | |
EclipseSolar = 48517, | |
Starsurge = 197626, | |
Sunfire = 93402, | |
Moonfire = 8921, | |
SunfireAura = 164815, | |
MoonfireAura = 164812 | |
}; | |
function _BoomkinInstants() | |
local fd = MaxDps.FrameData; | |
if fd.isMany and not fd.debuff[BL.SunfireAura].up then | |
return BL.Sunfire; | |
end | |
if (not fd.isAoe) and (not fd.debuff[BL.MoonfireAura].up) then | |
return BL.Moonfire; | |
end | |
if fd.eclipseInAny then | |
local starsurgeRequirements = | |
( | |
fd.buff[BL.EclipseSolar].remains > 9.5 or | |
fd.buff[BL.EclipseLunar].remains > 9.5 | |
); | |
if fd.cooldown[BL.Starsurge].ready and starsurgeRequirements 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.Wrath; | |
return BL.Wrath | |
else | |
fd.cachedSpell = BL.Starfire; | |
return BL.Starfire | |
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 not fd.debuff[BL.SunfireAura].up then return BL.Sunfire end | |
if not fd.debuff[BL.MoonfireAura].up then return BL.Moonfire end | |
if dotRequirementsMax then return nil end | |
if fd.debuff[BL.SunfireAura].refreshable then return BL.Sunfire end | |
if fd.debuff[BL.MoonfireAura].refreshable then return BL.Moonfire end | |
end | |
local fd = MaxDps.FrameData; | |
local targets = MaxDps:SmartAoe(); | |
fd.isAoe = ( targets > 2 ) | |
fd.isMany = ( targets > 4 ) | |
local wrathCount = GetSpellCount(BL.Wrath); | |
local starfireCount = GetSpellCount(BL.Starfire); | |
local origWrathCount = wrathCount; | |
local origStarfireCount = starfireCount; | |
if fd.currentSpell == BL.Wrath then | |
wrathCount = wrathCount - 1; | |
elseif fd.currentSpell == BL.Starfire then | |
starfireCount = starfireCount - 1; | |
end | |
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