Skip to content

Commit

Permalink
updated how aggro checks work to support chars without xtarg
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Jan 1, 2024
1 parent 3e6b3a6 commit b287876
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function Utils.file_exists(path)
end
end

function Utils.BroadcastUpdate(module, event)
Utils.Actors.send({ from = RGMercConfig.Globals.CurLoadedChar, script = Utils.ScriptName, module = module, event = event })
function Utils.BroadcastUpdate(module, event, data)
Utils.Actors.send({ from = RGMercConfig.Globals.CurLoadedChar, script = Utils.ScriptName, module = module, event = event, data = data })
end

function Utils.PrintGroupMessage(msg, ...)
Expand Down Expand Up @@ -641,6 +641,14 @@ function Utils.GetTargetID()
return (mq.TLO.Target.ID() or 0)
end

function Utils.GetTargetAggroPct()
return (mq.TLO.Target.PctAggro() or 0)
end

function Utils.GetTargetAggressive()
return (mq.TLO.Target.Aggressive() or false)
end

function Utils.GetGroupMainAssistID()
return (mq.TLO.Group.MainAssist.ID() or 0)
end
Expand Down Expand Up @@ -1226,11 +1234,11 @@ end

function Utils.GetXTHaterCount()
local xtCount = mq.TLO.Me.XTarget() or 0
local haterCount = 0
local haterCount = (Utils.GetTargetAggroPct() > 0 or Utils.GetTargetAggressive()) and 1 or 0

for i = 1, xtCount do
local xtarg = mq.TLO.Me.XTarget(i)
if xtarg and xtarg.PctAggro() > 1 then
if xtarg and xtarg.PctAggro() > 1 and xtarg.ID() ~= Utils.GetTargetID() then
haterCount = haterCount + 1
end
end
Expand Down
2 changes: 1 addition & 1 deletion version.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return { commitId = '6824de7 2024-01-01' }
return { commitId = '3e6b3a6 2024-01-01' }

0 comments on commit b287876

Please sign in to comment.