Skip to content

Commit

Permalink
pushed all rotations for sk into debug ui and added buff rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Dec 28, 2023
1 parent 9a12668 commit e65179d
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 3 deletions.
19 changes: 17 additions & 2 deletions class_configs/shd_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ return {
[13] = "Drape of the Akheva",
[14] = "Drape of the Ankexfen",
},
['Convenant'] = {
['Covenant'] = {
[1] = "Grim Covenant",
[2] = "Venril's Covenant",
[3] = "Gixblat's Covenant",
Expand Down Expand Up @@ -549,7 +549,22 @@ return {
},
['DPS'] = {
['Rotation'] = {
['Buff'] = {},
['Buff'] = {
[1] = { name="Dark Lord's Unity (Azia)", type="AA", cond=function(self) return self:castDLU() and not mq.TLO.Me.FindBuff("name "..tostring(mq.TLO.Me.AltAbility("Dark Lord's Unity (Azia)").Spell.Trigger(1).BaseName()))() end },
[2] = { name="Skin", type="Spell", cond=function(self, spell) return RGMercUtils.SelfBuffCheck(spell) end },
[3] = { name="Horror", type="Spell", cond=function(self, spell) return not self:castDLU() and RGMercUtils.SelfBuffCheck(spell) end },
[4] = { name="Demeanor", type="Spell", cond=function(self, spell) return not self:castDLU() and RGMercUtils.SelfBuffCheck(spell) end },
[5] = { name="CloakHP", type="Spell", cond=function(self, spell) return not self:castDLU() and RGMercUtils.SelfBuffCheck(spell) end },
[6] = { name="SelfDS", type="Spell", cond=function(self, spell) return not self:castDLU() and mq.TLO.FindItemCount(spell.NoExpendReagentID(1))() > 0 and RGMercUtils.SelfBuffCheck(spell) end },
[7] = { name="Shroud", type="Spell", cond=function(self, spell) return not self:castDLU() and RGMercUtils.SelfBuffCheck(spell) end },
[8] = { name="Covenant", type="Spell", cond=function(self, spell) return not self:castDLU() and RGMercUtils.SelfBuffCheck(spell) end },
[9] = { name="CallAtk", type="Spell", cond=function(self, spell) return not self:castDLU() and RGMercUtils.SelfBuffCheck(spell) end },
[10] = { name="TempHP", type="Spell", cond=function(self, spell) return RGMercUtils.SelfBuffCheck(spell) end },
[11] = { name="HealBurn", type="Spell", cond=function(self, spell) return RGMercUtils.SelfBuffCheck(spell) end },
[12] = { name="Voice of Thule", type="AA", cond=function(self) return RGMercUtils.SelfBuffAACheck("Voice of Thule") end },
[13] = { name="PetSpell", type="Spell", cond=function(self, spell) return not mq.TLO.Me.Pet.ID() and self.settings.DoPet and mq.TLO.FindItemCount(spell.ReagentID(1))() > 0 end },
[14] = { name="PetHaste", type="Spell", cond=function(self, spell) return RGMercUtils.SelfBuffPetCheck(spell) end },
},
['Debuff'] = {},
['Heal'] = {},
['DPS'] = {},
Expand Down
15 changes: 15 additions & 0 deletions modules/shd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function Module:LoadSettings()
self.settings.StartLifeTap = self.settings.StartLifeTap or 100
self.settings.BurnSize = self.settings.BurnSize or 1
self.settings.BurnAuto = self.settings.BurnAuto or false
self.settings.DoPet = self.settings.DoPet or true
newCombatMode = true
end

Expand All @@ -69,6 +70,17 @@ function Module.New()
return newModule
end

-- helper function for advanced logic to see if we want to use Darl Lord's Unity
function Module:castDLU()
if not Module.ResolvedActionMap['Shroud'] then return false end

local res = mq.TLO.Spell(Module.ResolvedActionMap['Shroud']).Level() <= (mq.TLO.Me.AltAbility("Dark Lord's Unity (Azia)").Spell.Level() or 0) and
mq.TLO.Me.AltAbility("Dark Lord's Unity (Azia)").MinLevel() <= mq.TLO.Me.Level() and
mq.TLO.Me.AltAbility("Dark Lord's Unity (Azia)").Rank() > 0

return res
end

function Module:setLoadOut(t)
Module.SpellLoadOut = {}
Module.ResolvedActionMap = {}
Expand Down Expand Up @@ -164,6 +176,9 @@ function Module:Render()
self.settings.DoDiretap, pressed = RGMercUtils.RenderOptionToggle("##_bool_do_diretap", "Use Diretap", self.settings.DoDiretap)
newCombatMode = newCombatMode or pressed

self.settings.DoPet, pressed = RGMercUtils.RenderOptionToggle("##_bool_do_pet", "Cast Pet", self.settings.DoPet)
if pressed then self:SaveSettings(true) end

self.settings.DoBandolier, pressed = RGMercUtils.RenderOptionToggle("##_bool_do_bandolier", "Use Bandolier", self.settings.DoBandolier)
if pressed then self:SaveSettings(true) end

Expand Down
34 changes: 33 additions & 1 deletion utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,32 @@ function Utils.GetBestSpell(t)
return selectedSpell
end

function Utils.SelfBuffPetCheck(spell)
if not spell then return false end
return not mq.TLO.Me.PetBuff(spell.Name()) and spell.StacksPet() and mq.TLO.Me.Pet.ID() > 0
end

function Utils.SelfBuffCheck(spell)
if not spell then return false end
local res = not mq.TLO.Me.FindBuff("id "..tostring(spell.ID())).ID() and spell.Stacks()
return res
end

function Utils.SelfBuffAACheck(aaName)
return not mq.TLO.Me.FindBuff("id "..tostring(mq.TLO.Spell(mq.TLO.Me.AltAbility(aaName)).ID())).ID() and
not mq.TLO.Me.FindBuff("id "..tostring(mq.TLO.Me.AltAbility(aaName).Spell.Trigger(1).ID())).ID() and
not mq.TLO.Me.Aura(tostring(mq.TLO.Spell(aaName).RankName())).ID() and
mq.TLO.Spell(mq.TLO.Me.AltAbility(aaName).Spell.RankName()).Stacks() and
mq.TLO.Spell(mq.TLO.Me.AltAbility(aaName).Spell.Trigger(1)).Stacks()
end

function Utils.DotSpellCheck(config, spell)
if not spell then return false end
return not mq.TLO.Target.FindBuff("id "..tostring(spell.ID())).ID() and spell.StacksTarget() and mq.TLO.Target.PctHPs > config.HPStopDOT
end

function Utils.DetSpellCheck(config, spell)
if not spell then return false end
return not mq.TLO.Target.FindBuff("id "..tostring(spell.ID())).ID() and spell.StacksTarget()
end

Expand All @@ -122,6 +143,17 @@ function Utils.DetAACheck(aaId)
(Me.AltAbility(aaid).Spell.StacksTarget() or Me.AltAbility(aaid).Spell.Trigger(1).StacksTarget())
end

function Utils.Tooltip(desc)
ImGui.SameLine()
if ImGui.IsItemHovered() then
ImGui.BeginTooltip()
ImGui.PushTextWrapPos(ImGui.GetFontSize() * 25.0)
ImGui.Text(desc)
ImGui.PopTextWrapPos()
ImGui.EndTooltip()
end
end

function Utils.DrawInspectableSpellIcon(iconID, spell)
local cursor_x, cursor_y = ImGui.GetCursorPos()

Expand Down Expand Up @@ -182,7 +214,7 @@ function Utils.RenderRotationTable(s, n, t, map)
ImGui.Text(tostring(idx))
ImGui.TableNextColumn()
if entry.cond then
local pass = entry.cond(s, mq.TLO.Spell(entry.name))
local pass = entry.cond(s, map[entry.name] or mq.TLO.Spell(entry.name))
if pass == true then
ImGui.PushStyleColor(ImGuiCol.Text, 0.03,1.0,0.3,1.0)
ImGui.Text(ICONS.MD_CHECK)
Expand Down

0 comments on commit e65179d

Please sign in to comment.