Skip to content

Commit

Permalink
Mage work.
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Jan 9, 2024
1 parent 0a47e82 commit 14acc41
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 14 deletions.
59 changes: 53 additions & 6 deletions class_configs/mag_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ _ClassConfig = {
'Fire',
'PetTank',
},
['OnModeChange'] = function(self, mode)
if mode == "PetTank" then
RGMercUtils.DoCmd("/pet taunt on")
RGMercUtils.DoCmd("/pet resume on")
else
RGMercUtils.DoCmd("/pet taunt off")
end
end,
['ItemSets'] = {
['Epic'] = {
"Focus of Primal Elements",
Expand Down Expand Up @@ -767,7 +775,7 @@ _ClassConfig = {
name = 'PetHealPoint',
state = 1,
steps = 1,
cond = function(self, _) return mq.TLO.Me.Pet.PctHPs() < self.settings.PetHealPct end,
cond = function(self, _) return (mq.TLO.Me.Pet.PctHPs() or 100) < self.settings.PetHealPct end,
},
},
['HealRotations'] = {
Expand All @@ -794,7 +802,16 @@ _ClassConfig = {
targetId = function(self) return RGMercConfig.Globals.AutoTargetID end,
cond = function(self, combat_state)
return combat_state == "Combat" and
RGMercUtils.BurnCheck() and mq.TLO.Me.State():lower() ~= "feign"
RGMercUtils.BurnCheck() and not RGMercUtils.Feigning()
end,
},
{
name = 'Debuff',
state = 1,
steps = 1,
targetId = function(self) return RGMercConfig.Globals.AutoTargetID end,
cond = function(self, combat_state)
return combat_state == "Combat" and not RGMercUtils.Feigning()
end,
},
{
Expand All @@ -803,7 +820,7 @@ _ClassConfig = {
steps = 1,
targetId = function(self) return RGMercConfig.Globals.AutoTargetID end,
cond = function(self, combat_state)
return combat_state == "Combat" and mq.TLO.Me.State():lower() ~= "feign" and RGMercUtils.IsModeActive("PetTank")
return combat_state == "Combat" and not RGMercUtils.Feigning() and RGMercUtils.IsModeActive("PetTank")
end,
},
{
Expand All @@ -812,7 +829,7 @@ _ClassConfig = {
steps = 1,
targetId = function(self) return RGMercConfig.Globals.AutoTargetID end,
cond = function(self, combat_state)
return combat_state == "Combat" and mq.TLO.Me.State():lower() ~= "feign"
return combat_state == "Combat" and not RGMercUtils.Feigning()
end,
},
},
Expand Down Expand Up @@ -1033,7 +1050,6 @@ _ClassConfig = {
return true
end,
},

['Pet Management'] = {
{
name = "Pet Management",
Expand Down Expand Up @@ -1348,8 +1364,37 @@ _ClassConfig = {
},

},
['Debuff'] = {
{
name = "Malaise",
type = "AA",
cond = function(self, aaName)
return self.settings.DoMalo and RGMercUtils.DetAACheck(aaName)
end,
},
{
name = "MaloDebuff",
type = "Spell",
cond = function(self, spell)
return self.settings.DoMalo and RGMercUtils.DetSpellCheck(spell)
end,
},
{
name = "Malaise",
type = "Wind of Malaise",
cond = function(self, aaName)
return self.settings.DoMalo and self.settings.doAEMalo and RGMercUtils.DetAACheck(aaName)
end,
},
},
['Downtime'] = {

{
name = "PetAura",
type = "Spell",
cond = function(self, spell)
return RGMercUtils.AuraActiveByName(spell.BaseName())
end,
},
},
},
['Spells'] = {
Expand All @@ -1375,6 +1420,8 @@ _ClassConfig = {
['ModRodManaPct'] = { DisplayName = "Mod Rod Mana %", Category = "Pet", Tooltip = "Use Mod Rod at [X]% Mana", Default = 70, Min = 1, Max = 99, },
['DoForce'] = { DisplayName = "Do Force", Category = "Spells & Abilities", Tooltip = "Use Force of Elements AA", Default = true, },
['DoChestClick'] = { DisplayName = "Do Check Click", Category = "Utilities", Tooltip = "Click your chest item", Default = true, },
['DoMalo'] = { DisplayName = "Cast Malo", Category = "Debuffs", Tooltip = "Do Malo Spells/AAs", Default = true, },
['DoAEMalo'] = { DisplayName = "Cast AE Malo", Category = "Debuffs", Tooltip = "Do AE Malo Spells/AAs", Default = false, },
},
}

Expand Down
6 changes: 3 additions & 3 deletions class_configs/nec_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ local _ClassConfig = {
targetId = function(self) return RGMercConfig.Globals.AutoTargetID end,
cond = function(self, combat_state)
return combat_state == "Combat" and
RGMercUtils.BurnCheck() and mq.TLO.Me.State():lower() ~= "feign"
RGMercUtils.BurnCheck() and not RGMercUtils.Feigning()
end,
},
{
Expand All @@ -589,7 +589,7 @@ local _ClassConfig = {
steps = 1,
targetId = function(self) return RGMercConfig.Globals.AutoTargetID end,
cond = function(self, combat_state)
return combat_state == "Combat" and mq.TLO.Me.State():lower() ~= "feign"
return combat_state == "Combat" and not RGMercUtils.Feigning()
end,
},
},
Expand All @@ -606,7 +606,7 @@ local _ClassConfig = {
name = "Harm Shield",
type = "AA",
cond = function(self, aaName)
return mq.TLO.Me.State():lower() ~= "feign" and RGMercUtils.AAReady(aaName) and mq.TLO.Me.PctHPs() > 75 and
return not RGMercUtils.Feigning() and RGMercUtils.AAReady(aaName) and mq.TLO.Me.PctHPs() > 75 and
(mq.TLO.Me.PctAggro() > 80 or mq.TLO.Me.TargetOfTarget.ID() == mq.TLO.Me.ID())
end,
},
Expand Down
8 changes: 4 additions & 4 deletions class_configs/shm_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ local _ClassConfig = {
targetId = function(self) return RGMercUtils.GetMainAssistId() end,
cond = function(self, combat_state)
return combat_state == "Combat" and
RGMercUtils.IsHealing() and mq.TLO.Me.State():lower() ~= "feign"
RGMercUtils.IsHealing() and not RGMercUtils.Feigning()
end,
},
{
Expand All @@ -734,7 +734,7 @@ local _ClassConfig = {
targetId = function(self) return RGMercConfig.Globals.AutoTargetID end,
cond = function(self, combat_state)
return combat_state == "Combat" and
self.ClassConfig.Modes[self.settings.Mode] == "Hybrid" and mq.TLO.Me.State():lower() ~= "feign"
self.ClassConfig.Modes[self.settings.Mode] == "Hybrid" and not RGMercUtils.Feigning()
end,
},
{
Expand All @@ -744,7 +744,7 @@ local _ClassConfig = {
targetId = function(self) return RGMercConfig.Globals.AutoTargetID end,
cond = function(self, combat_state)
return combat_state == "Combat" and
RGMercUtils.BurnCheck() and self.ClassConfig.Modes[self.settings.Mode] == "Hybrid" and mq.TLO.Me.State():lower() ~= "feign"
RGMercUtils.BurnCheck() and self.ClassConfig.Modes[self.settings.Mode] == "Hybrid" and not RGMercUtils.Feigning()
end,
},
{
Expand All @@ -753,7 +753,7 @@ local _ClassConfig = {
steps = 1,
targetId = function(self) return RGMercConfig.Globals.AutoTargetID end,
cond = function(self, combat_state)
return combat_state == "Combat" and self.ClassConfig.Modes[self.settings.Mode] == "Hybrid" and mq.TLO.Me.State():lower() ~= "feign"
return combat_state == "Combat" and self.ClassConfig.Modes[self.settings.Mode] == "Hybrid" and not RGMercUtils.Feigning()
end,
},

Expand Down
2 changes: 1 addition & 1 deletion extras/version.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return { commitId = '394e833 2024-01-08' }
return { commitId = '0a47e82 2024-01-08' }
4 changes: 4 additions & 0 deletions modules/class.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ function Module:SetCombatMode(mode)

self.ReloadingLoadouts = false
RGMercUtils.LoadSpellLoadOut(self.SpellLoadOut)

if self.ClassConfig.OnModeChange then
self.ClassConfig.OnModeChange(self, mode)
end
end

function Module:Render()
Expand Down
11 changes: 11 additions & 0 deletions utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1814,6 +1814,11 @@ function Utils.IAmMA()
return Utils.GetMainAssistId() == mq.TLO.Me.ID()
end

---@return boolean
function Utils.Feigning()
return mq.TLO.Me.State():lower() == "feign"
end

---@return boolean
function Utils.IHaveAggro()
local target = mq.TLO.Target
Expand Down Expand Up @@ -1935,6 +1940,12 @@ function Utils.BuffActiveByID(buffId)
return ((mq.TLO.Me.FindBuff("id " .. tostring(buffId)).ID() or 0) > 0)
end

---@param auraName string
---@return boolean
function Utils.AuraActiveByName(auraName)
return string.find(mq.TLO.Me.Aura(1)() or "", auraName) ~= nil
end

---@param spell MQSpell
---@return boolean
function Utils.DetGOMCheck(spell)
Expand Down

0 comments on commit 14acc41

Please sign in to comment.