Skip to content

Commit

Permalink
- Defaulted BattleRez to true for only clerics
Browse files Browse the repository at this point in the history
- Shaman now respect battle rez option
- Necro Safety functions overhall to check XTargets.
- Mages will now correctly pocket pets.
- Ranger will now check for Shared cloak before casting cloaks
  • Loading branch information
DerpleMQ2 committed Mar 10, 2024
1 parent 8d5b5b0 commit 19f997c
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 14 deletions.
1 change: 1 addition & 0 deletions class_configs/clr_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local _ClassConfig = {
['ModeChecks'] = {
IsHealing = function() return true end,
IsCuring = function() return true end,
IsRezing = function() return RGMercUtils.GetSetting('DoBattleRez') or RGMercUtils.GetXTHaterCount() == 0 end,
},
['Modes'] = {
'Heal',
Expand Down
24 changes: 22 additions & 2 deletions class_configs/mag_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ _ClassConfig = {
end
end,
pet_management = function(self)
if not RGMercConfig:GetSettings().DoPet or (RGMercUtils.CanUseAA("Companion's Suspension)") and not RGMercUtils.AAReady("Companion's Suspension")) then
if not RGMercConfig:GetSettings().DoPet or (RGMercUtils.CanUseAA("Companion's Suspension") and not RGMercUtils.AAReady("Companion's Suspension")) then
return false
end

Expand Down Expand Up @@ -1182,10 +1182,30 @@ _ClassConfig = {
end,
cond = function(self)
if self.TempSettings.PocketPet == nil then self.TempSettings.PocketPet = false end
return mq.TLO.Me.Pet.ID() == 0 and RGMercUtils.GetSetting('DoPet') and (self.TempSettings.PocketPet or RGMercUtils.GetXTHaterCount() == 0)
return mq.TLO.Me.Pet.ID() == 0 and RGMercUtils.GetSetting('DoPet') and RGMercUtils.GetXTHaterCount() == 0
end,
custom_func = function(self) return self.ClassConfig.HelperFunctions.summon_pet(self) end,
},
{
name = "Pocket Pet",
type = "CustomFunc",
active_cond = function(self)
return self.TempSettings.PocketPet == true
end,
cond = function(self)
if self.TempSettings.PocketPet == nil then self.TempSettings.PocketPet = false end
return not self.TempSettings.PocketPet and RGMercUtils.GetSetting('DoPocketPet') and RGMercUtils.GetXTHaterCount() == 0
end,
custom_func = function(self) return self.ClassConfig.HelperFunctions.pet_management(self) end,
},
{
name = "Companion's Suspension",
type = "AA",
cond = function(self)
if self.TempSettings.PocketPet == nil then self.TempSettings.PocketPet = false end
return self.TempSettings.PocketPet and RGMercUtils.GetSetting('DoPocketPet') and RGMercUtils.GetXTHaterCount() > 0
end,
},
{
name = "Drop Cursor Items",
type = "CustomFunc",
Expand Down
11 changes: 6 additions & 5 deletions class_configs/nec_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ local _ClassConfig = {
name = 'Safety',
targetId = function(self) return { mq.TLO.Me.ID(), } end,
cond = function(self, combat_state)
return combat_state == "Combat"
return combat_state == "Combat" and (RGMercUtils.IHaveAggro(RGMercUtils.GetSetting('StartFDPct')) or RGMercUtils.Feigning())
end,
},
{
Expand Down Expand Up @@ -704,22 +704,21 @@ local _ClassConfig = {
name = "Death Peace",
type = "AA",
cond = function(self, aaName)
return 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())
return not RGMercUtils.Feigning() and RGMercUtils.AAReady(aaName) and mq.TLO.Me.PctHPs() < 75
end,
},
{
name = "Harm Shield",
type = "AA",
cond = function(self, aaName)
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())
return not RGMercUtils.Feigning() and RGMercUtils.AAReady(aaName) and mq.TLO.Me.PctHPs() >= 75
end,
},
{
name = "Stand Back Up",
type = "CustomFunc",
cond = function(self)
return RGMercUtils.Feigning() and (mq.TLO.Me.PctAggro() < 90 or mq.TLO.Me.TargetOfTarget.ID() ~= mq.TLO.Me.ID())
return RGMercUtils.Feigning() and RGMercUtils.GetHighestAggroPct() <= RGMercUtils.GetSetting('StopFDPct')
end,
custom_func = function(_)
RGMercUtils.DoCmd("/stand")
Expand Down Expand Up @@ -1251,6 +1250,8 @@ local _ClassConfig = {
['DoUnity'] = { DisplayName = "Cast Unity", Category = "Spells and Abilities", Tooltip = "Enable casting Mortifiers Unity.", Default = true, },
['DeathBloomPercent'] = { DisplayName = "Death Bloom %", Category = "Spells and Abilities", Tooltip = "Mana % at which to cast Death Bloom", Default = 40, Min = 1, Max = 100, },
['DoSnare'] = { DisplayName = "Cast Snares", Category = "Spells and Abilities", Tooltip = "Enable casting Snare spells.", Default = true, },
['StartFDPct'] = { DisplayName = "FD Aggro Pct", Category = "Aggro Management", Tooltip = "Aggro % at which to FD", Default = 90, Min = 1, Max = 99, },
['StopFDPct'] = { DisplayName = "Stand Aggro Pct", Category = "Aggro Management", Tooltip = "Aggro % at which to Stand up from FD", Default = 80, Min = 1, Max = 99, },
['WakeDeadCorpseCnt'] = { DisplayName = "WtD Corpse Count", Category = "Spells and Abilities", Tooltip = "Number of Corpses before we cast Wake the Dead", Default = 5, Min = 1, Max = 20, },
['HPStopDOT'] = { DisplayName = "HP Stop DOTs", Category = "Spells and Abilities", Tooltip = "Stop casting DOTs when the mob hits [x] HP %.", Default = 30, Min = 1, Max = 100, },
},
Expand Down
2 changes: 1 addition & 1 deletion class_configs/rng_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ local _ClassConfig = {
active_cond = function(self, spell) return RGMercUtils.BuffActiveByID(spell.RankName.ID()) end,
cond = function(self, spell, target, uiCheck)
if not uiCheck then RGMercUtils.SetTarget(target.ID() or 0) end
return RGMercUtils.SpellStacksOnTarget(spell) and not RGMercUtils.TargetHasBuff(spell)
return RGMercUtils.SpellStacksOnTarget(spell) and not RGMercUtils.TargetHasBuff(spell) and not RGMercUtils.TargetHasBuffByName("Shared " .. spell.Name())
end,
},
},
Expand Down
2 changes: 1 addition & 1 deletion class_configs/shm_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local _ClassConfig = {
['ModeChecks'] = {
IsHealing = function() return true end,
IsCuring = function() return true end,
IsRezing = function() return RGMercUtils.GetXTHaterCount() == 0 end,
IsRezing = function() return RGMercUtils.GetSetting('DoBattleRez') or RGMercUtils.GetXTHaterCount() == 0 end,
},
['Modes'] = {
'Heal',
Expand Down
2 changes: 1 addition & 1 deletion class_configs/wiz_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ return {
name = "A Hole in Space",
type = "AA",
cond = function(self)
return mq.TLO.Me.PctAggro() > 99 and RGMercUtils.IHaveAggro()
return mq.TLO.Me.PctAggro() > 99 and RGMercUtils.IHaveAggro(100)
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 = '468c3b7 2024-03-09' }
return { commitId = '8d5b5b0 2024-03-09' }
2 changes: 1 addition & 1 deletion utils/rgmercs_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Config.DefaultConfig = {

-- [ REZ ] --
['RetryRezDelay'] = { DisplayName = "Retry Rez Delay", Category = "Rez", Tooltip = "Time in seconds of how often to try to rez a corpse.", Default = 6, Min = 1, Max = 60, ConfigType = "Advanced", },
['DoBattleRez'] = { DisplayName = "Do Battle Rez", Category = "Rez", Tooltip = "Use Rez while in combat", Default = true, ConfigType = "Advanced", },
['DoBattleRez'] = { DisplayName = "Do Battle Rez", Category = "Rez", Tooltip = "Use Rez while in combat", Default = RGMercUtils.MyClassIs("clr"), ConfigType = "Advanced", },
['BuffRezables'] = { DisplayName = "Buff Rezables", Category = "Rez", Tooltip = "If this PC has a corpse near us buff them even though they are likely to get rezed.", Default = false, ConfigType = "Advanced", },

-- [ FELLOWSHIP ] --
Expand Down
38 changes: 36 additions & 2 deletions utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2901,11 +2901,45 @@ function RGMercUtils.Feigning()
return mq.TLO.Me.State():lower() == "feign"
end

---@return number
function RGMercUtils.GetHighestAggroPct()
local target = mq.TLO.Target
local me = mq.TLO.Me

local highestPct = target.PctAggro() or 0

local xtCount = mq.TLO.Me.XTarget()

for i = 1, xtCount do
local xtSpawn = mq.TLO.Me.XTarget(i)

if xtSpawn() and (xtSpawn.ID() or 0) > 0 and xtSpawn.TargetType():lower() == "auto hater" then
if xtSpawn.PctAggro() > highestPct then highestPct = xtSpawn.PctAggro() end
end
end

return highestPct
end

---@param pct number #Pct Aggro Minimum
---@return boolean
function RGMercUtils.IHaveAggro()
function RGMercUtils.IHaveAggro(pct)
local target = mq.TLO.Target
local me = mq.TLO.Me
return (target() and target.AggroHolder() == me.CleanName()) and true or false

if (target() and target.PctAggro() >= pct) then return true end

local xtCount = mq.TLO.Me.XTarget()

for i = 1, xtCount do
local xtSpawn = mq.TLO.Me.XTarget(i)

if xtSpawn() and (xtSpawn.ID() or 0) > 0 and xtSpawn.TargetType():lower() == "auto hater" then
if xtSpawn.PctAggro() >= pct then return true end
end
end

return false
end

---@return boolean
Expand Down

0 comments on commit 19f997c

Please sign in to comment.