Skip to content

Commit

Permalink
group buff functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Jan 13, 2024
1 parent 6a443ca commit ecf4cc2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion extras/version.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return { commitId = 'e4b4148 2024-01-13' }
return { commitId = '6a443ca 2024-01-13' }
19 changes: 19 additions & 0 deletions utils/rgmercs_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,25 @@ function Utils.UseItem(itemName, targetId)
end
end

---@param spell MQSpell
---@param targetId number
---@param targetName string
function Utils.CheckPCNeedsBuff(spell, targetId, targetName)
if targetId == mq.TLO.Me.ID() then
return mq.TLO.Me.FindBuff("id " .. tostring(spell.ID()))() == nil
elseif mq.TLO.DanNet(targetName)() == nil then
-- Target.
Utils.SetTarget(targetId)
mq.delay("2s", function() return mq.TLO.Target.BuffsPopulated() end)
return mq.TLO.Target.FindBuff("id " .. tostring(spell.ID()))() == nil
else
-- DanNet
local ret = DanNet.query(targetName, string.format("Me.FindBuff[id %d]", spell.ID()), 1000)

return (ret == "NULL") or not ret
end
end

---@param abilityName string
function Utils.UseAbility(abilityName)
local me = mq.TLO.Me
Expand Down

0 comments on commit ecf4cc2

Please sign in to comment.