Skip to content

Commit

Permalink
- Added Paragon of Spirit to BST [UNTESTED]
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Mar 11, 2024
1 parent 44b4ae9 commit ac40639
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 87 deletions.
29 changes: 28 additions & 1 deletion class_configs/bst_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,16 @@ return {
RGMercUtils.DoBuffCheck() and RGMercConfig:GetTimeSinceLastMove() > RGMercUtils.GetSetting('BuffWaitMoveTimer')
end,
},
{
name = 'Paragon',
targetId = function(self)
return { RGMercUtils.FindWorstHurtManaGroupMember(RGMercUtils.GetSetting('ParagonPct')),
RGMercUtils.FindWorstHurtManaXT(RGMercUtils.GetSetting('ParagonPct')), }
end,
cond = function(self, combat_state)
return combat_state ~= "Downtime" and RGMercUtils.GetSetting('DoParagon')
end,
},
{
name = 'Downtime Pet',
targetId = function(self) return { mq.TLO.Me.Pet.ID(), } end,
Expand Down Expand Up @@ -856,6 +866,22 @@ return {
end,
},
},
['Paragon'] = {
{
name = "Focused Paragon of Spirit",
type = "AA",
cond = function(self, aaName)
return RGMercUtils.AAReady(aaName)
end,
},
{
name = "Paragon of Spirit",
type = "AA",
cond = function(self, aaName)
return RGMercUtils.AAReady(aaName)
end,
},
},
['DPS'] = {
{
name = "PetSpell",
Expand Down Expand Up @@ -1316,6 +1342,8 @@ return {
['DefaultConfig'] = {
['Mode'] = { DisplayName = "Mode", Category = "Combat", Tooltip = "Select the Combat Mode for this Toon", Type = "Custom", RequiresLoadoutChange = true, Default = 1, Min = 1, Max = 1, },
['DoCombatFero'] = { DisplayName = "Do Combat Fero", Category = "Combat", Tooltip = "Do Combat Fero", Default = true, },
['DoParagon'] = { DisplayName = "Do Paragon", Category = "Combat", Tooltip = "Cast Paragon on lowest mana in Group / XT", Default = true, },
['ParagonPct'] = { DisplayName = "Paragon Min Pct", Category = "Combat", Tooltip = "Minimum mana % before we cast Paragon on someone", Default = 60, Min = 1, Max = 99, },
['DoEpic'] = { DisplayName = "Do Epic", Category = "Abilities", Tooltip = "Enable using your epic clicky", Default = true, },
['DoSnare'] = { DisplayName = "Cast Snares", Category = "Spells and Abilities", Tooltip = "Enable casting Snare spells.", Default = true, },
['DoRunSpeed'] = { DisplayName = "Do Run Speed", Category = "Buffs", Tooltip = "Do Run Speed Spells/AAs", Default = true, },
Expand All @@ -1329,5 +1357,4 @@ return {
['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, },
['DoAvatar'] = { DisplayName = "Do Avatar", Category = "Buffs", Tooltip = "Buff Group/Pet with Avatar", Default = true, },
},

}
2 changes: 1 addition & 1 deletion extras/version.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return { commitId = '6541a17 2024-03-10' }
return { commitId = '44b4ae9 2024-03-10' }
86 changes: 2 additions & 84 deletions modules/class.lua
Original file line number Diff line number Diff line change
Expand Up @@ -480,88 +480,6 @@ function Module:OOGCheckAndRez()
end
end

function Module:FindWorstHurtGroupMember(minHPs)
local groupSize = mq.TLO.Group.Members()
local worstId = mq.TLO.Me.ID()
local worstPct = mq.TLO.Me.PctHPs()

RGMercsLogger.log_verbose("\ayChecking for worst Hurt Group Members. Group Count: %d", groupSize)

for i = 1, groupSize do
local healTarget = mq.TLO.Group.Member(i)

if healTarget and healTarget() and not healTarget.OtherZone() and not healTarget.Offline() then
if (healTarget.Class.ShortName() or "none"):lower() ~= "ber" then -- berzerkers have special handing
if not healTarget.Dead() and healTarget.PctHPs() < worstPct then
RGMercsLogger.log_verbose("\aySo far %s is the worst off.", healTarget.DisplayName())
worstPct = healTarget.PctHPs()
worstId = healTarget.ID()
end

if RGMercUtils.GetSetting('DoPetHeals') then
if healTarget.Pet.ID() > 0 and healTarget.Pet.PctHPs() < worstPct then
RGMercsLogger.log_verbose("\aySo far %s's pet %s is the worst off.", healTarget.DisplayName(),
healTarget.Pet.DisplayName())
worstPct = healTarget.Pet.PctHPs()
worstId = healTarget.Pet.ID()
end
end
else
RGMercsLogger.log_verbose("\aySkipping %s because they are a zerker", healTarget.DisplayName())
end
end
end

if worstId > 0 then
RGMercsLogger.log_verbose("\agWorst hurt group member id is %d", worstId)
else
RGMercsLogger.log_verbose("\agNo one is hurt!")
end

return worstId
end

function Module:FindWorstHurtXT(minHPs)
local xtSize = mq.TLO.Me.XTargetSlots()
local worstId = 0
local worstPct = minHPs

RGMercsLogger.log_verbose("\ayChecking for worst Hurt XTargs. XT Slot Count: %d", xtSize)

for i = 1, xtSize do
local healTarget = mq.TLO.Me.XTarget(i)

if healTarget and healTarget() and RGMercUtils.TargetIsType("pc", healTarget) then
if healTarget.Class.ShortName():lower() ~= "ber" then -- berzerkers have special handing
if not healTarget.Dead() and healTarget.PctHPs() < worstPct then
RGMercsLogger.log_verbose("\aySo far %s is the worst off.", healTarget.DisplayName())
worstPct = healTarget.PctHPs()
worstId = healTarget.ID()
end

if RGMercUtils.GetSetting('DoPetHeals') then
if healTarget.Pet.ID() > 0 and healTarget.Pet.PctHPs() < worstPct then
RGMercsLogger.log_verbose("\aySo far %s's pet %s is the worst off.", healTarget.DisplayName(),
healTarget.Pet.DisplayName())
worstPct = healTarget.Pet.PctHPs()
worstId = healTarget.Pet.ID()
end
end
else
RGMercsLogger.log_verbose("\aySkipping %s because they are a zerker", healTarget.DisplayName())
end
end
end

if worstId > 0 then
RGMercsLogger.log_verbose("\agWorst hurt xtarget id is %d", worstId)
else
RGMercsLogger.log_verbose("\agNo one is hurt!")
end

return worstId
end

function Module:HealById(id)
if id == 0 then return end
if not self.TempSettings.HealingRotationStates then return end
Expand Down Expand Up @@ -637,10 +555,10 @@ function Module:RunHealRotation()
end

RGMercsLogger.log_verbose("\ao[Heals] Checking for injured friends...")
self:HealById(self:FindWorstHurtGroupMember(RGMercUtils.GetSetting('MaxHealPoint')))
self:HealById(RGMercUtils.FindWorstHurtGroupMember(RGMercUtils.GetSetting('MaxHealPoint')))

if RGMercUtils.GetSetting('AssistOutside') then
self:HealById(self:FindWorstHurtXT(RGMercUtils.GetSetting('MaxHealPoint')))
self:HealById(RGMercUtils.FindWorstHurtXT(RGMercUtils.GetSetting('MaxHealPoint')))
end

if mq.TLO.Me.PctHPs() < RGMercUtils.GetSetting('MaxHealPoint') then
Expand Down
2 changes: 1 addition & 1 deletion modules/mez.lua
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ function Module:IsValidMezTarget(mobId)
local spawn = mq.TLO.Spawn(mobId)

-- Is the mob ID in our mez immune list? If so, skip.
if self.TempSettings.MezImmune[mobId] ~= nil then
if self:IsMezImmune(mobId) then
RGMercsLogger.log_debug("\ayUpdateMezList: Skipping Mob ID: %d Name: %s Level: %d as it is in our immune list.",
spawn.ID(), spawn.CleanName(), spawn.Level())
return false
Expand Down
142 changes: 142 additions & 0 deletions utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2888,6 +2888,148 @@ function RGMercUtils.DiffXTHaterIDs(t)
return false
end

function RGMercUtils.FindWorstHurtManaGroupMember(minMana)
local groupSize = mq.TLO.Group.Members()
local worstId = mq.TLO.Me.ID()
local worstPct = mq.TLO.Me.PctMana() < minMana and mq.TLO.Me.PctMana() or minMana

RGMercsLogger.log_verbose("\ayChecking for worst HurtMana Group Members. Group Count: %d", groupSize)

for i = 1, groupSize do
local healTarget = mq.TLO.Group.Member(i)

if healTarget and healTarget() and not healTarget.OtherZone() and not healTarget.Offline() then
if RGMercConfig.Constants.RGCasters:contains(healTarget.Class.ShortName() or "none") then -- berzerkers have special handing
if not healTarget.Dead() and healTarget.PctMana() < worstPct then
RGMercsLogger.log_verbose("\aySo far %s is the worst off.", healTarget.DisplayName())
worstPct = healTarget.PctMana()
worstId = healTarget.ID()
end
end
end
end

if worstId > 0 then
RGMercsLogger.log_verbose("\agWorst HurtMana group member id is %d", worstId)
else
RGMercsLogger.log_verbose("\agNo one is HurtMana!")
end

return worstId
end

function RGMercUtils.FindWorstHurtGroupMember(minHPs)
local groupSize = mq.TLO.Group.Members()
local worstId = mq.TLO.Me.ID()
local worstPct = mq.TLO.Me.PctHPs() < minHPs and mq.TLO.Me.PctHPs() or minHPs

RGMercsLogger.log_verbose("\ayChecking for worst Hurt Group Members. Group Count: %d", groupSize)

for i = 1, groupSize do
local healTarget = mq.TLO.Group.Member(i)

if healTarget and healTarget() and not healTarget.OtherZone() and not healTarget.Offline() then
if (healTarget.Class.ShortName() or "none"):lower() ~= "ber" then -- berzerkers have special handing
if not healTarget.Dead() and healTarget.PctHPs() < worstPct then
RGMercsLogger.log_verbose("\aySo far %s is the worst off.", healTarget.DisplayName())
worstPct = healTarget.PctHPs()
worstId = healTarget.ID()
end

if RGMercUtils.GetSetting('DoPetHeals') then
if healTarget.Pet.ID() > 0 and healTarget.Pet.PctHPs() < worstPct then
RGMercsLogger.log_verbose("\aySo far %s's pet %s is the worst off.", healTarget.DisplayName(),
healTarget.Pet.DisplayName())
worstPct = healTarget.Pet.PctHPs()
worstId = healTarget.Pet.ID()
end
end
else
RGMercsLogger.log_verbose("\aySkipping %s because they are a zerker", healTarget.DisplayName())
end
end
end

if worstId > 0 then
RGMercsLogger.log_verbose("\agWorst hurt group member id is %d", worstId)
else
RGMercsLogger.log_verbose("\agNo one is hurt!")
end

return worstId
end

function RGMercUtils.FindWorstHurtManaXT(minMana)
local xtSize = mq.TLO.Me.XTargetSlots()
local worstId = 0
local worstPct = minMana

RGMercsLogger.log_verbose("\ayChecking for worst HurtMana XTargs. XT Slot Count: %d", xtSize)

for i = 1, xtSize do
local healTarget = mq.TLO.Me.XTarget(i)

if healTarget and healTarget() and RGMercUtils.TargetIsType("pc", healTarget) then
if RGMercConfig.Constants.RGCasters:contains(healTarget.Class.ShortName()) then -- berzerkers have special handing
if not healTarget.Dead() and healTarget.PctMana() < worstPct then
RGMercsLogger.log_verbose("\aySo far %s is the worst off.", healTarget.DisplayName())
worstPct = healTarget.PctMana()
worstId = healTarget.ID()
end
end
end
end

if worstId > 0 then
RGMercsLogger.log_verbose("\agWorst HurtMana xtarget id is %d", worstId)
else
RGMercsLogger.log_verbose("\agNo one is HurtMana!")
end

return worstId
end

function RGMercUtils.FindWorstHurtXT(minHPs)
local xtSize = mq.TLO.Me.XTargetSlots()
local worstId = 0
local worstPct = minHPs

RGMercsLogger.log_verbose("\ayChecking for worst Hurt XTargs. XT Slot Count: %d", xtSize)

for i = 1, xtSize do
local healTarget = mq.TLO.Me.XTarget(i)

if healTarget and healTarget() and RGMercUtils.TargetIsType("pc", healTarget) then
if healTarget.Class.ShortName():lower() ~= "ber" then -- berzerkers have special handing
if not healTarget.Dead() and healTarget.PctHPs() < worstPct then
RGMercsLogger.log_verbose("\aySo far %s is the worst off.", healTarget.DisplayName())
worstPct = healTarget.PctHPs()
worstId = healTarget.ID()
end

if RGMercUtils.GetSetting('DoPetHeals') then
if healTarget.Pet.ID() > 0 and healTarget.Pet.PctHPs() < worstPct then
RGMercsLogger.log_verbose("\aySo far %s's pet %s is the worst off.", healTarget.DisplayName(),
healTarget.Pet.DisplayName())
worstPct = healTarget.Pet.PctHPs()
worstId = healTarget.Pet.ID()
end
end
else
RGMercsLogger.log_verbose("\aySkipping %s because they are a zerker", healTarget.DisplayName())
end
end
end

if worstId > 0 then
RGMercsLogger.log_verbose("\agWorst hurt xtarget id is %d", worstId)
else
RGMercsLogger.log_verbose("\agNo one is hurt!")
end

return worstId
end

---@param spawnId number
---@return boolean
function RGMercUtils.IsSpawnXHater(spawnId)
Expand Down

0 comments on commit ac40639

Please sign in to comment.