• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Question - How do I get the current target of any arbitrary spawn (AKA How can I get my pet to save my healer merc)?

Joined
Jan 26, 2023
RedCents
1,247¢
I often solo with MageKill. I would like my pet to automatically try to save my healer merc if anything attacks it, by taunting it off.
How do I get the target or top aggro holder of any arbitrary spawn without having to rotate all the nearest mobs through my toon's target?
xSpawn.TargetOfTarget does not seem to work.

If this isn't possible then I might look for events where my healer merc takes dmg.
I am open to alternate approaches, the goal is to save the healer whatever it takes.
Thanks in advance for any advice.

Here is some sample code:
[CODE lang="Lua" title="SaveHealer"]---@type Mq
mq = require('mq')

function SaveHealer()
if mq.TLO.Group.Members() == 0 then return false end

local healers = {
['Cleric'] = true,
['Druid'] = true,
['Shaman'] = true,
}
local save_range = 180
local myHealers = {}

-- list group healers
myHealers[mq.TLO.Me.ID()] = mq.TLO.Me.Name()
for i = 1, mq.TLO.Group.Members() do
local member = mq.TLO.Group.Member(i)
local class = member.Spawn.Class()
if healers[class] and member.Spawn.Distance3D() < save_range then
myHealers[member.Spawn.ID()] = member()
end
end

-- check if anything is attacking group healers
local xSpawn = mq.TLO.NearestSpawn('npc targetable')
while (xSpawn.Name()) do
if not xSpawn.Dead() and xSpawn.Distance3D() < save_range then
if myHealers[xSpawn.TargetOfTarget.ID()] then
print('-= SAVING =- ' .. myHealers[xSpawn.TargetOfTarget.ID()])
local id = xSpawn.ID()
mq.cmd('/pet taunt on')
mq.delay(100)
mq.cmd('/pet attack ' .. id)
mq.delay(100)
return true
end
end
xSpawn = xSpawn.Next
end
return false
end[/CODE]
 
Because EQ mercs are handled by the game differently than player characters, I think this is what the challenge would be. It is far better to consider a FTP healer than use in-game EQ mercs. I understand the pitfalls of needing to have yet another account running, geared, etc. But still. Way better.
 
Because EQ mercs are handled by the game differently than player characters, I think this is what the challenge would be. It is far better to consider a FTP healer than use in-game EQ mercs. I understand the pitfalls of needing to have yet another account running, geared, etc. But still. Way better.
What about saving the human-controlled player healers I play with? How do i find out all the spawns that are hitting my group's healers without DanNet magic?
 
What about saving the human-controlled player healers I play with? How do i find out all the spawns that are hitting my group's healers without DanNet magic?
I don't believe you can. Need Dannet for that I think. There needs to be network (local or machine) feedback. CWTN plugins do not use DanNet, but only monitor on same PC.
 
the CWTN plugins poll data of xtar, so if your human friends are getting smacked, and the target is on the CWTN tank xtar, it will register as a valid target... they wont willy nilly swap, but YOU can hand swap anytime.
 
TargetOfTarget does work, but MQ has to wait for the server to supply the data. You need a long (up to 1s) delay between targetting and polling ToT data.
 
Question - How do I get the current target of any arbitrary spawn (AKA How can I get my pet to save my healer merc)?

Users who are viewing this thread

Back
Top
Cart