Skip to content

Commit

Permalink
- additional ench debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Apr 16, 2024
1 parent f45a9d3 commit 6866037
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
17 changes: 13 additions & 4 deletions class_configs/enc_class_config.lua
Expand Up @@ -1285,11 +1285,20 @@ local _ClassConfig = {
{
name = "Slowing Helix",
type = "AA",
cond = function(self, aaName)
cond = function(self, aaName, uiCheck)
if mq.TLO.Target.ID() <= 0 then return false end
return RGMercUtils.GetSetting('DoSlow') and RGMercUtils.DetAACheck(mq.TLO.Me.AltAbility(aaName).ID()) and
(not RGMercUtils.NPCAAReady("Enveloping Helix", mq.TLO.Target.ID(), false) or
RGMercUtils.GetXTHaterCount() > 2) and mq.TLO.Target.Slowed() == nil

local detAACheck = RGMercUtils.DetAACheck(mq.TLO.Me.AltAbility(aaName).ID())
local envelopingCheck = not RGMercUtils.NPCAAReady("Enveloping Helix", mq.TLO.Target.ID(), false)
local slowedCheck = mq.TLO.Target.Slowed() == nil

if not uiCheck then
RGMercsLogger.log_verbose("Enc: Slowing Helix: detAA(%s), enveloping(%s), slowed(%s)", RGMercUtils.BoolToColorString(detAACheck),
RGMercUtils.BoolToColorString(envelopingCheck), RGMercUtils.BoolToColorString(slowedCheck))
end

return RGMercUtils.GetSetting('DoSlow') and detAACheck and
(envelopingCheck or RGMercUtils.GetXTHaterCount() > 2) and slowedCheck
end,
},
{
Expand Down
2 changes: 1 addition & 1 deletion extras/version.lua
@@ -1 +1 @@
return { commitId = '754a23c 2024-04-15' }
return { commitId = 'f45a9d3 2024-04-15' }
23 changes: 20 additions & 3 deletions utils/rgmercs_utils.lua
Expand Up @@ -375,29 +375,46 @@ end
---@param healingSpell boolean?
---@return boolean
function RGMercUtils.NPCAAReady(aaName, targetId, healingSpell)
RGMercsLogger.log_verbose("NPCAAReady(%s)", aaName)
local me = mq.TLO.Me
local ability = mq.TLO.Me.AltAbility(aaName)

if targetId == 0 or not targetId then targetId = mq.TLO.Target.ID() end

if not ability or not ability() then return false end
if not ability or not ability() then
RGMercsLogger.log_verbose("NPCAAReady(%s) - Don't have ability.", aaName)
return false
end

if me.Stunned() then return false end
if me.Stunned() then
RGMercsLogger.log_verbose("NPCAAReady(%s) - Stunned", aaName)
return false
end

local target = mq.TLO.Spawn(string.format("id %d", targetId))

if not target or not target() or target.Dead() then return false end
if not target or not target() or target.Dead() then
RGMercsLogger.log_verbose("NPCAAReady(%s) - Target Dead", aaName)
return false
end

if RGMercUtils.AAReady(aaName) and me.CurrentMana() >= ability.Spell.Mana() and me.CurrentEndurance() >= ability.Spell.EnduranceCost() then
if RGMercUtils.MyClassIs("brd") or (not me.Moving() and not me.Casting.ID()) then
RGMercsLogger.log_verbose("NPCAAReady(%s) - Check LOS", aaName)
if target.LineOfSight() then
RGMercsLogger.log_verbose("NPCAAReady(%s) - Success", aaName)
return true
elseif healingSpell == true then
RGMercsLogger.log_verbose("NPCAAReady(%s) - Healing Success", aaName)
return true
end
end
else
RGMercsLogger.log_verbose("NPCAAReady(%s) CurrentMana(%d) >= SpellMana(%d) CurrentEnd(%d) >= SpellEnd(%d)", aaName, me.CurrentMana(), ability.Spell.Mana(),
me.CurrentEndurance(), ability.Spell.EnduranceCost())
end

RGMercsLogger.log_verbose("NPCAAReady(%s) - Failed", aaName)
return false
end

Expand Down

0 comments on commit 6866037

Please sign in to comment.